List:Commits« Previous MessageNext Message »
From:jbalint Date:March 13 2008 3:46pm
Subject:Connector/ODBC 3.51 commit: r1062 - in branches/guffert: . driver util
View as plain text  
Modified:
   branches/guffert/ChangeLog
   branches/guffert/driver/connect.c
   branches/guffert/driver/execute.c
   branches/guffert/driver/results.c
   branches/guffert/driver/unicode.c
   branches/guffert/driver/utility.c
   branches/guffert/util/MYODBCUtil.h
   branches/guffert/util/MYODBCUtilReadDataSourceStr.c
   branches/guffert/util/stringutil.h
Log:
Unresolved symbols "min" and "max" in libmyodbc3.so w/gcc 4.2. (Bug #34256)

Modified: branches/guffert/ChangeLog
===================================================================
--- branches/guffert/ChangeLog	2008-03-13 15:22:53 UTC (rev 1061)
+++ branches/guffert/ChangeLog	2008-03-13 15:46:47 UTC (rev 1062)
@@ -11,6 +11,8 @@
     SQLFreeStmt(SQL_UNBIND). (Bug #34271)
   * The driver incorrectly reported that the SQL standard CAST() and
     CONVERT() functions were supported. (Bug #33808)
+  * Unresolved symbols "min" and "max" in libmyodbc3.so w/gcc 4.2. 
+    (Bug #34256)
 
 ----
 

Modified: branches/guffert/driver/connect.c
===================================================================
--- branches/guffert/driver/connect.c	2008-03-13 15:22:53 UTC (rev 1061)
+++ branches/guffert/driver/connect.c	2008-03-13 15:46:47 UTC (rev 1062)
@@ -790,7 +790,7 @@
   if (!bPrompt)
   {
     size_t inlen= (sqlwcharlen(szConnStrIn) + 1) * sizeof(SQLWCHAR);
-    size_t copylen= min((size_t)cbConnStrOutMax, inlen);
+    size_t copylen= myodbc_min((size_t)cbConnStrOutMax, inlen);
     memcpy(szConnStrOut, szConnStrIn, copylen);
     if (pcbConnStrOut)
       *pcbConnStrOut= copylen / sizeof(SQLWCHAR);

Modified: branches/guffert/driver/execute.c
===================================================================
--- branches/guffert/driver/execute.c	2008-03-13 15:22:53 UTC (rev 1061)
+++ branches/guffert/driver/execute.c	2008-03-13 15:46:47 UTC (rev 1062)
@@ -281,7 +281,7 @@
 
         if (!octet_length_ptr && aprec->octet_length > 0 &&
             aprec->octet_length != SQL_SETPARAM_VALUE_MAX)
-          length= min(length, aprec->octet_length);
+          length= myodbc_min(length, aprec->octet_length);
       }
       else
       {

Modified: branches/guffert/driver/results.c
===================================================================
--- branches/guffert/driver/results.c	2008-03-13 15:22:53 UTC (rev 1061)
+++ branches/guffert/driver/results.c	2008-03-13 15:46:47 UTC (rev 1062)
@@ -1107,7 +1107,7 @@
   uint length= 0;
   DESCREC *irrec, *arrec;
 
-  for (i= 0; i < min(stmt->ird->count, stmt->ard->count); ++i, ++values)
+  for (i= 0; i < myodbc_min(stmt->ird->count, stmt->ard->count); ++i,
++values)
   {
     irrec= desc_get_rec(stmt->ird, i, FALSE);
     arrec= desc_get_rec(stmt->ard, i, FALSE);
@@ -1294,7 +1294,7 @@
     }
     stmt->current_row= cur_row;
 
-    rows_to_fetch= min(max_row-cur_row, (long)stmt->ard->array_size);
+    rows_to_fetch= myodbc_min(max_row-cur_row, (long)stmt->ard->array_size);
     if ( !rows_to_fetch )
     {
         *pcrow= 0;

Modified: branches/guffert/driver/unicode.c
===================================================================
--- branches/guffert/driver/unicode.c	2008-03-13 15:22:53 UTC (rev 1061)
+++ branches/guffert/driver/unicode.c	2008-03-13 15:46:47 UTC (rev 1062)
@@ -102,7 +102,7 @@
 
     if (char_attr_max > 0)
     {
-      len= min(len, char_attr_max - 1);
+      len= myodbc_min(len, char_attr_max - 1);
       (void)memcpy((char *)char_attr, (const char *)wvalue,
                    len * sizeof(SQLWCHAR));
       ((SQLWCHAR *)char_attr)[len]= 0;
@@ -275,7 +275,7 @@
 
     if (name_max > 0)
     {
-      len= min(len, name_max - 1);
+      len= myodbc_min(len, name_max - 1);
       (void)memcpy((char *)name, (const char *)wvalue,
                    len * sizeof(SQLWCHAR));
       ((SQLWCHAR *)name)[len]= 0;
@@ -432,7 +432,7 @@
 
     if (value_max > 0)
     {
-      len= min(len, value_max - 1);
+      len= myodbc_min(len, value_max - 1);
       (void)memcpy((char *)value, (const char *)wvalue,
                    len * sizeof(SQLWCHAR));
       ((SQLWCHAR *)value)[len]= 0;
@@ -481,7 +481,7 @@
 
   if (cursor_max > 0)
   {
-    len= min(len, cursor_max - 1);
+    len= myodbc_min(len, cursor_max - 1);
     (void)memcpy((char *)cursor, (const char *)name, len * sizeof(SQLWCHAR));
     cursor[len]= 0;
   }
@@ -539,7 +539,7 @@
 
     if (info_max > 0)
     {
-      len= min(len, info_max - 1);
+      len= myodbc_min(len, info_max - 1);
       (void)memcpy((char *)info, (const char *)wvalue,
                    len * sizeof(SQLWCHAR));
       ((SQLWCHAR *)info)[len]= 0;
@@ -611,7 +611,7 @@
 
     if (message_max > 0)
     {
-      len= min(len, message_max - 1);
+      len= myodbc_min(len, message_max - 1);
       (void)memcpy((char *)message, (const char *)wvalue,
                    len * sizeof(SQLWCHAR));
       ((SQLWCHAR *)message)[len]= 0;
@@ -679,7 +679,7 @@
 
     if (value && value_max > 0)
     {
-      len= min(len, value_max - 1);
+      len= myodbc_min(len, value_max - 1);
       (void)memcpy((char *)value, (const char *)wvalue,
                    len * sizeof(SQLWCHAR));
       ((SQLWCHAR *)value)[len]= 0;

Modified: branches/guffert/driver/utility.c
===================================================================
--- branches/guffert/driver/utility.c	2008-03-13 15:22:53 UTC (rev 1061)
+++ branches/guffert/driver/utility.c	2008-03-13 15:46:47 UTC (rev 1062)
@@ -138,7 +138,7 @@
       irrec->precision= (SQLSMALLINT) irrec->length;
       break;
     }
-    irrec->scale= max(0, (SQLSMALLINT) get_decimal_digits(stmt, field));
+    irrec->scale= myodbc_max(0, (SQLSMALLINT) get_decimal_digits(stmt, field));
     if ((field->flags & NOT_NULL_FLAG) &&
         !(field->flags & TIMESTAMP_FLAG) &&
         !(field->flags & AUTO_INCREMENT_FLAG))
@@ -327,7 +327,7 @@
     if ( rgbValue )
         strmake((char*) rgbValue, src, cbValueMax);
 
-    if ( min(*pcbValue , cbValueMax) != *pcbValue )
+    if ( myodbc_min(*pcbValue , cbValueMax) != *pcbValue )
         return SQL_SUCCESS_WITH_INFO;
     return SQL_SUCCESS;
 }
@@ -377,7 +377,7 @@
       return SQL_NO_DATA_FOUND;
   }
 
-  copy_bytes= min((unsigned long)result_bytes, src_bytes);
+  copy_bytes= myodbc_min((unsigned long)result_bytes, src_bytes);
 
   if (result)
     memcpy(result, src, copy_bytes);
@@ -452,7 +452,7 @@
                            field, src, src_bytes);
 
     if (SQL_SUCCEEDED(rc) && result)
-      result[min(*avail_bytes, result_bytes)]= '\0';
+      result[myodbc_min(*avail_bytes, result_bytes)]= '\0';
 
     return rc;
   }
@@ -491,8 +491,9 @@
   */
   if (stmt->getdata.latest_bytes)
   {
-    int new_bytes= min(stmt->getdata.latest_bytes - stmt->getdata.latest_used,
-                       result_end - result);
+    int new_bytes= myodbc_min(stmt->getdata.latest_bytes -
+                              stmt->getdata.latest_used,
+                              result_end - result);
     memcpy(result, stmt->getdata.latest + stmt->getdata.latest_used, new_bytes);
     if (new_bytes + stmt->getdata.latest_used == stmt->getdata.latest_bytes)
       stmt->getdata.latest_bytes= 0;
@@ -582,8 +583,8 @@
                                            stmt->getdata.latest +
                                            sizeof(stmt->getdata.latest));
 
-      stmt->getdata.latest_used= min(stmt->getdata.latest_bytes,
-                                     result_end - result);
+      stmt->getdata.latest_used= myodbc_min(stmt->getdata.latest_bytes,
+                                            result_end - result);
       memcpy(result, stmt->getdata.latest, stmt->getdata.latest_used);
       result+= stmt->getdata.latest_used;
       *result= '\0';
@@ -624,8 +625,9 @@
       *avail_bytes= used_bytes;
   }
 
-  stmt->getdata.dst_offset+= min((ulong)(result_bytes ? result_bytes - 1 : 0),
-                                 used_bytes);
+  stmt->getdata.dst_offset+= myodbc_min((ulong)(result_bytes ?
+                                                result_bytes - 1 : 0),
+                                        used_bytes);
 
   /* Did we truncate the data? */
   if (!result_bytes || stmt->getdata.dst_bytes > stmt->getdata.dst_offset)
@@ -842,8 +844,9 @@
       *avail_bytes= used_chars * sizeof(SQLWCHAR);
   }
 
-  stmt->getdata.dst_offset+= min((ulong)(result_len ? result_len - 1 : 0),
-                                 used_chars) * sizeof(SQLWCHAR);
+  stmt->getdata.dst_offset+= myodbc_min((ulong)(result_len ?
+                                                result_len - 1 : 0),
+                                        used_chars) * sizeof(SQLWCHAR);
 
   /* Did we truncate the data? */
   if (!result_len || stmt->getdata.dst_bytes > stmt->getdata.dst_offset)
@@ -898,7 +901,7 @@
     src+= *offset;
     src_length-= *offset;
     length= cbValueMax ? (ulong)(cbValueMax-1)/2 : 0;
-    length= min(src_length,length);
+    length= myodbc_min(src_length,length);
     (*offset)+= length;     /* Fix for next call */
     if ( pcbValue )
         *pcbValue= src_length*2;

Modified: branches/guffert/util/MYODBCUtil.h
===================================================================
--- branches/guffert/util/MYODBCUtil.h	2008-03-13 15:22:53 UTC (rev 1061)
+++ branches/guffert/util/MYODBCUtil.h	2008-03-13 15:46:47 UTC (rev 1062)
@@ -56,9 +56,9 @@
 #define TRUE 1
 #endif
 
-#ifndef max
-#define max( a, b ) (((a) > (b)) ? (a) : (b))
-#define min( a, b ) (((a) < (b)) ? (a) : (b))
+#ifndef myodbc_max
+#define myodbc_max( a, b ) (((a) > (b)) ? (a) : (b))
+#define myodbc_min( a, b ) (((a) < (b)) ? (a) : (b))
 #endif
 
 /* Could use DRIVER_NAME but trying to keep dependency upon driver specific code to a min
*/

Modified: branches/guffert/util/MYODBCUtilReadDataSourceStr.c
===================================================================
--- branches/guffert/util/MYODBCUtilReadDataSourceStr.c	2008-03-13 15:22:53 UTC (rev 1061)
+++ branches/guffert/util/MYODBCUtilReadDataSourceStr.c	2008-03-13 15:46:47 UTC (rev 1062)
@@ -29,7 +29,7 @@
     if ( !s )
         return 0;
 
-    nAvail = min( strlen(s) + 1, n + 1 );
+    nAvail = myodbc_min( strlen(s) + 1, n + 1 );
 
     if ( nAvail < 1 )
         return 0;
@@ -63,7 +63,7 @@
     if ( !s )
         return 0;
 
-    nAvail = min( strlen(s) + 1, n + 1 );
+    nAvail = myodbc_min( strlen(s) + 1, n + 1 );
 
     if ( nAvail < 1 )
         return 0;
@@ -327,4 +327,4 @@
         _global_free( pszName );
 
     return TRUE;
-}
\ No newline at end of file
+}

Modified: branches/guffert/util/stringutil.h
===================================================================
--- branches/guffert/util/stringutil.h	2008-03-13 15:22:53 UTC (rev 1061)
+++ branches/guffert/util/stringutil.h	2008-03-13 15:46:47 UTC (rev 1062)
@@ -42,6 +42,9 @@
 #define x_free(A) { void *tmp= (A); if (tmp) my_free((char *) tmp,MYF(MY_WME+MY_FAE)); }
 #endif
 
+#define myodbc_min(a, b) ((a) < (b) ? (a) : (b))
+#define myodbc_max(a, b) ((a) > (b) ? (a) : (b))
+
 #define MAX_BYTES_PER_UTF8_CP 4 /* max 4 bytes per utf8 codepoint */
 
 /* Unicode transcoding */

Thread
Connector/ODBC 3.51 commit: r1062 - in branches/guffert: . driver utiljbalint13 Mar