diff options
author | unknown <kostja@bodhi.local> | 2006-07-19 22:33:19 +0400 |
---|---|---|
committer | unknown <kostja@bodhi.local> | 2006-07-19 22:33:19 +0400 |
commit | 0fa250a9362b0cb8038cc453410e214fb723c18e (patch) | |
tree | 72597d625ecfd2d08568d72222348e925c5b5e7d /mysql-test/r/derived.result | |
parent | c1851446093f4ea87eddfe8efc9713cfd769adad (diff) | |
download | mariadb-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/derived.result')
-rw-r--r-- | mysql-test/r/derived.result | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index 19325731d35..8c7e39e0e90 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -276,7 +276,7 @@ select * from t1; N M 3 0 delete P1.*,p2.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS p2 ON P1.N = p2.N; -ERROR HY000: The target table p2 of the DELETE is not updatable +ERROR 42S02: Unknown table 'p2' in MULTI DELETE delete P1.* from `t1` AS P1 INNER JOIN (SELECT aaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N; ERROR 42S22: Unknown column 'aaa' in 'field list' drop table t1; |