diff options
author | bell@sanja.is.com.ua <> | 2004-07-16 01:15:55 +0300 |
---|---|---|
committer | bell@sanja.is.com.ua <> | 2004-07-16 01:15:55 +0300 |
commit | 9336d36cf81f404088844fc31918887799d3da03 (patch) | |
tree | 7a8e815ca26d9138de3bc77a619aa8103e037911 /sql/sql_help.cc | |
parent | 2fd11169ab10b8d752afbcc2dd58a15cf4de9c45 (diff) | |
download | mariadb-git-9336d36cf81f404088844fc31918887799d3da03.tar.gz |
VIEW
two TABLE_LIST copy eliminated
Diffstat (limited to 'sql/sql_help.cc')
-rw-r--r-- | sql/sql_help.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sql/sql_help.cc b/sql/sql_help.cc index eabe66d33bf..08a8fc626cc 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -84,12 +84,11 @@ static bool init_fields(THD *thd, TABLE_LIST *tables, DBUG_ENTER("init_fields"); for (; count-- ; find_fields++) { - TABLE_LIST *not_used; /* We have to use 'new' here as field will be re_linked on free */ Item_field *field= new Item_field("mysql", find_fields->table_name, find_fields->field_name); if (!(find_fields->field= find_field_in_tables(thd, field, tables, - ¬_used, TRUE))) + 0, TRUE, 1))) DBUG_RETURN(1); } DBUG_RETURN(0); @@ -622,16 +621,15 @@ int mysqld_help(THD *thd, const char *mask) bzero((gptr)tables,sizeof(tables)); tables[0].alias= tables[0].real_name= (char*) "help_topic"; tables[0].lock_type= TL_READ; - tables[0].next= &tables[1]; + tables[0].next_global= tables[0].next_local= &tables[1]; tables[1].alias= tables[1].real_name= (char*) "help_category"; tables[1].lock_type= TL_READ; - tables[1].next= &tables[2]; + tables[1].next_global= tables[1].next_local= &tables[2]; tables[2].alias= tables[2].real_name= (char*) "help_relation"; tables[2].lock_type= TL_READ; - tables[2].next= &tables[3]; + tables[2].next_global= tables[2].next_local= &tables[3]; tables[3].alias= tables[3].real_name= (char*) "help_keyword"; tables[3].lock_type= TL_READ; - tables[3].next= 0; tables[0].db= tables[1].db= tables[2].db= tables[3].db= (char*) "mysql"; List<String> topics_list, categories_list, subcategories_list; @@ -645,8 +643,12 @@ int mysqld_help(THD *thd, const char *mask) res= -1; goto end; } - /* Init tables and fields to be usable from items */ - setup_tables(tables); + /* + Init tables and fields to be usable from items + + tables do not contain VIEWs => we can pass 0 as conds + */ + setup_tables(thd, tables, 0); memcpy((char*) used_fields, (char*) init_used_fields, sizeof(used_fields)); if (init_fields(thd, tables, used_fields, array_elements(used_fields))) { |