Commit 5681ceda authored by MySQL Build Team's avatar MySQL Build Team

Cherry-pick fix for bug#40386, "Not flushing query cache after truncate", out...

Cherry-pick fix for bug#40386, "Not flushing query cache after truncate", out of 5.1-bugteam branch.

This fix is r3114 from innodb-5.1-ss3603.
parent c5acb125
...@@ -6024,11 +6024,13 @@ ha_innobase::info( ...@@ -6024,11 +6024,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
......
...@@ -342,7 +342,7 @@ row_mysql_store_col_in_innobase_format( ...@@ -342,7 +342,7 @@ row_mysql_store_col_in_innobase_format(
/* In some cases we strip trailing spaces from UTF-8 and other /* In some cases we strip trailing spaces from UTF-8 and other
multibyte charsets, from FIXED-length CHAR columns, to save multibyte charsets, from FIXED-length CHAR columns, to save
space. UTF-8 would otherwise normally use 3 * the string length space. UTF-8 would otherwise normally use 3 * the string length
bytes to store a latin1 string! */ bytes to store an ASCII string! */
/* We assume that this CHAR field is encoded in a /* We assume that this CHAR field is encoded in a
variable-length character set where spaces have variable-length character set where spaces have
......
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