From 78492226529495f2dcac22e0dcd2a32c2956bb9a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Jun 2004 16:41:24 +0200 Subject: WL#1689 "Map OPTIMIZE TABLE to ALTER TABLE for InnoDB" exactly it's mapped to "ALTER TABLE t; ANALYZE TABLE t;" sql/ha_innodb.cc: ::optimize() now returns "try ALTER and then analyze" instead of only analyze. sql/handler.h: new code to say "try alter and analyze". sql/mysql_priv.h: as we may now use mysql_alter_table() internally to ::optimize we must prevent it from talking to the client. New function mysql_recreate_table() which is the same as ALTER TABLE t; sql/sql_parse.cc: the big block removed here is moved into mysql_recreate_table(). sql/sql_table.cc: In mysql_admin_table(): if the handler returns HA_ADMIN_TRY_ALTER, we close the table, recreate it, then open it and analyze it. This is currently used only for OPTIMIZE TABLE of an InnoDB table. --- sql/handler.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index e7dcb97f0e8..c8d3d30aa23 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -43,6 +43,7 @@ #define HA_ADMIN_INTERNAL_ERROR -4 #define HA_ADMIN_INVALID -5 #define HA_ADMIN_REJECT -6 +#define HA_ADMIN_TRY_ALTER -7 /* Bits in table_flags() to show what database can do */ #define HA_READ_RND_SAME 1 /* Read RND-record to KEY-record -- cgit v1.2.1