MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:jwinstead Date:September 5 2007 8:20pm
Subject:Connector/ODBC 3.51 commit: r739 - trunk/driver
View as plain text  
Modified:
   trunk/driver/connect.c
   trunk/driver/myodbc3.h
   trunk/driver/myutil.h
   trunk/driver/results.c
   trunk/driver/utility.c
Log:
Enable query logging in non-debug builds, and always enable checking of
column number in SQLColAttribute().


Modified: trunk/driver/connect.c
===================================================================
--- trunk/driver/connect.c	2007-09-05 18:44:46 UTC (rev 738)
+++ trunk/driver/connect.c	2007-09-05 20:20:49 UTC (rev 739)
@@ -181,10 +181,8 @@
   dbc->port= port;
   dbc->flag= options;
 
-#ifdef MYODBC_DBG
   if (options & FLAG_LOG_QUERY && !dbc->query_log)
     dbc->query_log= init_query_log();
-#endif
 
   /* Set the statement error prefix based on the server version. */
   strxmov(dbc->st_error_prefix, MYODBC3_ERROR_PREFIX, "[mysqld-",
@@ -672,10 +670,8 @@
   my_free(dbc->password, MYF(0));
   dbc->dsn= dbc->database= dbc->server= dbc->user= dbc->password= 0;
 
-#ifdef MYODBC_DBG
   if (dbc->flag & FLAG_LOG_QUERY)
     end_query_log(dbc->query_log);
-#endif
 
   return SQL_SUCCESS;
 }

Modified: trunk/driver/myodbc3.h
===================================================================
--- trunk/driver/myodbc3.h	2007-09-05 18:44:46 UTC (rev 738)
+++ trunk/driver/myodbc3.h	2007-09-05 20:20:49 UTC (rev 739)
@@ -92,30 +92,20 @@
 #if defined(__APPLE__)
 
 #define DRIVER_DLL_NAME   "libmyodbc3.dylib"
-#ifdef MYODBC_DBG
 #define DRIVER_QUERY_LOGFILE "/tmp/myodbc.sql"
-#endif
 
 #elif defined(_UNIX_)
 
 #define DRIVER_DLL_NAME   "libmyodbc3.so"
-#ifdef MYODBC_DBG
 #define DRIVER_QUERY_LOGFILE "/tmp/myodbc.sql"
-#endif
 
 #else
 
 #define DRIVER_DLL_NAME   "myodbc3.dll"
-#ifdef MYODBC_DBG
 #define DRIVER_QUERY_LOGFILE "c:\\myodbc.sql"
-#endif
 
 #endif
 
-#ifdef MYODBC_DBG
-#define CHECK_EXTRA_ARGUMENTS
-#endif
-
 /*
    Internal driver definations
 */

Modified: trunk/driver/myutil.h
===================================================================
--- trunk/driver/myutil.h	2007-09-05 18:44:46 UTC (rev 738)
+++ trunk/driver/myutil.h	2007-09-05 20:20:49 UTC (rev 739)
@@ -48,18 +48,12 @@
 #define digit(A) ((int) (A - '0'))
 #define option_flag(A,B) ((A)->dbc->flag & B)
 
-#ifdef MYODBC_DBG
-
 #define MYLOG_QUERY(A,B) if ((A)->dbc->flag & FLAG_LOG_QUERY) \
 			   query_print((A)->dbc->query_log,(char*) B)
 
 #define MYLOG_DBC_QUERY(A,B) if((A)->flag & FLAG_LOG_QUERY) \
 			   query_print((A)->query_log,(char*) B)
 
-#else
-#define MYLOG_QUERY(A,B)
-#define MYLOG_DBC_QUERY(A,B)
-#endif
 
 #define UTF8_CHARSET_NUMBER 33
 
@@ -225,11 +219,9 @@
                              const char *from, ulong length);
 
 /* Functions used when debugging */
-#ifdef MYODBC_DBG
 void query_print(FILE *log_file,char *query);
 FILE *init_query_log(void);
 void end_query_log(FILE *query_log);
-#endif
 
 #ifdef __WIN__
 #define cmp_database(A,B) myodbc_strcasecmp((const char *)(A),(const char *)(B))

Modified: trunk/driver/results.c
===================================================================
--- trunk/driver/results.c	2007-09-05 18:44:46 UTC (rev 738)
+++ trunk/driver/results.c	2007-09-05 20:20:49 UTC (rev 739)
@@ -582,10 +582,10 @@
 
     if ( !stmt->result )
         return set_stmt_error(stmt,"07005","No result set",0);
-#ifdef CHECK_EXTRA_ARGUMENTS
+
     if ( ColumnNumber > stmt->result->field_count )
         return set_error(StatementHandle, MYERR_07009,NULL,0);
-#endif
+
     if ( !StringLengthPtr )
         StringLengthPtr= &str_length;
 

Modified: trunk/driver/utility.c
===================================================================
--- trunk/driver/utility.c	2007-09-05 18:44:46 UTC (rev 738)
+++ trunk/driver/utility.c	2007-09-05 20:20:49 UTC (rev 739)
@@ -1370,7 +1370,6 @@
   @purpose : logs the queries sent to server
 */
 
-#ifdef MYODBC_DBG
 void query_print(FILE *log_file,char *query)
 {
     if ( log_file && query )
@@ -1418,13 +1417,7 @@
     }
 }
 
-#else
-void query_print(char *query __attribute__((unused)))
-{
-}
-#endif /* !MYODBC_DBG */
 
-
 my_bool is_minimum_version(const char *server_version,const char *version,
                            uint length)
 {

Thread
Connector/ODBC 3.51 commit: r739 - trunk/driverjwinstead5 Sep