Skip to content

Commit

Permalink
Fix of SQLCanclel testcase, that would fail in case of RS streaming
Browse files Browse the repository at this point in the history
on linux.
  • Loading branch information
lawrinn committed Dec 1, 2023
1 parent cdb2990 commit 9241fb8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
18 changes: 14 additions & 4 deletions test/basic.c
Expand Up @@ -901,10 +901,20 @@ ODBC_TEST(sqlcancel)

pthread_create(&thread, NULL, cancel_in_one_second, Stmt);

/* Error "execution was interrupted" is returned when it's killed,
"SLEEP(n) returns 1 when it is killed" - that is probably for older versions. Need to verify. */
EXPECT_STMT(Stmt, SQLExecDirect(Stmt, "SELECT SLEEP(5)", SQL_NTS), SQL_ERROR);

if (ForwardOnly == TRUE && NoCache == TRUE)
{
/**/
OK_SIMPLE_STMT(Stmt, "SELECT SLEEP(5)");
EXPECT_STMT(Stmt, SQLFetch(Stmt), SQL_ERROR);
/* is_num(my_fetch_int(Stmt, 1), 1);*/
CHECK_STMT_RC(Stmt, SQLFreeStmt(Stmt, SQL_CLOSE));
}
else
{
/* Error "execution was interrupted" is returned when it's killed,
"SLEEP(n) returns 1 when it is killed" - that is probably for older versions. Need to verify. */
EXPECT_STMT(Stmt, SQLExecDirect(Stmt, "SELECT SLEEP(5)", SQL_NTS), SQL_ERROR);
}
pthread_join(thread, NULL);

return OK;
Expand Down
14 changes: 0 additions & 14 deletions test/multistatement.c
Expand Up @@ -758,19 +758,6 @@ ODBC_TEST(t_odbc375)
}


ODBC_TEST(t_odbc399)
{
OK_SIMPLE_STMT(Stmt, "/*!80019 SELECT * FROM information_schema.applicable_roles ORDER BY host, user */");
//EXPECT_STMT(Stmt, SQLFetch(Stmt), SQL_NO_DATA);
CHECK_STMT_RC(Stmt, SQLFreeStmt(Stmt, SQL_CLOSE));
CHECK_STMT_RC(Stmt, SQLPrepare(Stmt, "/*!80019 SELECT * FROM information_schema.applicable_roles ORDER BY host, user */", SQL_NTS));
CHECK_STMT_RC(Stmt, SQLExecute(Stmt));
//EXPECT_STMT(Stmt, SQLFetch(Stmt), SQL_NO_DATA);
CHECK_STMT_RC(Stmt, SQLFreeStmt(Stmt, SQL_CLOSE));
return OK;
}


MA_ODBC_TESTS my_tests[]=
{
{test_multi_statements, "test_multi_statements"},
Expand All @@ -789,7 +776,6 @@ MA_ODBC_TESTS my_tests[]=
{t_odbc219, "t_odbc219"},
{test_autocommit, "test_autocommit"},
{t_odbc375, "t_odbc375_reStoreError"},
{t_odbc399, "t_odbc399_commentQuery"},
{NULL, NULL}
};

Expand Down

0 comments on commit 9241fb8

Please sign in to comment.