From 810291575fcfcdf35b22ca3cc43eec9b52d9a7e4 Mon Sep 17 00:00:00 2001 From: freemine Date: Fri, 30 Oct 2020 14:08:00 +0800 Subject: [PATCH] typo correction,and bugfix --- src/connector/odbc/src/todbc.c | 12 +++++++++--- src/connector/odbc/src/todbc_scanner.l | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/connector/odbc/src/todbc.c b/src/connector/odbc/src/todbc.c index c39c57cd94..ac6169c6f8 100644 --- a/src/connector/odbc/src/todbc.c +++ b/src/connector/odbc/src/todbc.c @@ -167,7 +167,8 @@ do { \ TSDB_CONV_CODE code_0c80 = (statement); \ switch (code_0c80) { \ case TSDB_CONV_OK: return SQL_SUCCESS; \ - case TSDB_CONV_OOM: { \ + case TSDB_CONV_OOM: \ + case TSDB_CONV_NOT_AVAIL: { \ SET_ERROR(sql, "HY001", TSDB_CODE_ODBC_OOM, ""); \ return SQL_ERROR; \ } break; \ @@ -175,7 +176,8 @@ do { \ SET_ERROR(sql, "22003", TSDB_CODE_ODBC_CONV_OOR, ""); \ return SQL_ERROR; \ } break; \ - case TSDB_CONV_CHAR_NOT_NUM: { \ + case TSDB_CONV_CHAR_NOT_NUM: \ + case TSDB_CONV_CHAR_NOT_TS: { \ SET_ERROR(sql, "22018", TSDB_CODE_ODBC_CONV_CHAR_NOT_NUM, ""); \ return SQL_ERROR; \ } break; \ @@ -187,8 +189,12 @@ do { \ SET_ERROR(sql, "22001", TSDB_CODE_ODBC_CONV_TRUNC, ""); \ return SQL_ERROR; \ } break; \ + case TSDB_CONV_BAD_CHAR: { \ + SET_ERROR(sql, "22001", TSDB_CODE_ODBC_CONV_TRUNC, ""); \ + return SQL_ERROR; \ + } break; \ default: { \ - DASSERTX(0, "internal logic error"); \ + DASSERTX(0, "internal logic error: %d", code_0c80); \ return SQL_ERROR; /* never reached here */ \ } break; \ } \ diff --git a/src/connector/odbc/src/todbc_scanner.l b/src/connector/odbc/src/todbc_scanner.l index 988a34d47c..ce7d8c421d 100644 --- a/src/connector/odbc/src/todbc_scanner.l +++ b/src/connector/odbc/src/todbc_scanner.l @@ -64,12 +64,12 @@ do { \ } \ if (strcasecmp(yyextra->key, "SERVER_ENC")==0) { \ free(yyextra->svr_enc); \ - yyextra->host = strdup(yytext); \ + yyextra->svr_enc = strdup(yytext); \ break; \ } \ if (strcasecmp(yyextra->key, "CLIENT_ENC")==0) { \ free(yyextra->cli_enc); \ - yyextra->host = strdup(yytext); \ + yyextra->cli_enc = strdup(yytext); \ break; \ } \ } while (0) @@ -98,7 +98,7 @@ do { \ if (state == VAL) yyterminate(); return -1; } [[:space:]]+ { } -[[:alnum:]]+ { set_key(); PUSH_STATE(KEY); } +[[:alnum:]_]+ { set_key(); PUSH_STATE(KEY); } .|\n { return -1; } [[:space:]]+ { } -- GitLab