List:Commits« Previous MessageNext Message »
From:bdegtyariov Date:August 8 2007 7:09pm
Subject:Connector/ODBC 3.51 commit: r645 - in trunk: . driver test
View as plain text  
Modified:
   trunk/ChangeLog
   trunk/driver/utility.c
   trunk/test/my_result.c
Log:
Because of Bug #10491 in the server, character string results were sometimes incorrectly
identified as SQL_VARBINARY. Until this server bug is corrected, the driver will identify
all variable-length strings as SQL_VARCHAR.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-08-08 01:44:02 UTC (rev 644)
+++ trunk/ChangeLog	2007-08-08 19:09:53 UTC (rev 645)
@@ -1,6 +1,9 @@
-3.51.19
+3.51.19 (8-Aug-2007)
 
   Functionality added or changed:
+  * Because of Bug #10491 in the server, character string results were sometimes
+    incorrectly identified as SQL_VARBINARY. Until this server bug is corrected, 
+    the driver will identify all variable-length strings as SQL_VARCHAR.
 
   Bugs fixed:
 

Modified: trunk/driver/utility.c
===================================================================
--- trunk/driver/utility.c	2007-08-08 01:44:02 UTC (rev 644)
+++ trunk/driver/utility.c	2007-08-08 19:09:53 UTC (rev 645)
@@ -490,10 +490,19 @@
   */
   case MYSQL_TYPE_VARCHAR:
   case MYSQL_TYPE_VAR_STRING:
+#ifdef SERVER_BUG_10491_FIXED
+    /**
+      @todo Re-enable this when Bug #... is fixed in the server.
+    */
     if (buff)
       (void)strmov(buff, field_is_binary ? "varbinary" : "varchar");
 
     return field_is_binary ? SQL_VARBINARY : SQL_VARCHAR;
+#else
+    if (buff)
+      (void)strmov(buff, "varchar");
+    return SQL_VARCHAR;
+#endif
 
   case MYSQL_TYPE_TINY_BLOB:
     if (buff)

Modified: trunk/test/my_result.c
===================================================================
--- trunk/test/my_result.c	2007-08-08 01:44:02 UTC (rev 644)
+++ trunk/test/my_result.c	2007-08-08 19:09:53 UTC (rev 645)
@@ -1796,6 +1796,25 @@
 }
 
 
+DECLARE_TEST(t_binary_collation)
+{
+  SQLSMALLINT name_length, data_type, decimal_digits, nullable;
+  SQLCHAR column_name[SQL_MAX_COLUMN_NAME_LEN];
+  SQLULEN column_size;
+
+  ok_sql(hstmt, "DROP TABLE IF EXISTS t_binary_collation");
+  ok_sql(hstmt, "CREATE TABLE t_binary_collation (id INT)");
+  ok_sql(hstmt, "SHOW CREATE TABLE t_binary_collation");
+
+  ok_stmt(hstmt, SQLDescribeCol(hstmt, 1, column_name, sizeof(column_name),
+                                &name_length, &data_type, &column_size,
+                                &decimal_digits, &nullable));
+  is_num(data_type, SQL_VARCHAR);
+  ok_sql(hstmt, "DROP TABLE IF EXISTS t_binary_collation");
+  return OK;
+}
+
+
 BEGIN_TESTS
   ADD_TEST(my_resultset)
   ADD_TEST(t_convert_type)
@@ -1817,6 +1836,7 @@
   ADD_TEST(t_bug27544)
   ADD_TEST(t_bug16817)
   ADD_TEST(bug6157)
+  ADD_TEST(t_binary_collation)
 END_TESTS
 
 

Thread
Connector/ODBC 3.51 commit: r645 - in trunk: . driver testbdegtyariov8 Aug