summaryrefslogtreecommitdiff
path: root/mysql-test/r/sp.result
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 /mysql-test/r/sp.result
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 'mysql-test/r/sp.result')
-rw-r--r--mysql-test/r/sp.result15
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 96bf2f01f86..229dab72422 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -5057,4 +5057,19 @@ concat('data was: /', var1, '/')
data was: /1/
drop table t3|
drop procedure bug15217|
+drop table if exists t3|
+drop database if exists mysqltest1|
+create table t3 (a int)|
+insert into t3 (a) values (1), (2)|
+create database mysqltest1|
+use mysqltest1|
+drop database mysqltest1|
+select database()|
+database()
+NULL
+select * from (select 1 as a) as t1 natural join (select * from test.t3) as t2|
+a
+1
+use test|
+drop table t3|
drop table t1,t2;