mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 03:17:20 +02:00
Merge mysql.com:/usr/home/bar/mysql-4.1.b19741v0
into mysql.com:/usr/home/bar/mysql-4.1.b19741
This commit is contained in:
commit
ef6019010d
47 changed files with 601 additions and 69 deletions
44
mysql-test/r/bug20328.result
Normal file
44
mysql-test/r/bug20328.result
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
? (\?) Synonym for `help'.
|
||||
clear (\c) Clear command.
|
||||
connect (\r) Reconnect to the server. Optional arguments are db and host.
|
||||
delimiter (\d) Set query delimiter.
|
||||
edit (\e) Edit command with $EDITOR.
|
||||
ego (\G) Send command to mysql server, display result vertically.
|
||||
exit (\q) Exit mysql. Same as quit.
|
||||
go (\g) Send command to mysql server.
|
||||
help (\h) Display this help.
|
||||
nopager (\n) Disable pager, print to stdout.
|
||||
notee (\t) Don't write into outfile.
|
||||
pager (\P) Set PAGER [to_pager]. Print the query results via PAGER.
|
||||
print (\p) Print current command.
|
||||
prompt (\R) Change your mysql prompt.
|
||||
quit (\q) Quit mysql.
|
||||
rehash (\#) Rebuild completion hash.
|
||||
source (\.) Execute an SQL script file. Takes a file name as an argument.
|
||||
status (\s) Get status information from the server.
|
||||
system (\!) Execute a system shell command.
|
||||
tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
|
||||
use (\u) Use another database. Takes database name as argument.
|
||||
charset_name(\C) Switch to another charset. Might be needed for processing binlog.
|
||||
? (\?) Synonym for `help'.
|
||||
clear (\c) Clear command.
|
||||
connect (\r) Reconnect to the server. Optional arguments are db and host.
|
||||
delimiter (\d) Set query delimiter.
|
||||
edit (\e) Edit command with $EDITOR.
|
||||
ego (\G) Send command to mysql server, display result vertically.
|
||||
exit (\q) Exit mysql. Same as quit.
|
||||
go (\g) Send command to mysql server.
|
||||
help (\h) Display this help.
|
||||
nopager (\n) Disable pager, print to stdout.
|
||||
notee (\t) Don't write into outfile.
|
||||
pager (\P) Set PAGER [to_pager]. Print the query results via PAGER.
|
||||
print (\p) Print current command.
|
||||
prompt (\R) Change your mysql prompt.
|
||||
quit (\q) Quit mysql.
|
||||
rehash (\#) Rebuild completion hash.
|
||||
source (\.) Execute an SQL script file. Takes a file name as an argument.
|
||||
status (\s) Get status information from the server.
|
||||
system (\!) Execute a system shell command.
|
||||
tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
|
||||
use (\u) Use another database. Takes database name as argument.
|
||||
charset_name(\C) Switch to another charset. Might be needed for processing binlog.
|
||||
|
|
@ -824,6 +824,7 @@ select 1, min(a) from t1m where 1=99;
|
|||
1 NULL
|
||||
select 1, min(1) from t1m where a=99;
|
||||
1 min(1)
|
||||
1 NULL
|
||||
select 1, min(1) from t1m where 1=99;
|
||||
1 min(1)
|
||||
1 NULL
|
||||
|
|
@ -835,6 +836,7 @@ select 1, max(a) from t1m where 1=99;
|
|||
1 NULL
|
||||
select 1, max(1) from t1m where a=99;
|
||||
1 max(1)
|
||||
1 NULL
|
||||
select 1, max(1) from t1m where 1=99;
|
||||
1 max(1)
|
||||
1 NULL
|
||||
|
|
|
|||
|
|
@ -1036,4 +1036,32 @@ a c
|
|||
abc abc abc
|
||||
xyz xyz xyz
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (s varchar(10));
|
||||
INSERT INTO t1 VALUES ('yadda'), ('yaddy');
|
||||
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(s) > 'ab';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
|
||||
Warnings:
|
||||
Note 1003 select test.t1.s AS `s` from test.t1 where (trim(test.t1.s) > _latin1'ab')
|
||||
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM('y' FROM s) > 'ab';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
|
||||
Warnings:
|
||||
Note 1003 select test.t1.s AS `s` from test.t1 where (trim(both _latin1'y' from test.t1.s) > _latin1'ab')
|
||||
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(LEADING 'y' FROM s) > 'ab';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
|
||||
Warnings:
|
||||
Note 1003 select test.t1.s AS `s` from test.t1 where (trim(leading _latin1'y' from test.t1.s) > _latin1'ab')
|
||||
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(TRAILING 'y' FROM s) > 'ab';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
|
||||
Warnings:
|
||||
Note 1003 select test.t1.s AS `s` from test.t1 where (trim(trailing _latin1'y' from test.t1.s) > _latin1'ab')
|
||||
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(BOTH 'y' FROM s) > 'ab';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
|
||||
Warnings:
|
||||
Note 1003 select test.t1.s AS `s` from test.t1 where (trim(both _latin1'y' from test.t1.s) > _latin1'ab')
|
||||
DROP TABLE t1;
|
||||
End of 4.1 tests
|
||||
|
|
|
|||
|
|
@ -383,7 +383,7 @@ GRANT SELECT (c) ON `mysqltest_2`.`t1` TO 'mysqltest_3'@'localhost'
|
|||
update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1;
|
||||
ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'q' in table 't1'
|
||||
update mysqltest_1.t1, mysqltest_2.t2 set d=20 where d=1;
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'd' in table 't2'
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for table 't1'
|
||||
update mysqltest_2.t1, mysqltest_1.t2 set c=20 where b=1;
|
||||
ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1'
|
||||
update mysqltest_2.t1, mysqltest_2.t2 set d=10 where s=2;
|
||||
|
|
@ -402,6 +402,7 @@ revoke all on mysqltest_2.t1 from mysqltest_3@localhost;
|
|||
revoke all on mysqltest_2.t2 from mysqltest_3@localhost;
|
||||
grant all on mysqltest_2.* to mysqltest_3@localhost;
|
||||
grant select on *.* to mysqltest_3@localhost;
|
||||
grant select on mysqltest_2.t1 to mysqltest_3@localhost;
|
||||
flush privileges;
|
||||
use mysqltest_1;
|
||||
update mysqltest_2.t1, mysqltest_2.t2 set c=500,d=600;
|
||||
|
|
@ -409,11 +410,11 @@ update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200;
|
|||
ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'a' in table 't1'
|
||||
use mysqltest_2;
|
||||
update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200;
|
||||
ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest_1'
|
||||
ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for table 't1'
|
||||
update mysqltest_2.t1, mysqltest_1.t2 set c=100,b=200;
|
||||
ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest_1'
|
||||
ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for table 't2'
|
||||
update mysqltest_1.t1, mysqltest_2.t2 set a=100,d=200;
|
||||
ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest_1'
|
||||
ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for table 't1'
|
||||
select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2;
|
||||
a q b r
|
||||
10 2 1 2
|
||||
|
|
|
|||
|
|
@ -143,3 +143,13 @@ flush privileges;
|
|||
drop user mysqltest_3@host3;
|
||||
drop user mysqltest_1@host1, mysqltest_2@host2, mysqltest_4@host4,
|
||||
mysqltest_5@host5, mysqltest_6@host6, mysqltest_7@host7;
|
||||
create database mysqltest_1;
|
||||
grant select, insert, update on `mysqltest\_1`.* to mysqltest_1@localhost;
|
||||
set sql_log_off = 1;
|
||||
ERROR HY000: Access denied; you need the SUPER privilege for this operation
|
||||
set sql_log_bin = 0;
|
||||
ERROR HY000: Access denied; you need the SUPER privilege for this operation
|
||||
delete from mysql.user where user like 'mysqltest\_1';
|
||||
delete from mysql.db where user like 'mysqltest\_1';
|
||||
drop database mysqltest_1;
|
||||
flush privileges;
|
||||
|
|
|
|||
|
|
@ -246,3 +246,38 @@ DELETE from t1 where a < 100;
|
|||
SELECT * from t1;
|
||||
a
|
||||
DROP TABLE t1;
|
||||
create table t1(a int not null, key using btree(a)) engine=heap;
|
||||
insert into t1 values (2), (2), (2), (1), (1), (3), (3), (3), (3);
|
||||
select a from t1 where a > 2;
|
||||
a
|
||||
3
|
||||
3
|
||||
3
|
||||
3
|
||||
delete from t1 where a < 4;
|
||||
select a from t1;
|
||||
a
|
||||
insert into t1 values (2), (2), (2), (1), (1), (3), (3), (3), (3);
|
||||
select a from t1 where a > 4;
|
||||
a
|
||||
delete from t1 where a > 4;
|
||||
select a from t1;
|
||||
a
|
||||
3
|
||||
3
|
||||
1
|
||||
3
|
||||
3
|
||||
1
|
||||
2
|
||||
2
|
||||
2
|
||||
select a from t1 where a > 3;
|
||||
a
|
||||
delete from t1 where a >= 2;
|
||||
select a from t1;
|
||||
a
|
||||
1
|
||||
1
|
||||
drop table t1;
|
||||
End of 4.1 tests
|
||||
|
|
|
|||
|
|
@ -2,3 +2,47 @@
|
|||
1
|
||||
ERROR 1064 (42000) at line 3: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
|
||||
ERROR at line 1: USE must be followed by a database name
|
||||
? (\?) Synonym for `help'.
|
||||
clear (\c) Clear command.
|
||||
connect (\r) Reconnect to the server. Optional arguments are db and host.
|
||||
delimiter (\d) Set query delimiter.
|
||||
edit (\e) Edit command with $EDITOR.
|
||||
ego (\G) Send command to mysql server, display result vertically.
|
||||
exit (\q) Exit mysql. Same as quit.
|
||||
go (\g) Send command to mysql server.
|
||||
help (\h) Display this help.
|
||||
nopager (\n) Disable pager, print to stdout.
|
||||
notee (\t) Don't write into outfile.
|
||||
pager (\P) Set PAGER [to_pager]. Print the query results via PAGER.
|
||||
print (\p) Print current command.
|
||||
prompt (\R) Change your mysql prompt.
|
||||
quit (\q) Quit mysql.
|
||||
rehash (\#) Rebuild completion hash.
|
||||
source (\.) Execute an SQL script file. Takes a file name as an argument.
|
||||
status (\s) Get status information from the server.
|
||||
system (\!) Execute a system shell command.
|
||||
tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
|
||||
use (\u) Use another database. Takes database name as argument.
|
||||
charset_name(\C) Switch to another charset. Might be needed for processing binlog.
|
||||
? (\?) Synonym for `help'.
|
||||
clear (\c) Clear command.
|
||||
connect (\r) Reconnect to the server. Optional arguments are db and host.
|
||||
delimiter (\d) Set query delimiter.
|
||||
edit (\e) Edit command with $EDITOR.
|
||||
ego (\G) Send command to mysql server, display result vertically.
|
||||
exit (\q) Exit mysql. Same as quit.
|
||||
go (\g) Send command to mysql server.
|
||||
help (\h) Display this help.
|
||||
nopager (\n) Disable pager, print to stdout.
|
||||
notee (\t) Don't write into outfile.
|
||||
pager (\P) Set PAGER [to_pager]. Print the query results via PAGER.
|
||||
print (\p) Print current command.
|
||||
prompt (\R) Change your mysql prompt.
|
||||
quit (\q) Quit mysql.
|
||||
rehash (\#) Rebuild completion hash.
|
||||
source (\.) Execute an SQL script file. Takes a file name as an argument.
|
||||
status (\s) Get status information from the server.
|
||||
system (\!) Execute a system shell command.
|
||||
tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
|
||||
use (\u) Use another database. Takes database name as argument.
|
||||
charset_name(\C) Switch to another charset. Might be needed for processing binlog.
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ t9 MyISAM 9 Dynamic 2 220 440 4294967295 2048 0 NULL # # # latin1_swedish_ci NUL
|
|||
prepare stmt4 from ' show status like ''Threads_running'' ';
|
||||
execute stmt4;
|
||||
Variable_name Value
|
||||
Threads_running 1
|
||||
Threads_running #
|
||||
prepare stmt4 from ' show variables like ''sql_mode'' ';
|
||||
execute stmt4;
|
||||
Variable_name Value
|
||||
|
|
|
|||
|
|
@ -2744,3 +2744,78 @@ SELECT i='1e+01',i=1e+01, i in (1e+01), i in ('1e+01') FROM t1;
|
|||
i='1e+01' i=1e+01 i in (1e+01) i in ('1e+01')
|
||||
0 1 1 1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
INSERT INTO t1 VALUES (1,1), (2,1), (4,10);
|
||||
CREATE TABLE t2 (a int PRIMARY KEY, b int, KEY b (b));
|
||||
INSERT INTO t2 VALUES (1,NULL), (2,10);
|
||||
ALTER TABLE t1 ENABLE KEYS;
|
||||
EXPLAIN SELECT STRAIGHT_JOIN SQL_NO_CACHE COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 index b b 5 NULL 2 Using index
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
|
||||
SELECT STRAIGHT_JOIN SQL_NO_CACHE * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
|
||||
a b a b
|
||||
1 NULL 1 1
|
||||
1 NULL 2 1
|
||||
1 NULL 4 10
|
||||
2 10 4 10
|
||||
EXPLAIN SELECT STRAIGHT_JOIN SQL_NO_CACHE COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 index b b 5 NULL 2 Using index
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
|
||||
SELECT STRAIGHT_JOIN SQL_NO_CACHE * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
|
||||
a b a b
|
||||
1 NULL 1 1
|
||||
1 NULL 2 1
|
||||
1 NULL 4 10
|
||||
2 10 4 10
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
CREATE TABLE t1 (key1 float default NULL, UNIQUE KEY key1 (key1));
|
||||
CREATE TABLE t2 (key2 float default NULL, UNIQUE KEY key2 (key2));
|
||||
INSERT INTO t1 VALUES (0.3762),(0.3845),(0.6158),(0.7941);
|
||||
INSERT INTO t2 VALUES (1.3762),(1.3845),(1.6158),(1.7941);
|
||||
explain select max(key1) from t1 where key1 <= 0.6158;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||
explain select max(key2) from t2 where key2 <= 1.6158;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||
explain select min(key1) from t1 where key1 >= 0.3762;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||
explain select min(key2) from t2 where key2 >= 1.3762;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||
explain select max(key1), min(key2) from t1, t2
|
||||
where key1 <= 0.6158 and key2 >= 1.3762;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||
explain select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||
explain select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||
select max(key1) from t1 where key1 <= 0.6158;
|
||||
max(key1)
|
||||
0.61580002307892
|
||||
select max(key2) from t2 where key2 <= 1.6158;
|
||||
max(key2)
|
||||
1.6158000230789
|
||||
select min(key1) from t1 where key1 >= 0.3762;
|
||||
min(key1)
|
||||
0.37619999051094
|
||||
select min(key2) from t2 where key2 >= 1.3762;
|
||||
min(key2)
|
||||
1.3761999607086
|
||||
select max(key1), min(key2) from t1, t2
|
||||
where key1 <= 0.6158 and key2 >= 1.3762;
|
||||
max(key1) min(key2)
|
||||
0.61580002307892 1.3761999607086
|
||||
select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
|
||||
max(key1)
|
||||
0.61580002307892
|
||||
select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
|
||||
min(key1)
|
||||
0.37619999051094
|
||||
DROP TABLE t1,t2;
|
||||
|
|
|
|||
|
|
@ -539,7 +539,7 @@ EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1';
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||
Warnings:
|
||||
Note 1003 select max(test.t1.numreponse) AS `MAX(numreponse)` from test.t1 where (test.t1.numeropost = _latin1'1')
|
||||
Note 1003 select max(test.t1.numreponse) AS `MAX(numreponse)` from test.t1
|
||||
EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1');
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 Using index
|
||||
|
|
@ -2868,3 +2868,30 @@ select 1 from dual where 1 < any (select 2 from dual);
|
|||
select 1 from dual where 1 < all (select 2 from dual where 1!=1);
|
||||
1
|
||||
1
|
||||
create table t1 (s1 char);
|
||||
insert into t1 values (1),(2);
|
||||
select * from t1 where (s1 < any (select s1 from t1));
|
||||
s1
|
||||
1
|
||||
select * from t1 where not (s1 < any (select s1 from t1));
|
||||
s1
|
||||
2
|
||||
select * from t1 where (s1 < ALL (select s1+1 from t1));
|
||||
s1
|
||||
1
|
||||
select * from t1 where not(s1 < ALL (select s1+1 from t1));
|
||||
s1
|
||||
2
|
||||
select * from t1 where (s1+1 = ANY (select s1 from t1));
|
||||
s1
|
||||
1
|
||||
select * from t1 where NOT(s1+1 = ANY (select s1 from t1));
|
||||
s1
|
||||
2
|
||||
select * from t1 where (s1 = ALL (select s1/s1 from t1));
|
||||
s1
|
||||
1
|
||||
select * from t1 where NOT(s1 = ALL (select s1/s1 from t1));
|
||||
s1
|
||||
2
|
||||
drop table t1;
|
||||
|
|
|
|||
|
|
@ -130,3 +130,15 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
5 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
|
||||
6 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 32 func 1 Using index; Using where
|
||||
drop table t1, t2, t3, t4;
|
||||
CREATE TABLE t1 (a int(10) , PRIMARY KEY (a)) Engine=InnoDB;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
CREATE TABLE t2 (a int(10), PRIMARY KEY (a)) Engine=InnoDB;
|
||||
INSERT INTO t2 VALUES (1);
|
||||
CREATE TABLE t3 (a int(10), b int(10), c int(10),
|
||||
PRIMARY KEY (a)) Engine=InnoDB;
|
||||
INSERT INTO t3 VALUES (1,2,1);
|
||||
SELECT t1.* FROM t1 WHERE (SELECT COUNT(*) FROM t3,t2 WHERE t3.c=t2.a
|
||||
and t2.a='1' AND t1.a=t3.b) > 0;
|
||||
a
|
||||
2
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue