diff options
author | pappa@c-4a09e253.1238-1-64736c10.cust.bredbandsbolaget.se <> | 2005-08-25 13:11:38 -0400 |
---|---|---|
committer | pappa@c-4a09e253.1238-1-64736c10.cust.bredbandsbolaget.se <> | 2005-08-25 13:11:38 -0400 |
commit | 02056f8e3ae729c06875ab63eef8680574b3d91e (patch) | |
tree | 86faf87634c19937967b360a0dd1413fc9eb2879 /sql/sql_help.cc | |
parent | 1c9a78438e789a70c6ee3f227c164739c4bd25e2 (diff) | |
parent | 0c859d6651277c2ee3664cb14bb34a23d048731f (diff) | |
download | mariadb-git-02056f8e3ae729c06875ab63eef8680574b3d91e.tar.gz |
Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.0
into c-4a09e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/mysql-5.1
Diffstat (limited to 'sql/sql_help.cc')
-rw-r--r-- | sql/sql_help.cc | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/sql/sql_help.cc b/sql/sql_help.cc index 11045529a51..e3a2602713f 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -75,7 +75,7 @@ enum enum_used_fields RETURN VALUES 0 all ok - 1 one of the fileds didn't finded + 1 one of the fileds was not found */ static bool init_fields(THD *thd, TABLE_LIST *tables, @@ -90,7 +90,7 @@ static bool init_fields(THD *thd, TABLE_LIST *tables, Item_field *field= new Item_field(context, "mysql", find_fields->table_name, find_fields->field_name); - if (!(find_fields->field= find_field_in_tables(thd, field, tables, + if (!(find_fields->field= find_field_in_tables(thd, field, tables, NULL, 0, REPORT_ALL_ERRORS, 1, TRUE))) DBUG_RETURN(1); @@ -623,43 +623,45 @@ bool mysqld_help(THD *thd, const char *mask) Protocol *protocol= thd->protocol; SQL_SELECT *select; st_find_field used_fields[array_elements(init_used_fields)]; - DBUG_ENTER("mysqld_help"); - TABLE_LIST *leaves= 0; TABLE_LIST tables[4]; + List<String> topics_list, categories_list, subcategories_list; + String name, description, example; + int count_topics, count_categories, error; + uint mlen= strlen(mask); + size_t i; + MEM_ROOT *mem_root= thd->mem_root; + DBUG_ENTER("mysqld_help"); + bzero((gptr)tables,sizeof(tables)); tables[0].alias= tables[0].table_name= (char*) "help_topic"; tables[0].lock_type= TL_READ; - tables[0].next_global= tables[0].next_local= &tables[1]; + tables[0].next_global= tables[0].next_local= + tables[0].next_name_resolution_table= &tables[1]; tables[1].alias= tables[1].table_name= (char*) "help_category"; tables[1].lock_type= TL_READ; - tables[1].next_global= tables[1].next_local= &tables[2]; + tables[1].next_global= tables[1].next_local= + tables[1].next_name_resolution_table= &tables[2]; tables[2].alias= tables[2].table_name= (char*) "help_relation"; tables[2].lock_type= TL_READ; - tables[2].next_global= tables[2].next_local= &tables[3]; + tables[2].next_global= tables[2].next_local= + tables[2].next_name_resolution_table= &tables[3]; tables[3].alias= tables[3].table_name= (char*) "help_keyword"; tables[3].lock_type= TL_READ; tables[0].db= tables[1].db= tables[2].db= tables[3].db= (char*) "mysql"; - List<String> topics_list, categories_list, subcategories_list; - String name, description, example; - int count_topics, count_categories, error; - uint mlen= strlen(mask); - MEM_ROOT *mem_root= thd->mem_root; - if (open_and_lock_tables(thd, tables)) goto error; /* Init tables and fields to be usable from items - tables do not contain VIEWs => we can pass 0 as conds */ setup_tables(thd, &thd->lex->select_lex.context, + &thd->lex->select_lex.top_join_list, tables, 0, &leaves, FALSE); memcpy((char*) used_fields, (char*) init_used_fields, sizeof(used_fields)); if (init_fields(thd, tables, used_fields, array_elements(used_fields))) goto error; - size_t i; for (i=0; i<sizeof(tables)/sizeof(TABLE_LIST); i++) tables[i].table->file->init_table_handle_for_HANDLER(); |