1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Safer fix for Bug #18435 "5.0.19 libmysqlclient not ABI-compatible with 5.0.18"

This fixes the problem if someone is using struct MYSQL as part of another structure together with a shared
library


include/mysql.h:
  Safer fix for Bug #18435
sql-common/client.c:
  Safer fix for Bug #18435
This commit is contained in:
unknown
2006-03-27 12:02:23 +03:00
parent 6d7711660c
commit 783780f1c9
2 changed files with 2 additions and 6 deletions

View File

@@ -287,8 +287,10 @@ typedef struct st_mysql
from mysql_stmt_close if close had to cancel result set of this object. from mysql_stmt_close if close had to cancel result set of this object.
*/ */
my_bool *unbuffered_fetch_owner; my_bool *unbuffered_fetch_owner;
#if defined(EMBEDDED_LIBRARY) || defined(EMBEDDED_LIBRARY_COMPATIBLE) || MYSQL_VERSION_ID >= 50100
/* needed for embedded server - no net buffer to store the 'info' */ /* needed for embedded server - no net buffer to store the 'info' */
char *info_buffer; char *info_buffer;
#endif
} MYSQL; } MYSQL;
typedef struct st_mysql_res { typedef struct st_mysql_res {

View File

@@ -1428,13 +1428,7 @@ mysql_init(MYSQL *mysql)
mysql->free_me=1; mysql->free_me=1;
} }
else else
{
#if defined(EMBEDDED_LIBRARY) || MYSQL_VERSION_ID >= 50100
bzero((char*) (mysql), sizeof(*(mysql))); bzero((char*) (mysql), sizeof(*(mysql)));
#else
bzero((char*) (mysql), offsetof(MYSQL, info_buffer));
#endif
}
mysql->options.connect_timeout= CONNECT_TIMEOUT; mysql->options.connect_timeout= CONNECT_TIMEOUT;
mysql->last_used_con= mysql->next_slave= mysql->master = mysql; mysql->last_used_con= mysql->next_slave= mysql->master = mysql;
mysql->charset=default_charset_info; mysql->charset=default_charset_info;