1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

supported possiblity of item substitute (fixed bug) in setup_fields

more efficient reference creation
fixed table_name of Field in temporary table
This commit is contained in:
bell@sanja.is.com.ua
2002-11-25 01:38:56 +02:00
parent 1cee49dd86
commit c74c93ffc3
5 changed files with 23 additions and 6 deletions

View File

@ -27,6 +27,9 @@ SELECT 1 FROM (SELECT 1 as a) HAVING (SELECT a)=1;
1
SELECT (SELECT 1), a;
Unknown column 'a' in 'field list'
SELECT 1 as a FROM (SELECT 1) HAVING (SELECT a)=1;
a
1
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8;
create table t1 (a int);
create table t2 (a int, b int);
@ -308,3 +311,9 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1
2 SUBSELECT Select tables optimized away
drop table t1;
CREATE TABLE t1 (a int(1));
INSERT INTO t1 VALUES (1);
SELECT 1 FROM (SELECT a FROM t1) HAVING (SELECT a)=1;
1
1
drop table t1;

View File

@ -12,6 +12,7 @@ EXPLAIN SELECT 1 FROM (SELECT 1 as a) HAVING (SELECT a)=1;
SELECT 1 FROM (SELECT 1 as a) HAVING (SELECT a)=1;
-- error 1054
SELECT (SELECT 1), a;
SELECT 1 as a FROM (SELECT 1) HAVING (SELECT a)=1;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8;
create table t1 (a int);
create table t2 (a int, b int);
@ -197,3 +198,7 @@ EXPLAIN SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT 1
EXPLAIN SELECT MAX(numreponse) FROM t1 WHERE numeropost='1';
EXPLAIN SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1');
drop table t1;
CREATE TABLE t1 (a int(1));
INSERT INTO t1 VALUES (1);
SELECT 1 FROM (SELECT a FROM t1) HAVING (SELECT a)=1;
drop table t1;