summaryrefslogtreecommitdiff
path: root/sql-common/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'sql-common/client.c')
-rw-r--r--sql-common/client.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index 374cbb29112..5b702f0e966 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -967,7 +967,8 @@ void mysql_read_default_options(struct st_mysql_options *options,
#endif
break;
case 27:
- options->max_allowed_packet= atoi(opt_arg);
+ if (opt_arg)
+ options->max_allowed_packet= atoi(opt_arg);
break;
case 28: /* protocol */
if ((options->protocol = find_type(opt_arg,
@@ -1310,7 +1311,9 @@ read_one_row(MYSQL *mysql,uint fields,MYSQL_ROW row, ulong *lengths)
MYSQL * STDCALL
mysql_init(MYSQL *mysql)
{
- mysql_once_init();
+ if (mysql_once_init())
+ return 0;
+
if (!mysql)
{
if (!(mysql=(MYSQL*) my_malloc(sizeof(*mysql),MYF(MY_WME | MY_ZEROFILL))))