=== modified file 'ChangeLog' --- ChangeLog 2013-01-04 16:49:34 +0000 +++ ChangeLog 2013-01-14 07:37:08 +0000 @@ -5,6 +5,7 @@ Bugs fixed: * While retrieving data from a field, BLOB to CHAR conversion is done only for fields having BLOB_FLAG, BINARY_FLAG and binary character set(63) (Bug #11746572) + * Non-compliant behavior of SQLMoreResults (Bug# 16101282/67920) ---- === modified file 'driver/results.c' --- driver/results.c 2013-01-04 16:49:34 +0000 +++ driver/results.c 2013-01-14 05:44:23 +0000 @@ -1222,10 +1222,17 @@ CLEAR_STMT_ERROR( pStmt ); - /* SQLExecute or SQLExecDirect need to be called first */ + /* + http://msdn.microsoft.com/en-us/library/ms714673%28v=vs.85%29.aspx + + For some drivers, output parameters and return values are not available + until all result sets and row counts have been processed. For such + drivers, output parameters and return values become available when + SQLMoreResults returns SQL_NO_DATA. + */ if ( pStmt->state != ST_EXECUTED ) { - nReturn = set_stmt_error( pStmt, "HY010", NULL, 0 ); + nReturn = SQL_NO_DATA; goto exitSQLMoreResults; } === modified file 'test/my_prepare.c' --- test/my_prepare.c 2012-12-13 23:31:25 +0000 +++ test/my_prepare.c 2013-01-14 06:11:59 +0000 @@ -1180,6 +1180,20 @@ } +/** + Bug #67920: Non-compliant behavior of SQLMoreResults +*/ +DECLARE_TEST(t_bug67920) +{ + ok_stmt(hstmt, SQLPrepare(hstmt, "SELECT 1", SQL_NTS)); + + expect_stmt(hstmt, SQLMoreResults(hstmt), SQL_NO_DATA); + + SQLFreeStmt(hstmt, SQL_CLOSE); + return OK; +} + + BEGIN_TESTS ADD_TEST(t_prep_basic) ADD_TEST(t_prep_buffer_length) @@ -1197,6 +1211,7 @@ ADD_TEST(t_bug29871) ADD_TEST(t_bug67340) ADD_TEST(t_bug67702) + ADD_TEST(t_bug67920) END_TESTS