mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge magare.gmz:/home/kgeorge/mysql/work/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/work/merge-5.1-opt mysql-test/r/gis.result: Auto merged mysql-test/r/type_bit.result: Auto merged mysql-test/r/type_blob.result: Auto merged mysql-test/t/gis.test: Auto merged mysql-test/t/type_bit.test: Auto merged mysql-test/t/type_blob.test: Auto merged sql/item.h: Auto merged sql/item_subselect.cc: Auto merged sql/opt_range.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_string.cc: Auto merged tests/mysql_client_test.c: Auto merged mysql-test/r/subselect.result: null merge. resolve latete. mysql-test/t/subselect.test: merge 5.0-opt -> 5.1-opt sql/key.cc: merge 5.0-opt -> 5.1-opt sql/sql_class.h: merge 5.0-opt -> 5.1-opt sql/sql_insert.cc: merge 5.0-opt -> 5.1-opt sql/sql_table.cc: merge 5.0-opt -> 5.1-opt
This commit is contained in:
@ -958,6 +958,12 @@ COUNT(*)
|
||||
2
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.0 tests
|
||||
create table `t1` (`col002` point)engine=myisam;
|
||||
insert into t1 values (),(),();
|
||||
select min(`col002`) from t1 union select `col002` from t1;
|
||||
min(`col002`)
|
||||
NULL
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);
|
||||
create view v1 as select * from t1;
|
||||
|
@ -82,4 +82,22 @@ c1 c2
|
||||
-r- =raker=
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#32533: SELECT INTO OUTFILE never escapes multibyte character
|
||||
#
|
||||
CREATE TABLE t1 (c1 VARCHAR(256));
|
||||
INSERT INTO t1 VALUES (0xC3);
|
||||
SELECT HEX(c1) FROM t1;
|
||||
HEX(c1)
|
||||
C3
|
||||
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug32533.txt' FIELDS ENCLOSED BY 0xC3 FROM t1;
|
||||
TRUNCATE t1;
|
||||
SELECT HEX(LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug32533.txt'));
|
||||
HEX(LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug32533.txt'))
|
||||
C35CC3C30A
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug32533.txt' INTO TABLE t1 FIELDS ENCLOSED BY 0xC3;
|
||||
SELECT HEX(c1) FROM t1;
|
||||
HEX(c1)
|
||||
C3
|
||||
DROP TABLE t1;
|
||||
# End of 5.0 tests.
|
||||
|
@ -672,6 +672,16 @@ COUNT(DISTINCT b,c)
|
||||
2
|
||||
2
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t1(a BIT(13), KEY(a));
|
||||
INSERT INTO t1(a) VALUES
|
||||
(65535),(65525),(65535),(65535),(65535),(65535),(65535),(65535),(65535),(65535);
|
||||
EXPLAIN SELECT 1 FROM t1 GROUP BY a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range NULL a 3 NULL 6 Using index for group-by
|
||||
SELECT 1 FROM t1 GROUP BY a;
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
create table t1(a bit(7));
|
||||
insert into t1 values(0x40);
|
||||
|
@ -807,4 +807,18 @@ set @@sql_mode='TRADITIONAL';
|
||||
create table t1 (a text default '');
|
||||
ERROR 42000: BLOB/TEXT column 'a' can't have a default value
|
||||
set @@sql_mode='';
|
||||
CREATE TABLE t (c TEXT CHARSET ASCII);
|
||||
INSERT INTO t (c) VALUES (REPEAT('1',65537));
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'c' at row 1
|
||||
INSERT INTO t (c) VALUES (REPEAT('2',65536));
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'c' at row 1
|
||||
INSERT INTO t (c) VALUES (REPEAT('3',65535));
|
||||
SELECT LENGTH(c), CHAR_LENGTH(c) FROM t;
|
||||
LENGTH(c) CHAR_LENGTH(c)
|
||||
65535 65535
|
||||
65535 65535
|
||||
65535 65535
|
||||
DROP TABLE t;
|
||||
End of 5.0 tests
|
||||
|
@ -632,6 +632,15 @@ SELECT 1;
|
||||
|
||||
-- source include/gis_keys.inc
|
||||
|
||||
#
|
||||
# Bug #31155 gis types in union'd select cause crash
|
||||
#
|
||||
|
||||
create table `t1` (`col002` point)engine=myisam;
|
||||
insert into t1 values (),(),();
|
||||
select min(`col002`) from t1 union select `col002` from t1;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
|
||||
|
@ -86,4 +86,28 @@ DROP TABLE t2;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#32533: SELECT INTO OUTFILE never escapes multibyte character
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (c1 VARCHAR(256));
|
||||
INSERT INTO t1 VALUES (0xC3);
|
||||
SELECT HEX(c1) FROM t1;
|
||||
|
||||
--let $file=$MYSQLTEST_VARDIR/tmp/bug32533.txt
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT * INTO OUTFILE '$file' FIELDS ENCLOSED BY 0xC3 FROM t1
|
||||
TRUNCATE t1;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT HEX(LOAD_FILE('$file'))
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval LOAD DATA INFILE '$file' INTO TABLE t1 FIELDS ENCLOSED BY 0xC3
|
||||
SELECT HEX(c1) FROM t1;
|
||||
|
||||
--remove_file $file
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # End of 5.0 tests.
|
||||
|
@ -2987,6 +2987,100 @@ SELECT (SELECT SUM(t1.a) FROM t2 WHERE a!=0) FROM t1;
|
||||
SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=1) FROM t1;
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
#
|
||||
# Bug31048: Many nested subqueries may cause server crash.
|
||||
#
|
||||
create table t1(a int,b int,key(a),key(b));
|
||||
insert into t1(a,b) values (1,2),(2,1),(2,3),(3,4),(5,4),(5,5),
|
||||
(6,7),(7,4),(5,3);
|
||||
# test for the stack overflow bug
|
||||
select sum(a),a from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1
|
||||
)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1)
|
||||
group by a;
|
||||
--replace_regex /overrun.*$/overrun detected/
|
||||
--error 1436
|
||||
select sum(a),a from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1)
|
||||
group by a;
|
||||
# test for the memory consumption & subquery slowness bug
|
||||
explain select sum(a),a from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1
|
||||
)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1)
|
||||
group by a;
|
||||
--replace_regex /overrun.*$/overrun detected/
|
||||
--error 1436
|
||||
explain select sum(a),a from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1)
|
||||
group by a;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #31884: Assertion + crash in subquery in the SELECT clause.
|
||||
#
|
||||
|
@ -318,6 +318,21 @@ INSERT INTO t2 VALUES (3, 2, 'two'), (2, 3, 'three'), (2, 0, 'zero'),
|
||||
SELECT COUNT(DISTINCT b,c) FROM t2 GROUP BY a;
|
||||
DROP TABLE t2;
|
||||
|
||||
#
|
||||
# BUG#32556 assert in "using index for group-by" : is_last_prefix <= 0,
|
||||
# file .\opt_range.cc
|
||||
|
||||
CREATE TABLE t1(a BIT(13), KEY(a));
|
||||
--disable_warnings
|
||||
INSERT INTO t1(a) VALUES
|
||||
(65535),(65525),(65535),(65535),(65535),(65535),(65535),(65535),(65535),(65535);
|
||||
--enable_warnings
|
||||
|
||||
EXPLAIN SELECT 1 FROM t1 GROUP BY a;
|
||||
SELECT 1 FROM t1 GROUP BY a;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
#
|
||||
|
@ -436,4 +436,15 @@ set @@sql_mode='TRADITIONAL';
|
||||
create table t1 (a text default '');
|
||||
set @@sql_mode='';
|
||||
|
||||
#
|
||||
# Bug #32282: TEXT silently truncates when value is exactly 65536 bytes
|
||||
#
|
||||
|
||||
CREATE TABLE t (c TEXT CHARSET ASCII);
|
||||
INSERT INTO t (c) VALUES (REPEAT('1',65537));
|
||||
INSERT INTO t (c) VALUES (REPEAT('2',65536));
|
||||
INSERT INTO t (c) VALUES (REPEAT('3',65535));
|
||||
SELECT LENGTH(c), CHAR_LENGTH(c) FROM t;
|
||||
DROP TABLE t;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
Reference in New Issue
Block a user