List:Commits« Previous MessageNext Message »
From:jbalint Date:March 17 2008 7:07pm
Subject:Connector/ODBC 3.51 commit: r1074 - in branches/guffert: . driver
View as plain text  
Modified:
   branches/guffert/ChangeLog
   branches/guffert/driver/connect.c
   branches/guffert/driver/driver.h
   branches/guffert/driver/prepare.c
Log:
Notorious #DELETED problem when linking tables in Access and BIGINT PK (Bug #24535)

Modified: branches/guffert/ChangeLog
===================================================================
--- branches/guffert/ChangeLog	2008-03-17 16:30:36 UTC (rev 1073)
+++ branches/guffert/ChangeLog	2008-03-17 19:07:23 UTC (rev 1074)
@@ -13,6 +13,8 @@
     CONVERT() functions were supported. (Bug #33808)
   * Unresolved symbols "min" and "max" in libmyodbc3.so w/gcc 4.2. 
     (Bug #34256)
+  * Notorious #DELETED problem when linking tables in Access and BIGINT PK
+    (Bug #24535)
 
 ----
 

Modified: branches/guffert/driver/connect.c
===================================================================
--- branches/guffert/driver/connect.c	2008-03-17 16:30:36 UTC (rev 1073)
+++ branches/guffert/driver/connect.c	2008-03-17 19:07:23 UTC (rev 1074)
@@ -153,6 +153,10 @@
   */
   if (GetModuleHandle("msado15.dll") != NULL)
     options|= FLAG_COLUMN_SIZE_S32;
+
+  /* Detect another problem specific to MS Access */
+  if (GetModuleHandle("msaccess.exe") != NULL)
+    options|= FLAG_DFLT_BIGINT_BIND_STR;
 #endif
 
   mysql_init(mysql);

Modified: branches/guffert/driver/driver.h
===================================================================
--- branches/guffert/driver/driver.h	2008-03-17 16:30:36 UTC (rev 1073)
+++ branches/guffert/driver/driver.h	2008-03-17 19:07:23 UTC (rev 1074)
@@ -145,6 +145,11 @@
 #define FLAG_MIN_DATE_TO_ZERO (1 << 25) /* Convert ODBC min date to 0000-00-00 on
query */
 #define FLAG_MULTI_STATEMENTS (1 << 26) /* Allow multiple statements in a query */
 #define FLAG_COLUMN_SIZE_S32 (1 << 27) /* Limit column size to a signed 32-bit
value (automatically set for ADO) */
+/*
+  When binding SQL_BIGINT as SQL_C_DEFAULT, treat it as a string
+  (automatically set for MS Access) see bug#24535
+*/
+#define FLAG_DFLT_BIGINT_BIND_STR (1 << 28)
 
 /* We don't make any assumption about what the default may be. */
 #ifndef DEFAULT_TXN_ISOLATION

Modified: branches/guffert/driver/prepare.c
===================================================================
--- branches/guffert/driver/prepare.c	2008-03-17 16:30:36 UTC (rev 1073)
+++ branches/guffert/driver/prepare.c	2008-03-17 19:07:23 UTC (rev 1074)
@@ -231,7 +231,16 @@
 
     /* first, set apd fields */
     if (ValueType == SQL_C_DEFAULT)
-        ValueType= default_c_type(ParameterType);
+    {
+      ValueType= default_c_type(ParameterType);
+      /*
+        Access treats BIGINT as a string on linked tables.
+        The value is read correctly, but bound as a string.
+      */
+      if (ParameterType == SQL_BIGINT &&
+          (stmt->dbc->flag & FLAG_DFLT_BIGINT_BIND_STR))
+        ValueType= SQL_C_CHAR;
+    }
     if (!SQL_SUCCEEDED(rc = stmt_SQLSetDescField(stmt, stmt->apd,
                                                  ParameterNumber,
                                                  SQL_DESC_CONCISE_TYPE,

Thread
Connector/ODBC 3.51 commit: r1074 - in branches/guffert: . driverjbalint17 Mar