List:Commits« Previous MessageNext Message »
From:jwinstead Date:July 2 2007 5:15pm
Subject:Connector/ODBC 3.51 commit: r542 - in branches/guffert: . driver
View as plain text  
Modified:
   branches/guffert/
   branches/guffert/driver/myutil.h
   branches/guffert/driver/options.c
   branches/guffert/driver/results.c
Log:
Merged revisions 538-541 via svnmerge from trunk

.......
  r541 | jwinstead | 2007-06-29 15:24:57 -0700 (Fri, 29 Jun 2007) | 2 lines
  
  Fix more 64-bit issues, this time having to do with column attributes.
.......



Property changes on: branches/guffert
___________________________________________________________________
Name: svnmerge-integrated
   - /trunk:1-537
   + /trunk:1-541

Modified: branches/guffert/driver/myutil.h
===================================================================
--- branches/guffert/driver/myutil.h	2007-06-29 22:24:57 UTC (rev 541)
+++ branches/guffert/driver/myutil.h	2007-07-02 17:15:27 UTC (rev 542)
@@ -113,7 +113,7 @@
 				      SQLLEN cbValueMax,
 				      SQLLEN *pcbValue);
 SQLRETURN SQL_API my_SQLExtendedFetch(SQLHSTMT hstmt, SQLUSMALLINT fFetchType,
-				      SQLROWOFFSET irow, SQLROWSETSIZE *pcrow,
+				      SQLROWOFFSET 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);

Modified: branches/guffert/driver/options.c
===================================================================
--- branches/guffert/driver/options.c	2007-06-29 22:24:57 UTC (rev 541)
+++ branches/guffert/driver/options.c	2007-07-02 17:15:27 UTC (rev 542)
@@ -769,7 +769,7 @@
             break;
 
         case SQL_ATTR_ROWS_FETCHED_PTR:
-            ValuePtr= (SQLUINTEGER *)options->rowsFetchedPtr;
+            ValuePtr= (SQLULEN *)options->rowsFetchedPtr;
             break;
 
         case SQL_ATTR_SIMULATE_CURSOR:

Modified: branches/guffert/driver/results.c
===================================================================
--- branches/guffert/driver/results.c	2007-06-29 22:24:57 UTC (rev 541)
+++ branches/guffert/driver/results.c	2007-07-02 17:15:27 UTC (rev 542)
@@ -574,12 +574,12 @@
              SQLPOINTER   CharacterAttributePtr,
              SQLSMALLINT  BufferLength,
              SQLSMALLINT  *StringLengthPtr,
-             SQLPOINTER   NumericAttributePtr)
+             SQLLEN       *NumericAttributePtr)
 {
     MYSQL_FIELD *field;
     STMT FAR *stmt= (STMT FAR*) StatementHandle;
     SQLSMALLINT str_length;
-    SQLPOINTER strparam= 0;
+    SQLLEN strparam= 0;
     SQLPOINTER nparam= 0;
     ulong transfer_length,precision,display_size;
     SQLRETURN error;
@@ -612,7 +612,7 @@
     if ( FieldIdentifier == SQL_DESC_COUNT ||
          FieldIdentifier == SQL_COLUMN_COUNT )
     {
-        *(SQLINTEGER *)NumericAttributePtr= stmt->result->field_count;
+        *NumericAttributePtr= (SQLLEN)stmt->result->field_count;
         MYODBCDbgReturnReturn(SQL_SUCCESS);
     }
     if ( FieldIdentifier == SQL_DESC_TYPE && ColumnNumber == 0 )
@@ -688,7 +688,7 @@
         case SQL_DESC_DISPLAY_SIZE:
             (void)
unireg_to_sql_datatype(stmt,field,0,&transfer_length,&precision,
                                           &display_size);
-            *(SQLINTEGER *)NumericAttributePtr= display_size;
+            *NumericAttributePtr= display_size;
             break;
 
         case SQL_DESC_FIXED_PREC_SCALE: /* need to verify later */
@@ -705,7 +705,7 @@
         case SQL_DESC_OCTET_LENGTH: /* need to validate again for octet length..*/
             (void)
unireg_to_sql_datatype(stmt,field,0,&transfer_length,&precision,
                                           &display_size);
-            *(SQLINTEGER *)NumericAttributePtr= transfer_length;
+            *NumericAttributePtr= transfer_length;
             break;
 
         case SQL_DESC_LITERAL_PREFIX:
@@ -870,26 +870,10 @@
 #endif
                                  )
 {
-  SQLRETURN  rc;
-  SQLINTEGER num;
-
   MYODBCDbgEnter;
 
-  /*
-   get_col_attr() expects an SQLINTEGER * for its last argument, but sometimes
-   this function can use SQLLEN *.
-  */
-  rc= get_col_attr(hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, &num);
-  if (pfDesc)
-  {
-#ifdef USE_SQLCOLATTRIBUTE_SQLLEN_PTR
-    *pfDesc= num;
-#else
-    *(SQLINTEGER *)pfDesc= num;
-#endif
-  }
-
-  MYODBCDbgReturnReturn(rc);
+  MYODBCDbgReturnReturn(get_col_attr(hstmt, icol, fDescType, rgbDesc,
+                                     cbDescMax, pcbDesc, pfDesc));
 }
 
 
@@ -919,20 +903,10 @@
                                    SQLSMALLINT *pcbDesc,
                                    SQLLEN      *pfDesc)
 {
-  SQLRETURN  rc;
-  SQLINTEGER num;
-
   MYODBCDbgEnter;
 
-  /*
-   get_col_attr() is built for SQLColAttribute(), which uses an SQLINTEGER *
-   for its last argument, but this legacy function uses SQLLEN *.
-  */
-  rc= get_col_attr(hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, &num);
-  if (pfDesc)
-    *pfDesc= num;
-
-  MYODBCDbgReturnReturn(rc);
+  MYODBCDbgReturnReturn(get_col_attr(hstmt, icol, fDescType, rgbDesc,
+                                     cbDescMax, pcbDesc, pfDesc));
 }
 
 
@@ -1277,7 +1251,7 @@
 SQLRETURN SQL_API my_SQLExtendedFetch( SQLHSTMT             hstmt,
                                        SQLUSMALLINT         fFetchType,
                                        SQLROWOFFSET         irow,
-                                       SQLROWSETSIZE       *pcrow,
+                                       SQLULEN             *pcrow,
                                        SQLUSMALLINT FAR    *rgfRowStatus,
                                        bool                 upd_status )
 {
@@ -1288,7 +1262,7 @@
     STMT FAR *stmt= (STMT FAR*) hstmt;
     MYSQL_ROW values= 0;
     MYSQL_ROW_OFFSET save_position;
-    SQLROWSETSIZE dummy_pcrow;
+    SQLULEN dummy_pcrow;
 
     MYODBCDbgEnter;
 
@@ -1543,18 +1517,17 @@
                                     SQLROWSETSIZE  *pcrow,
                                     SQLUSMALLINT FAR *rgfRowStatus )
 {
+    SQLRETURN rc;
+    SQLULEN rows;
     STMT_OPTIONS *options= &((STMT FAR *)hstmt)->stmt_options;
 
-    MYODBCDbgEnter;
-
     options->rowStatusPtr_ex= rgfRowStatus;
 
-    MYODBCDbgReturnReturn( my_SQLExtendedFetch( hstmt,
-                                fFetchType,
-                                irow,
-                                pcrow,
-                                rgfRowStatus,
-                                1 ) );
+    rc= my_SQLExtendedFetch(hstmt, fFetchType, irow, &rows, rgfRowStatus, 1);
+    if (pcrow)
+      *pcrow= (SQLROWSETSIZE)rows;
+
+    return rc;
 }
 
 

Thread
Connector/ODBC 3.51 commit: r542 - in branches/guffert: . driverjwinstead2 Jul