List:Commits« Previous MessageNext Message »
From:jbalint Date:January 2 2008 4:52am
Subject:Connector/ODBC 3.51 commit: r973 - in branches/guffert: . driver test
View as plain text  
Modified:
   branches/guffert/ChangeLog
   branches/guffert/driver/utility.c
   branches/guffert/test/my_result.c
Log:
Fix bug#28617


Modified: branches/guffert/ChangeLog
===================================================================
--- branches/guffert/ChangeLog	2008-01-02 04:49:40 UTC (rev 972)
+++ branches/guffert/ChangeLog	2008-01-02 04:52:49 UTC (rev 973)
@@ -54,6 +54,8 @@
   * Recordset Update() fails in 5.1 ODBC connector when using adUseClient
     cursor. (Bug #26985)
   * MyODBC 5/ ADO Not possible to update a client side cursor. (Bug #27961)
+  * Intermixing of SQLGetData() using SQL_C_CHAR and SQL_C_WCHAR on the same
+    field value was incorrect. (Bug #28617)
 
   Includes changes from Connector/ODBC 3.51.21 and 3.51.22.
 

Modified: branches/guffert/driver/utility.c
===================================================================
--- branches/guffert/driver/utility.c	2008-01-02 04:49:40 UTC (rev 972)
+++ branches/guffert/driver/utility.c	2008-01-02 04:52:49 UTC (rev 973)
@@ -801,7 +801,8 @@
           continue;
       }
 
-      stmt->getdata.source+= cnvres;
+      if (result)
+        stmt->getdata.source+= cnvres;
     }
     else if (stmt->getdata.latest_bytes == MY_CS_ILUNI && wc != '?')
     {

Modified: branches/guffert/test/my_result.c
===================================================================
--- branches/guffert/test/my_result.c	2008-01-02 04:49:40 UTC (rev 972)
+++ branches/guffert/test/my_result.c	2008-01-02 04:52:49 UTC (rev 973)
@@ -2120,6 +2120,33 @@
 }
 
 
+/*
+  Bug#28617 Gibberish when reading utf8 TEXT column through ADO
+*/
+DECLARE_TEST(t_bug28617)
+{
+  SQLWCHAR outbuf[100];
+  SQLLEN outlen;
+
+  ok_sql(hstmt, "select 'qwertyuiop'");
+
+  ok_stmt(hstmt, SQLFetch(hstmt));
+
+  expect_stmt(hstmt, SQLGetData(hstmt, 1, SQL_C_CHAR, outbuf, 0, &outlen),
+              SQL_SUCCESS_WITH_INFO);
+  is_num(outlen, 10);
+  expect_stmt(hstmt, SQLGetData(hstmt, 1, SQL_C_WCHAR, outbuf, 0, &outlen),
+              SQL_SUCCESS_WITH_INFO);
+  is_num(outlen, 20);
+  ok_stmt(hstmt, SQLGetData(hstmt, 1, SQL_C_WCHAR, outbuf, 100, &outlen));
+
+  is_num(outlen, 20);
+  is_wstr(outbuf, W(L"qwertyuiop"), 11);
+
+  return OK;
+}
+
+
 BEGIN_TESTS
   ADD_TEST(my_resultset)
   ADD_TEST(t_convert_type)
@@ -2149,6 +2176,7 @@
   ADD_TEST(t_bug31246)
   ADD_TEST(t_bug13776)
   ADD_TEST(t_bug13776_auto)
+  ADD_TEST(t_bug28617)
 END_TESTS
 
 

Thread
Connector/ODBC 3.51 commit: r973 - in branches/guffert: . driver testjbalint2 Jan