diff options
author | unknown <konstantin@mysql.com> | 2004-10-22 14:47:35 +0400 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2004-10-22 14:47:35 +0400 |
commit | 4512a46e655cd3f706b214ada5384205863ecfd8 (patch) | |
tree | c91f35d8dafca87c0b5c62689189e4641443c49f /mysql-test/r/ps.result | |
parent | 10a6020ee0dfba7ae845c85d6a92db4a6ca2fa2f (diff) | |
download | mariadb-git-4512a46e655cd3f706b214ada5384205863ecfd8.tar.gz |
A fix and test case for Bug#6050 "EXECUTE stmt reports ambiguous field
names with ident. tables fr. diff. schemata": revise all uses of
Item_field and make them prepared-statements friendly when necessary.
mysql-test/r/ps.result:
Test results fixed: the test case for Bug#6050
mysql-test/r/ps_1general.result:
Test results fixed: in prepared statements we expand '*' to a list
of fully qualified fields (db.table.column).
mysql-test/t/ps.test:
A test for Bug#6050 "EXECUTE stmt reports ambiguous fieldnames with
ident. tables fr. diff. schemata"
sql/item.cc:
Revise all Item_field constructors: we need to make sure that no Item_field
object points to unaccessible memory in prepared statements.
sql/item.h:
Revise all Item_field constructors: we need to make sure that no Item_field
object points to unaccessible memory in prepared statements.
sql/sql_base.cc:
Item_field use changed to be prepared statements friendly.
sql/sql_class.h:
New check of Item_arena state.
sql/sql_union.cc:
Fixing the problem with name resolving in UNION and prepared statements:
In case of SELECT a, b, c FROM t1 UNION SELECT a, b, c FROM t2 the list of
selected items is represented as a List<Item_field>, where each
Item_field points to a field of temporary table.
But the temporary table is created anew on each execution of the prepared
statement. So on each subsequent execution we should reset Item_field
items to point to fields from freshly-created temporary table.
sql/table.h:
Comment TABLE member.
Diffstat (limited to 'mysql-test/r/ps.result')
-rw-r--r-- | mysql-test/r/ps.result | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 0aba0c4672e..0950a066e64 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -375,3 +375,38 @@ rand() cast(rand(10)*@precision as unsigned integer) cast(rand(a)*@precision as - 9647622201 3845601374 6211931236 drop table t1; deallocate prepare stmt; +create database mysqltest1; +create table t1 (a int); +create table mysqltest1.t1 (a int); +select * from t1, mysqltest1.t1; +a a +prepare stmt from "select * from t1, mysqltest1.t1"; +execute stmt; +a a +execute stmt; +a a +execute stmt; +a a +drop table t1; +drop table mysqltest1.t1; +drop database mysqltest1; +deallocate prepare stmt; +select '1.1' as a, '1.2' as a UNION SELECT '2.1', '2.2'; +a a +1.1 1.2 +2.1 2.2 +prepare stmt from +"select '1.1' as a, '1.2' as a UNION SELECT '2.1', '2.2'"; +execute stmt; +a a +1.1 1.2 +2.1 2.2 +execute stmt; +a a +1.1 1.2 +2.1 2.2 +execute stmt; +a a +1.1 1.2 +2.1 2.2 +deallocate prepare stmt; |