mirror of
https://github.com/MariaDB/server.git
synced 2025-08-29 00:08:14 +03:00
Made multiple queries (SELECT without INTO) work in SPs.
This included bug fixes in the 4.1 protocol (actually send and receive the server_status flags). libmysql/libmysql.c: Pick up the server_status (with the 4.1 protocol) as well. mysql-test/r/sp-error.result: Test for "bad selects" in non-CLIENT_MULTI_QUERIES clients (as mysqltest for the momen; this test will have to go away eventually). mysql-test/t/sp-error.test: Test for "bad selects" in non-CLIENT_MULTI_QUERIES clients (as mysqltest for the momen; this test will have to go away eventually). sql/protocol.cc: Actually send the server_status flags in send_eof() (4.1 protocol), not just zero. sql/sp_head.cc: Made multiple queries (SELECT without INTO) work in SPs. sql/sp_head.h: Made multiple queries (SELECT without INTO) work in SPs. sql/sql_parse.cc: Made multiple queries (SELECT without INTO) work in SPs. sql/sql_yacc.yy: Made multiple queries (SELECT without INTO) work in SPs.
This commit is contained in:
@@ -1370,6 +1370,7 @@ static MYSQL_DATA *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));
|
||||
@@ -1395,7 +1396,10 @@ read_one_row(MYSQL *mysql,uint fields,MYSQL_ROW row, ulong *lengths)
|
||||
if (pkt_len <= 8 && mysql->net.read_pos[0] == 254)
|
||||
{
|
||||
if (pkt_len > 1) /* MySQL 4.1 protocol */
|
||||
{
|
||||
mysql->warning_count= uint2korr(mysql->net.read_pos+1);
|
||||
mysql->server_status= uint2korr(mysql->net.read_pos+3);
|
||||
}
|
||||
return 1; /* End of data */
|
||||
}
|
||||
prev_pos= 0; /* allowed to write at packet[-1] */
|
||||
@@ -5370,6 +5374,7 @@ static MYSQL_DATA *read_binary_rows(MYSQL_STMT *stmt)
|
||||
if (pkt_len > 1)
|
||||
{
|
||||
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));
|
||||
|
Reference in New Issue
Block a user