List:Commits« Previous MessageNext Message »
From:jbalint Date:June 20 2007 5:23pm
Subject:Connector/ODBC 3.51 commit: r525 - in trunk: driver test
View as plain text  
Modified:
   trunk/driver/error.c
   trunk/test/my_error.c
Log:
add test and fix for bug#16224 - removed useless code causing issue


Modified: trunk/driver/error.c
===================================================================
--- trunk/driver/error.c	2007-06-20 09:36:29 UTC (rev 524)
+++ trunk/driver/error.c	2007-06-20 17:23:11 UTC (rev 525)
@@ -488,13 +488,6 @@
     if ( RecNumber > 1 )
         MYODBCDbgReturnReturn( SQL_NO_DATA_FOUND );
 
-    /*
-      If record number is 0 and if it is not a
-      diag header field request, return error
-    */
-    if ( RecNumber == 0 && DiagIdentifier > 0 )
-        MYODBCDbgReturnReturn( SQL_ERROR );
-
     switch ( DiagIdentifier )
     {
 

Modified: trunk/test/my_error.c
===================================================================
--- trunk/test/my_error.c	2007-06-20 09:36:29 UTC (rev 524)
+++ trunk/test/my_error.c	2007-06-20 17:23:11 UTC (rev 525)
@@ -269,6 +269,25 @@
 }
 
 
+/*
+ * Bug #16224: Calling SQLGetDiagField with RecNumber 0,DiagIdentifier
+ *             NOT 0 returns SQL_ERROR
+ */
+DECLARE_TEST(t_bug16224)
+{
+  SQLINTEGER diagcnt;
+
+  expect_sql(hstmt, "This is an invalid Query! (odbc test)", SQL_ERROR);
+
+  ok_stmt(hstmt, SQLGetDiagField(SQL_HANDLE_STMT, hstmt, 0,
+                                 SQL_DIAG_NUMBER, &diagcnt,
+                                 SQL_IS_INTEGER, NULL));
+  is_num(diagcnt, 1);
+
+  return OK;
+}
+
+
 BEGIN_TESTS
 #ifndef NO_DRIVERMANAGER
   ADD_TEST(t_odbc2_error)
@@ -279,6 +298,7 @@
   ADD_TEST(t_diagrec)
   ADD_TEST(t_warning)
   ADD_TODO(t_bug3456)
+  ADD_TEST(t_bug16224)
 END_TESTS
 
 RUN_TESTS

Thread
Connector/ODBC 3.51 commit: r525 - in trunk: driver testjbalint20 Jun