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.
This commit is contained in:
MySQL Build Team 2009-01-15 21:16:18 +01:00
parent 920021c9b8
commit e9f9afc288
2 changed files with 6 additions and 4 deletions

View file

@ -6024,11 +6024,13 @@ ha_innobase::info(
n_rows++;
}
/* Fix bug#29507: TRUNCATE shows too many rows affected.
Do not show the estimates for TRUNCATE command. */
/* Fix bug#40386: Not flushing query cache after truncate.
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) {
n_rows = 0;
n_rows = 1;
/* We need to reset the prebuilt value too, otherwise
checks for values greater than the last value written

View file

@ -342,7 +342,7 @@ row_mysql_store_col_in_innobase_format(
/* In some cases we strip trailing spaces from UTF-8 and other
multibyte charsets, from FIXED-length CHAR columns, to save
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
variable-length character set where spaces have