Changeset: 8aa10f303f25 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8aa10f303f25
Modified Files:
clients/odbc/tests/ODBCtester.c
Branch: default
Log Message:
Move SQLCloseCursor(stmt); to the test bodies.
diffs (53 lines):
diff --git a/clients/odbc/tests/ODBCtester.c b/clients/odbc/tests/ODBCtester.c
--- a/clients/odbc/tests/ODBCtester.c
+++ b/clients/odbc/tests/ODBCtester.c
@@ -29,7 +29,7 @@
static void
prerr(SQLSMALLINT tpe, SQLHANDLE hnd, const char *func, const char *pref)
{
- SQLCHAR state[6];
+ SQLCHAR state[SQL_SQLSTATE_SIZE +1];
SQLINTEGER errnr;
SQLCHAR msg[256];
SQLSMALLINT msglen;
@@ -207,6 +207,9 @@ testGetDataTruncatedString(SQLHANDLE stm
"SQLstate 01004, Errnr 0, Message [MonetDB][ODBC Driver
11.##.#][MonetDB-Test]String data, right truncated\n");
}
+ ret = SQLCloseCursor(stmt);
+ check(ret, SQL_HANDLE_STMT, stmt, "SQLCloseCursor");
+
/* cleanup */
free(outp);
return ret;
@@ -286,6 +289,9 @@ testGetDataGUID(SQLHANDLE stmt)
"SQLGetData(3, SQL_C_CHAR, 36) returns 0, vallen 36,
str_val: 'beefc4f7-0264-4735-9b7a-75fd371ef803'\n"
"SQLGetData(3, SQL_C_GUID, 16) returns 0, vallen 16,
data_val: beefc4f7-0264-4735-9b7a-75fd371ef803\n");
+ ret = SQLCloseCursor(stmt);
+ check(ret, SQL_HANDLE_STMT, stmt, "SQLCloseCursor");
+
/* cleanup */
free(outp);
return ret;
@@ -335,19 +341,13 @@ main(int argc, char **argv)
ret = SQLAllocHandle(SQL_HANDLE_STMT, dbc, &stmt);
check(ret, SQL_HANDLE_DBC, dbc, "SQLAllocHandle (STMT)");
- /* run tests */
+ /**** run tests ****/
ret = testGetDataTruncatedString(stmt, SQL_C_CHAR);
check(ret, SQL_HANDLE_STMT, stmt, "testGetDataTruncatedString(STMT,
SQL_C_CHAR)");
- ret = SQLCloseCursor(stmt);
- check(ret, SQL_HANDLE_STMT, stmt, "SQLCloseCursor");
-
ret = testGetDataTruncatedString(stmt, SQL_C_WCHAR);
check(ret, SQL_HANDLE_STMT, stmt, "testGetDataTruncatedString(STMT,
SQL_C_WCHAR)");
- ret = SQLCloseCursor(stmt);
- check(ret, SQL_HANDLE_STMT, stmt, "SQLCloseCursor");
-
ret = testGetDataGUID(stmt);
check(ret, SQL_HANDLE_STMT, stmt, "testGetDataGUID(STMT)");
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]