summaryrefslogtreecommitdiff
path: root/sql/sp.cc
diff options
context:
space:
mode:
authorunknown <kostja@bodhi.local>2006-07-19 22:33:19 +0400
committerunknown <kostja@bodhi.local>2006-07-19 22:33:19 +0400
commit0fa250a9362b0cb8038cc453410e214fb723c18e (patch)
tree72597d625ecfd2d08568d72222348e925c5b5e7d /sql/sp.cc
parentc1851446093f4ea87eddfe8efc9713cfd769adad (diff)
downloadmariadb-git-0fa250a9362b0cb8038cc453410e214fb723c18e.tar.gz
A fix and a test case for Bug#21002 "Derived table not selecting from a
"real" table fails in JOINs". This is a regression caused by the fix for Bug 18444. This fix removed the assignment of empty_c_string to table->db performed in add_table_to_list, as neither me nor anyone else knew what it was there for. Now we know it and it's covered with tests: the only case when a table database name can be empty is when the table is a derived table. The fix puts the assignment back but makes it a bit more explicit. Additionally, finally drop sp.result.orig which was checked in by mistake. BitKeeper/deleted/.del-sp.result.orig: Delete: mysql-test/r/sp.result.orig mysql-test/r/derived.result: Updated result file. mysql-test/r/sp.result: Test results fixed (Bug#21002) mysql-test/t/derived.test: New error return for the case when MULTI-DELETE tries to delete from a derived table: now derived tables belong to their own db (""), and MUTLI-DELETE can't find the correspondent table for it in the DELETE list, as it can't resolve tables in different dbs by alias (See Bug#21148 for details) mysql-test/t/sp.test: Add a test case for Bug#21002 "Derived table not selecting from a "real" table fails in JOINs" sql/sp.cc: Make empty_c_string globally accessible. sql/sql_class.cc: Add empty_c_string definition. sql/sql_class.h: Add a comment for the constructor of Table_ident which is used for derived tables. Make sure this constructor also initializes the database name, not only the table name. sql/sql_parse.cc: Don't call check_db_name for empty database. Currently the only case when a table database name can be empty is when the table is a derived table. Report the right error if the database name is wrong (ER_WRONG_DB_NAME, not ER_WRONG_TABLE_NAME).
Diffstat (limited to 'sql/sp.cc')
-rw-r--r--sql/sp.cc1
1 files changed, 0 insertions, 1 deletions
diff --git a/sql/sp.cc b/sql/sp.cc
index 553465ebff8..a7078da2f50 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -1846,7 +1846,6 @@ sp_use_new_db(THD *thd, LEX_STRING new_db, LEX_STRING *old_db,
bool no_access_check, bool *dbchangedp)
{
int ret;
- static char empty_c_string[1]= {0}; /* used for not defined db */
DBUG_ENTER("sp_use_new_db");
DBUG_PRINT("enter", ("newdb: %s", new_db.str));