summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2010-05-26 13:18:18 -0700
committerIgor Babaev <igor@askmonty.org>2010-05-26 13:18:18 -0700
commit709a0a131021135e9fb7a2095fcfcbc223dfb126 (patch)
tree9f8143ae3fa17bac5ab74140da692228d73c283f /sql/sql_table.cc
parentcb325eb2b2f738b63d162fb0d46cf335e4ae84a4 (diff)
downloadmariadb-git-709a0a131021135e9fb7a2095fcfcbc223dfb126.tar.gz
MWL#106: Backport optimizations for derived tables and views.
The main consolidated patch.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 9699f949cab..c798bf441e9 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -4623,8 +4623,13 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
thd->no_warnings_for_error= no_warnings_for_error;
if (view_operator_func == NULL)
table->required_type=FRMTYPE_TABLE;
-
+ if (lex->sql_command == SQLCOM_CHECK ||
+ lex->sql_command == SQLCOM_REPAIR ||
+ lex->sql_command == SQLCOM_ANALYZE ||
+ lex->sql_command == SQLCOM_OPTIMIZE)
+ thd->prepare_derived_at_open= TRUE;
open_and_lock_tables(thd, table);
+ thd->prepare_derived_at_open= FALSE;
thd->no_warnings_for_error= 0;
table->next_global= save_next_global;
table->next_local= save_next_local;
@@ -4722,7 +4727,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
else
/* Default failure code is corrupt table */
result_code= HA_ADMIN_CORRUPT;
- goto send_result;
+ goto send_result;
}
if (table->view)