Commit fff52da3 authored by calvin's avatar calvin

branches/5.1: fix bug#40386: Not flushing query cache after truncate

ha_statistics.records can not be 0 unless the table is empty, set to
1 instead. The original problem of bug#29507 is fixed in the server.

Additional test was done with the fix of bug#29507 in the server.

Approved by: Heikki (on IM)
parent 36544570
...@@ -6022,11 +6022,13 @@ ha_innobase::info( ...@@ -6022,11 +6022,13 @@ ha_innobase::info(
n_rows++; n_rows++;
} }
/* Fix bug#29507: TRUNCATE shows too many rows affected. /* Fix bug#40386: Not flushing query cache after truncate.
Do not show the estimates for TRUNCATE command. */ n_rows can not be 0 unless the table is empty, set to 1
instead. The original problem of bug#29507 is actually
fixed in the server code. */
if (thd_sql_command(user_thd) == SQLCOM_TRUNCATE) { if (thd_sql_command(user_thd) == SQLCOM_TRUNCATE) {
n_rows = 0; n_rows = 1;
/* We need to reset the prebuilt value too, otherwise /* We need to reset the prebuilt value too, otherwise
checks for values greater than the last value written checks for values greater than the last value written
......
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