summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2003-11-18 13:47:27 +0200
committermonty@mashka.mysql.fi <>2003-11-18 13:47:27 +0200
commitcab1dc628c116f042a3fd8dbc505f7ca2df599a3 (patch)
tree0a23d90c946c5f05a8c160fc7c6ef3f05505fc79 /sql-common
parentf277c9f88a4a2e392e44cfdb6b3f4785b6c730d0 (diff)
downloadmariadb-git-cab1dc628c116f042a3fd8dbc505f7ca2df599a3.tar.gz
CLIENT_MULTI_QUERIES -> CLIENT_MULTI_STATEMENTS
New multi-key-cache handling. This was needed becasue the old one didn't work reliable with MERGE tables. ALTER TABLE table_name ... CHARACTER SET ... now changes all char/varchar/text columns to the given character set (One must use ALTER TABLE ... DEFAULT CHARACTER SET ... to change the default character set) Fixed that have_compress is detected properly (fixes problems with func_compress.test on platforms without zlib) New syntax for CACHE INDEX ('keys' is optional if no index name is given and one mentions the key cache name only ones) Removed compiler warnings Added mysql_set_server_option() to allow clients like PHP to easaily set/reset the multi-statement flag.
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/client.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index 85308539222..c6abfb0ba91 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -754,7 +754,15 @@ mysql_free_result(MYSQL_RES *result)
if ((pkt_len=net_safe_read(result->handle)) == packet_error)
break;
if (pkt_len <= 8 && result->handle->net.read_pos[0] == 254)
+ {
+ if (protocol_41(result->handle))
+ {
+ char *pos= (char*) result->handle->net.read_pos;
+ result->handle->warning_count=uint2korr(pos); pos+=2;
+ result->handle->server_status=uint2korr(pos); pos+=2;
+ }
break; /* End of data */
+ }
}
result->handle->status=MYSQL_STATUS_READY;
}
@@ -987,7 +995,7 @@ void mysql_read_default_options(struct st_mysql_options *options,
options->client_flag|= CLIENT_MULTI_RESULTS;
break;
case 31:
- options->client_flag|= CLIENT_MULTI_QUERIES | CLIENT_MULTI_RESULTS;
+ options->client_flag|= CLIENT_MULTI_STATEMENTS | CLIENT_MULTI_RESULTS;
break;
default:
DBUG_PRINT("warning",("unknown option: %s",option[0]));
@@ -1231,6 +1239,7 @@ MYSQL_DATA * STDCALL cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
if (pkt_len > 1) /* MySQL 4.1 protocol */
{
mysql->warning_count= uint2korr(cp+1);
+ mysql->server_status= uint2korr(cp+3);
DBUG_PRINT("info",("warning_count: %ld", mysql->warning_count));
}
DBUG_PRINT("exit",("Got %d rows",result->rows));
@@ -1256,7 +1265,10 @@ read_one_row(MYSQL *mysql,uint fields,MYSQL_ROW row, ulong *lengths)
if (pkt_len <= 8 && net->read_pos[0] == 254)
{
if (pkt_len > 1) /* MySQL 4.1 protocol */
+ {
mysql->warning_count= uint2korr(net->read_pos+1);
+ mysql->server_status= uint2korr(net->read_pos+3);
+ }
return 1; /* End of data */
}
prev_pos= 0; /* allowed to write at packet[-1] */
@@ -1818,7 +1830,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
client_flag|=mysql->options.client_flag;
client_flag|=CLIENT_CAPABILITIES;
- if (client_flag & CLIENT_MULTI_QUERIES)
+ if (client_flag & CLIENT_MULTI_STATEMENTS)
client_flag|= CLIENT_MULTI_RESULTS;
#ifdef HAVE_OPENSSL