File MyODBC-unixODBC-64bit.patch of Package MyODBC-unixODBC

Fix some 64-bitness issues arising from unixODBC 2.2.14 changes.


diff -Naur mysql-connector-odbc-5.1.8.orig/driver/utility.c mysql-connector-odbc-5.1.8/driver/utility.c
--- mysql-connector-odbc-5.1.8.orig/driver/utility.c	2010-10-28 14:33:18.000000000 -0400
+++ mysql-connector-odbc-5.1.8/driver/utility.c	2010-12-23 17:15:37.516602586 -0500
@@ -1205,7 +1205,7 @@
 {
   /* See comment for fill_transfer_oct_len_buff()*/
   SQLLEN size= get_display_size(stmt, field);
-  sprintf(buff,size == SQL_NO_TOTAL ? "%d" : (sizeof(SQLLEN) == 4 ? "%lu" : "%lld"), size);
+  sprintf(buff, (size == SQL_NO_TOTAL ? "%ld" : "%lu"), size);
 
   return size;
 }
@@ -1228,7 +1228,7 @@
   */
   SQLLEN len= get_transfer_octet_length(stmt, field);
 
-  sprintf(buff, len == SQL_NO_TOTAL ? "%d" : (sizeof(SQLLEN) == 4 ? "%lu" : "%lld"), len );
+  sprintf(buff, (len == SQL_NO_TOTAL ? "%ld" : "%lu"), len );
 
   return len;
 }
@@ -1245,8 +1245,7 @@
 SQLULEN fill_column_size_buff(char *buff, STMT *stmt, MYSQL_FIELD *field)
 {
   SQLULEN size= get_column_size(stmt, field);
-  sprintf(buff, (size== SQL_NO_TOTAL ? "%d" :
-      (sizeof(SQLULEN) == 4 ? "%lu" : "%llu")), size);
+  sprintf(buff, (size== SQL_NO_TOTAL ? "%ld" : "%lu"), size);
   return size;
 }
 
diff -Naur mysql-connector-odbc-5.1.8.orig/test/my_catalog.c mysql-connector-odbc-5.1.8/test/my_catalog.c
--- mysql-connector-odbc-5.1.8.orig/test/my_catalog.c	2010-10-28 14:33:18.000000000 -0400
+++ mysql-connector-odbc-5.1.8/test/my_catalog.c	2010-12-23 17:16:26.284605944 -0500
@@ -599,7 +599,7 @@
     fprintf(stdout, "#  Column Name   : %s\n", szColName);
     fprintf(stdout, "#  NameLengh     : %d\n", pcbColName);
     fprintf(stdout, "#  DataType      : %d\n", pfSqlType);
-    fprintf(stdout, "#  ColumnSize    : %d\n", pcbColDef);
+    fprintf(stdout, "#  ColumnSize    : %ld\n", pcbColDef);
     fprintf(stdout, "#  DecimalDigits : %d\n", pibScale);
     fprintf(stdout, "#  Nullable      : %d\n", pfNullable);
 
@@ -632,7 +632,7 @@
 
     rc = SQLGetConnectAttr(hdbc, SQL_ATTR_CURRENT_CATALOG, db, sizeof(db), &len);
     mycon(hdbc,rc);
-    fprintf(stdout,"current_catalog: %s (%ld)\n", db, len);
+    fprintf(stdout,"current_catalog: %s (%d)\n", db, len);
     is_num(len, 4);
     is_str(db, "test", 5);
 
@@ -653,7 +653,7 @@
 
     rc = SQLGetConnectAttr(hdbc, SQL_ATTR_CURRENT_CATALOG, db, 255, &len);
     mycon(hdbc,rc);
-    fprintf(stdout,"current_catalog: %s (%ld)\n", db, len);
+    fprintf(stdout,"current_catalog: %s (%d)\n", db, len);
     is_num(len, 17);
     is_str(db, cur_db, 18);
 
diff -Naur mysql-connector-odbc-5.1.8.orig/test/my_cursor.c mysql-connector-odbc-5.1.8/test/my_cursor.c
--- mysql-connector-odbc-5.1.8.orig/test/my_cursor.c	2010-10-28 14:33:18.000000000 -0400
+++ mysql-connector-odbc-5.1.8/test/my_cursor.c	2010-12-23 17:12:16.632676933 -0500
@@ -711,7 +711,7 @@
 
     rc = SQLRowCount(hstmt1,&row_count);
     mystmt(hstmt1,rc);
-    fprintf(stdout, "rows affected: %d\n", row_count);
+    fprintf(stdout, "rows affected: %ld\n", row_count);
     myassert(row_count == 1);
 
     rc = SQLExtendedFetch(hstmt,SQL_FETCH_NEXT,1,NULL,&rgfRowStatus);
@@ -732,7 +732,7 @@
 
     rc = SQLRowCount(hstmt1,&row_count);
     mystmt(hstmt1,rc);
-    fprintf(stdout, "rows affected: %d\n", row_count);
+    fprintf(stdout, "rows affected: %ld\n", row_count);
     myassert(row_count == 1);
 
     SQLFreeStmt(hstmt,SQL_UNBIND);