1
0
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:
evgen@moonbone.local
2005-10-03 23:22:46 +04:00
parent bd417d158e
commit 5a10244d8b
3 changed files with 29 additions and 3 deletions

View File

@@ -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);
}