Commit 94387d4b authored by unknown's avatar unknown

Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1

into sanja.is.com.ua:/home/bell/mysql/bk/work-union-4.1

parents 48ea56a5 8c430b22
...@@ -149,10 +149,10 @@ select (select a from t1 where t1.a=t2.b), a from t2; ...@@ -149,10 +149,10 @@ select (select a from t1 where t1.a=t2.b), a from t2;
(select a from t1 where t1.a=t2.b) a (select a from t1 where t1.a=t2.b) a
NULL 1 NULL 1
NULL 2 NULL 2
select (select a from t1), a from t2; select (select a from t1), a, (select 1 union select 2 limit 1) from t2;
(select a from t1) a (select a from t1) a (select 1 union select 2 limit 1)
2 1 2 1 1
2 2 2 2 1
select (select a from t3), a from t2; select (select a from t3), a from t2;
(select a from t3) a (select a from t3) a
NULL 1 NULL 1
......
...@@ -803,3 +803,23 @@ t1 CREATE TABLE `t1` ( ...@@ -803,3 +803,23 @@ t1 CREATE TABLE `t1` (
`test` char(5) character set latin2 NOT NULL default '' `test` char(5) character set latin2 NOT NULL default ''
) TYPE=MyISAM DEFAULT CHARSET=latin1 ) TYPE=MyISAM DEFAULT CHARSET=latin1
drop table t1; drop table t1;
create table t1 (s char(200));
insert into t1 values (repeat("1",200));
create table t2 select * from t1;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
set local tmp_table_size=1024;
select count(*) from (select * from t1 union all select * from t2 order by 1) b;
count(*)
21
select count(*) from t1;
count(*)
8
select count(*) from t2;
count(*)
13
drop table t1,t2;
set local tmp_table_size=default;
...@@ -67,7 +67,7 @@ insert into t4 values (4,8),(3,8),(5,9); ...@@ -67,7 +67,7 @@ insert into t4 values (4,8),(3,8),(5,9);
select (select a from t1 where t1.a = a1) as a2, (select b from t2 where t2.b=a2) as a1; select (select a from t1 where t1.a = a1) as a2, (select b from t2 where t2.b=a2) as a1;
select (select a from t1 where t1.a=t2.a), a from t2; select (select a from t1 where t1.a=t2.a), a from t2;
select (select a from t1 where t1.a=t2.b), a from t2; select (select a from t1 where t1.a=t2.b), a from t2;
select (select a from t1), a from t2; select (select a from t1), a, (select 1 union select 2 limit 1) from t2;
select (select a from t3), a from t2; select (select a from t3), a from t2;
select * from t2 where t2.a=(select a from t1); select * from t2 where t2.a=(select a from t1);
insert into t3 values (6),(7),(3); insert into t3 values (6),(7),(3);
......
...@@ -306,8 +306,6 @@ drop table t1, t2; ...@@ -306,8 +306,6 @@ drop table t1, t2;
# #
# types conversions # types conversions
# #
create table t1 SELECT "a" as a UNION select "aa" as a; create table t1 SELECT "a" as a UNION select "aa" as a;
select * from t1; select * from t1;
show create table t1; show create table t1;
...@@ -417,3 +415,24 @@ create table t1 select _latin1"test" union select _latin2"testt" ; ...@@ -417,3 +415,24 @@ create table t1 select _latin1"test" union select _latin2"testt" ;
create table t1 select _latin2"test" union select _latin2"testt" ; create table t1 select _latin2"test" union select _latin2"testt" ;
show create table t1; show create table t1;
drop table t1; drop table t1;
#
# conversion memory->disk table
#
#
# conversion memory->disk table
#
create table t1 (s char(200));
insert into t1 values (repeat("1",200));
create table t2 select * from t1;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
set local tmp_table_size=1024;
select count(*) from (select * from t1 union all select * from t2 order by 1) b;
select count(*) from t1;
select count(*) from t2;
drop table t1,t2;
set local tmp_table_size=default;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment