summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorunknown <monty@mishka.local>2005-08-20 11:00:00 +0300
committerunknown <monty@mishka.local>2005-08-20 11:00:00 +0300
commit3eda70b270e2d24e6b4bd6662ddc0b2172b47b67 (patch)
tree499bcf518b69b974792bbb607094965a41e25061 /sql/sql_base.cc
parent4d2bf4befcf6a91978c60b9a402301e864ed999e (diff)
downloadmariadb-git-3eda70b270e2d24e6b4bd6662ddc0b2172b47b67.tar.gz
Fixes during review of new pushed code
Fixed new bug when running a SP without a default database mysql-test/r/information_schema.result: Added test to cover changes made in default handling mysql-test/r/sp-security.result: Added test when executing SP without a default database mysql-test/t/information_schema.test: Added test to cover changes made in default handling mysql-test/t/sp-security.test: Added test when executing SP without a default database sql/item_strfunc.cc: Removed wrong push sql/mysqld.cc: Indentation fix sql/sql_base.cc: Use share->db instead of share->table_cache_key Remove assert that can never fail (because of test in previous row) sql/sql_db.cc: Allow empty database name when called from SP (To allow on run without a default database) sql/sql_parse.cc: Added comment sql/sql_show.cc: Indentation fixes Simplified code by checking for 'wrong' condition first and doing continue instead of going down one level Simplified precision and decimal handling
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 98ce12eb7de..f9193d38c98 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -150,14 +150,10 @@ OPEN_TABLE_LIST *list_open_tables(THD *thd, const char *db, const char *wild)
DBUG_ASSERT(share->table_name != 0);
if ((!share->table_name)) // To be removed
continue; // Shouldn't happen
- if (db && my_strcasecmp(system_charset_info, db, share->table_cache_key))
+ if (db && my_strcasecmp(system_charset_info, db, share->db))
+ continue;
+ if (wild && wild_compare(share->table_name,wild,0))
continue;
-
- if (wild)
- {
- if (wild_compare(share->table_name,wild,0))
- continue;
- }
/* Check if user has SELECT privilege for any column in the table */
table_list.db= (char*) share->db;
@@ -3803,7 +3799,6 @@ store_top_level_join_columns(THD *thd, TABLE_LIST *table_ref,
if (cur_left_neighbor &&
cur_table_ref->outer_join & JOIN_TYPE_RIGHT)
{
- DBUG_ASSERT(cur_table_ref);
/* This can happen only for JOIN ... ON. */
DBUG_ASSERT(table_ref->nested_join->join_list.elements == 2);
swap_variables(TABLE_LIST*, cur_left_neighbor, cur_table_ref);
@@ -3813,7 +3808,7 @@ store_top_level_join_columns(THD *thd, TABLE_LIST *table_ref,
store_top_level_join_columns(thd, cur_table_ref,
cur_left_neighbor, cur_right_neighbor))
DBUG_RETURN(TRUE);
- cur_right_neighbor= cur_table_ref;
+ cur_right_neighbor= cur_table_ref;
}
}