summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <gluh@mysql.com/eagle.(none)>2007-02-26 16:52:54 +0400
committerunknown <gluh@mysql.com/eagle.(none)>2007-02-26 16:52:54 +0400
commit46f1341846a0618b9999f8a7c3717637a4e85c65 (patch)
tree18a8e98d0082cdf6308374068d3790ba225348bc
parent65c7f3811c3be5f67a162b06906cbb172beb5318 (diff)
downloadmariadb-git-46f1341846a0618b9999f8a7c3717637a4e85c65.tar.gz
after merge fix
-rw-r--r--mysql-test/r/insert_select.result14
-rw-r--r--mysql-test/r/subselect.result12
-rw-r--r--mysql-test/t/insert_select.test13
-rw-r--r--mysql-test/t/subselect.test4
-rw-r--r--sql/sql_insert.cc6
5 files changed, 11 insertions, 38 deletions
diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result
index 77420890053..18a0ed1a1cb 100644
--- a/mysql-test/r/insert_select.result
+++ b/mysql-test/r/insert_select.result
@@ -717,20 +717,6 @@ select * from t1;
f1 f2
1 2
drop table t1;
-create table t1(f1 int primary key auto_increment, f2 int unique);
-insert into t1(f2) values(1);
-select @@identity;
-@@identity
-1
-insert ignore t1(f2) values(1);
-select @@identity;
-@@identity
-0
-insert ignore t1(f2) select 1;
-select @@identity;
-@@identity
-0
-drop table t1;
CREATE TABLE t1 (f1 INT, f2 INT );
CREATE TABLE t2 (f1 INT PRIMARY KEY, f2 INT);
INSERT INTO t1 VALUES (1,1),(2,2),(10,10);
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 7c6657d0960..43abef692e9 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -328,9 +328,9 @@ patient_uq clinic_uq
1 2
2 2
explain extended select * from t6 where exists (select * from t7 where uq = clinic_uq);
-id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t6 ALL NULL NULL NULL NULL 4 Using where
-2 DEPENDENT SUBQUERY t7 eq_ref PRIMARY PRIMARY 4 t6.clinic_uq 1 Using where; Using index
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t6 ALL NULL NULL NULL NULL 4 100.00 Using where
+2 DEPENDENT SUBQUERY t7 eq_ref PRIMARY PRIMARY 4 t6.clinic_uq 1 100.00 Using where; Using index
Warnings:
Note 1276 Field or reference 'test.t6.clinic_uq' of SELECT #2 was resolved in SELECT #1
Note 1003 select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t6` where exists(select 1 AS `Not_used` from `test`.`t7` where (`test`.`t7`.`uq` = `test`.`t6`.`clinic_uq`))
@@ -1739,9 +1739,9 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where (not(<in_optimizer>(`test`.`t1`.`id`,<exists>(<primary_index_lookup>(<cache>(`test`.`t1`.`id`) in t1 on PRIMARY where (`test`.`t1`.`id` < 8))))))
explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null);
-id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY tt ALL NULL NULL NULL NULL 12 Using where
-2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 tt.id 1 Using where; Using index
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY tt ALL NULL NULL NULL NULL 12 100.00 Using where
+2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 tt.id 1 100.00 Using where; Using index
Warnings:
Note 1276 Field or reference 'test.tt.id' of SELECT #2 was resolved in SELECT #1
Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where (not(exists(select `test`.`t1`.`id` AS `id` from `test`.`t1` where ((`test`.`t1`.`id` < 8) and (`test`.`t1`.`id` = `test`.`tt`.`id`)) having (`test`.`t1`.`id` is not null))))
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test
index 93a7a3e5ab8..0f9a0ca4872 100644
--- a/mysql-test/t/insert_select.test
+++ b/mysql-test/t/insert_select.test
@@ -281,19 +281,6 @@ select * from t1;
drop table t1;
#
-# Bug#23170: LAST_INSERT_ID isn't reset to 0 in INSERT .. SELECT if no rows
-# were inserted.
-#
-create table t1(f1 int primary key auto_increment, f2 int unique);
-insert into t1(f2) values(1);
-select @@identity;
-insert ignore t1(f2) values(1);
-select @@identity;
-insert ignore t1(f2) select 1;
-select @@identity;
-drop table t1;
-
-#
# Bug#16630: wrong result, when INSERT t1 SELECT ... FROM t1 ON DUPLICATE
#
CREATE TABLE t1 (f1 INT, f2 INT );
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index abf6273ad7e..0ce3d1d78c6 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -2599,8 +2599,6 @@ SELECT * FROM t1
WHERE EXISTS (SELECT t2.c FROM t2 JOIN t3 ON t2.c=t3.c WHERE t2.c=1
UNION
SELECT c from t2 WHERE c=t1.c);
-
-
DROP TABLE t1,t2,t3;
#
@@ -2610,7 +2608,7 @@ CREATE TABLE t1 (s1 char(1));
INSERT INTO t1 VALUES ('a');
SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1);
DROP TABLE t1;
-DROP TABLE t1,t2,t3;
+
#
# Bug#23800: Outer fields in correlated subqueries is used in a temporary
# table created for sorting.
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 3501675f09f..f939b6371df 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -2502,9 +2502,11 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
the INSERT table and the tables in the SELECT part of INSERT ... SELECT.
To do that we must concatenate the two lists
*/
- table_list->next_name_resolution_table= ctx_state.get_first_name_resolution_table();
+ table_list->next_name_resolution_table=
+ ctx_state.get_first_name_resolution_table();
- res= res || setup_fields(thd, 0, *info.update_values, MARK_COLUMNS_READ, 0, 0);
+ res= res || setup_fields(thd, 0, *info.update_values,
+ MARK_COLUMNS_READ, 0, 0);
if (!res)
{
/*