diff options
author | Michael Widenius <monty@askmonty.org> | 2010-08-05 22:56:11 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2010-08-05 22:56:11 +0300 |
commit | d042146e5b41b6222df3e6b4c16a44f3ef2939b7 (patch) | |
tree | e40f5b435f7d17ed1c24dfb787ab8cd5f4f7d5d8 /sql-common | |
parent | 3e610bc58d0ba325fdca3b06dfa976ecc513dc1e (diff) | |
parent | f0f21036951f6fed2fddeb58375425f957751fd5 (diff) | |
download | mariadb-git-d042146e5b41b6222df3e6b4c16a44f3ef2939b7.tar.gz |
Merge with MariaDB 5.1.49
Removed references to HA_END_SPACE_KEY (which has been 0 for a long time)
Diffstat (limited to 'sql-common')
-rw-r--r-- | sql-common/client.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/sql-common/client.c b/sql-common/client.c index 18f01661c0a..2cad8df1f9b 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -2986,6 +2986,11 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, goto error; } + /* + Using init_commands is not supported when connecting from within the + server. + */ +#ifndef MYSQL_SERVER if (mysql->options.init_commands) { DYNAMIC_ARRAY *init_commands= mysql->options.init_commands; @@ -2997,18 +3002,26 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, for (; ptr < end_command; ptr++) { - MYSQL_RES *res; + int status; + if (mysql_real_query(mysql,*ptr, (ulong) strlen(*ptr))) goto error; - if (mysql->fields) - { - if (!(res= cli_use_result(mysql))) - goto error; - mysql_free_result(res); - } + + do { + if (mysql->fields) + { + MYSQL_RES *res; + if (!(res= cli_use_result(mysql))) + goto error; + mysql_free_result(res); + } + if ((status= mysql_next_result(mysql)) > 0) + goto error; + } while (status == 0); } mysql->reconnect=reconnect; } +#endif #ifndef TO_BE_DELETED if (mysql->options.rpl_probe && mysql_rpl_probe(mysql)) |