Modified:
ChangeLog
myodbc3/connect.c
myodbc3/myodbc3.h
Log:
fixed problem with memory allocation in Windows for BLOB and long queries that need
re-allocation of net->buf
Modified: ChangeLog
===================================================================
--- ChangeLog 2006-07-17 13:09:54 UTC (rev 50)
+++ ChangeLog 2006-07-18 08:55:24 UTC (rev 51)
@@ -6,6 +6,8 @@
---------------------------------------------
22-FEB-2006 (3.51.13): pharvey@stripped
---------------------------------------------
+-- fixed problem with memory allocation in Windows for BLOB and long
+ queries that need re-allocation of net->buf
-- updated fix for GlobalAlloc-ated memory
-- fixed bug #20547 - SQL_LEN_DATA_AT_EXEC not working
-- fixed problem with query log
Modified: myodbc3/connect.c
===================================================================
--- myodbc3/connect.c 2006-07-17 13:09:54 UTC (rev 50)
+++ myodbc3/connect.c 2006-07-18 08:55:24 UTC (rev 51)
@@ -273,6 +273,12 @@
dbc->password= my_strdup(passwd,MYF(MY_WME));
dbc->port= port_nr;
dbc->flag= flag_nr;
+#if defined(_WIN32) || defined(WIN32)
+ dbc->oldbuf = dbc->mysql.net.buff;
+ dbc->mysql.net.buff = (uchar*) my_malloc((uint32) dbc->mysql.net.max_packet+
+ NET_HEADER_SIZE + COMP_HEADER_SIZE,
+ MYF(MY_WME));
+#endif
MYODBCDbgReturn(set_connect_defaults(dbc));
}
@@ -342,6 +348,12 @@
return SQL_ERROR;
}
+#if defined(_WIN32) || defined(WIN32)
+ dbc->oldbuf = dbc->mysql.net.buff;
+ dbc->mysql.net.buff = (uchar*) my_malloc((uint32) dbc->mysql.net.max_packet+
+ NET_HEADER_SIZE + COMP_HEADER_SIZE,
+ MYF(MY_WME));
+#endif
return SQL_SUCCESS;
}
@@ -751,6 +763,10 @@
next_element= list_element->next;
my_SQLFreeStmt((SQLHSTMT) list_element->data, SQL_DROP);
}
+#if defined(_WIN32) || defined(WIN32)
+ my_free(dbc->mysql.net.buff, MYF(0));
+ dbc->mysql.net.buff = dbc->oldbuf;
+#endif
mysql_close(&dbc->mysql);
my_free(dbc->dsn,MYF(0));
my_free(dbc->database,MYF(0));
Modified: myodbc3/myodbc3.h
===================================================================
--- myodbc3/myodbc3.h 2006-07-17 13:09:54 UTC (rev 50)
+++ myodbc3/myodbc3.h 2006-07-18 08:55:24 UTC (rev 51)
@@ -272,6 +272,9 @@
#ifdef THREAD
pthread_mutex_t lock;
#endif
+#if defined(_WIN32) || defined(WIN32)
+ char *oldbuf; // old buffer to store memory pointer allocated previously in
another heap
+#endif
} DBC;
| Thread |
|---|
| • Connector/ODBC 3.51 commit: r51 - / myodbc3 | bdegtyariov | 18 Jul |