mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Fix bug#13535 Incorrect result from SELECT statement after SHOW TABLE STATUS
After SHOW TABLE STATUS last_insert_id wasn't cleaned, and next select erroneously rewrites WHERE condition and returs a row; 5.0 isn't affected because of different SHOW TABLE STATUS handling. last_insert_id cleanup added to mysqld_extend_show_tables().
This commit is contained in:
@@ -462,6 +462,7 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild)
|
||||
TABLE *table;
|
||||
Protocol *protocol= thd->protocol;
|
||||
TIME time;
|
||||
int res= 0;
|
||||
DBUG_ENTER("mysqld_extend_show_tables");
|
||||
|
||||
(void) sprintf(path,"%s/%s",mysql_data_home,db);
|
||||
@@ -632,10 +633,15 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild)
|
||||
close_thread_tables(thd,0);
|
||||
}
|
||||
if (protocol->write())
|
||||
DBUG_RETURN(-1);
|
||||
{
|
||||
res= -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
send_eof(thd);
|
||||
DBUG_RETURN(0);
|
||||
thd->insert_id(0);
|
||||
if (!res)
|
||||
send_eof(thd);
|
||||
DBUG_RETURN(res);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user