Commit 344c639b authored by unknown's avatar unknown

Post-merge fixes (adapting new SP code to 4.1 changes).


sql/sql_class.cc:
  Unlock tables after a SELECT INTO variables, or an assert() in lock_tables() fails.
  Note: This might be a problem with other SELECT variants too.
sql/sql_yacc.yy:
  Make all bison versions work (hopefully).
parent 3de0f8d3
......@@ -48,12 +48,12 @@ sp_find_procedure(THD *thd, Item_string *iname)
HA_READ_KEY_EXACT))
goto done;
if ((defstr= get_field(&thd->mem_root, table, 1)) == NULL)
if ((defstr= get_field(&thd->mem_root, table->field[1])) == NULL)
goto done;
// QQ Set up our own mem_root here???
tmplex= lex_start(thd, (uchar*)defstr, strlen(defstr));
if (yyparse(thd) || thd->fatal_error || tmplex->sphead == NULL)
if (yyparse(thd) || thd->is_fatal_error || tmplex->sphead == NULL)
goto done; // Error
else
sp = tmplex->sphead;
......
......@@ -1043,6 +1043,15 @@ bool select_dumpvar::send_data(List<Item> &items)
bool select_dumpvar::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;
}
if (row_count)
{
::send_ok(thd,row_count);
......
......@@ -2982,13 +2982,17 @@ mysql_execute_command(THD *thd)
}
else
{
#ifndef EMBEDDED_LIBRARY
// When executing substatements, they're assumed to send_error when
// it happens, but not to send_ok.
my_bool nsok= thd->net.no_send_ok;
thd->net.no_send_ok= TRUE;
#endif
res= sp->execute(thd);
#ifndef EMBEDDED_LIBRARY
thd->net.no_send_ok= nsok;
#endif
if (res == 0)
send_ok(thd);
......
......@@ -1224,9 +1224,9 @@ sp_case:
;
sp_whens:
/* Empty */
| WHEN_SYM sp_case
| ELSE sp_proc_stmts
/* Empty */ {}
| WHEN_SYM sp_case {}
| ELSE sp_proc_stmts {}
;
sp_labeled_control:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment