From faec0c3ad72822a1d9a6344ef35e4f260c7a45e0 Mon Sep 17 00:00:00 2001 From: freemine Date: Fri, 30 Oct 2020 16:59:45 +0800 Subject: [PATCH] add select statements test file --- src/connector/odbc/tests/main.c | 4 +++- src/connector/odbc/tests/select.stmts | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 src/connector/odbc/tests/select.stmts diff --git a/src/connector/odbc/tests/main.c b/src/connector/odbc/tests/main.c index 1bb174e7b9..2c817f1385 100644 --- a/src/connector/odbc/tests/main.c +++ b/src/connector/odbc/tests/main.c @@ -434,7 +434,9 @@ int test_sqls_in_stmt(SQLHENV env, SQLHDBC conn, SQLHSTMT stmt, const char *sqls const char *p = NULL; do { if (line[0] == '#') break; - if (line[n-1] == '\n') line[n-1]='\0'; + if (n>0 && line[n-1] == '\n') line[n-1]='\0'; + if (n>0 && line[n-1] == '\r') line[n-1]='\0'; + if (n>1 && line[n-2] == '\r') line[n-2]='\0'; p = line; while (isspace(*p)) ++p; diff --git a/src/connector/odbc/tests/select.stmts b/src/connector/odbc/tests/select.stmts new file mode 100644 index 0000000000..f7152ba6cf --- /dev/null +++ b/src/connector/odbc/tests/select.stmts @@ -0,0 +1,4 @@ +P: select * from db.t; +P: select * from db.f; +P: select * from db.v; +P: select * from db.mt; \ No newline at end of file -- GitLab