mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Fixed BUG#1862 (flush table in SPs didn't work).
Fixed various bugs: setting local variables to NULL, SELECT INTO var now actually
might work, SELECT INTO with not row now gives a "no data" warning (instead of
the "empty query" error), etc.
Updated test cases accordingly.
mysql-test/r/sp-error.result:
Corrected security syntax for alter/create procedure.
mysql-test/r/sp.result:
Corrected security syntax for alter/create procedure.
New tests for setting local variables to null,
bug fixes for SELECT INTO var, FLUSH TABLES calls (BUG#1862),
and corrected "no data" warning for SELECT INTO with no rows.
mysql-test/t/sp-error.test:
Corrected security syntax for alter/create procedure.
mysql-test/t/sp.test:
Corrected security syntax for alter/create procedure.
New tests for setting local variables to null,
bug fixes for SELECT INTO var, FLUSH TABLES calls (BUG#1862),
and corrected "no data" warning for SELECT INTO with no rows.
sql/lex.h:
Added SQL_SYM (and added a few _SYM suffixes for new symbols).
sql/sp_head.cc:
Fixed bug in the item_list copying for "with_wild" cases (list nodes ended
up in the wrong memroot).
Catch errors and warnings even if return values is 0 from sub-statements.
Restore table_list which is zapped by SQLCOM_CREATE_TABLE and INSERT_SELECT.
Set old table pointers to NULL after sub-statement call (since all tables are
closed).
sql/sql_class.cc:
Corrected error message when no rows return by a SELECT INTO var; should
be a "no data" warning.
sql/sql_lex.h:
Have to store the original table_list first pointer for some
sub-statements in SPs.
sql/sql_yacc.yy:
Corrected SECURITY INVOKER/DEFINER syntax ("SQL" missing), added some _SYM
suffixes, and fixed valgrind complaints for SP COMMENTs.
(Also removed some now irrelevant comments.)
This commit is contained in:
@@ -1253,14 +1253,8 @@ bool select_dumpvar::send_data(List<Item> &items)
|
||||
|
||||
bool select_dumpvar::send_eof()
|
||||
{
|
||||
if (row_count)
|
||||
{
|
||||
::send_ok(thd,row_count);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
my_error(ER_EMPTY_QUERY,MYF(0));
|
||||
return 1;
|
||||
}
|
||||
if (! row_count)
|
||||
send_warning(thd, ER_SP_FETCH_NO_DATA);
|
||||
::send_ok(thd,row_count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user