List:Commits« Previous MessageNext Message »
From:jwinstead Date:February 13 2007 11:44pm
Subject:Connector/ODBC 3.51 commit: r170 - in trunk: . driver test/test3
View as plain text  
Modified:
   trunk/ChangeLog
   trunk/driver/execute.c
   trunk/test/test3/mytest3.c
Log:
Fix truncation of queries with leading spaces when SQL_ATTR_MAX_ROWS
is set to a non-zero value. (Bug #6609)

Also cleans up a couple of lingering 64-bit issues in mytest3.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-02-13 21:20:39 UTC (rev 169)
+++ trunk/ChangeLog	2007-02-13 22:44:48 UTC (rev 170)
@@ -6,6 +6,8 @@
 ---------------------------------------------
 06-DEC-2006 (3.51.13): pharvey@stripped
 ---------------------------------------------
+-- Fix truncation of queries with leading spaces when SQL_ATTR_MAX_ROWS
+   is set to a non-zero value. (Bug #6609)
 -- Added support of HENV handlers in SQLEndTran(), updated tran
    test case
 -- Added auto-reconnect option since default auto-reconnecting

Modified: trunk/driver/execute.c
===================================================================
--- trunk/driver/execute.c	2007-02-13 21:20:39 UTC (rev 169)
+++ trunk/driver/execute.c	2007-02-13 22:44:48 UTC (rev 170)
@@ -69,7 +69,7 @@
             uint length= strlen(pos);
             if ( (tmp_buffer= my_malloc(length+30,MYF(0))) )
             {
-                memcpy(tmp_buffer,query,length);
+                memcpy(tmp_buffer,pos,length);
                 sprintf(tmp_buffer+length, " limit %lu",
                         (unsigned long)stmt->stmt_options.max_rows);
                 if ( query != stmt->query )

Modified: trunk/test/test3/mytest3.c
===================================================================
--- trunk/test/test3/mytest3.c	2007-02-13 21:20:39 UTC (rev 169)
+++ trunk/test/test3/mytest3.c	2007-02-13 22:44:48 UTC (rev 170)
@@ -2530,7 +2530,12 @@
     rc = SQLSetStmtAttr(hstmt,SQL_ATTR_MAX_ROWS,(SQLPOINTER)5,0);
     mystmt(hstmt,rc);
 
-    rc = tmysql_exec(hstmt,"select * from t_max_rows");
+    /*
+     This query includes leading spaces to act as a regression test
+     for Bug #6609: SQL_ATTR_MAX_ROWS and leading spaces in query result in
+     truncating end of query.
+    */
+    rc = tmysql_exec(hstmt,"  select * from t_max_rows");
     mystmt(hstmt,rc);
     myassert( 5 == myrowcount(hstmt));
 
@@ -4462,7 +4467,7 @@
 {
   SQLRETURN rc;
   SQLHSTMT  hstmt1;
-  long      int_data;
+  SQLINTEGER int_data;
   SQLLEN    row_count, cur_type;
 
   printMessageHeader();
@@ -5863,8 +5868,8 @@
 void t_row_array_size(SQLHDBC hdbc,SQLHSTMT hstmt)
 {
   SQLRETURN rc;
-  long      i, iarray[15];
-  SQLUINTEGER nrows;
+  SQLINTEGER i, iarray[15];
+  SQLLEN nrows;
   const int max_rows=9;
 
   printMessageHeader();
@@ -6938,8 +6943,4 @@
 
   fprintf(stdout,"\n\n-- test-end --\n");
   return(0);
-} 
-
-
-
-
+}

Thread
Connector/ODBC 3.51 commit: r170 - in trunk: . driver test/test3jwinstead13 Feb