diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 6358f7ce055..4d1f1b4c734 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -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 diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c index d76af54b420..1019f33efef 100644 --- a/storage/innobase/row/row0mysql.c +++ b/storage/innobase/row/row0mysql.c @@ -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