mirror of
				https://github.com/MariaDB/server.git
				synced 2025-11-03 14:33:32 +03:00 
			
		
		
		
	mysql-test/r/ndb_subquery.result: Add testing of new 4006 handling mysql-test/t/ndb_subquery.test: Add testing of new 4006 handling ndb/include/ndbapi/Ndb.hpp: Check #transactions in startTransaction instead of getNdbCon ndb/src/ndbapi/Ndb.cpp: Check #transactions in startTransaction instead of getNdbCon ndb/src/ndbapi/NdbScanOperation.cpp: Check #transactions in startTransaction instead of getNdbCon ndb/src/ndbapi/Ndbif.cpp: Check #transactions in startTransaction instead of getNdbCon ndb/src/ndbapi/Ndbinit.cpp: Check #transactions in startTransaction instead of getNdbCon ndb/src/ndbapi/Ndblist.cpp: Check #transactions in startTransaction instead of getNdbCon ndb/test/ndbapi/testNdbApi.cpp: Check #transactions in startTransaction instead of getNdbCon ndb/test/run-test/daily-basic-tests.txt: Check #transactions in startTransaction instead of getNdbCon sql/ha_ndbcluster.cc: Check #transactions in startTransaction instead of getNdbCon
		
			
				
	
	
		
			62 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			62 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
drop table if exists t1;
 | 
						|
drop table if exists t2;
 | 
						|
create table t1 (p int not null primary key, u int not null, o int not null,
 | 
						|
unique (u), key(o)) engine=ndb;
 | 
						|
create table t2 (p int not null primary key, u int not null, o int not null,
 | 
						|
unique (u), key(o)) engine=ndb;
 | 
						|
insert into t1 values (1,1,1),(2,2,2),(3,3,3);
 | 
						|
insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5);
 | 
						|
explain select * from t2 where p NOT IN (select p from t1);
 | 
						|
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 | 
						|
1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	5	Using where
 | 
						|
2	DEPENDENT SUBQUERY	t1	unique_subquery	PRIMARY	PRIMARY	4	func	1	Using index
 | 
						|
select * from t2 where p NOT IN (select p from t1) order by p;
 | 
						|
p	u	o
 | 
						|
4	4	4
 | 
						|
5	5	5
 | 
						|
explain select * from t2 where p NOT IN (select u from t1);
 | 
						|
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 | 
						|
1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	5	Using where
 | 
						|
2	DEPENDENT SUBQUERY	t1	unique_subquery	u	u	4	func	1	Using index
 | 
						|
select * from t2 where p NOT IN (select u from t1) order by p;
 | 
						|
p	u	o
 | 
						|
4	4	4
 | 
						|
5	5	5
 | 
						|
explain select * from t2 where p NOT IN (select o from t1);
 | 
						|
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 | 
						|
1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	5	Using where
 | 
						|
2	DEPENDENT SUBQUERY	t1	index_subquery	o	o	4	func	1	Using index
 | 
						|
select * from t2 where p NOT IN (select o from t1) order by p;
 | 
						|
p	u	o
 | 
						|
4	4	4
 | 
						|
5	5	5
 | 
						|
explain select * from t2 where p NOT IN (select p+0 from t1);
 | 
						|
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 | 
						|
1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	5	Using where
 | 
						|
2	DEPENDENT SUBQUERY	t1	ALL	NULL	NULL	NULL	NULL	3	Using where
 | 
						|
select * from t2 where p NOT IN (select p+0 from t1) order by p;
 | 
						|
p	u	o
 | 
						|
4	4	4
 | 
						|
5	5	5
 | 
						|
drop table t1;
 | 
						|
drop table t2;
 | 
						|
create table t1 (p int not null primary key, u int not null) engine=ndb;
 | 
						|
insert into t1 values (1,1),(2,2),(3,3);
 | 
						|
create table t2 as 
 | 
						|
select t1.*
 | 
						|
from t1 as t1, t1 as t2, t1 as t3, t1 as t4, t1 as t5, t1 as t6, t1 as t7, t1 as t8
 | 
						|
where t1.u = t2.u
 | 
						|
and t2.u = t3.u
 | 
						|
and t3.u = t4.u
 | 
						|
and t4.u = t5.u
 | 
						|
and t5.u = t6.u
 | 
						|
and t6.u = t7.u
 | 
						|
and t7.u = t8.u;
 | 
						|
select * from t2 order by 1;
 | 
						|
p	u
 | 
						|
1	1
 | 
						|
2	2
 | 
						|
3	3
 | 
						|
drop table t1;
 | 
						|
drop table t2;
 |