Commit bab42f67 authored by unknown's avatar unknown
Browse files

after merge fix

parent b1060052
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -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);
+6 −6
Original line number Diff line number Diff line
@@ -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))))
+0 −13
Original line number Diff line number Diff line
@@ -280,19 +280,6 @@ insert into t1 values (1,1) on duplicate key update f2=2;
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
#
+1 −3
Original line number Diff line number Diff line
@@ -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.                                       
+4 −2
Original line number Diff line number Diff line
@@ -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)
    {
      /*