1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Derivation attribute was not processed correctly

by MAX/MIN in some cases:
SELECT coercibility(max(s1)) from t1;

Subselect collation and derivation was not processed
correctly:

create table a select (select s1 from t1);
select * from t1 where s1 = (select s2 from t1);
This commit is contained in:
bar@bar.mysql.r18.ru
2003-07-30 14:15:25 +05:00
parent 1f2a95e366
commit f8791c3962
7 changed files with 40 additions and 3 deletions

View File

@@ -612,3 +612,9 @@ select Case When Count(*) < MAX_REQ Then 1 Else 0 End from t1 where t1.USR_ID =
Case When Count(*) < MAX_REQ Then 1 Else 0 End
1
drop table t1;
create table t1 (a char(10));
insert into t1 values ('a'),('b'),('c');
select coercibility(max(a)) from t1;
coercibility(max(a))
3
drop table t1;

View File

@@ -1225,3 +1225,16 @@ a (select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 an
2 2
1 2
drop table t1,t2,t3;
create table t1 (a char(10) character set koi8r collate koi8r_bin);
create table t2 select (select a from t1);
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`(select a from t1)` char(10) character set koi8r collate koi8r_bin default NULL
) TYPE=MyISAM CHARSET=latin1
drop table t1,t2;
CREATE TABLE t1
(s1 CHAR(5) COLLATE latin1_german1_ci,
s2 CHAR(5) COLLATE latin1_swedish_ci);
SELECT * FROM t1 WHERE s1 = (SELECT s2 FROM t1);
ERROR HY000: Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '='

View File

@@ -355,3 +355,8 @@ insert into t1 values (1, 3);
select count(*) + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ from t1 group by MAX_REQ;
select Case When Count(*) < MAX_REQ Then 1 Else 0 End from t1 where t1.USR_ID = 1 group by MAX_REQ;
drop table t1;
create table t1 (a char(10));
insert into t1 values ('a'),('b'),('c');
select coercibility(max(a)) from t1;
drop table t1;

View File

@@ -817,4 +817,15 @@ insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10);
insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1);
insert into t3 values (3,3), (2,2), (1,1);
select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3;
drop table t1,t2,t3;s
drop table t1,t2,t3;
create table t1 (a char(10) character set koi8r collate koi8r_bin);
create table t2 select (select a from t1);
show create table t2;
drop table t1,t2;
CREATE TABLE t1
(s1 CHAR(5) COLLATE latin1_german1_ci,
s2 CHAR(5) COLLATE latin1_swedish_ci);
--error 1265
SELECT * FROM t1 WHERE s1 = (SELECT s2 FROM t1);