1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Fixed SELECT INTO OUTFILE/DUMPFILE and stored procedures, and extended and

reorganized the sp.test file.


mysql-test/r/sp.result:
  New results from the reorganized sp.test file.
mysql-test/t/sp.test:
  Reorganized the tests, and added a few new ones. ("fac" and more "select into")
sql/sql_class.cc:
  Unlock tables and set thd->lock=0 in select_export::send_eof() and
  select_dump::send_eof().
  This fixes a problem with an assert() in lock_tables(), and made
  SELECT ... INTO OUTFILE and ... INTO DUMPFILE work in stored procedures.
This commit is contained in:
unknown
2003-02-19 12:42:32 +01:00
parent 344c639b8b
commit 3c88ebdc9d
3 changed files with 451 additions and 251 deletions

View File

@@ -801,6 +801,15 @@ void select_export::send_error(uint errcode, const char *err)
bool select_export::send_eof()
{
/* This mimics select_send::send_eof(), which unlocks this way.
* It appears to be necessary, since tables aren't unlock after
* selects otherwise.
*/
if (thd->lock)
{
mysql_unlock_tables(thd, thd->lock);
thd->lock=0;
}
int error=test(end_io_cache(&cache));
if (my_close(file,MYF(MY_WME)))
error=1;
@@ -911,6 +920,15 @@ void select_dump::send_error(uint errcode,const char *err)
bool select_dump::send_eof()
{
/* This mimics select_send::send_eof(), which unlocks this way.
* It appears to be necessary, since tables aren't unlock after
* selects otherwise.
*/
if (thd->lock)
{
mysql_unlock_tables(thd, thd->lock);
thd->lock=0;
}
int error=test(end_io_cache(&cache));
if (my_close(file,MYF(MY_WME)))
error=1;