Bug #48174 ODBC 5.1.5r1144 will not build against the latest unixODBC on a 64-bit OS

Submitted: 20 Oct 2009 1:40 Modified: 24 Feb 2010 14:26
Reporter: Alex Goncharov Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version: OS:Linux
Assigned to: CPU Architecture:Any
Tags: 64-bit OS, ODBC, patch, unixODBC

[20 Oct 2009 1:40] Alex Goncharov
Description:
In order to build mysql-connector-odbc-5.1.5r1144 against the latest release of unixODBC (2.2.14) on a 64-bit OS, the enclosed patch (or similar) is required.
---------------------------------------------------------------
diff -Naur mysql-connector-odbc-5.1.5r1144.orig/driver/myutil.h mysql-connector-odbc-5.1.5r1144/driver/myutil.h
--- mysql-connector-odbc-5.1.5r1144.orig/driver/myutil.h	2008-04-14 21:03:13.000000000 -0400
+++ mysql-connector-odbc-5.1.5r1144/driver/myutil.h	2009-10-19 13:11:53.000000000 -0400
@@ -203,7 +203,7 @@
 				      SQLLEN cbValueMax,
 				      SQLLEN *pcbValue);
 SQLRETURN SQL_API my_SQLExtendedFetch(SQLHSTMT hstmt, SQLUSMALLINT fFetchType,
-				      SQLROWOFFSET irow, SQLULEN *pcrow,
+				      SQLLEN irow, SQLULEN *pcrow,
 				      SQLUSMALLINT FAR *rgfRowStatus, bool upd_status);
 SQLRETURN copy_stmt_error(STMT FAR *src, STMT FAR *dst);
 int unireg_to_c_datatype(MYSQL_FIELD *field);
diff -Naur mysql-connector-odbc-5.1.5r1144.orig/driver/results.c mysql-connector-odbc-5.1.5r1144/driver/results.c
--- mysql-connector-odbc-5.1.5r1144.orig/driver/results.c	2008-06-06 15:37:04.000000000 -0400
+++ mysql-connector-odbc-5.1.5r1144/driver/results.c	2009-10-19 13:11:53.000000000 -0400
@@ -1181,7 +1181,7 @@
 */
 SQLRETURN SQL_API my_SQLExtendedFetch( SQLHSTMT             hstmt,
                                        SQLUSMALLINT         fFetchType,
-                                       SQLROWOFFSET         irow,
+                                       SQLLEN         irow,
                                        SQLULEN             *pcrow,
                                        SQLUSMALLINT FAR    *rgfRowStatus,
                                        bool                 upd_status )
@@ -1384,8 +1384,8 @@
 
 SQLRETURN SQL_API SQLExtendedFetch( SQLHSTMT        hstmt,
                                     SQLUSMALLINT    fFetchType,
-                                    SQLROWOFFSET    irow,
-                                    SQLROWSETSIZE  *pcrow,
+                                    SQLLEN    irow,
+                                    SQLULEN  *pcrow,
                                     SQLUSMALLINT FAR *rgfRowStatus )
 {
     SQLRETURN rc;
@@ -1396,7 +1396,7 @@
 
     rc= my_SQLExtendedFetch(hstmt, fFetchType, irow, &rows, rgfRowStatus, 1);
     if (pcrow)
-      *pcrow= (SQLROWSETSIZE)rows;
+      *pcrow= (SQLUINTEGER)rows;
 
     return rc;
 }
diff -Naur mysql-connector-odbc-5.1.5r1144.orig/test/my_bulk.c mysql-connector-odbc-5.1.5r1144/test/my_bulk.c
--- mysql-connector-odbc-5.1.5r1144.orig/test/my_bulk.c	2007-08-24 23:46:18.000000000 -0400
+++ mysql-connector-odbc-5.1.5r1144/test/my_bulk.c	2009-10-19 13:11:53.000000000 -0400
@@ -91,7 +91,7 @@
 {
   SQLINTEGER nData;
   SQLLEN nlen;
-  SQLROWSETSIZE pcrow;
+  SQLLEN pcrow;
 
   ok_sql(hstmt, "DROP TABLE IF EXISTS t_mul_pkdel");
   ok_sql(hstmt, "CREATE TABLE t_mul_pkdel (a INT NOT NULL, b INT,"
diff -Naur mysql-connector-odbc-5.1.5r1144.orig/test/my_cursor.c mysql-connector-odbc-5.1.5r1144/test/my_cursor.c
--- mysql-connector-odbc-5.1.5r1144.orig/test/my_cursor.c	2008-04-14 21:02:23.000000000 -0400
+++ mysql-connector-odbc-5.1.5r1144/test/my_cursor.c	2009-10-19 13:11:53.000000000 -0400
@@ -465,7 +465,7 @@
   SQLCHAR szData[20];
   SQLINTEGER nData;
   SQLLEN  pcbValue, nlen;
-  SQLROWSETSIZE pcrow;
+  SQLLEN pcrow;
   SQLUSMALLINT rgfRowStatus;
 
   ok_sql(hstmt, "DROP TABLE IF EXISTS t_pos_column_ignore");
@@ -905,7 +905,7 @@
   SQLINTEGER nData;
   SQLLEN nlen;
   SQLCHAR szData[255];
-  SQLROWSETSIZE pcrow;
+  SQLLEN pcrow;
   SQLUSMALLINT rgfRowStatus;
 
   ok_sql(hstmt, "DROP TABLE IF EXISTS tmysql_setpos_del");
@@ -978,7 +978,7 @@
   SQLINTEGER nData;
   SQLLEN nlen;
   SQLCHAR szData[255];
-  SQLROWSETSIZE pcrow;
+  SQLLEN pcrow;
   SQLUSMALLINT rgfRowStatus;
 
   ok_sql(hstmt, "DROP TABLE IF EXISTS tmysql_setpos_del1");
@@ -1038,7 +1038,7 @@
     SQLINTEGER nData = 500;
     SQLLEN nlen;
     SQLCHAR szData[255]={0};
-    SQLROWSETSIZE pcrow;
+    SQLLEN pcrow;
     SQLUSMALLINT rgfRowStatus;
 
   ok_sql(hstmt, "DROP TABLE IF EXISTS tmysql_setpos");
@@ -1146,7 +1146,7 @@
     SQLINTEGER nData= 500;
     SQLLEN nlen;
     SQLCHAR szData[255]={0};
-    SQLROWSETSIZE pcrow;
+    SQLLEN pcrow;
     SQLUSMALLINT rgfRowStatus;
 
   ok_sql(hstmt, "DROP TABLE IF EXISTS tmysql_setpos_add");
@@ -1359,7 +1359,7 @@
 DECLARE_TEST(tmysql_pos_update_ex)
 {
   SQLHSTMT hstmt1;
-  SQLROWSETSIZE pcrow;
+  SQLLEN pcrow;
   SQLUSMALLINT rgfRowStatus;
   SQLLEN rows;
   SQLCHAR cursor[30], sql[255], data[]= "tmysql_pos_update_ex";
@@ -1483,7 +1483,7 @@
 DECLARE_TEST(tmysql_pos_update_ex3)
 {
   SQLHSTMT hstmt1;
-  SQLROWSETSIZE pcrow;
+  SQLLEN pcrow;
   SQLUSMALLINT rgfRowStatus;
   SQLCHAR cursor[30], sql[255];
 
@@ -1523,7 +1523,7 @@
 
 DECLARE_TEST(tmysql_pos_update_ex4)
 {
-  SQLROWSETSIZE pcrow;
+  SQLLEN pcrow;
   SQLLEN nlen= SQL_NTS;
   SQLCHAR data[]= "venu", szData[20];
   SQLUSMALLINT rgfRowStatus;
@@ -1572,7 +1572,7 @@
 DECLARE_TEST(tmysql_pos_dyncursor)
 {
   SQLHSTMT hstmt1;
-  SQLROWSETSIZE pcrow;
+  SQLLEN pcrow;
   SQLUSMALLINT rgfRowStatus;
   SQLCHAR buff[100];
   SQLLEN rows;
@@ -1632,7 +1632,7 @@
     SQLINTEGER nData= 500;
     SQLLEN nlen;
     SQLCHAR szData[255]={0};
-    SQLROWSETSIZE pcrow;
+    SQLLEN pcrow;
     SQLUSMALLINT rgfRowStatus;
 
   ok_sql(hstmt, "DROP TABLE IF EXISTS tmysql_t1, tmysql_t2");
@@ -1704,7 +1704,7 @@
     SQLINTEGER nData= 500;
     SQLLEN nlen;
     SQLCHAR szData[255]={0};
-    SQLROWSETSIZE pcrow;
+    SQLLEN pcrow;
     SQLUSMALLINT rgfRowStatus;
 
   ok_sql(hstmt, "DROP TABLE IF EXISTS tmysql_setpos1");
@@ -1785,7 +1785,7 @@
   SQLINTEGER nData= 500;
   SQLLEN nlen;
   SQLCHAR szData[255]= {0};
-  SQLROWSETSIZE pcrow;
+  SQLLEN pcrow;
   SQLUSMALLINT rgfRowStatus;
 
   ok_sql(hstmt, "DROP TABLE IF EXISTS t_alias_setpos_pkdel");
@@ -1848,7 +1848,7 @@
   SQLINTEGER nData= 500;
   SQLLEN nlen;
   SQLCHAR szData[255]= {0};
-  SQLROWSETSIZE pcrow;
+  SQLLEN pcrow;
   SQLUSMALLINT rgfRowStatus;
 
   ok_sql(hstmt, "DROP TABLE IF EXISTS t_alias_setpos_del");
@@ -1909,7 +1909,7 @@
   SQLINTEGER nData= 500;
   SQLLEN nlen;
   SQLCHAR szData[255]= {0};
-  SQLROWSETSIZE pcrow;
+  SQLLEN pcrow;
   SQLUSMALLINT rgfRowStatus;
 
   ok_sql(hstmt, "DROP TABLE IF EXISTS tmysql_setpos_pkdel2");
@@ -2091,7 +2091,7 @@
     SQLINTEGER nData= 500;
     SQLLEN nlen;
     SQLCHAR szData[255]={0};
-    SQLROWSETSIZE pcrow;
+    SQLLEN pcrow;
     SQLUSMALLINT rgfRowStatus;
 
   ok_sql(hstmt, "DROP TABLE IF EXISTS my_setpos_upd_pk_order");
@@ -2177,7 +2177,7 @@
 {
   SQLINTEGER nData;
   SQLCHAR szData[255];
-  SQLROWSETSIZE pcrow;
+  SQLLEN pcrow;
   SQLUSMALLINT rgfRowStatus;
   SQLLEN rows;
 
diff -Naur mysql-connector-odbc-5.1.5r1144.orig/test/my_result.c mysql-connector-odbc-5.1.5r1144/test/my_result.c
--- mysql-connector-odbc-5.1.5r1144.orig/test/my_result.c	2008-07-08 21:14:29.000000000 -0400
+++ mysql-connector-odbc-5.1.5r1144/test/my_result.c	2009-10-19 13:11:53.000000000 -0400
@@ -1473,7 +1473,7 @@
 {
     SQLRETURN rc;
     SQLHSTMT hstmt1;
-    SQLROWSETSIZE pcrow[4];
+    SQLLEN pcrow[4];
     SQLUSMALLINT rgfRowStatus[6];
     SQLINTEGER nData= 555;
     SQLCHAR szData[255] = "setpos-update";

How to repeat:
Try to build without the patch. Try to build after applying the patch. x86-64 OS.
[16 Nov 2009 9:51] Tonci Grgin
Hi Alex and thanks for your report.

I believe this is fixed in new release (5.1.6), can you please check?

5.1.6

  Functionality added or changed:
...
  * Remove use of "old" SQLLEN/SQLULEN types aliases. They are not
    supported in unixODBC 2.2.13 and later 64-bit builds. Removed
    SQLROWCOUNT, SQLROWSETSIZE, SQLTRANSID, SQLROWOFFSET.
...

New revision numbers should be 840 or 844, I think.
[17 Dec 2009 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.052 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.