mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge mysql.com:/home/jonas/src/mysql-5.0
into mysql.com:/home/jonas/src/mysql-5.0-ndb
This commit is contained in:
@ -784,32 +784,32 @@ t2.flag_value IS NULL;
|
||||
flag_name flag_value
|
||||
flag2 NULL
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE invoice (
|
||||
CREATE TABLE t1 (
|
||||
id int(11) unsigned NOT NULL auto_increment,
|
||||
text_id int(10) unsigned default NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
INSERT INTO invoice VALUES("1", "0");
|
||||
INSERT INTO invoice VALUES("2", "10");
|
||||
CREATE TABLE text_table (
|
||||
INSERT INTO t1 VALUES("1", "0");
|
||||
INSERT INTO t1 VALUES("2", "10");
|
||||
CREATE TABLE t2 (
|
||||
text_id char(3) NOT NULL default '',
|
||||
language_id char(3) NOT NULL default '',
|
||||
text_data text,
|
||||
PRIMARY KEY (text_id,language_id)
|
||||
);
|
||||
INSERT INTO text_table VALUES("0", "EN", "0-EN");
|
||||
INSERT INTO text_table VALUES("0", "SV", "0-SV");
|
||||
INSERT INTO text_table VALUES("10", "EN", "10-EN");
|
||||
INSERT INTO text_table VALUES("10", "SV", "10-SV");
|
||||
SELECT invoice.id, invoice.text_id, text_table.text_data
|
||||
FROM invoice LEFT JOIN text_table
|
||||
ON invoice.text_id = text_table.text_id
|
||||
AND text_table.language_id = 'SV'
|
||||
WHERE (invoice.id LIKE '%' OR text_table.text_data LIKE '%');
|
||||
INSERT INTO t2 VALUES("0", "EN", "0-EN");
|
||||
INSERT INTO t2 VALUES("0", "SV", "0-SV");
|
||||
INSERT INTO t2 VALUES("10", "EN", "10-EN");
|
||||
INSERT INTO t2 VALUES("10", "SV", "10-SV");
|
||||
SELECT t1.id, t1.text_id, t2.text_data
|
||||
FROM t1 LEFT JOIN t2
|
||||
ON t1.text_id = t2.text_id
|
||||
AND t2.language_id = 'SV'
|
||||
WHERE (t1.id LIKE '%' OR t2.text_data LIKE '%');
|
||||
id text_id text_data
|
||||
1 0 0-SV
|
||||
2 10 10-SV
|
||||
DROP TABLE invoice, text_table;
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t0 (a0 int PRIMARY KEY);
|
||||
CREATE TABLE t1 (a1 int PRIMARY KEY);
|
||||
CREATE TABLE t2 (a2 int);
|
||||
|
@ -2160,3 +2160,11 @@ WHERE f1 <> ALL ( SELECT SUM(f1) AS sf1 FROM t2 HAVING sf1 > 10000);
|
||||
f1
|
||||
NULL
|
||||
1
|
||||
drop table t1,t2;
|
||||
create table t1 (a1 int);
|
||||
create table t2 (b1 int);
|
||||
select * from t1 where a2 > any(select b1 from t2);
|
||||
ERROR 42S22: Unknown column 'a2' in 'scalar IN/ALL/ANY subquery'
|
||||
select * from t1 where a1 > any(select b1 from t2);
|
||||
a1
|
||||
drop table t1,t2;
|
||||
|
@ -554,34 +554,34 @@ SELECT t1.flag_name,t2.flag_value
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
CREATE TABLE invoice (
|
||||
CREATE TABLE t1 (
|
||||
id int(11) unsigned NOT NULL auto_increment,
|
||||
text_id int(10) unsigned default NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
INSERT INTO invoice VALUES("1", "0");
|
||||
INSERT INTO invoice VALUES("2", "10");
|
||||
INSERT INTO t1 VALUES("1", "0");
|
||||
INSERT INTO t1 VALUES("2", "10");
|
||||
|
||||
CREATE TABLE text_table (
|
||||
CREATE TABLE t2 (
|
||||
text_id char(3) NOT NULL default '',
|
||||
language_id char(3) NOT NULL default '',
|
||||
text_data text,
|
||||
PRIMARY KEY (text_id,language_id)
|
||||
);
|
||||
|
||||
INSERT INTO text_table VALUES("0", "EN", "0-EN");
|
||||
INSERT INTO text_table VALUES("0", "SV", "0-SV");
|
||||
INSERT INTO text_table VALUES("10", "EN", "10-EN");
|
||||
INSERT INTO text_table VALUES("10", "SV", "10-SV");
|
||||
INSERT INTO t2 VALUES("0", "EN", "0-EN");
|
||||
INSERT INTO t2 VALUES("0", "SV", "0-SV");
|
||||
INSERT INTO t2 VALUES("10", "EN", "10-EN");
|
||||
INSERT INTO t2 VALUES("10", "SV", "10-SV");
|
||||
|
||||
SELECT invoice.id, invoice.text_id, text_table.text_data
|
||||
FROM invoice LEFT JOIN text_table
|
||||
ON invoice.text_id = text_table.text_id
|
||||
AND text_table.language_id = 'SV'
|
||||
WHERE (invoice.id LIKE '%' OR text_table.text_data LIKE '%');
|
||||
SELECT t1.id, t1.text_id, t2.text_data
|
||||
FROM t1 LEFT JOIN t2
|
||||
ON t1.text_id = t2.text_id
|
||||
AND t2.language_id = 'SV'
|
||||
WHERE (t1.id LIKE '%' OR t2.text_data LIKE '%');
|
||||
|
||||
DROP TABLE invoice, text_table;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
# Test for bug #5896
|
||||
|
||||
|
@ -1417,3 +1417,14 @@ SELECT f1 FROM t1
|
||||
|
||||
SELECT f1 FROM t1
|
||||
WHERE f1 <> ALL ( SELECT SUM(f1) AS sf1 FROM t2 HAVING sf1 > 10000);
|
||||
|
||||
drop table t1,t2;
|
||||
# Test for BUG#7885: Server crash when 'any' subselect compared to
|
||||
# non-existant field.
|
||||
create table t1 (a1 int);
|
||||
create table t2 (b1 int);
|
||||
--error 1054
|
||||
select * from t1 where a2 > any(select b1 from t2);
|
||||
select * from t1 where a1 > any(select b1 from t2);
|
||||
drop table t1,t2;
|
||||
|
||||
|
Reference in New Issue
Block a user