1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fix that we can read tables with the 'older' decimal format used in 5.0.3 & 5.0.4

We will however give a warning when opening such a table that users should use ALTER TABLE ... FORCE to fix
the table. In future release we will fix that REPAIR TABLE will be able to handle this case


sql/sql_lex.h:
  Support for ALTER TABLE ... FORCE
sql/sql_table.cc:
  CHECK TABLE now gives a note if table->s->crashed was set
sql/sql_yacc.yy:
  Support for ALTER TABLE ... FORCE
sql/table.cc:
  
  Fix that we can read tables with the 'older' decimal format used in 5.0.3 & 5.0.4
  (Now we store display length in the .frm table while we previously stored precision)
sql/table.h:
  Store in TABLE_SHARE version number of MySQL where table was created (or checked)
This commit is contained in:
unknown
2005-05-25 18:33:36 +03:00
parent cfb54ed514
commit 1834f8899f
5 changed files with 77 additions and 6 deletions

View File

@ -2202,12 +2202,14 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
if ((table->table->db_stat & HA_READ_ONLY) && open_for_modify)
{
char buff[FN_REFLEN + MYSQL_ERRMSG_SIZE];
uint length;
protocol->prepare_for_resend();
protocol->store(table_name, system_charset_info);
protocol->store(operator_name, system_charset_info);
protocol->store("error", 5, system_charset_info);
my_snprintf(buff, sizeof(buff), ER(ER_OPEN_AS_READONLY), table_name);
protocol->store(buff, system_charset_info);
length= my_snprintf(buff, sizeof(buff), ER(ER_OPEN_AS_READONLY),
table_name);
protocol->store(buff, length, system_charset_info);
close_thread_tables(thd);
table->table=0; // For query cache
if (protocol->write())
@ -2238,6 +2240,17 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
open_for_modify= 0;
}
if (table->table->s->crashed && operator_func == &handler::check)
{
protocol->prepare_for_resend();
protocol->store(table_name, system_charset_info);
protocol->store(operator_name, system_charset_info);
protocol->store("warning", 7, system_charset_info);
protocol->store("Table is marked as crashed", 26, system_charset_info);
if (protocol->write())
goto err;
}
result_code = (table->table->file->*operator_func)(thd, check_opt);
send_result: