Skip to content

Remove CONSTANT_KEYWORD support #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions driver/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@
#define TYPE_UNSUPPORTED "UNSUPPORTED"
/* 12 */
#define TYPE_SCALED_FLOAT "SCALED_FLOAT"
/* 16 */
#define TYPE_CONSTANT_KEYWORD "CONSTANT_KEYWORD"

/*
* intervals
Expand Down Expand Up @@ -2273,15 +2271,6 @@ static BOOL elastic_name2types(wstr_st *type_name,
return TRUE;
}
break;

/* 16: CONSTANT_KEYWORD */
case sizeof(TYPE_CONSTANT_KEYWORD) - 1:
if (! wmemncasecmp(type_name->str,
MK_WPTR(TYPE_CONSTANT_KEYWORD), type_name->cnt)) {
*c_sql = ES_CKEYWORD_TO_CSQL;
*sql = ES_CKEYWORD_TO_SQL;
return TRUE;
}
}

return elastic_intervals_name2types(type_name, c_sql, sql);
Expand Down
4 changes: 2 additions & 2 deletions driver/convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -3813,7 +3813,7 @@ SQLRETURN c2sql_boolean(esodbc_rec_st *arec, esodbc_rec_st *irec,
/*INDENT-ON*/

DBGH(stmt, "parameter (pos#%llu) converted to boolean: %d.",
(uint64_t)pos, val);
(uint64_t)pos, val);

if (val) {
memcpy(dest, JSON_VAL_TRUE, sizeof(JSON_VAL_TRUE) - /*\0*/1);
Expand Down Expand Up @@ -4516,7 +4516,7 @@ static SQLRETURN c2sql_str2interval(esodbc_rec_st *arec, esodbc_rec_st *irec,
octet_len = *octet_len_ptr;
if (octet_len <= 0) {
ERRH(stmt, "invalid interval buffer length: %lld.",
(int64_t)octet_len);
(int64_t)octet_len);
RET_HDIAGS(stmt, SQL_STATE_HY090);
}
}
Expand Down
5 changes: 1 addition & 4 deletions driver/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@
#define ESODBC_SQL_OBJECT 2002
#define ESODBC_SQL_NESTED 2002

/* the SQL type ES/SQL uses for string types (KEYWORD, TEXT, CONSTANT_KEYWORD),
/* the SQL type ES/SQL uses for string types (KEYWORD, TEXT),
* plus IP and GEO */
#define ESODBC_SQL_VARCHAR SQL_VARCHAR

Expand Down Expand Up @@ -463,9 +463,6 @@
/* 12: KEYWORD */
#define ES_KEYWORD_TO_CSQL ES_WVARCHAR_CSQL
#define ES_KEYWORD_TO_SQL ES_WVARCHAR_SQL
/* 12: CONSTANT_KEYWORD */
#define ES_CKEYWORD_TO_CSQL ES_WVARCHAR_CSQL
#define ES_CKEYWORD_TO_SQL ES_WVARCHAR_SQL
/* 12: TEXT */
#define ES_TEXT_TO_CSQL ES_WVARCHAR_CSQL
#define ES_TEXT_TO_SQL ES_WVARCHAR_SQL
Expand Down
8 changes: 4 additions & 4 deletions driver/queries.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ void clear_resultset(esodbc_stmt_st *stmt, BOOL on_close)
/* the cursor is contained entirely in the received body */
assert(stmt->rset.body.str < stmt->rset.pack.cbor.curs.str); // &&
assert(stmt->rset.pack.cbor.curs.str +
stmt->rset.pack.cbor.curs.cnt <
stmt->rset.body.str + stmt->rset.body.cnt);
stmt->rset.pack.cbor.curs.cnt <
stmt->rset.body.str + stmt->rset.body.cnt);
}
}
memset(&stmt->rset, 0, sizeof(stmt->rset));
Expand Down Expand Up @@ -2528,7 +2528,7 @@ static esodbc_estype_st *match_es_type(esodbc_rec_st *irec)
case SQL_DOUBLE: /* DOUBLE, SCALED_FLOAT */
return dbc->max_float_type;
break;
case ES_WVARCHAR_SQL: /* CONSTANT_KEYWORD, KEYWORD, TEXT */
case ES_WVARCHAR_SQL: /* KEYWORD, TEXT */
case ES_VARCHAR_SQL: /* IP, GEO+ */
return dbc->max_varchar_type;
default:
Expand Down Expand Up @@ -2858,7 +2858,7 @@ static SQLRETURN convert_param_val(esodbc_rec_st *arec, esodbc_rec_st *irec,
return c2sql_number(arec, irec, pos, &min, &max, fixed, dest, len);

/* JSON string */
case ES_WVARCHAR_SQL: /* KEYWORD, TEXT, CONSTANT_KEYWORD */
case ES_WVARCHAR_SQL: /* KEYWORD, TEXT */
case ES_VARCHAR_SQL: /* IP, GEO+ */
return c2sql_varchar(arec, irec, pos, dest, len);

Expand Down
1 change: 0 additions & 1 deletion test/connected_dbc.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ extern "C" {
[\"FLOAT\", 7, 7, \"'\", \"'\", null, 2, false, 3, false, false, false, null, 7, 7, 7, 0, 2, null],\
[\"DOUBLE\", 8, 15, \"'\", \"'\", null, 2, false, 3, false, false, false, null, 15, 15, 8, 0, 2, null],\
[\"SCALED_FLOAT\", 8, 15, \"'\", \"'\", null, 2, false, 3, false, false, false, null, 15, 15, 8, 0, 2, null],\
[\"CONSTANT_KEYWORD\", 12, 32766, \"'\", \"'\", null, 2, true, 3, true, false, false, null, null, null, 12, 0, null, null],\
[\"IP\", 12, 45, \"'\", \"'\", null, 2, false, 3, true, false, false, null, null, null, 12, 0, null, null],\
[\"KEYWORD\", 12, 32766, \"'\", \"'\", null, 2, true, 3, true, false, false, null, null, null, 12, 0, null, null],\
[\"TEXT\", 12, 2147483647, \"'\", \"'\", null, 2, true, 3, true, false, false, null, null, null, 12, 0, null, null],\
Expand Down