mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge 10.0.14 into 10.1
This commit is contained in:
@ -21,4 +21,5 @@ ssl_crl_clients_valid : broken upstream
|
||||
ssl_crl : broken upstream
|
||||
ssl_crl_clrpath : broken upstream
|
||||
innodb-wl5522-debug-zip : broken upstream
|
||||
innodb_bug12902967 : broken upstream
|
||||
innodb_bug12902967 : broken upstream
|
||||
file_contents : MDEV-6526 these files are not installed anymore
|
||||
|
@ -18,26 +18,14 @@ source include/have_innodb.inc;
|
||||
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
|
||||
--enable_query_log
|
||||
|
||||
# MTR is not case-sensitive.
|
||||
let $lower_stmt_head= load data;
|
||||
let $UPPER_STMT_HEAD= LOAD DATA;
|
||||
if ($lock_option)
|
||||
{
|
||||
#if $lock_option is null, an extra blank is added into the statement,
|
||||
#this will change the result of rpl_loaddata test case. so $lock_option
|
||||
#is set only when it is not null.
|
||||
let $lower_stmt_head= load data $lock_option;
|
||||
let $UPPER_STMT_HEAD= LOAD DATA $lock_option;
|
||||
}
|
||||
|
||||
select last_insert_id();
|
||||
create table t1(a int not null auto_increment, b int, primary key(a) );
|
||||
eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
eval load data $lock_option infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
# verify that LAST_INSERT_ID() is set by LOAD DATA INFILE
|
||||
select last_insert_id();
|
||||
|
||||
create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
|
||||
eval $lower_stmt_head infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
|
||||
eval load data $lock_option infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
|
||||
|
||||
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
|
||||
--disable_warnings
|
||||
@ -63,7 +51,7 @@ sync_slave_with_master;
|
||||
insert into t1 values(1,10);
|
||||
|
||||
connection master;
|
||||
eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
eval load data $lock_option infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
@ -86,7 +74,7 @@ connection master;
|
||||
set sql_log_bin=0;
|
||||
delete from t1;
|
||||
set sql_log_bin=1;
|
||||
eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
eval load data $lock_option infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
# The SQL slave thread should be stopped now.
|
||||
@ -111,7 +99,7 @@ connection master;
|
||||
set sql_log_bin=0;
|
||||
delete from t1;
|
||||
set sql_log_bin=1;
|
||||
eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
eval load data $lock_option infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
# The SQL slave thread should be stopped now.
|
||||
@ -131,7 +119,7 @@ reset master;
|
||||
eval create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
|
||||
unique(day)) engine=$engine_type; # no transactions
|
||||
--error ER_DUP_ENTRY
|
||||
eval $lower_stmt_head infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
|
||||
eval load data $lock_option infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
|
||||
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
|
||||
'\n##\n' starting by '>' ignore 1 lines;
|
||||
select * from t2;
|
||||
@ -147,7 +135,7 @@ alter table t2 drop key day;
|
||||
connection master;
|
||||
delete from t2;
|
||||
--error ER_DUP_ENTRY
|
||||
eval $lower_stmt_head infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
|
||||
eval load data $lock_option infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
|
||||
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
|
||||
'\n##\n' starting by '>' ignore 1 lines;
|
||||
connection slave;
|
||||
@ -167,7 +155,7 @@ drop table t1, t2;
|
||||
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
|
||||
|
||||
--error ER_DUP_ENTRY
|
||||
eval $UPPER_STMT_HEAD INFILE "../../std_data/words.dat" INTO TABLE t1;
|
||||
eval LOAD DATA $lock_option INFILE "../../std_data/words.dat" INTO TABLE t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
@ -196,17 +184,17 @@ DROP TABLE t1;
|
||||
|
||||
-- echo ### assertion: works with cross-referenced database
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
|
||||
-- eval LOAD DATA $lock_option LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
|
||||
|
||||
-- eval use $db1
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- echo ### assertion: works with fully qualified name on current database
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
|
||||
-- eval LOAD DATA $lock_option LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
|
||||
|
||||
-- echo ### assertion: works without fully qualified name on current database
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1
|
||||
-- eval LOAD DATA $lock_option LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1
|
||||
|
||||
-- echo ### create connection without default database
|
||||
-- echo ### connect (conn2,localhost,root,,*NO-ONE*);
|
||||
@ -214,7 +202,7 @@ connect (conn2,localhost,root,,*NO-ONE*);
|
||||
-- connection conn2
|
||||
-- echo ### assertion: works without stating the default database
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
|
||||
-- eval LOAD DATA $lock_option LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
|
||||
|
||||
# We cannot disconnect right away because when inserting
|
||||
# concurrently in a MyISAM table, the server is sending an OK
|
||||
|
9
mysql-test/include/bytes.inc
Normal file
9
mysql-test/include/bytes.inc
Normal file
@ -0,0 +1,9 @@
|
||||
#
|
||||
# Create a table with all byte values
|
||||
#
|
||||
CREATE TABLE halfs (a INT);
|
||||
INSERT INTO halfs VALUES (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07);
|
||||
INSERT INTO halfs VALUES (0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
|
||||
CREATE TEMPORARY TABLE bytes (a BINARY(1), KEY(a)) ENGINE=MyISAM;
|
||||
INSERT INTO bytes SELECT CHAR((t1.a << 4) | t2.a USING BINARY) FROM halfs t1, halfs t2;
|
||||
DROP TABLE halfs;
|
21
mysql-test/include/bytes2.inc
Normal file
21
mysql-test/include/bytes2.inc
Normal file
@ -0,0 +1,21 @@
|
||||
#
|
||||
# Create a table with all 2 byte sequence values
|
||||
#
|
||||
|
||||
--source include/bytes.inc
|
||||
|
||||
CREATE TABLE halfs (a BINARY(1));
|
||||
# "bytes" is a temporary table, hence is not allowed in joins
|
||||
# Create a non-temporary copy.
|
||||
INSERT INTO halfs SELECT * FROM bytes;
|
||||
CREATE TEMPORARY TABLE bytes2 (
|
||||
a BINARY(2),
|
||||
hi BINARY(1),
|
||||
lo BINARY(1),
|
||||
KEY(a),
|
||||
KEY(lo)
|
||||
) ENGINE=MyISAM;
|
||||
INSERT INTO bytes2
|
||||
SELECT CONCAT(t1.a, t2.a), t1.a, t2.a FROM halfs t1, halfs t2
|
||||
ORDER BY t1.a, t2.a;
|
||||
DROP TABLE halfs;
|
111
mysql-test/include/ctype_E05C.inc
Normal file
111
mysql-test/include/ctype_E05C.inc
Normal file
@ -0,0 +1,111 @@
|
||||
--echo # Start of ctype_E05C.inc
|
||||
|
||||
#
|
||||
# A shared test for character sets big5, cp932, gbk, sjis
|
||||
# They all can have 0x5C as the second byte in a multi-byte character.
|
||||
# 0xE05C is one of such characters.
|
||||
#
|
||||
|
||||
# Checking that the character 0xE05C correctly understands 5C as the second byte
|
||||
# rather than a stand-alone backslash, including the strings that also
|
||||
# have real backslash escapes and/or separator escapes.
|
||||
|
||||
SELECT HEX('<27>\'),HEX('<EFBFBD>\t');
|
||||
SELECT HEX('\\<5C>\'),HEX('\\<5C>\t'),HEX('\\<5C>\t\t');
|
||||
SELECT HEX('''<EFBFBD>\'),HEX('<EFBFBD>\''');
|
||||
SELECT HEX('\\''<EFBFBD>\'),HEX('<EFBFBD>\''\\');
|
||||
|
||||
SELECT HEX(BINARY('<EFBFBD>\')),HEX(BINARY('<EFBFBD>\t'));
|
||||
SELECT HEX(BINARY('\\<5C>\')),HEX(BINARY('\\<5C>\t')),HEX(BINARY('\\<5C>\t\t'));
|
||||
SELECT HEX(BINARY('''<EFBFBD>\')),HEX(BINARY('<EFBFBD>\'''));
|
||||
SELECT HEX(BINARY('\\''<EFBFBD>\')),HEX(BINARY('<EFBFBD>\''\\'));
|
||||
|
||||
SELECT HEX(_BINARY'<EFBFBD>\'),HEX(_BINARY'<EFBFBD>\t');
|
||||
SELECT HEX(_BINARY'\\<5C>\'),HEX(_BINARY'\\<5C>\t'),HEX(_BINARY'\\<5C>\t\t');
|
||||
SELECT HEX(_BINARY'''<EFBFBD>\'),HEX(_BINARY'<EFBFBD>\''');
|
||||
SELECT HEX(_BINARY'\\''<EFBFBD>\'),HEX(_BINARY'<EFBFBD>\''\\');
|
||||
|
||||
CREATE TABLE t1 AS SELECT REPEAT(' ',10) AS a LIMIT 0;
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES ('<EFBFBD>\'),('<EFBFBD>\t');
|
||||
INSERT INTO t1 VALUES ('\\<5C>\'),('\\<5C>\t'),('\\<5C>\t\t');
|
||||
INSERT INTO t1 VALUES ('''<EFBFBD>\'),('<EFBFBD>\''');
|
||||
INSERT INTO t1 VALUES ('\\''<EFBFBD>\'),('<EFBFBD>\''\\');
|
||||
SELECT a, HEX(a) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (a BLOB);
|
||||
INSERT INTO t1 VALUES ('<EFBFBD>\'),('<EFBFBD>\t');
|
||||
INSERT INTO t1 VALUES ('\\<5C>\'),('\\<5C>\t'),('\\<5C>\t\t');
|
||||
INSERT INTO t1 VALUES ('''<EFBFBD>\'),('<EFBFBD>\''');
|
||||
INSERT INTO t1 VALUES ('\\''<EFBFBD>\'),('<EFBFBD>\''\\');
|
||||
SELECT a, HEX(a) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES (BINARY('<EFBFBD>\')),(BINARY('<EFBFBD>\t'));
|
||||
INSERT INTO t1 VALUES (BINARY('\\<5C>\')),(BINARY('\\<5C>\t')),(BINARY('\\<5C>\t\t'));
|
||||
INSERT INTO t1 VALUES (BINARY('''<EFBFBD>\')),(BINARY('<EFBFBD>\'''));
|
||||
INSERT INTO t1 VALUES (BINARY('\\''<EFBFBD>\')),(BINARY('<EFBFBD>\''\\'));
|
||||
SELECT a, HEX(a) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (a BLOB);
|
||||
INSERT INTO t1 VALUES (BINARY('<EFBFBD>\')),(BINARY('<EFBFBD>\t'));
|
||||
INSERT INTO t1 VALUES (BINARY('\\<5C>\')),(BINARY('\\<5C>\t')),(BINARY('\\<5C>\t\t'));
|
||||
INSERT INTO t1 VALUES (BINARY('''<EFBFBD>\')),(BINARY('<EFBFBD>\'''));
|
||||
INSERT INTO t1 VALUES (BINARY('\\''<EFBFBD>\')),(BINARY('<EFBFBD>\''\\'));
|
||||
SELECT a, HEX(a) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES (_BINARY'<EFBFBD>\'),(_BINARY'<EFBFBD>\t');
|
||||
INSERT INTO t1 VALUES (_BINARY'\\<5C>\'),(_BINARY'\\<5C>\t'),(_BINARY'\\<5C>\t\t');
|
||||
INSERT INTO t1 VALUES (_BINARY'''<EFBFBD>\'),(_BINARY'<EFBFBD>\''');
|
||||
INSERT INTO t1 VALUES (_BINARY'\\''<EFBFBD>\'),(_BINARY'<EFBFBD>\''\\');
|
||||
SELECT a, HEX(a) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (a BLOB);
|
||||
INSERT INTO t1 VALUES (_BINARY'<EFBFBD>\'),(_BINARY'<EFBFBD>\t');
|
||||
INSERT INTO t1 VALUES (_BINARY'\\<5C>\'),(_BINARY'\\<5C>\t'),(_BINARY'\\<5C>\t\t');
|
||||
INSERT INTO t1 VALUES (_BINARY'''<EFBFBD>\'),(_BINARY'<EFBFBD>\''');
|
||||
INSERT INTO t1 VALUES (_BINARY'\\''<EFBFBD>\'),(_BINARY'<EFBFBD>\''\\');
|
||||
SELECT a, HEX(a) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# Checking that with character_set_client=binary 0x5C in 0xE05C
|
||||
# is treated as escape rather than the second byte of a multi-byte character,
|
||||
# even if character_set_connection is big5/cp932/gbk/sjis.
|
||||
# Note, the other 0x5C which is before 0xE05C is also treated as escape.
|
||||
#
|
||||
SET character_set_client=binary, character_set_results=binary;
|
||||
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
|
||||
SELECT HEX('<EFBFBD>\['), HEX('\<5C>\[');
|
||||
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES ('<EFBFBD>\['),('\<5C>\[');
|
||||
SELECT HEX(a) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Checking the other way around:
|
||||
# 0x5C in 0xE05C is treated as the second byte
|
||||
# when character_set_client=big5,cp932,gbk,sjis
|
||||
# and character_set_connection=binary
|
||||
#
|
||||
SET character_set_client=@@character_set_connection, character_set_results=@@character_set_connection;
|
||||
SET character_set_connection=binary;
|
||||
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
|
||||
SELECT HEX('<EFBFBD>\['), HEX('\<5C>\[');
|
||||
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES ('<EFBFBD>\['),('\<5C>\[');
|
||||
SELECT HEX(a) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo # Start of ctype_E05C.inc
|
||||
|
327
mysql-test/include/ctype_unescape.inc
Normal file
327
mysql-test/include/ctype_unescape.inc
Normal file
@ -0,0 +1,327 @@
|
||||
--echo # Start of ctype_unescape.inc
|
||||
|
||||
#
|
||||
# Testing how string literals with backslash and quote-quote are unescaped.
|
||||
# The tests assume that single quote (') is used as a delimiter.
|
||||
#
|
||||
|
||||
#
|
||||
# Make sure that the parser really works using the character set we need.
|
||||
# We use binary strings to compose strings, to be able to test get malformed
|
||||
# sequences, which are possible as a result of mysql_real_escape_string().
|
||||
# The important thing for this test is to make the parser unescape using
|
||||
# the client character set, rather than binary. Currently it works exactly
|
||||
# that way by default, so the query below should return @@character_set_client
|
||||
#
|
||||
SET @query=_binary'SELECT CHARSET(\'test\'),@@character_set_client,@@character_set_connection';
|
||||
PREPARE stmt FROM @query;
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
|
||||
let $CHARSET=`SELECT @@character_set_connection`;
|
||||
|
||||
CREATE TABLE allbytes (a VARBINARY(10));
|
||||
|
||||
#
|
||||
# Create various byte sequences to test. Testing the full banch of
|
||||
# possible combinations takes about 2 minutes. So this test provides
|
||||
# variants to run with:
|
||||
# - the full set of possible combinations
|
||||
# - a reduced test of combinations for selected bytes only
|
||||
#
|
||||
|
||||
# Create selected byte combinations
|
||||
if ($ctype_unescape_combinations == 'selected')
|
||||
{
|
||||
--echo # Using selected bytes combinations
|
||||
--source include/bytes.inc
|
||||
#
|
||||
# Populate "selected_bytes" with bytes that have a special meaning.
|
||||
# We'll use "selected_bytes" to generate byte seqeunces,
|
||||
# instead of the full possible byte combinations, to reduce test time.
|
||||
#
|
||||
CREATE TABLE selected_bytes (a VARBINARY(10));
|
||||
|
||||
# Bytes that have a special meaning in all character sets:
|
||||
# 0x00 - mysql_real_escape_string() quotes this to '\0'
|
||||
# 0x0D - mysql_real_escape_string() quotes this to '\r'
|
||||
# 0x0A - mysql_real_escape_string() quotes this to '\n'
|
||||
# 0x1A - mysql_real_escape_string() quotes this to '\Z'
|
||||
# 0x08 - mysql_real_escape_string() does not quote this,
|
||||
# but '\b' is unescaped to 0x08.
|
||||
# 0x09 - mysql_real_escape_string() does not quote this,
|
||||
# but '\t' is unescaped to 0x09.
|
||||
# 0x30 - '0', as in '\0'
|
||||
# 0x5A - 'Z', as in '\Z'
|
||||
# 0x62 - 'b', as in '\b'
|
||||
# 0x6E - 'n', as in '\n'
|
||||
# 0x72 - 't', as in '\r'
|
||||
# 0x74 - 't', as in '\t'
|
||||
|
||||
INSERT INTO selected_bytes (a) VALUES ('\0'),('\b'),('\t'),('\r'),('\n'),('\Z');
|
||||
INSERT INTO selected_bytes (a) VALUES ('0'),('b'),('t'),('r'),('n'),('Z');
|
||||
|
||||
# 0x22 - double quote
|
||||
# 0x25 - percent sign, '\%' is preserved as is for LIKE.
|
||||
# 0x27 - single quote
|
||||
# 0x5C - backslash
|
||||
# 0x5F - underscore, '\_' is preserved as is for LIKE.
|
||||
INSERT INTO selected_bytes (a) VALUES ('\\'),('_'),('%'),(0x22),(0x27);
|
||||
|
||||
# Some bytes do not have any special meaning, for example basic Latin letters.
|
||||
# Let's add, one should be enough for a good enough coverage.
|
||||
INSERT INTO selected_bytes (a) VALUES ('a');
|
||||
|
||||
#
|
||||
# This maps summarizes bytes that have a special
|
||||
# meaning in various character sets:
|
||||
#
|
||||
# MBHEAD MBTAIL NONASCII-8BIT BAD
|
||||
# ------ ------ -------------- ----------
|
||||
# big5: [A1..F9] [40..7E,A1..FE] N/A [80..A0,FA..FF]
|
||||
# cp932: [81..9F,E0..FC] [40..7E,80..FC] [A1..DF] [FD..FF]
|
||||
# gbk: [81..FE] [40..7E,80..FE] N/A [FF]
|
||||
# sjis: [81..9F,E0..FC] [40..7E,80..FC] [A1..DF] [FD..FF]
|
||||
# swe7: N/A N/A [5B..5E,7B..7E] [80..FF]
|
||||
#
|
||||
|
||||
INSERT INTO selected_bytes (a) VALUES
|
||||
(0x3F), # 7bit
|
||||
(0x40), # 7bit mbtail
|
||||
(0x7E), # 7bit mbtail nonascii-8bit
|
||||
(0x7F), # 7bit nonascii-8bit
|
||||
(0x80), # mbtail bad-mb
|
||||
(0x81), # mbhead mbtail
|
||||
(0x9F), # mbhead mbtail bad-mb
|
||||
(0xA0), # mbhead mbtail bad-mb
|
||||
(0xA1), # mbhead mbtail nonascii-8bit
|
||||
(0xE0), # mbhead mbtai
|
||||
(0xEF), # mbhead mbtail
|
||||
(0xF9), # mbhead mbtail
|
||||
(0xFA), # mbhead mbtail bad-mb
|
||||
(0xFC), # mbhead mbtail bad-mb
|
||||
(0xFD), # mbhead mbtail bad-mb
|
||||
(0xFE), # mbhead mbtial bad-mb
|
||||
(0xFF); # bad-mb
|
||||
|
||||
#
|
||||
# Now populate the test table
|
||||
#
|
||||
|
||||
# Use all single bytes, this is cheap, there are only 256 values.
|
||||
INSERT INTO allbytes (a) SELECT a FROM bytes;
|
||||
|
||||
# Add selected bytes combinations
|
||||
INSERT INTO allbytes (a) SELECT CONCAT(t1.a,t2.a) FROM selected_bytes t1,selected_bytes t2;
|
||||
INSERT INTO allbytes (a) SELECT CONCAT(0x5C,t1.a,t2.a) FROM selected_bytes t1,selected_bytes t2;
|
||||
INSERT INTO allbytes (a) SELECT CONCAT(0x5C,t1.a,0x5C,t2.a) FROM selected_bytes t1,selected_bytes t2;
|
||||
DROP TABLE selected_bytes;
|
||||
|
||||
# Delete all non-single byte sequences that do not have
|
||||
# backslashes or quotes at all. There is nothing special with these strings.
|
||||
DELETE FROM allbytes WHERE
|
||||
OCTET_LENGTH(a)>1 AND
|
||||
LOCATE(0x5C,a)=0 AND
|
||||
a NOT LIKE '%\'%' AND
|
||||
a NOT LIKE '%"%';
|
||||
|
||||
}
|
||||
|
||||
if ($ctype_unescape_combinations=='')
|
||||
{
|
||||
--echo # Using full byte combinations
|
||||
--source include/bytes2.inc
|
||||
INSERT INTO allbytes (a) SELECT a FROM bytes;
|
||||
INSERT INTO allbytes (a) SELECT CONCAT(hi,lo) FROM bytes2;
|
||||
INSERT INTO allbytes (a) SELECT CONCAT(0x5C,hi,lo) FROM bytes2;
|
||||
INSERT INTO allbytes (a) SELECT CONCAT(0x5C,hi,0x5C,lo) FROM bytes2;
|
||||
}
|
||||
|
||||
|
||||
DELIMITER //;
|
||||
|
||||
#
|
||||
# A procedure that make an SQL query using 'val' as a string literal.
|
||||
# The result of the query execution is written into the table 't1'.
|
||||
# NULL in t1.b means that query failed due to syntax error,
|
||||
# typically because of mis-interpreted closing quote delimiter.
|
||||
#
|
||||
CREATE PROCEDURE p1(val VARBINARY(10))
|
||||
BEGIN
|
||||
DECLARE EXIT HANDLER FOR SQLSTATE '42000' INSERT INTO t1 (a,b) VALUES(val,NULL);
|
||||
SET @query=CONCAT(_binary"INSERT INTO t1 (a,b) VALUES (0x",HEX(val),",'",val,"')");
|
||||
PREPARE stmt FROM @query;
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
END//
|
||||
|
||||
#
|
||||
# A procedure that iterates through all records in "allbytes".
|
||||
# And runs p1() for every record.
|
||||
#
|
||||
CREATE PROCEDURE p2()
|
||||
BEGIN
|
||||
DECLARE val VARBINARY(10);
|
||||
DECLARE done INT DEFAULT FALSE;
|
||||
DECLARE stmt CURSOR FOR SELECT a FROM allbytes;
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done=TRUE;
|
||||
OPEN stmt;
|
||||
read_loop1: LOOP
|
||||
FETCH stmt INTO val;
|
||||
IF done THEN
|
||||
LEAVE read_loop1;
|
||||
END IF;
|
||||
CALL p1(val);
|
||||
END LOOP;
|
||||
CLOSE stmt;
|
||||
END//
|
||||
|
||||
|
||||
# A function that converts the value from binary to $CHARSET
|
||||
# and check if it has changed. CONVERT() fixes malformed strings.
|
||||
# So if the string changes in CONVERT(), it means it was not wellformed.
|
||||
--eval CREATE FUNCTION iswellformed(a VARBINARY(256)) RETURNS INT RETURN a=BINARY CONVERT(a USING $CHARSET);
|
||||
|
||||
#
|
||||
# A function that approximately reproduces how the SQL parser
|
||||
# would unescape a binary string.
|
||||
#
|
||||
CREATE FUNCTION unescape(a VARBINARY(256)) RETURNS VARBINARY(256)
|
||||
BEGIN
|
||||
# We need to do it in a way to avoid producing new escape sequences
|
||||
# First, enclose all known escsape sequences to '{{xx}}'
|
||||
# - Backslash not followed by a LIKE pattern characters _ and %
|
||||
# - Double escapes
|
||||
# This uses PCRE Branch Reset Groups: (?|(alt1)|(alt2)|(alt3)).
|
||||
# So '\\1' in the last argument always means the match, no matter
|
||||
# which alternative it came from.
|
||||
SET a=REGEXP_REPLACE(a,'(?|(\\\\[^_%])|(\\x{27}\\x{27}))','{{\\1}}');
|
||||
# Now unescape all enclosed standard escape sequences
|
||||
SET a=REPLACE(a,'{{\\0}}', '\0');
|
||||
SET a=REPLACE(a,'{{\\b}}', '\b');
|
||||
SET a=REPLACE(a,'{{\\t}}', '\t');
|
||||
SET a=REPLACE(a,'{{\\r}}', '\r');
|
||||
SET a=REPLACE(a,'{{\\n}}', '\n');
|
||||
SET a=REPLACE(a,'{{\\Z}}', '\Z');
|
||||
SET a=REPLACE(a,'{{\\\'}}', '\'');
|
||||
# Unescape double quotes
|
||||
SET a=REPLACE(a,'{{\'\'}}', '\'');
|
||||
# Unescape the rest: all other \x sequences mean just 'x'
|
||||
SET a=REGEXP_REPLACE(a, '{{\\\\(.|\\R)}}', '\\1');
|
||||
RETURN a;
|
||||
END//
|
||||
|
||||
|
||||
#
|
||||
# A function that checks what happened during unescaping.
|
||||
#
|
||||
# @param a - the value before unescaping
|
||||
# @param b - the value after unescaping
|
||||
#
|
||||
# The following return values are possible:
|
||||
# - SyntErr - b IS NULL, which means syntax error happened in p1().
|
||||
# - Preserv - the value was not modified during unescaping.
|
||||
# This is possible if 0x5C was treated as mbtail.
|
||||
# Or only LIKE escape sequences were found: '\_' and '\%'.
|
||||
# - Trivial - only 0x5C were removed.
|
||||
# - Regular - the value was unescaped like a binary string.
|
||||
# Some standard escape sequences were found.
|
||||
# No special multi-byte handling happened.
|
||||
# - Special - Something else happened. Should not happen.
|
||||
#
|
||||
CREATE FUNCTION unescape_type(a VARBINARY(256),b VARBINARY(256)) RETURNS VARBINARY(256)
|
||||
BEGIN
|
||||
RETURN CASE
|
||||
WHEN b IS NULL THEN '[SyntErr]'
|
||||
WHEN a=b THEN CASE
|
||||
WHEN OCTET_LENGTH(a)=1 THEN '[Preserve]'
|
||||
WHEN a RLIKE '\\\\[_%]' THEN '[Preserve][LIKE]'
|
||||
WHEN a RLIKE '^[[:ascii:]]+$' THEN '[Preserve][ASCII]'
|
||||
ELSE '[Preserv][MB]' END
|
||||
WHEN REPLACE(a,0x5C,'')=b THEN '[Trivial]'
|
||||
WHEN UNESCAPE(a)=b THEN '[Regular]'
|
||||
ELSE '[Special]' END;
|
||||
END//
|
||||
|
||||
|
||||
#
|
||||
# Check what happened with wellformedness during unescaping
|
||||
# @param a - the value before unescaping
|
||||
# @param b - the value after unescaping
|
||||
#
|
||||
# Returned values:
|
||||
# [FIXED] - the value was malformed and become wellformed after unescaping
|
||||
# [BROKE] - the value was wellformed and become malformed after unescaping
|
||||
# [ILSEQ] - both values (before unescaping and after unescaping) are malformed
|
||||
# '' - both values are wellformed
|
||||
#
|
||||
CREATE FUNCTION wellformedness(a VARBINARY(256), b VARBINARY(256))
|
||||
RETURNS VARBINARY(256)
|
||||
BEGIN
|
||||
RETURN CASE
|
||||
WHEN b IS NULL THEN ''
|
||||
WHEN NOT iswellformed(a) AND iswellformed(b) THEN '[FIXED]'
|
||||
WHEN iswellformed(a) AND NOT iswellformed(b) THEN '[BROKE]'
|
||||
WHEN NOT iswellformed(a) AND NOT iswellformed(b) THEN '[ILSEQ]'
|
||||
ELSE ''
|
||||
END;
|
||||
END//
|
||||
|
||||
|
||||
#
|
||||
# Check if the value could be generated by mysql_real_escape_string(),
|
||||
# or can only come from a direct user input.
|
||||
#
|
||||
# @param a - the value before unescaping
|
||||
#
|
||||
# Returns:
|
||||
# [USER] - if the value could not be generated by mysql_real_escape_string()
|
||||
# '' - if the value was possibly generated by mysql_real_escape_string()
|
||||
#
|
||||
#
|
||||
CREATE FUNCTION mysql_real_escape_string_generated(a VARBINARY(256))
|
||||
RETURNS VARBINARY(256)
|
||||
BEGIN
|
||||
DECLARE a1 BINARY(1) DEFAULT SUBSTR(a,1,1);
|
||||
DECLARE a2 BINARY(1) DEFAULT SUBSTR(a,2,1);
|
||||
DECLARE a3 BINARY(1) DEFAULT SUBSTR(a,3,1);
|
||||
DECLARE a4 BINARY(1) DEFAULT SUBSTR(a,4,1);
|
||||
DECLARE a2a4 BINARY(2) DEFAULT CONCAT(a2,a4);
|
||||
RETURN CASE
|
||||
WHEN (a1=0x5C) AND
|
||||
(a3=0x5C) AND
|
||||
(a2>0x7F) AND
|
||||
(a4 NOT IN ('_','%','0','t','r','n','Z')) AND
|
||||
iswellformed(a2a4) THEN '[USER]'
|
||||
ELSE ''
|
||||
END;
|
||||
END//
|
||||
|
||||
DELIMITER ;//
|
||||
|
||||
|
||||
CREATE TABLE t1 (a VARBINARY(10),b VARBINARY(10));
|
||||
CALL p2();
|
||||
# Avoid "Invalid XXX character string" warnings
|
||||
# We mark malformed strings in the output anyway
|
||||
--disable_warnings
|
||||
# All records marked with '[BAD]' mean that the string was unescaped
|
||||
# in a unexpected way, that means there is a bug in UNESCAPE() above.
|
||||
SELECT HEX(a),HEX(b),
|
||||
CONCAT(unescape_type(a,b),
|
||||
wellformedness(a,b),
|
||||
mysql_real_escape_string_generated(a),
|
||||
IF(UNESCAPE(a)<>b,CONCAT('[BAD',HEX(UNESCAPE(a)),']'),'')) AS comment
|
||||
FROM t1 ORDER BY LENGTH(a),a;
|
||||
--enable_warnings
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE p1;
|
||||
DROP PROCEDURE p2;
|
||||
DROP FUNCTION unescape;
|
||||
DROP FUNCTION unescape_type;
|
||||
DROP FUNCTION wellformedness;
|
||||
DROP FUNCTION mysql_real_escape_string_generated;
|
||||
DROP FUNCTION iswellformed;
|
||||
DROP TABLE allbytes;
|
||||
|
||||
--echo # End of ctype_backslash.inc
|
161
mysql-test/include/gis_debug.inc
Normal file
161
mysql-test/include/gis_debug.inc
Normal file
@ -0,0 +1,161 @@
|
||||
#
|
||||
# This is a shared file included from t/gis-precise.test and t/gis-debug.test
|
||||
#
|
||||
# - gis-precise.test is executed both in debug and production builds
|
||||
# and makes sure that the checked GIS functions return the expected results.
|
||||
#
|
||||
# - gis-debug.test is executed only in debug builds
|
||||
# (and is skipped in production builds).
|
||||
# gis-debug.test activates tracing of the internal GIS routines.
|
||||
# The trace log is printed to the client side warnings.
|
||||
# So gis-debug.test makes sure not only that the correct results are returned,
|
||||
# but also check *how* these results were generated - makes sure that
|
||||
# the internal GIS routines went through the expected data and code flow paths.
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS p1;
|
||||
--enable_warnings
|
||||
|
||||
DELIMITER |;
|
||||
CREATE PROCEDURE p1(dist DOUBLE, geom TEXT)
|
||||
BEGIN
|
||||
DECLARE g GEOMETRY;
|
||||
SET g=GeomFromText(geom);
|
||||
SELECT geom AS `-----`;
|
||||
SELECT dist, GeometryType(@buf:=ST_Buffer(g, dist)) AS `buffer`, ROUND(ST_AREA(@buf),2) AS buf_area;
|
||||
END|
|
||||
DELIMITER ;|
|
||||
|
||||
--disable_query_log
|
||||
|
||||
--echo #
|
||||
--echo # Testing ST_BUFFER with positive distance
|
||||
--echo #
|
||||
|
||||
CALL p1(1, 'POINT(0 0))');
|
||||
CALL p1(1, 'LineString(0 1, 1 1))');
|
||||
CALL p1(1, 'LineString(9 9,8 1,1 5,0 0)');
|
||||
CALL p1(1, 'Polygon((2 2,2 8,8 8,8 2,2 2))');
|
||||
CALL p1(1, 'Polygon((0 0,0 8,8 8,8 0,0 0),(2 2,6 2,6 6,2 6,2 2))');
|
||||
CALL p1(1, 'Polygon((0 0, 0 8, 8 8, 8 10, -10 10, -10 0, 0 0))');
|
||||
CALL p1(1, 'MultiPoint(9 9,8 1,1 5)');
|
||||
CALL p1(1, 'MultiLineString((0 0,2 2))');
|
||||
CALL p1(1, 'MultiLineString((0 0,2 2,0 4))');
|
||||
CALL p1(1, 'MultiLineString((0 0,2 2),(0 2,2 0))');
|
||||
CALL p1(1, 'MultiLineString((2 2,2 8,-2 8),(-6 -6, 6 6),(10 10, 14 14))');
|
||||
CALL p1(1, 'MultiPolygon(((2 2,2 8,8 8,8 2,2 2)), ((9 9,8 1,1 5,9 9)))');
|
||||
CALL p1(1, 'MultiPolygon(((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)),((9 9,8 1,1 5,9 9)))');
|
||||
CALL p1(1, 'GeometryCollection(Point(0 0))');
|
||||
CALL p1(1, 'GeometryCollection(LineString(0 0, 2 2)))');
|
||||
CALL p1(1, 'GeometryCollection(Polygon((2 2,2 8,8 8,8 2,2 2))))');
|
||||
CALL p1(1, 'GeometryCollection(MultiPoint(9 9,8 1,1 5))');
|
||||
CALL p1(1, 'GeometryCollection(MultiLineString((0 0,0 1),(3 0,3 1)))');
|
||||
CALL p1(1, 'GeometryCollection(MultiPolygon(((0 0, 3 0, 3 3, 0 3, 0 0)),((6 6,6 9,9 9,9 6,6 6))))');
|
||||
CALL p1(1, 'GeometryCollection(Point(9 9),LineString(1 5,0 0),Polygon((2 2,2 8,8 8,8 2,2 2)))');
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Testing ST_BUFFER with zero distance
|
||||
--echo #
|
||||
|
||||
CALL p1(0, 'POINT(0 0))');
|
||||
CALL p1(0, 'LineString(0 1, 1 1))');
|
||||
CALL p1(0, 'LineString(9 9,8 1,1 5,0 0)');
|
||||
CALL p1(0, 'Polygon((2 2,2 8,8 8,8 2,2 2))');
|
||||
CALL p1(0, 'Polygon((0 0,0 8,8 8,8 0,0 0),(2 2,6 2,6 6,2 6,2 2))');
|
||||
CALL p1(0, 'Polygon((0 0, 0 8, 8 8, 8 10, -10 10, -10 0, 0 0))');
|
||||
CALL p1(0, 'MultiPoint(9 9,8 1,1 5)');
|
||||
CALL p1(0, 'MultiLineString((0 0,2 2))');
|
||||
CALL p1(0, 'MultiLineString((0 0,2 2,0 4))');
|
||||
CALL p1(0, 'MultiLineString((0 0,2 2),(0 2,2 0))');
|
||||
CALL p1(0, 'MultiLineString((2 2,2 8,-2 8),(-6 -6, 6 6),(10 10, 14 14))');
|
||||
CALL p1(0, 'MultiPolygon(((2 2,2 8,8 8,8 2,2 2)), ((9 9,8 1,1 5,9 9)))');
|
||||
CALL p1(0, 'MultiPolygon(((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)),((9 9,8 1,1 5,9 9)))');
|
||||
CALL p1(0, 'GeometryCollection(Point(0 0))');
|
||||
CALL p1(0, 'GeometryCollection(LineString(0 0, 2 2)))');
|
||||
CALL p1(0, 'GeometryCollection(Polygon((2 2,2 8,8 8,8 2,2 2))))');
|
||||
CALL p1(0, 'GeometryCollection(MultiPoint(9 9,8 1,1 5))');
|
||||
CALL p1(0, 'GeometryCollection(MultiLineString((0 0,0 1),(3 0,3 1)))');
|
||||
CALL p1(0, 'GeometryCollection(MultiPolygon(((0 0, 3 0, 3 3, 0 3, 0 0)),((6 6,6 9,9 9,9 6,6 6))))');
|
||||
CALL p1(0, 'GeometryCollection(Point(9 9),LineString(1 5,0 0),Polygon((2 2,2 8,8 8,8 2,2 2)))');
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Testing ST_BUFFER with negative distance
|
||||
--echo #
|
||||
|
||||
CALL p1(-1, 'POINT(0 0))');
|
||||
CALL p1(-1, 'LineString(0 1, 1 1))');
|
||||
CALL p1(-1, 'LineString(9 9,8 1,1 5,0 0)');
|
||||
CALL p1(-1, 'Polygon((2 2,2 8,8 8,8 2,2 2))');
|
||||
#
|
||||
# Wrong shape
|
||||
# CALL p1(-1, 'Polygon((0 0,0 8,8 8,8 0,0 0),(2 2,6 2,6 6,2 6,2 2))');
|
||||
# Wrong shape
|
||||
# CALL p1(-1, 'Polygon((0 0, 0 8, 8 8, 8 10, -10 10, -10 0, 0 0))');
|
||||
#
|
||||
CALL p1(-1, 'MultiPoint(9 9,8 1,1 5)');
|
||||
CALL p1(-1, 'MultiLineString((0 0,2 2))');
|
||||
CALL p1(-1, 'MultiLineString((0 0,2 2,0 4))');
|
||||
CALL p1(-1, 'MultiLineString((0 0,2 2),(0 2,2 0))');
|
||||
CALL p1(-1, 'MultiLineString((2 2,2 8,-2 8),(-6 -6, 6 6),(10 10, 14 14))');
|
||||
#
|
||||
# Wrong shape
|
||||
#CALL p1(-1, 'MultiPolygon(((2 2,2 8,8 8,8 2,2 2)), ((9 9,8 1,1 5,9 9)))');
|
||||
#CALL p1(-1, 'MultiPolygon(((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)),((9 9,8 1,1 5,9 9)))');
|
||||
#
|
||||
CALL p1(-1, 'GeometryCollection(Point(0 0))');
|
||||
CALL p1(-1, 'GeometryCollection(LineString(0 0, 2 2)))');
|
||||
CALL p1(-1, 'GeometryCollection(Polygon((2 2,2 8,8 8,8 2,2 2))))');
|
||||
CALL p1(-1, 'GeometryCollection(MultiPoint(9 9,8 1,1 5))');
|
||||
CALL p1(-1, 'GeometryCollection(MultiLineString((0 0,0 1),(3 0,3 1)))');
|
||||
#
|
||||
# Wrong shape
|
||||
# CALL p1(-1, 'GeometryCollection(MultiPolygon(((0 0, 3 0, 3 3, 0 3, 0 0)),((6 6,6 9,9 9,9 6,6 6))))');
|
||||
#
|
||||
CALL p1(-1, 'GeometryCollection(Point(9 9),LineString(1 5,0 0),Polygon((2 2,2 8,8 8,8 2,2 2)))');
|
||||
|
||||
|
||||
--enable_query_log
|
||||
|
||||
SELECT ST_CONTAINS(
|
||||
GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((6 6, 6 11, 11 11, 11 6, 6 6)))'),
|
||||
GeomFromText('POINT(5 10)'));
|
||||
SELECT AsText(ST_UNION(
|
||||
GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((6 6, 6 11, 11 11, 11 6, 6 6)))'),
|
||||
GeomFromText('POINT(5 10)')));
|
||||
|
||||
DROP PROCEDURE p1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #13833019 ASSERTION `T1->RESULT_RANGE' FAILED IN GCALC_OPERATION_REDUCER::END_COUPLE
|
||||
--echo #
|
||||
SELECT GeometryType(ST_BUFFER(MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((0 0,9 4,3 3,0 0)),((2 2,2 2,8 8,2 3,2 2)))'), 3));
|
||||
|
||||
--echo #
|
||||
--echo # Bug #13832749 HANDLE_FATAL_SIGNAL IN GCALC_FUNCTION::COUNT_INTERNAL
|
||||
--echo #
|
||||
SELECT GeometryType(ST_BUFFER(MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5)),((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)), ((9 9,8 1,1 5,9 9)))'),1));
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#13358363 - ASSERTION: N > 0 && N < SINUSES_CALCULATED*2+1 | GET_N_SINCOS/ADD_EDGE_BUFFER
|
||||
--echo #
|
||||
|
||||
DO ST_BUFFER(ST_GEOMCOLLFROMTEXT('linestring(1 1,2 2)'),'');
|
||||
|
||||
SELECT ST_WITHIN(
|
||||
LINESTRINGFROMTEXT(' LINESTRING(3 8,9 2,3 8,3 3,7 6,4 7,4 7,8 1) '),
|
||||
ST_BUFFER(MULTIPOLYGONFROMTEXT(' MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5)),((2 2,2 8,8 8,8 2,2 2),(4 4,4 6,6 6,6 4,4 4)),((0 5,3 5,3 2,1 2,1 1,3 1,3 0,0 0,0 3,2 3,2 4,0 4,0 5))) '),
|
||||
ST_NUMINTERIORRINGS(POLYGONFROMTEXT('POLYGON((3 5,2 4,2 5,3 5)) '))));
|
||||
|
||||
SELECT ST_DIMENSION(ST_BUFFER(POLYGONFROMTEXT(' POLYGON((3 5,2 5,2 4,3 4,3 5)) '),
|
||||
ST_NUMINTERIORRINGS(POLYGONFROMTEXT(' POLYGON((0 0,9 3,4 2,0 0))'))));
|
||||
|
||||
SELECT ST_NUMINTERIORRINGS(
|
||||
ST_ENVELOPE(ST_BUFFER(MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5))) '),
|
||||
SRID(MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 2,4 2,1 2,2 4,2 2)) ')))));
|
||||
|
||||
SELECT ASTEXT(ST_BUFFER(POLYGONFROMTEXT(' POLYGON((9 9,5 2,4 5,9 9))'),
|
||||
SRID(GEOMETRYFROMTEXT(' MULTIPOINT(8 4,5 0,7 8,6 9,3 4,7 3,5 5) '))));
|
@ -72,6 +72,19 @@ INSERT into gis_geometry SELECT * FROM gis_multi_line;
|
||||
INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
|
||||
INSERT into gis_geometry SELECT * FROM gis_geometrycollection;
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
ANALYZE TABLE gis_point;
|
||||
ANALYZE TABLE gis_line;
|
||||
ANALYZE TABLE gis_polygon;
|
||||
ANALYZE TABLE gis_multi_point;
|
||||
ANALYZE TABLE gis_multi_line;
|
||||
ANALYZE TABLE gis_multi_polygon;
|
||||
ANALYZE TABLE gis_geometrycollection;
|
||||
ANALYZE TABLE gis_geometry;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
SELECT fid, AsText(g) FROM gis_point ORDER by fid;
|
||||
SELECT fid, AsText(g) FROM gis_line ORDER by fid;
|
||||
SELECT fid, AsText(g) FROM gis_polygon ORDER by fid;
|
||||
|
@ -1,4 +0,0 @@
|
||||
--require r/have_mysql_upgrade.result
|
||||
--disable_query_log
|
||||
select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade;
|
||||
--enable_query_log
|
15
mysql-test/include/have_semisync_plugin.inc
Normal file
15
mysql-test/include/have_semisync_plugin.inc
Normal file
@ -0,0 +1,15 @@
|
||||
#
|
||||
# Check if server has support for loading plugins
|
||||
#
|
||||
if (`SELECT @@have_dynamic_loading != 'YES'`) {
|
||||
--skip Requires dynamic loading
|
||||
}
|
||||
|
||||
#
|
||||
# Check if the variable SEMISYNC_MASTER_SO is set
|
||||
#
|
||||
if (!$SEMISYNC_MASTER_SO)
|
||||
{
|
||||
skip Need semisync plugins;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
if ($value == No such row)
|
||||
{
|
||||
SET sql_log_bin = 0;
|
||||
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
|
||||
install plugin rpl_semi_sync_master soname 'semisync_master';
|
||||
SET GLOBAL rpl_semi_sync_master_enabled = 1;
|
||||
SET sql_log_bin = 1;
|
||||
}
|
||||
@ -28,7 +28,7 @@ if ($value == No such row)
|
||||
if ($value == No such row)
|
||||
{
|
||||
SET sql_log_bin = 0;
|
||||
eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN';
|
||||
install plugin rpl_semi_sync_slave soname 'semisync_slave';
|
||||
SET GLOBAL rpl_semi_sync_slave_enabled = 1;
|
||||
SET sql_log_bin = 1;
|
||||
}
|
||||
|
@ -155,6 +155,7 @@ INSERT INTO global_suppressions VALUES
|
||||
("InnoDB: Error: in ALTER TABLE `test`.`t[123]`"),
|
||||
("InnoDB: Error: in RENAME TABLE table `test`.`t1`"),
|
||||
("InnoDB: Error: table `test`.`t[123]` .*does not exist in the InnoDB internal"),
|
||||
("InnoDB: Warning: semaphore wait:"),
|
||||
|
||||
/*
|
||||
BUG#32080 - Excessive warnings on Solaris: setrlimit could not
|
||||
|
@ -2,13 +2,6 @@
|
||||
|
||||
# Can't run test of external client with embedded server
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
# Only run test if "mysql_upgrade" is found
|
||||
--require r/have_mysql_upgrade.result
|
||||
--disable_query_log
|
||||
select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade;
|
||||
--enable_query_log
|
||||
|
||||
#
|
||||
# Hack:
|
||||
#
|
||||
|
@ -109,7 +109,7 @@ DROP DATABASE hotcopy_save;
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
--list_files $MYSQLD_DATADIR/hotcopy_save
|
||||
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
|
||||
--error 9,11,2304
|
||||
--error 1
|
||||
--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
|
||||
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
|
||||
--exec $MYSQLHOTCOPY --quiet --allowold -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
|
||||
|
@ -10,6 +10,10 @@
|
||||
# The environment variables SEARCH_FILE and SEARCH_PATTERN must be set
|
||||
# before sourcing this routine.
|
||||
#
|
||||
# Optionally, SEARCH_RANGE can be set to the max number of bytes of the file
|
||||
# to search. If negative, it will search that many bytes at the end of the
|
||||
# file. The default is to search only the first 50000 bytes of the file.
|
||||
#
|
||||
# In case of
|
||||
# - SEARCH_FILE and/or SEARCH_PATTERN is not set
|
||||
# - SEARCH_FILE cannot be opened
|
||||
@ -38,6 +42,7 @@
|
||||
# --error 0,1
|
||||
# --remove_file $error_log
|
||||
# let SEARCH_FILE= $error_log;
|
||||
# let SEARCH_RANGE= -50000;
|
||||
# # Stop the server
|
||||
# let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
|
||||
# --exec echo "wait" > $restart_file
|
||||
@ -57,8 +62,18 @@ perl;
|
||||
use strict;
|
||||
my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set";
|
||||
my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set";
|
||||
my $search_range= $ENV{'SEARCH_RANGE'};
|
||||
my $file_content;
|
||||
$search_range= 50000 unless $search_range =~ /-?[0-9]+/;
|
||||
open(FILE, "$search_file") or die("Unable to open '$search_file': $!\n");
|
||||
read(FILE, my $file_content, 50000, 0);
|
||||
if ($search_range >= 0) {
|
||||
read(FILE, $file_content, $search_range, 0);
|
||||
} else {
|
||||
my $size= -s $search_file;
|
||||
$search_range = -$size if $size > -$search_range;
|
||||
seek(FILE, $search_range, 2);
|
||||
read(FILE, $file_content, -$search_range, 0);
|
||||
}
|
||||
close(FILE);
|
||||
if ( not $file_content =~ m{$search_pattern} ) {
|
||||
die("# ERROR: The file '$search_file' does not contain the expected pattern $search_pattern\n->$file_content<-\n");
|
||||
|
@ -83,7 +83,7 @@ let $script=
|
||||
s{block_len=[0-9]+}{block_len=#};
|
||||
s{Server ver:.*DOLLAR}{SERVER_VERSION, BINLOG_VERSION};
|
||||
s{GTID [0-9]+-[0-9]+-[0-9]+}{GTID #-#-#};
|
||||
s{\[[0-9]-[0-9]-[0-9]+\]}{[#-#-#]};
|
||||
s{\[([0-9]-[0-9]-[0-9]+,?)+\]}{[#-#-#]};
|
||||
s{cid=[0-9]+}{cid=#};
|
||||
s{SQL_LOAD-[a-z,0-9,-]*.[a-z]*}{SQL_LOAD-<SERVER UUID>-<MASTER server-id>-<file-id>.<extension>};
|
||||
s{rand_seed1=[0-9]*,rand_seed2=[0-9]*}{rand_seed1=<seed 1>,rand_seed2=<seed 2>};
|
||||
|
32
mysql-test/include/stop_dump_threads.inc
Normal file
32
mysql-test/include/stop_dump_threads.inc
Normal file
@ -0,0 +1,32 @@
|
||||
# ==== Purpose ====
|
||||
#
|
||||
# Stop all dump threads on the server of the current connection.
|
||||
#
|
||||
# ==== Usage ====
|
||||
#
|
||||
# --source include/stop_dump_threads.inc
|
||||
|
||||
--let $include_filename= stop_dump_threads.inc
|
||||
--source include/begin_include_file.inc
|
||||
|
||||
|
||||
--let $_sdt_show_rpl_debug_info_old= $show_rpl_debug_info
|
||||
--let $show_rpl_debug_info= 1
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
|
||||
--let $_sdt_dump_thread_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND = 'Binlog dump'`
|
||||
|
||||
while ($_sdt_dump_thread_id != '')
|
||||
{
|
||||
eval KILL $_sdt_dump_thread_id;
|
||||
--let $wait_condition= SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID = $_sdt_dump_thread_id
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $_sdt_dump_thread_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND = 'Binlog dump'`
|
||||
}
|
||||
|
||||
--let $show_rpl_debug_info= $_sdt_show_rpl_debug_info_old
|
||||
|
||||
--let $include_filename= stop_dump_threads.inc
|
||||
--source include/end_include_file.inc
|
@ -13,6 +13,11 @@
|
||||
UNINSTALL PLUGIN rpl_semi_sync_slave;
|
||||
|
||||
--connection master
|
||||
# After BUG#17638477 fix, uninstallation of rpl_semi_sync_master
|
||||
# is not allowed when there are semi sync slaves. Hence kill
|
||||
# all dump threads before uninstalling it.
|
||||
SET GLOBAL rpl_semi_sync_master_enabled = OFF;
|
||||
--source include/stop_dump_threads.inc
|
||||
UNINSTALL PLUGIN rpl_semi_sync_master;
|
||||
--enable_warnings
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/perl
|
||||
# Call mtr in out-of-source build
|
||||
$ENV{MTR_BINDIR} = "@CMAKE_BINARY_DIR@";
|
||||
chdir("@CMAKE_SOURCE_DIR@/mysql-test");
|
||||
exit(system($^X, "@CMAKE_SOURCE_DIR@/mysql-test/mysql-test-run.pl", @ARGV) >> 8);
|
||||
$ENV{MTR_BINDIR} = '@CMAKE_BINARY_DIR@';
|
||||
chdir('@CMAKE_SOURCE_DIR@/mysql-test');
|
||||
exit(system($^X, '@CMAKE_SOURCE_DIR@/mysql-test/mysql-test-run.pl', @ARGV) >> 8);
|
||||
|
@ -5265,7 +5265,7 @@ sub get_extra_opts {
|
||||
sub stop_servers($$) {
|
||||
my (@servers)= @_;
|
||||
|
||||
mtr_report("Restarting ", started(@servers));
|
||||
mtr_report("Stopping ", started(@servers));
|
||||
|
||||
My::SafeProcess::shutdown($opt_shutdown_timeout,
|
||||
started(@servers));
|
||||
|
@ -427,4 +427,16 @@ THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
|
||||
# MDL_SHARED_READ MDL_EXPLICIT Table metadata lock test t2
|
||||
drop table t1;
|
||||
unlock tables;
|
||||
#
|
||||
# MDEV-6560
|
||||
# Assertion `! is_set() ' failed in Diagnostics_area::set_ok_status
|
||||
#
|
||||
CREATE TABLE t1 (col_int_nokey INT) ENGINE=InnoDB;
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp LIKE t1;
|
||||
LOCK TABLE t1 WRITE;
|
||||
CREATE OR REPLACE TABLE t1 LIKE tmp;
|
||||
KILL QUERY con_id;
|
||||
CREATE OR REPLACE TABLE t1 (a int);
|
||||
KILL QUERY con_id;
|
||||
drop table t1;
|
||||
DROP TABLE t2;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -20060,3 +20060,204 @@ hex(weight_string(cast(0x814081408140 as char),25, 4, 0xC0))
|
||||
#
|
||||
# End of 5.6 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.0 tests
|
||||
#
|
||||
SET NAMES cp932;
|
||||
# Start of ctype_E05C.inc
|
||||
SELECT HEX('<27>\'),HEX('<27>\t');
|
||||
HEX('<27>\') HEX('<27>\t')
|
||||
E05C E05C74
|
||||
SELECT HEX('\\<5C>\'),HEX('\\<5C>\t'),HEX('\\<5C>\t\t');
|
||||
HEX('\\<5C>\') HEX('\\<5C>\t') HEX('\\<5C>\t\t')
|
||||
5CE05C 5CE05C74 5CE05C7409
|
||||
SELECT HEX('''<27>\'),HEX('<27>\''');
|
||||
HEX('''<27>\') HEX('<27>\''')
|
||||
27E05C E05C27
|
||||
SELECT HEX('\\''<27>\'),HEX('<27>\''\\');
|
||||
HEX('\\''<27>\') HEX('<27>\''\\')
|
||||
5C27E05C E05C275C
|
||||
SELECT HEX(BINARY('<27>\')),HEX(BINARY('<27>\t'));
|
||||
HEX(BINARY('<27>\')) HEX(BINARY('<27>\t'))
|
||||
E05C E05C74
|
||||
SELECT HEX(BINARY('\\<5C>\')),HEX(BINARY('\\<5C>\t')),HEX(BINARY('\\<5C>\t\t'));
|
||||
HEX(BINARY('\\<5C>\')) HEX(BINARY('\\<5C>\t')) HEX(BINARY('\\<5C>\t\t'))
|
||||
5CE05C 5CE05C74 5CE05C7409
|
||||
SELECT HEX(BINARY('''<27>\')),HEX(BINARY('<27>\'''));
|
||||
HEX(BINARY('''<27>\')) HEX(BINARY('<27>\'''))
|
||||
27E05C E05C27
|
||||
SELECT HEX(BINARY('\\''<27>\')),HEX(BINARY('<27>\''\\'));
|
||||
HEX(BINARY('\\''<27>\')) HEX(BINARY('<27>\''\\'))
|
||||
5C27E05C E05C275C
|
||||
SELECT HEX(_BINARY'<27>\'),HEX(_BINARY'<27>\t');
|
||||
HEX(_BINARY'<27>\') HEX(_BINARY'<27>\t')
|
||||
E05C E05C74
|
||||
SELECT HEX(_BINARY'\\<5C>\'),HEX(_BINARY'\\<5C>\t'),HEX(_BINARY'\\<5C>\t\t');
|
||||
HEX(_BINARY'\\<5C>\') HEX(_BINARY'\\<5C>\t') HEX(_BINARY'\\<5C>\t\t')
|
||||
5CE05C 5CE05C74 5CE05C7409
|
||||
SELECT HEX(_BINARY'''<27>\'),HEX(_BINARY'<27>\''');
|
||||
HEX(_BINARY'''<27>\') HEX(_BINARY'<27>\''')
|
||||
27E05C E05C27
|
||||
SELECT HEX(_BINARY'\\''<27>\'),HEX(_BINARY'<27>\''\\');
|
||||
HEX(_BINARY'\\''<27>\') HEX(_BINARY'<27>\''\\')
|
||||
5C27E05C E05C275C
|
||||
CREATE TABLE t1 AS SELECT REPEAT(' ',10) AS a LIMIT 0;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) CHARACTER SET cp932 NOT NULL DEFAULT ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 VALUES ('<27>\'),('<27>\t');
|
||||
INSERT INTO t1 VALUES ('\\<5C>\'),('\\<5C>\t'),('\\<5C>\t\t');
|
||||
INSERT INTO t1 VALUES ('''<27>\'),('<27>\''');
|
||||
INSERT INTO t1 VALUES ('\\''<27>\'),('<27>\''\\');
|
||||
SELECT a, HEX(a) FROM t1;
|
||||
a HEX(a)
|
||||
<EFBFBD>\ E05C
|
||||
<EFBFBD>\t E05C74
|
||||
\<5C>\ 5CE05C
|
||||
\<5C>\t 5CE05C74
|
||||
\<5C>\t 5CE05C7409
|
||||
'<27>\ 27E05C
|
||||
<EFBFBD>\' E05C27
|
||||
\'<27>\ 5C27E05C
|
||||
<EFBFBD>\'\ E05C275C
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a BLOB);
|
||||
INSERT INTO t1 VALUES ('<27>\'),('<27>\t');
|
||||
INSERT INTO t1 VALUES ('\\<5C>\'),('\\<5C>\t'),('\\<5C>\t\t');
|
||||
INSERT INTO t1 VALUES ('''<27>\'),('<27>\''');
|
||||
INSERT INTO t1 VALUES ('\\''<27>\'),('<27>\''\\');
|
||||
SELECT a, HEX(a) FROM t1;
|
||||
a HEX(a)
|
||||
<EFBFBD>\ E05C
|
||||
<EFBFBD>\t E05C74
|
||||
\<5C>\ 5CE05C
|
||||
\<5C>\t 5CE05C74
|
||||
\<5C>\t 5CE05C7409
|
||||
'<27>\ 27E05C
|
||||
<EFBFBD>\' E05C27
|
||||
\'<27>\ 5C27E05C
|
||||
<EFBFBD>\'\ E05C275C
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) CHARACTER SET cp932 NOT NULL DEFAULT ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 VALUES (BINARY('<27>\')),(BINARY('<27>\t'));
|
||||
INSERT INTO t1 VALUES (BINARY('\\<5C>\')),(BINARY('\\<5C>\t')),(BINARY('\\<5C>\t\t'));
|
||||
INSERT INTO t1 VALUES (BINARY('''<27>\')),(BINARY('<27>\'''));
|
||||
INSERT INTO t1 VALUES (BINARY('\\''<27>\')),(BINARY('<27>\''\\'));
|
||||
SELECT a, HEX(a) FROM t1;
|
||||
a HEX(a)
|
||||
<EFBFBD>\ E05C
|
||||
<EFBFBD>\t E05C74
|
||||
\<5C>\ 5CE05C
|
||||
\<5C>\t 5CE05C74
|
||||
\<5C>\t 5CE05C7409
|
||||
'<27>\ 27E05C
|
||||
<EFBFBD>\' E05C27
|
||||
\'<27>\ 5C27E05C
|
||||
<EFBFBD>\'\ E05C275C
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a BLOB);
|
||||
INSERT INTO t1 VALUES (BINARY('<27>\')),(BINARY('<27>\t'));
|
||||
INSERT INTO t1 VALUES (BINARY('\\<5C>\')),(BINARY('\\<5C>\t')),(BINARY('\\<5C>\t\t'));
|
||||
INSERT INTO t1 VALUES (BINARY('''<27>\')),(BINARY('<27>\'''));
|
||||
INSERT INTO t1 VALUES (BINARY('\\''<27>\')),(BINARY('<27>\''\\'));
|
||||
SELECT a, HEX(a) FROM t1;
|
||||
a HEX(a)
|
||||
<EFBFBD>\ E05C
|
||||
<EFBFBD>\t E05C74
|
||||
\<5C>\ 5CE05C
|
||||
\<5C>\t 5CE05C74
|
||||
\<5C>\t 5CE05C7409
|
||||
'<27>\ 27E05C
|
||||
<EFBFBD>\' E05C27
|
||||
\'<27>\ 5C27E05C
|
||||
<EFBFBD>\'\ E05C275C
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) CHARACTER SET cp932 NOT NULL DEFAULT ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 VALUES (_BINARY'<27>\'),(_BINARY'<27>\t');
|
||||
INSERT INTO t1 VALUES (_BINARY'\\<5C>\'),(_BINARY'\\<5C>\t'),(_BINARY'\\<5C>\t\t');
|
||||
INSERT INTO t1 VALUES (_BINARY'''<27>\'),(_BINARY'<27>\''');
|
||||
INSERT INTO t1 VALUES (_BINARY'\\''<27>\'),(_BINARY'<27>\''\\');
|
||||
SELECT a, HEX(a) FROM t1;
|
||||
a HEX(a)
|
||||
<EFBFBD>\ E05C
|
||||
<EFBFBD>\t E05C74
|
||||
\<5C>\ 5CE05C
|
||||
\<5C>\t 5CE05C74
|
||||
\<5C>\t 5CE05C7409
|
||||
'<27>\ 27E05C
|
||||
<EFBFBD>\' E05C27
|
||||
\'<27>\ 5C27E05C
|
||||
<EFBFBD>\'\ E05C275C
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a BLOB);
|
||||
INSERT INTO t1 VALUES (_BINARY'<27>\'),(_BINARY'<27>\t');
|
||||
INSERT INTO t1 VALUES (_BINARY'\\<5C>\'),(_BINARY'\\<5C>\t'),(_BINARY'\\<5C>\t\t');
|
||||
INSERT INTO t1 VALUES (_BINARY'''<27>\'),(_BINARY'<27>\''');
|
||||
INSERT INTO t1 VALUES (_BINARY'\\''<27>\'),(_BINARY'<27>\''\\');
|
||||
SELECT a, HEX(a) FROM t1;
|
||||
a HEX(a)
|
||||
<EFBFBD>\ E05C
|
||||
<EFBFBD>\t E05C74
|
||||
\<5C>\ 5CE05C
|
||||
\<5C>\t 5CE05C74
|
||||
\<5C>\t 5CE05C7409
|
||||
'<27>\ 27E05C
|
||||
<EFBFBD>\' E05C27
|
||||
\'<27>\ 5C27E05C
|
||||
<EFBFBD>\'\ E05C275C
|
||||
DROP TABLE t1;
|
||||
SET character_set_client=binary, character_set_results=binary;
|
||||
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
|
||||
@@character_set_client @@character_set_connection @@character_set_results
|
||||
binary cp932 binary
|
||||
SELECT HEX('<27>\['), HEX('\<5C>\[');
|
||||
HEX('<27>\[') HEX('\<5C>\[')
|
||||
E05B E05B
|
||||
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) CHARACTER SET cp932 NOT NULL DEFAULT ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 VALUES ('<27>\['),('\<5C>\[');
|
||||
SELECT HEX(a) FROM t1;
|
||||
HEX(a)
|
||||
E05B
|
||||
E05B
|
||||
DROP TABLE t1;
|
||||
SET character_set_client=@@character_set_connection, character_set_results=@@character_set_connection;
|
||||
SET character_set_connection=binary;
|
||||
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
|
||||
@@character_set_client @@character_set_connection @@character_set_results
|
||||
cp932 binary cp932
|
||||
SELECT HEX('<27>\['), HEX('\<5C>\[');
|
||||
HEX('<27>\[') HEX('\<5C>\[')
|
||||
E05C5B E05B
|
||||
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varbinary(10) NOT NULL DEFAULT ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 VALUES ('<27>\['),('\<5C>\[');
|
||||
SELECT HEX(a) FROM t1;
|
||||
HEX(a)
|
||||
E05C5B
|
||||
E05B
|
||||
DROP TABLE t1;
|
||||
# Start of ctype_E05C.inc
|
||||
#
|
||||
# End of 10.0 tests
|
||||
#
|
||||
|
@ -33622,3 +33622,20 @@ hex(weight_string(cast(0x8FA2C38FA2C38FA2C3 as char),25, 4, 0xC0))
|
||||
#
|
||||
# End of 5.6 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.0 tests
|
||||
#
|
||||
#
|
||||
# MDEV-6776 ujis and eucjmps erroneously accept 0x8EA0 as a valid byte sequence
|
||||
#
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET eucjpms);
|
||||
INSERT INTO t1 VALUES (0x8EA0);
|
||||
SELECT HEX(a), CHAR_LENGTH(a) FROM t1;
|
||||
HEX(a) CHAR_LENGTH(a)
|
||||
0
|
||||
DROP TABLE t1;
|
||||
SELECT _eucjpms 0x8EA0;
|
||||
ERROR HY000: Invalid eucjpms character string: '8EA0'
|
||||
#
|
||||
# End of 10.0 tests
|
||||
#
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
51
mysql-test/r/ctype_partitions.result
Normal file
51
mysql-test/r/ctype_partitions.result
Normal file
@ -0,0 +1,51 @@
|
||||
#
|
||||
# MDEV-6255 DUPLICATE KEY Errors on SELECT .. GROUP BY that uses temporary and filesort
|
||||
#
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET cp1251 COLLATE cp1251_ukrainian_ci);
|
||||
INSERT INTO t1 VALUES (0x20),(0x60),(0x6060),(0x606060);
|
||||
SELECT HEX(a) FROM t1 WHERE a=0x60;
|
||||
HEX(a)
|
||||
20
|
||||
60
|
||||
6060
|
||||
606060
|
||||
ALTER TABLE t1 PARTITION BY KEY(a) PARTITIONS 3;
|
||||
SELECT HEX(a) FROM t1 WHERE a=0x60;
|
||||
HEX(a)
|
||||
20
|
||||
60
|
||||
6060
|
||||
606060
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET koi8u COLLATE koi8u_general_ci);
|
||||
INSERT INTO t1 VALUES (0x20),(0x60),(0x6060),(0x606060);
|
||||
SELECT HEX(a) FROM t1 WHERE a=0x60;
|
||||
HEX(a)
|
||||
20
|
||||
60
|
||||
6060
|
||||
606060
|
||||
ALTER TABLE t1 PARTITION BY KEY(a) PARTITIONS 3;
|
||||
SELECT HEX(a) FROM t1 WHERE a=0x60;
|
||||
HEX(a)
|
||||
20
|
||||
60
|
||||
6060
|
||||
606060
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET cp1250 COLLATE cp1250_general_ci);
|
||||
INSERT INTO t1 VALUES (0x20),(0xA0),(0xA0A0),(0xA0A0A0);
|
||||
SELECT HEX(a) FROM t1 WHERE a=0xA0;
|
||||
HEX(a)
|
||||
20
|
||||
A0
|
||||
A0A0
|
||||
A0A0A0
|
||||
ALTER TABLE t1 PARTITION BY KEY(a) PARTITIONS 3;
|
||||
SELECT HEX(a) FROM t1 WHERE a=0xA0;
|
||||
HEX(a)
|
||||
20
|
||||
A0
|
||||
A0A0
|
||||
A0A0A0
|
||||
DROP TABLE t1;
|
File diff suppressed because it is too large
Load Diff
3071
mysql-test/r/ctype_swe7.result
Normal file
3071
mysql-test/r/ctype_swe7.result
Normal file
File diff suppressed because it is too large
Load Diff
@ -4508,6 +4508,39 @@ COALESCE(c1)
|
||||
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-5745 analyze MySQL fix for bug#12368495
|
||||
#
|
||||
SELECT CHAR_LENGTH(TRIM(LEADING 0x000000 FROM _ucs2 0x0061));
|
||||
CHAR_LENGTH(TRIM(LEADING 0x000000 FROM _ucs2 0x0061))
|
||||
2
|
||||
SELECT CHAR_LENGTH(TRIM(LEADING 0x0001 FROM _ucs2 0x0061));
|
||||
CHAR_LENGTH(TRIM(LEADING 0x0001 FROM _ucs2 0x0061))
|
||||
2
|
||||
SELECT CHAR_LENGTH(TRIM(LEADING 0x00 FROM _ucs2 0x0061));
|
||||
CHAR_LENGTH(TRIM(LEADING 0x00 FROM _ucs2 0x0061))
|
||||
1
|
||||
SELECT CHAR_LENGTH(TRIM(TRAILING 0x000000 FROM _ucs2 0x0061));
|
||||
CHAR_LENGTH(TRIM(TRAILING 0x000000 FROM _ucs2 0x0061))
|
||||
2
|
||||
SELECT CHAR_LENGTH(TRIM(TRAILING 0x0001 FROM _ucs2 0x0061));
|
||||
CHAR_LENGTH(TRIM(TRAILING 0x0001 FROM _ucs2 0x0061))
|
||||
2
|
||||
SELECT CHAR_LENGTH(TRIM(TRAILING 0x61 FROM _ucs2 0x0061));
|
||||
CHAR_LENGTH(TRIM(TRAILING 0x61 FROM _ucs2 0x0061))
|
||||
1
|
||||
SELECT CHAR_LENGTH(TRIM(BOTH 0x000000 FROM _ucs2 0x0061));
|
||||
CHAR_LENGTH(TRIM(BOTH 0x000000 FROM _ucs2 0x0061))
|
||||
2
|
||||
SELECT CHAR_LENGTH(TRIM(BOTH 0x0001 FROM _ucs2 0x0061));
|
||||
CHAR_LENGTH(TRIM(BOTH 0x0001 FROM _ucs2 0x0061))
|
||||
2
|
||||
SELECT CHAR_LENGTH(TRIM(BOTH 0x61 FROM _ucs2 0x0061));
|
||||
CHAR_LENGTH(TRIM(BOTH 0x61 FROM _ucs2 0x0061))
|
||||
1
|
||||
SELECT CHAR_LENGTH(TRIM(BOTH 0x00 FROM _ucs2 0x0061));
|
||||
CHAR_LENGTH(TRIM(BOTH 0x00 FROM _ucs2 0x0061))
|
||||
1
|
||||
#
|
||||
# End of 5.5 tests
|
||||
#
|
||||
#
|
||||
@ -5290,3 +5323,22 @@ DROP TABLE t1;
|
||||
#
|
||||
# End of 5.6 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.0 tests
|
||||
#
|
||||
#
|
||||
# MDEV-6661 PI() does not work well in UCS2/UTF16/UTF32 context
|
||||
#
|
||||
SELECT CONCAT(CONVERT('pi=' USING ucs2),PI()) AS PI;
|
||||
PI
|
||||
pi=3.141593
|
||||
#
|
||||
# MDEV-6695 Bad column name for UCS2 string literals
|
||||
#
|
||||
SET NAMES utf8, character_set_connection=ucs2;
|
||||
SELECT 'a','aa';
|
||||
a aa
|
||||
a aa
|
||||
#
|
||||
# End of 10.0 tests
|
||||
#
|
||||
|
@ -25928,3 +25928,20 @@ hex(weight_string(cast(0x8FA2C38FA2C38FA2C3 as char),25, 4, 0xC0))
|
||||
#
|
||||
# End of 5.6 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.0 tests
|
||||
#
|
||||
#
|
||||
# MDEV-6776 ujis and eucjmps erroneously accept 0x8EA0 as a valid byte sequence
|
||||
#
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET ujis);
|
||||
INSERT INTO t1 VALUES (0x8EA0);
|
||||
SELECT HEX(a), CHAR_LENGTH(a) FROM t1;
|
||||
HEX(a) CHAR_LENGTH(a)
|
||||
0
|
||||
DROP TABLE t1;
|
||||
SELECT _ujis 0x8EA0;
|
||||
ERROR HY000: Invalid ujis character string: '8EA0'
|
||||
#
|
||||
# End of 10.0 tests
|
||||
#
|
||||
|
@ -227,13 +227,8 @@ DROP TABLE mysql050614_xxx_croatian_ci;
|
||||
# Checking mysql_upgrade
|
||||
#
|
||||
# Running mysql_upgrade
|
||||
Phase 1/3: Fixing table and database names
|
||||
Phase 2/3: Checking and upgrading tables
|
||||
Phase 1/4: Checking mysql database
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
mysql
|
||||
mysql.column_stats OK
|
||||
mysql.columns_priv OK
|
||||
@ -263,6 +258,14 @@ mysql.time_zone_name OK
|
||||
mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
Phase 2/4: Running 'mysql_fix_privilege_tables'...
|
||||
Phase 3/4: Fixing table and database names
|
||||
Phase 4/4: Checking and upgrading tables
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
performance_schema
|
||||
test
|
||||
test.maria050313_ucs2_croatian_ci_def Needs upgrade
|
||||
@ -276,17 +279,11 @@ test.maria050313_ucs2_croatian_ci_def OK
|
||||
test.maria050313_utf8_croatian_ci OK
|
||||
test.maria050533_xxx_croatian_ci OK
|
||||
test.maria100004_xxx_croatian_ci OK
|
||||
Phase 3/3: Running 'mysql_fix_privilege_tables'...
|
||||
OK
|
||||
# Running mysql_upgrade for the second time
|
||||
# This should report OK for all tables
|
||||
Phase 1/3: Fixing table and database names
|
||||
Phase 2/3: Checking and upgrading tables
|
||||
Phase 1/4: Checking mysql database
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
mysql
|
||||
mysql.column_stats OK
|
||||
mysql.columns_priv OK
|
||||
@ -316,6 +313,14 @@ mysql.time_zone_name OK
|
||||
mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
Phase 2/4: Running 'mysql_fix_privilege_tables'...
|
||||
Phase 3/4: Fixing table and database names
|
||||
Phase 4/4: Checking and upgrading tables
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
performance_schema
|
||||
test
|
||||
test.maria050313_ucs2_croatian_ci_def OK
|
||||
@ -323,7 +328,6 @@ test.maria050313_utf8_croatian_ci OK
|
||||
test.maria050533_xxx_croatian_ci OK
|
||||
test.maria100004_xxx_croatian_ci OK
|
||||
test.mysql050614_xxx_croatian_ci OK
|
||||
Phase 3/3: Running 'mysql_fix_privilege_tables'...
|
||||
OK
|
||||
SHOW CREATE TABLE maria050313_ucs2_croatian_ci_def;
|
||||
Table Create Table
|
||||
|
@ -1549,7 +1549,7 @@ SELECT space(date_add(101, INTERVAL CHAR('1' USING utf16) hour_second));
|
||||
space(date_add(101, INTERVAL CHAR('1' USING utf16) hour_second))
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
|
||||
Warning 1301 Result of space() was larger than max_allowed_packet (1048576) - truncated
|
||||
#
|
||||
# Bug#11750518 41090: ORDER BY TRUNCATES GROUP_CONCAT RESULT
|
||||
#
|
||||
@ -2078,3 +2078,45 @@ DFFFFFDFFFFF9CFFFF9DFFFF9EFFFF
|
||||
#
|
||||
# End of 5.6 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.0 tests
|
||||
#
|
||||
#
|
||||
# MDEV-6661 PI() does not work well in UCS2/UTF16/UTF32 context
|
||||
#
|
||||
SELECT CONCAT(CONVERT('pi=' USING utf16),PI()) AS PI;
|
||||
PI
|
||||
pi=3.141593
|
||||
#
|
||||
# MDEV-6666 Malformed result for CONCAT(utf8_column, binary_string)
|
||||
#
|
||||
SET NAMES utf8mb4;
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf16);
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
SELECT CONCAT(a,0xD800) FROM t1;
|
||||
ERROR HY000: Invalid utf16 character string: 'D800'
|
||||
SELECT CONCAT(a,0xD800DC00) FROM t1;
|
||||
CONCAT(a,0xD800DC00)
|
||||
a𐀀
|
||||
SELECT CONCAT(a,0x00FF) FROM t1;
|
||||
CONCAT(a,0x00FF)
|
||||
aÿ
|
||||
DROP TABLE t1;
|
||||
SELECT CONCAT(_utf16'a' COLLATE utf16_unicode_ci, _binary 0xD800);
|
||||
ERROR HY000: Invalid utf16 character string: 'D800'
|
||||
PREPARE stmt FROM "SELECT CONCAT(_utf16'a' COLLATE utf16_unicode_ci, ?)";
|
||||
SET @arg00=_binary 0xD800;
|
||||
EXECUTE stmt USING @arg00;
|
||||
ERROR HY000: Invalid utf16 character string: 'D800'
|
||||
SET @arg00=_binary 0xD800DC00;
|
||||
EXECUTE stmt USING @arg00;
|
||||
CONCAT(_utf16'a' COLLATE utf16_unicode_ci, ?)
|
||||
a𐀀
|
||||
SET @arg00=_binary 0x00FF;
|
||||
EXECUTE stmt USING @arg00;
|
||||
CONCAT(_utf16'a' COLLATE utf16_unicode_ci, ?)
|
||||
aÿ
|
||||
DEALLOCATE PREPARE stmt;
|
||||
#
|
||||
# End of 10.0 tests
|
||||
#
|
||||
|
@ -1626,6 +1626,39 @@ SELECT '2010-10-10 10:10:10' + INTERVAL GeometryType(GeomFromText('POINT(1 1)'))
|
||||
'2010-10-10 10:10:10' + INTERVAL GeometryType(GeomFromText('POINT(1 1)')) hour_second
|
||||
2010-10-10 10:10:10
|
||||
#
|
||||
# MDEV-5745 analyze MySQL fix for bug#12368495
|
||||
#
|
||||
SELECT CHAR_LENGTH(TRIM(LEADING 0x0000000000 FROM _utf32 0x00000061));
|
||||
CHAR_LENGTH(TRIM(LEADING 0x0000000000 FROM _utf32 0x00000061))
|
||||
4
|
||||
SELECT CHAR_LENGTH(TRIM(LEADING 0x0001 FROM _utf32 0x00000061));
|
||||
CHAR_LENGTH(TRIM(LEADING 0x0001 FROM _utf32 0x00000061))
|
||||
4
|
||||
SELECT CHAR_LENGTH(TRIM(LEADING 0x00 FROM _utf32 0x00000061));
|
||||
CHAR_LENGTH(TRIM(LEADING 0x00 FROM _utf32 0x00000061))
|
||||
1
|
||||
SELECT CHAR_LENGTH(TRIM(TRAILING 0x0000000000 FROM _utf32 0x00000061));
|
||||
CHAR_LENGTH(TRIM(TRAILING 0x0000000000 FROM _utf32 0x00000061))
|
||||
4
|
||||
SELECT CHAR_LENGTH(TRIM(TRAILING 0x0001 FROM _utf32 0x00000061));
|
||||
CHAR_LENGTH(TRIM(TRAILING 0x0001 FROM _utf32 0x00000061))
|
||||
4
|
||||
SELECT CHAR_LENGTH(TRIM(TRAILING 0x61 FROM _utf32 0x00000061));
|
||||
CHAR_LENGTH(TRIM(TRAILING 0x61 FROM _utf32 0x00000061))
|
||||
3
|
||||
SELECT CHAR_LENGTH(TRIM(BOTH 0x0000000000 FROM _utf32 0x00000061));
|
||||
CHAR_LENGTH(TRIM(BOTH 0x0000000000 FROM _utf32 0x00000061))
|
||||
4
|
||||
SELECT CHAR_LENGTH(TRIM(BOTH 0x0001 FROM _utf32 0x00000061));
|
||||
CHAR_LENGTH(TRIM(BOTH 0x0001 FROM _utf32 0x00000061))
|
||||
4
|
||||
SELECT CHAR_LENGTH(TRIM(BOTH 0x61 FROM _utf32 0x00000061));
|
||||
CHAR_LENGTH(TRIM(BOTH 0x61 FROM _utf32 0x00000061))
|
||||
3
|
||||
SELECT CHAR_LENGTH(TRIM(BOTH 0x00 FROM _utf32 0x00000061));
|
||||
CHAR_LENGTH(TRIM(BOTH 0x00 FROM _utf32 0x00000061))
|
||||
1
|
||||
#
|
||||
# End of 5.5 tests
|
||||
#
|
||||
#
|
||||
@ -2131,3 +2164,45 @@ DFFFFFDFFFFF9CFFFF9DFFFF9EFFFF
|
||||
#
|
||||
# End of 5.6 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.0 tests
|
||||
#
|
||||
#
|
||||
# MDEV-6661 PI() does not work well in UCS2/UTF16/UTF32 context
|
||||
#
|
||||
SELECT CONCAT(CONVERT('pi=' USING utf32),PI()) AS PI;
|
||||
PI
|
||||
pi=3.141593
|
||||
#
|
||||
# MDEV-6666 Malformed result for CONCAT(utf8_column, binary_string)
|
||||
#
|
||||
SET NAMES utf8mb4;
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32);
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
SELECT CONCAT(a,0x20FFFF) FROM t1;
|
||||
ERROR HY000: Invalid utf32 character string: '0020FF'
|
||||
SELECT CONCAT(a,0x010000) FROM t1;
|
||||
CONCAT(a,0x010000)
|
||||
a𐀀
|
||||
SELECT CONCAT(a,0x00FF) FROM t1;
|
||||
CONCAT(a,0x00FF)
|
||||
aÿ
|
||||
DROP TABLE t1;
|
||||
SELECT CONCAT(_utf32'a' COLLATE utf32_unicode_ci, _binary 0x20FFFF);
|
||||
ERROR HY000: Invalid utf32 character string: '0020FF'
|
||||
PREPARE stmt FROM "SELECT CONCAT(_utf32'a' COLLATE utf32_unicode_ci, ?)";
|
||||
SET @arg00=_binary 0x20FFFF;
|
||||
EXECUTE stmt USING @arg00;
|
||||
ERROR HY000: Invalid utf32 character string: '0020FF'
|
||||
SET @arg00=_binary 0x010000;
|
||||
EXECUTE stmt USING @arg00;
|
||||
CONCAT(_utf32'a' COLLATE utf32_unicode_ci, ?)
|
||||
a𐀀
|
||||
SET @arg00=_binary 0x00FF;
|
||||
EXECUTE stmt USING @arg00;
|
||||
CONCAT(_utf32'a' COLLATE utf32_unicode_ci, ?)
|
||||
aÿ
|
||||
DEALLOCATE PREPARE stmt;
|
||||
#
|
||||
# End of 10.0 tests
|
||||
#
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2406,6 +2406,94 @@ deallocate prepare stmt;
|
||||
drop table t1,t2;
|
||||
set optimizer_switch=@save_optimizer_switch5740;
|
||||
#
|
||||
# Bug mdev-5721: possible long key access to a materialized derived table
|
||||
# (see also the test case for Bug#13261277 that is actually the same bug)
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
id varchar(255) NOT NULL DEFAULT '',
|
||||
familyid int(11) DEFAULT NULL,
|
||||
withdrawndate date DEFAULT NULL,
|
||||
KEY index_td_familyid_id (familyid,id)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
activefromts datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
shortdescription text,
|
||||
useraccessfamily varchar(512) DEFAULT NULL,
|
||||
serialized longtext,
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
insert into t1 values ('picture/89/1369722032695.pmd',89,NULL);
|
||||
insert into t1 values ('picture/90/1369832057370.pmd',90,NULL);
|
||||
insert into t2 values (38,'2013-03-04 07:49:22','desc','CODE','string');
|
||||
EXPLAIN
|
||||
SELECT * FROM t2 x,
|
||||
(SELECT t2.useraccessfamily, t2.serialized AS picturesubuser, COUNT(*)
|
||||
FROM t2, t1 GROUP BY t2.useraccessfamily, picturesubuser) y
|
||||
WHERE x.useraccessfamily = y.useraccessfamily;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY x system NULL NULL NULL NULL 1
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using where
|
||||
2 DERIVED t2 system NULL NULL NULL NULL 1
|
||||
2 DERIVED t1 index NULL index_td_familyid_id 772 NULL 2 Using index
|
||||
SELECT * FROM t2 x,
|
||||
(SELECT t2.useraccessfamily, t2.serialized AS picturesubuser, COUNT(*)
|
||||
FROM t2, t1 GROUP BY t2.useraccessfamily, picturesubuser) y
|
||||
WHERE x.useraccessfamily = y.useraccessfamily;
|
||||
id activefromts shortdescription useraccessfamily serialized useraccessfamily picturesubuser COUNT(*)
|
||||
38 2013-03-04 07:49:22 desc CODE string CODE string 2
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
# Bug#13261277: Unchecked key length caused missing records.
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
col_varchar varchar(1024) CHARACTER SET utf8 DEFAULT NULL,
|
||||
stub1 varchar(1024) CHARACTER SET utf8 DEFAULT NULL,
|
||||
stub2 varchar(1024) CHARACTER SET utf8 DEFAULT NULL,
|
||||
stub3 varchar(1024) CHARACTER SET utf8 DEFAULT NULL
|
||||
);
|
||||
INSERT INTO t1 VALUES
|
||||
('d','d','l','ther'),
|
||||
(NULL,'s','NJBIQ','trzetuchv'),
|
||||
(-715390976,'coul','MYWFB','cfhtrzetu'),
|
||||
(1696792576,'f','i\'s','c'),
|
||||
(1,'i','ltpemcfhtr','gsltpemcf'),
|
||||
(-663027712,'mgsltpemcf','sa','amgsltpem'),
|
||||
(-1686700032,'JPRVK','i','vamgsltpe'),
|
||||
(NULL,'STUNB','UNVJV','u'),
|
||||
(5,'oka','qyihvamgsl','AXSMD'),
|
||||
(NULL,'tqwmqyihva','h','yntqwmqyi'),
|
||||
(3,'EGMJN','e','e');
|
||||
CREATE TABLE t2 (
|
||||
col_varchar varchar(10) DEFAULT NULL,
|
||||
col_int INT DEFAULT NULL
|
||||
);
|
||||
INSERT INTO t2 VALUES ('d',9);
|
||||
set optimizer_switch='derived_merge=off,derived_with_keys=on';
|
||||
SET @save_heap_size= @@max_heap_table_size;
|
||||
SET @@max_heap_table_size= 16384;
|
||||
SELECT t2.col_int
|
||||
FROM t2
|
||||
RIGHT JOIN ( SELECT * FROM t1 ) AS dt
|
||||
ON t2.col_varchar = dt.col_varchar
|
||||
WHERE t2.col_int IS NOT NULL ;
|
||||
col_int
|
||||
9
|
||||
# Shouldn't use auto_key0 for derived table
|
||||
EXPLAIN
|
||||
SELECT t2.col_int
|
||||
FROM t2
|
||||
RIGHT JOIN ( SELECT * FROM t1 ) AS dt
|
||||
ON t2.col_varchar = dt.col_varchar
|
||||
WHERE t2.col_int IS NOT NULL ;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t2 system NULL NULL NULL NULL 1
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 11 Using where
|
||||
2 DERIVED t1 ALL NULL NULL NULL NULL 11
|
||||
SET @@max_heap_table_size= @save_heap_size;
|
||||
SET optimizer_switch=@save_optimizer_switch;
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
# end of 5.3 tests
|
||||
#
|
||||
set optimizer_switch=@exit_optimizer_switch;
|
||||
|
@ -1,6 +1,8 @@
|
||||
drop table if exists t1;
|
||||
flush status;
|
||||
show status like "feature%";
|
||||
Variable_name Value
|
||||
Feature_delay_key_write 0
|
||||
Feature_dynamic_columns 0
|
||||
Feature_fulltext 0
|
||||
Feature_gis 0
|
||||
@ -138,3 +140,17 @@ upd1
|
||||
show status like "feature_xml";
|
||||
Variable_name Value
|
||||
Feature_xml 2
|
||||
#
|
||||
# Feature delayed_keys
|
||||
#
|
||||
create table t1 (a int, key(a)) engine=myisam delay_key_write=1;
|
||||
insert into t1 values(1);
|
||||
insert into t1 values(2);
|
||||
drop table t1;
|
||||
create table t1 (a int, key(a)) engine=aria delay_key_write=1;
|
||||
insert into t1 values(1);
|
||||
insert into t1 values(2);
|
||||
drop table t1;
|
||||
show status like "feature_delay_key_write";
|
||||
Variable_name Value
|
||||
Feature_delay_key_write 2
|
||||
|
@ -1,7 +1,7 @@
|
||||
FLUSH TABLES WITH READ LOCK AND DISABLE CHECKPOINT;
|
||||
UNLOCK TABLES;
|
||||
CREATE TABLE t1 ( m MEDIUMTEXT ) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES ( REPEAT('i',1048576) );
|
||||
INSERT INTO t1 VALUES ( REPEAT('i',65535) );
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
|
@ -1,4 +1,4 @@
|
||||
drop table if exists t1,t2;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6;
|
||||
set @sav_dpi= @@div_precision_increment;
|
||||
set div_precision_increment= 5;
|
||||
show variables like 'div_precision_increment';
|
||||
@ -2239,3 +2239,34 @@ explain select MIN(b) from t1 where b >= inet_aton('192.168.119.32');
|
||||
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
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-6743 crash in GROUP_CONCAT(IF () ORDER BY 1)
|
||||
#
|
||||
CREATE TABLE t1 (pk INT, t2_id INT, t5_id INT, PRIMARY KEY (pk));
|
||||
INSERT INTO t1 VALUES (1,3,12),(2,3,15);
|
||||
CREATE TABLE t2 (pk INT, PRIMARY KEY (pk));
|
||||
INSERT INTO t2 VALUES (4),(5);
|
||||
CREATE TABLE t3 (t2_id INT, t4_id INT);
|
||||
INSERT INTO t3 VALUES (6,11),(7,12);
|
||||
CREATE TABLE t4 (id INT);
|
||||
INSERT INTO t4 VALUES (13),(14);
|
||||
CREATE TABLE t5 (pk INT, f VARCHAR(50), t6_id INT, PRIMARY KEY (pk));
|
||||
INSERT INTO t5 VALUES (9,'FOO',NULL);
|
||||
CREATE TABLE t6 (pk INT, f VARCHAR(120), b TINYINT(4), PRIMARY KEY (pk));
|
||||
PREPARE stmt FROM "
|
||||
SELECT t1.t2_id, GROUP_CONCAT(IF (t6.b, t6.f, t5.f) ORDER BY 1)
|
||||
FROM t1
|
||||
JOIN t2 ON t1.t2_id = t2.pk
|
||||
JOIN t3 ON t2.pk = t3.t2_id
|
||||
JOIN t4 ON t4.id = t3.t4_id
|
||||
JOIN t5 ON t1.t5_id = t5.pk
|
||||
LEFT JOIN t6 ON t6.pk = t5.t6_id
|
||||
GROUP BY t1.t2_id
|
||||
";
|
||||
EXECUTE stmt;
|
||||
t2_id GROUP_CONCAT(IF (t6.b, t6.f, t5.f) ORDER BY 1)
|
||||
EXECUTE stmt;
|
||||
t2_id GROUP_CONCAT(IF (t6.b, t6.f, t5.f) ORDER BY 1)
|
||||
EXECUTE stmt;
|
||||
t2_id GROUP_CONCAT(IF (t6.b, t6.f, t5.f) ORDER BY 1)
|
||||
DROP TABLE t1,t2,t3,t4,t5,t6;
|
||||
|
@ -845,7 +845,7 @@ explain extended select concat('*',space(5),'*');
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select concat('*',repeat(' ',5),'*') AS `concat('*',space(5),'*')`
|
||||
Note 1003 select concat('*',space(5),'*') AS `concat('*',space(5),'*')`
|
||||
explain extended select reverse('abc');
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
@ -2083,7 +2083,7 @@ select space(4294967295);
|
||||
space(4294967295)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
|
||||
Warning 1301 Result of space() was larger than max_allowed_packet (1048576) - truncated
|
||||
select space(-4294967296);
|
||||
space(-4294967296)
|
||||
|
||||
@ -2091,7 +2091,7 @@ select space(4294967296);
|
||||
space(4294967296)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
|
||||
Warning 1301 Result of space() was larger than max_allowed_packet (1048576) - truncated
|
||||
select space(-4294967297);
|
||||
space(-4294967297)
|
||||
|
||||
@ -2099,7 +2099,7 @@ select space(4294967297);
|
||||
space(4294967297)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
|
||||
Warning 1301 Result of space() was larger than max_allowed_packet (1048576) - truncated
|
||||
select space(-18446744073709551615);
|
||||
space(-18446744073709551615)
|
||||
|
||||
@ -2110,7 +2110,7 @@ select space(18446744073709551615);
|
||||
space(18446744073709551615)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
|
||||
Warning 1301 Result of space() was larger than max_allowed_packet (1048576) - truncated
|
||||
select space(-18446744073709551616);
|
||||
space(-18446744073709551616)
|
||||
|
||||
@ -2123,7 +2123,7 @@ NULL
|
||||
Warnings:
|
||||
Warning 1916 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
Warning 1916 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
|
||||
Warning 1301 Result of space() was larger than max_allowed_packet (1048576) - truncated
|
||||
select space(-18446744073709551617);
|
||||
space(-18446744073709551617)
|
||||
|
||||
@ -2136,7 +2136,7 @@ NULL
|
||||
Warnings:
|
||||
Warning 1916 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
Warning 1916 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
|
||||
Warning 1301 Result of space() was larger than max_allowed_packet (1048576) - truncated
|
||||
select rpad('hello', -1, '1');
|
||||
rpad('hello', -1, '1')
|
||||
NULL
|
||||
@ -2961,6 +2961,9 @@ replace(var, '00000000', table_name)
|
||||
(( t2 ++ t2 ))
|
||||
drop procedure foo;
|
||||
drop table t1,t2;
|
||||
select md5(_filename "a"), sha(_filename "a");
|
||||
md5(_filename "a") sha(_filename "a")
|
||||
0cc175b9c0f1b6a831c399e269772661 86f7e437faa5a7fce15d1ddcb9eaeaea377667b8
|
||||
#
|
||||
# End of 5.5 tests
|
||||
#
|
||||
@ -4510,3 +4513,20 @@ SELECT FROM_BASE64(TO_BASE64(dt1)) FROM t1;
|
||||
FROM_BASE64(TO_BASE64(dt1))
|
||||
2011-01-01 02:03:04
|
||||
DROP TABLE t1;
|
||||
SELECT SPACE(@@global.max_allowed_packet*2);
|
||||
SPACE(@@global.max_allowed_packet*2)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1301 Result of space() was larger than max_allowed_packet (1048576) - truncated
|
||||
SET NAMES latin1;
|
||||
PREPARE stmt FROM "SELECT COLLATION(space(2))";
|
||||
EXECUTE stmt;
|
||||
COLLATION(space(2))
|
||||
latin1_swedish_ci
|
||||
SET NAMES latin2;
|
||||
EXECUTE stmt;
|
||||
COLLATION(space(2))
|
||||
latin2_general_ci
|
||||
#
|
||||
# End of 5.6 tests
|
||||
#
|
||||
|
@ -2023,10 +2023,72 @@ SEC_TO_TIME(1.12)+0.1 decimal(14,2) YES NULL
|
||||
SEC_TO_TIME(1.123456)+0.1 decimal(18,6) YES NULL
|
||||
SEC_TO_TIME(1.1234567)+0.1 decimal(18,6) YES NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a DATE) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES ('2005-05-04'),('2000-02-23');
|
||||
SELECT * FROM t1 GROUP BY FROM_UNIXTIME(concat(a,'10'))*1;
|
||||
a
|
||||
2000-02-23
|
||||
2005-05-04
|
||||
SELECT * FROM t1 GROUP BY (-FROM_UNIXTIME(concat(a,'10')))*1;
|
||||
a
|
||||
2005-05-04
|
||||
2000-02-23
|
||||
SELECT * FROM t1 GROUP BY (-FROM_UNIXTIME(concat(a,'10')));
|
||||
a
|
||||
2005-05-04
|
||||
2000-02-23
|
||||
SELECT * FROM t1 GROUP BY ABS(FROM_UNIXTIME(concat(a,'10')));
|
||||
a
|
||||
2000-02-23
|
||||
2005-05-04
|
||||
SELECT * FROM t1 GROUP BY @a:=(FROM_UNIXTIME(concat(a,'10'))*1);
|
||||
a
|
||||
2000-02-23
|
||||
2005-05-04
|
||||
DROP TABLE t1;
|
||||
SET TIME_ZONE='+02:00';
|
||||
#
|
||||
# MDEV-6302 Wrong result set when using GROUP BY FROM_UNIXTIME(...)+0
|
||||
#
|
||||
CREATE TABLE t1 (a DATE);
|
||||
INSERT INTO t1 VALUES ('2005-05-04'),('2000-02-23');
|
||||
SELECT a, FROM_UNIXTIME(CONCAT(a,'10')) AS f1, FROM_UNIXTIME(CONCAT(a,'10'))+0 AS f2 FROM t1;
|
||||
a f1 f2
|
||||
2005-05-04 1970-01-01 02:33:25 19700101023325.000000
|
||||
2000-02-23 1970-01-01 02:33:20 19700101023320.000000
|
||||
SELECT * FROM t1 GROUP BY FROM_UNIXTIME(CONCAT(a,'10'))+0;
|
||||
a
|
||||
2000-02-23
|
||||
2005-05-04
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a DATE) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES ('2005-05-04'),('2000-02-23');
|
||||
SELECT * FROM t1 GROUP BY FROM_UNIXTIME(concat(a,'10'))/1;
|
||||
a
|
||||
2000-02-23
|
||||
2005-05-04
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a DATE);
|
||||
INSERT INTO t1 VALUES ('2005-05-04');
|
||||
SELECT CONCAT(FROM_UNIXTIME(CONCAT(a,'10')) MOD FROM_UNIXTIME(CONCAT(a,'10'))) AS f2 FROM t1;
|
||||
f2
|
||||
0.000000
|
||||
SELECT CHAR_LENGTH(CONCAT(FROM_UNIXTIME(CONCAT(a,'10')) MOD FROM_UNIXTIME(CONCAT(a,'10')))) AS f2 FROM t1;
|
||||
f2
|
||||
8
|
||||
CREATE TABLE t2 AS SELECT CONCAT(FROM_UNIXTIME(CONCAT(a,'10')) MOD FROM_UNIXTIME(CONCAT(a,'10'))) AS f2 FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`f2` varchar(26) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SELECT * FROM t2;
|
||||
f2
|
||||
0.000000
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
# MDEV-4635 Crash in UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'))
|
||||
#
|
||||
SET TIME_ZONE='+02:00';
|
||||
SELECT UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'));
|
||||
UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'))
|
||||
NULL
|
||||
@ -2600,3 +2662,18 @@ SELECT COALESCE(TIME'10:20:30',DATE'2001-01-01');
|
||||
COALESCE(TIME'10:20:30',DATE'2001-01-01')
|
||||
2014-04-15 10:20:30
|
||||
SET timestamp=DEFAULT;
|
||||
#
|
||||
# MDEV-5750 Assertion `ltime->year == 0' fails on a query with EXTRACT DAY_MINUTE and TIME column
|
||||
#
|
||||
CREATE TABLE t1 ( d DATE, t TIME );
|
||||
INSERT INTO t1 VALUES ('2008-12-05','22:34:09'),('2005-03-27','14:26:02');
|
||||
SELECT EXTRACT(DAY_MINUTE FROM GREATEST(t,d)), GREATEST(t,d) FROM t1;
|
||||
EXTRACT(DAY_MINUTE FROM GREATEST(t,d)) GREATEST(t,d)
|
||||
342259 838:59:59
|
||||
342259 838:59:59
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '9336:00:00'
|
||||
Warning 1292 Truncated incorrect time value: '9336:00:00'
|
||||
Warning 1292 Truncated incorrect time value: '2952:00:00'
|
||||
Warning 1292 Truncated incorrect time value: '2952:00:00'
|
||||
DROP TABLE t1;
|
||||
|
294
mysql-test/r/gis-debug.result
Normal file
294
mysql-test/r/gis-debug.result
Normal file
@ -0,0 +1,294 @@
|
||||
SET @tmp=ST_GIS_DEBUG(1);
|
||||
DROP TABLE IF EXISTS p1;
|
||||
CREATE PROCEDURE p1(dist DOUBLE, geom TEXT)
|
||||
BEGIN
|
||||
DECLARE g GEOMETRY;
|
||||
SET g=GeomFromText(geom);
|
||||
SELECT geom AS `-----`;
|
||||
SELECT dist, GeometryType(@buf:=ST_Buffer(g, dist)) AS `buffer`, ROUND(ST_AREA(@buf),2) AS buf_area;
|
||||
END|
|
||||
#
|
||||
# Testing ST_BUFFER with positive distance
|
||||
#
|
||||
-----
|
||||
POINT(0 0))
|
||||
dist buffer buf_area
|
||||
1 POLYGON 3.14
|
||||
-----
|
||||
LineString(0 1, 1 1))
|
||||
dist buffer buf_area
|
||||
1 POLYGON 5.14
|
||||
-----
|
||||
LineString(9 9,8 1,1 5,0 0)
|
||||
dist buffer buf_area
|
||||
1 POLYGON 44.63
|
||||
-----
|
||||
Polygon((2 2,2 8,8 8,8 2,2 2))
|
||||
dist buffer buf_area
|
||||
1 POLYGON 63.14
|
||||
-----
|
||||
Polygon((0 0,0 8,8 8,8 0,0 0),(2 2,6 2,6 6,2 6,2 2))
|
||||
dist buffer buf_area
|
||||
1 POLYGON 95.14
|
||||
-----
|
||||
Polygon((0 0, 0 8, 8 8, 8 10, -10 10, -10 0, 0 0))
|
||||
dist buffer buf_area
|
||||
1 POLYGON 174.93
|
||||
-----
|
||||
MultiPoint(9 9,8 1,1 5)
|
||||
dist buffer buf_area
|
||||
1 MULTIPOLYGON 9.42
|
||||
-----
|
||||
MultiLineString((0 0,2 2))
|
||||
dist buffer buf_area
|
||||
1 POLYGON 8.80
|
||||
-----
|
||||
MultiLineString((0 0,2 2,0 4))
|
||||
dist buffer buf_area
|
||||
1 POLYGON 14.24
|
||||
-----
|
||||
MultiLineString((0 0,2 2),(0 2,2 0))
|
||||
dist buffer buf_area
|
||||
1 POLYGON 13.59
|
||||
-----
|
||||
MultiLineString((2 2,2 8,-2 8),(-6 -6, 6 6),(10 10, 14 14))
|
||||
dist buffer buf_area
|
||||
1 MULTIPOLYGON 70.06
|
||||
-----
|
||||
MultiPolygon(((2 2,2 8,8 8,8 2,2 2)), ((9 9,8 1,1 5,9 9)))
|
||||
dist buffer buf_area
|
||||
1 POLYGON 73.18
|
||||
-----
|
||||
MultiPolygon(((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)),((9 9,8 1,1 5,9 9)))
|
||||
dist buffer buf_area
|
||||
1 POLYGON 73.18
|
||||
-----
|
||||
GeometryCollection(Point(0 0))
|
||||
dist buffer buf_area
|
||||
1 POLYGON 3.14
|
||||
-----
|
||||
GeometryCollection(LineString(0 0, 2 2)))
|
||||
dist buffer buf_area
|
||||
1 POLYGON 8.80
|
||||
-----
|
||||
GeometryCollection(Polygon((2 2,2 8,8 8,8 2,2 2))))
|
||||
dist buffer buf_area
|
||||
1 POLYGON 63.14
|
||||
-----
|
||||
GeometryCollection(MultiPoint(9 9,8 1,1 5))
|
||||
dist buffer buf_area
|
||||
1 MULTIPOLYGON 9.42
|
||||
-----
|
||||
GeometryCollection(MultiLineString((0 0,0 1),(3 0,3 1)))
|
||||
dist buffer buf_area
|
||||
1 MULTIPOLYGON 10.28
|
||||
-----
|
||||
GeometryCollection(MultiPolygon(((0 0, 3 0, 3 3, 0 3, 0 0)),((6 6,6 9,9 9,9 6,6 6))))
|
||||
dist buffer buf_area
|
||||
1 MULTIPOLYGON 48.28
|
||||
-----
|
||||
GeometryCollection(Point(9 9),LineString(1 5,0 0),Polygon((2 2,2 8,8 8,8 2,2 2)))
|
||||
dist buffer buf_area
|
||||
1 POLYGON 75.92
|
||||
#
|
||||
# Testing ST_BUFFER with zero distance
|
||||
#
|
||||
-----
|
||||
POINT(0 0))
|
||||
dist buffer buf_area
|
||||
0 POINT 0.00
|
||||
-----
|
||||
LineString(0 1, 1 1))
|
||||
dist buffer buf_area
|
||||
0 LINESTRING 0.00
|
||||
-----
|
||||
LineString(9 9,8 1,1 5,0 0)
|
||||
dist buffer buf_area
|
||||
0 LINESTRING 0.00
|
||||
-----
|
||||
Polygon((2 2,2 8,8 8,8 2,2 2))
|
||||
dist buffer buf_area
|
||||
0 POLYGON 36.00
|
||||
-----
|
||||
Polygon((0 0,0 8,8 8,8 0,0 0),(2 2,6 2,6 6,2 6,2 2))
|
||||
dist buffer buf_area
|
||||
0 POLYGON 48.00
|
||||
-----
|
||||
Polygon((0 0, 0 8, 8 8, 8 10, -10 10, -10 0, 0 0))
|
||||
dist buffer buf_area
|
||||
0 POLYGON 116.00
|
||||
-----
|
||||
MultiPoint(9 9,8 1,1 5)
|
||||
dist buffer buf_area
|
||||
0 MULTIPOINT NULL
|
||||
-----
|
||||
MultiLineString((0 0,2 2))
|
||||
dist buffer buf_area
|
||||
0 MULTILINESTRING NULL
|
||||
-----
|
||||
MultiLineString((0 0,2 2,0 4))
|
||||
dist buffer buf_area
|
||||
0 MULTILINESTRING NULL
|
||||
-----
|
||||
MultiLineString((0 0,2 2),(0 2,2 0))
|
||||
dist buffer buf_area
|
||||
0 MULTILINESTRING NULL
|
||||
-----
|
||||
MultiLineString((2 2,2 8,-2 8),(-6 -6, 6 6),(10 10, 14 14))
|
||||
dist buffer buf_area
|
||||
0 MULTILINESTRING NULL
|
||||
-----
|
||||
MultiPolygon(((2 2,2 8,8 8,8 2,2 2)), ((9 9,8 1,1 5,9 9)))
|
||||
dist buffer buf_area
|
||||
0 MULTIPOLYGON 66.00
|
||||
-----
|
||||
MultiPolygon(((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)),((9 9,8 1,1 5,9 9)))
|
||||
dist buffer buf_area
|
||||
0 MULTIPOLYGON 62.00
|
||||
-----
|
||||
GeometryCollection(Point(0 0))
|
||||
dist buffer buf_area
|
||||
0 GEOMETRYCOLLECTION 0.00
|
||||
-----
|
||||
GeometryCollection(LineString(0 0, 2 2)))
|
||||
dist buffer buf_area
|
||||
0 GEOMETRYCOLLECTION 0.00
|
||||
-----
|
||||
GeometryCollection(Polygon((2 2,2 8,8 8,8 2,2 2))))
|
||||
dist buffer buf_area
|
||||
0 GEOMETRYCOLLECTION 36.00
|
||||
-----
|
||||
GeometryCollection(MultiPoint(9 9,8 1,1 5))
|
||||
dist buffer buf_area
|
||||
0 GEOMETRYCOLLECTION NULL
|
||||
-----
|
||||
GeometryCollection(MultiLineString((0 0,0 1),(3 0,3 1)))
|
||||
dist buffer buf_area
|
||||
0 GEOMETRYCOLLECTION NULL
|
||||
-----
|
||||
GeometryCollection(MultiPolygon(((0 0, 3 0, 3 3, 0 3, 0 0)),((6 6,6 9,9 9,9 6,6 6))))
|
||||
dist buffer buf_area
|
||||
0 GEOMETRYCOLLECTION 18.00
|
||||
-----
|
||||
GeometryCollection(Point(9 9),LineString(1 5,0 0),Polygon((2 2,2 8,8 8,8 2,2 2)))
|
||||
dist buffer buf_area
|
||||
0 GEOMETRYCOLLECTION 36.00
|
||||
#
|
||||
# Testing ST_BUFFER with negative distance
|
||||
#
|
||||
-----
|
||||
POINT(0 0))
|
||||
dist buffer buf_area
|
||||
-1 GEOMETRYCOLLECTION 0.00
|
||||
-----
|
||||
LineString(0 1, 1 1))
|
||||
dist buffer buf_area
|
||||
-1 GEOMETRYCOLLECTION 0.00
|
||||
-----
|
||||
LineString(9 9,8 1,1 5,0 0)
|
||||
dist buffer buf_area
|
||||
-1 GEOMETRYCOLLECTION 0.00
|
||||
-----
|
||||
Polygon((2 2,2 8,8 8,8 2,2 2))
|
||||
dist buffer buf_area
|
||||
-1 POLYGON 16.00
|
||||
-----
|
||||
MultiPoint(9 9,8 1,1 5)
|
||||
dist buffer buf_area
|
||||
-1 GEOMETRYCOLLECTION 0.00
|
||||
-----
|
||||
MultiLineString((0 0,2 2))
|
||||
dist buffer buf_area
|
||||
-1 GEOMETRYCOLLECTION 0.00
|
||||
-----
|
||||
MultiLineString((0 0,2 2,0 4))
|
||||
dist buffer buf_area
|
||||
-1 GEOMETRYCOLLECTION 0.00
|
||||
-----
|
||||
MultiLineString((0 0,2 2),(0 2,2 0))
|
||||
dist buffer buf_area
|
||||
-1 GEOMETRYCOLLECTION 0.00
|
||||
-----
|
||||
MultiLineString((2 2,2 8,-2 8),(-6 -6, 6 6),(10 10, 14 14))
|
||||
dist buffer buf_area
|
||||
-1 GEOMETRYCOLLECTION 0.00
|
||||
-----
|
||||
GeometryCollection(Point(0 0))
|
||||
dist buffer buf_area
|
||||
-1 GEOMETRYCOLLECTION 0.00
|
||||
-----
|
||||
GeometryCollection(LineString(0 0, 2 2)))
|
||||
dist buffer buf_area
|
||||
-1 GEOMETRYCOLLECTION 0.00
|
||||
-----
|
||||
GeometryCollection(Polygon((2 2,2 8,8 8,8 2,2 2))))
|
||||
dist buffer buf_area
|
||||
-1 POLYGON 16.00
|
||||
-----
|
||||
GeometryCollection(MultiPoint(9 9,8 1,1 5))
|
||||
dist buffer buf_area
|
||||
-1 GEOMETRYCOLLECTION 0.00
|
||||
-----
|
||||
GeometryCollection(MultiLineString((0 0,0 1),(3 0,3 1)))
|
||||
dist buffer buf_area
|
||||
-1 GEOMETRYCOLLECTION 0.00
|
||||
-----
|
||||
GeometryCollection(Point(9 9),LineString(1 5,0 0),Polygon((2 2,2 8,8 8,8 2,2 2)))
|
||||
dist buffer buf_area
|
||||
-1 POLYGON 16.00
|
||||
SELECT ST_CONTAINS(
|
||||
GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((6 6, 6 11, 11 11, 11 6, 6 6)))'),
|
||||
GeomFromText('POINT(5 10)'));
|
||||
ST_CONTAINS(
|
||||
GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((6 6, 6 11, 11 11, 11 6, 6 6)))'),
|
||||
GeomFromText('POINT(5 10)'))
|
||||
0
|
||||
SELECT AsText(ST_UNION(
|
||||
GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((6 6, 6 11, 11 11, 11 6, 6 6)))'),
|
||||
GeomFromText('POINT(5 10)')));
|
||||
AsText(ST_UNION(
|
||||
GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((6 6, 6 11, 11 11, 11 6, 6 6)))'),
|
||||
GeomFromText('POINT(5 10)')))
|
||||
GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)),POLYGON((6 6,6 11,11 11,11 6,6 6)),POINT(5 10))
|
||||
DROP PROCEDURE p1;
|
||||
#
|
||||
# Bug #13833019 ASSERTION `T1->RESULT_RANGE' FAILED IN GCALC_OPERATION_REDUCER::END_COUPLE
|
||||
#
|
||||
SELECT GeometryType(ST_BUFFER(MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((0 0,9 4,3 3,0 0)),((2 2,2 2,8 8,2 3,2 2)))'), 3));
|
||||
GeometryType(ST_BUFFER(MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((0 0,9 4,3 3,0 0)),((2 2,2 2,8 8,2 3,2 2)))'), 3))
|
||||
POLYGON
|
||||
#
|
||||
# Bug #13832749 HANDLE_FATAL_SIGNAL IN GCALC_FUNCTION::COUNT_INTERNAL
|
||||
#
|
||||
SELECT GeometryType(ST_BUFFER(MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5)),((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)), ((9 9,8 1,1 5,9 9)))'),1));
|
||||
GeometryType(ST_BUFFER(MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5)),((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)), ((9 9,8 1,1 5,9 9)))'),1))
|
||||
POLYGON
|
||||
#
|
||||
# Bug#13358363 - ASSERTION: N > 0 && N < SINUSES_CALCULATED*2+1 | GET_N_SINCOS/ADD_EDGE_BUFFER
|
||||
#
|
||||
DO ST_BUFFER(ST_GEOMCOLLFROMTEXT('linestring(1 1,2 2)'),'');
|
||||
SELECT ST_WITHIN(
|
||||
LINESTRINGFROMTEXT(' LINESTRING(3 8,9 2,3 8,3 3,7 6,4 7,4 7,8 1) '),
|
||||
ST_BUFFER(MULTIPOLYGONFROMTEXT(' MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5)),((2 2,2 8,8 8,8 2,2 2),(4 4,4 6,6 6,6 4,4 4)),((0 5,3 5,3 2,1 2,1 1,3 1,3 0,0 0,0 3,2 3,2 4,0 4,0 5))) '),
|
||||
ST_NUMINTERIORRINGS(POLYGONFROMTEXT('POLYGON((3 5,2 4,2 5,3 5)) '))));
|
||||
ST_WITHIN(
|
||||
LINESTRINGFROMTEXT(' LINESTRING(3 8,9 2,3 8,3 3,7 6,4 7,4 7,8 1) '),
|
||||
ST_BUFFER(MULTIPOLYGONFROMTEXT(' MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5)),((2 2,2 8,8 8,8 2,2 2),(4 4,4 6,6 6,6 4,4 4)),((0 5,3 5,3 2,1 2,1 1,3 1,3 0,0 0,0 3,2 3,2 4,0 4,0 5))) ')
|
||||
0
|
||||
SELECT ST_DIMENSION(ST_BUFFER(POLYGONFROMTEXT(' POLYGON((3 5,2 5,2 4,3 4,3 5)) '),
|
||||
ST_NUMINTERIORRINGS(POLYGONFROMTEXT(' POLYGON((0 0,9 3,4 2,0 0))'))));
|
||||
ST_DIMENSION(ST_BUFFER(POLYGONFROMTEXT(' POLYGON((3 5,2 5,2 4,3 4,3 5)) '),
|
||||
ST_NUMINTERIORRINGS(POLYGONFROMTEXT(' POLYGON((0 0,9 3,4 2,0 0))'))))
|
||||
2
|
||||
SELECT ST_NUMINTERIORRINGS(
|
||||
ST_ENVELOPE(ST_BUFFER(MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5))) '),
|
||||
SRID(MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 2,4 2,1 2,2 4,2 2)) ')))));
|
||||
ST_NUMINTERIORRINGS(
|
||||
ST_ENVELOPE(ST_BUFFER(MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5))) '),
|
||||
SRID(MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 2,4 2,1 2,2 4,2 2)) ')))))
|
||||
0
|
||||
SELECT ASTEXT(ST_BUFFER(POLYGONFROMTEXT(' POLYGON((9 9,5 2,4 5,9 9))'),
|
||||
SRID(GEOMETRYFROMTEXT(' MULTIPOINT(8 4,5 0,7 8,6 9,3 4,7 3,5 5) '))));
|
||||
ASTEXT(ST_BUFFER(POLYGONFROMTEXT(' POLYGON((9 9,5 2,4 5,9 9))'),
|
||||
SRID(GEOMETRYFROMTEXT(' MULTIPOINT(8 4,5 0,7 8,6 9,3 4,7 3,5 5) '))))
|
||||
POLYGON((9 9,5 2,4 5,9 9))
|
File diff suppressed because one or more lines are too long
@ -834,6 +834,17 @@ create table t1 (g geometry not null);
|
||||
insert into t1 values(default);
|
||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a GEOMETRY);
|
||||
CREATE VIEW v1 AS SELECT GeomFromwkb(ASBINARY(a)) FROM t1;
|
||||
CREATE VIEW v2 AS SELECT a FROM t1;
|
||||
DESCRIBE v1;
|
||||
Field Type Null Key Default Extra
|
||||
GeomFromwkb(ASBINARY(a)) geometry YES NULL
|
||||
DESCRIBE v2;
|
||||
Field Type Null Key Default Extra
|
||||
a geometry YES NULL
|
||||
DROP VIEW v1,v2;
|
||||
DROP TABLE t1;
|
||||
create table t1 (name VARCHAR(100), square GEOMETRY);
|
||||
INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
|
||||
INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
|
||||
|
2
mysql-test/r/grant5.result
Normal file
2
mysql-test/r/grant5.result
Normal file
@ -0,0 +1,2 @@
|
||||
SHOW GRANTS FOR root@invalid_host;
|
||||
ERROR 42000: There is no such grant defined for user 'root' on host 'invalid_host'
|
@ -3536,7 +3536,7 @@ COUNT(DISTINCT a, b) SUM(DISTINCT a)
|
||||
0 NULL
|
||||
EXPLAIN SELECT SUM(DISTINCT a), MAX(b) FROM t2 GROUP BY a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL a 5 NULL 9 Using index for group-by
|
||||
1 SIMPLE t2 index NULL a 15 NULL 16 Using index
|
||||
SELECT SUM(DISTINCT a), MAX(b) FROM t2 GROUP BY a;
|
||||
SUM(DISTINCT a) MAX(b)
|
||||
1 8
|
||||
@ -3564,7 +3564,7 @@ SELECT 42 * (a + c + COUNT(DISTINCT c, a, b)) FROM t2 GROUP BY a, b, c;
|
||||
168
|
||||
EXPLAIN SELECT (SUM(DISTINCT a) + MAX(b)) FROM t2 GROUP BY a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL a 5 NULL 9 Using index for group-by
|
||||
1 SIMPLE t2 index NULL a 15 NULL 16 Using index
|
||||
SELECT (SUM(DISTINCT a) + MAX(b)) FROM t2 GROUP BY a;
|
||||
(SUM(DISTINCT a) + MAX(b))
|
||||
9
|
||||
@ -3593,6 +3593,58 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
drop table t1;
|
||||
# End of test#50539.
|
||||
#
|
||||
# Bug#17217128 - BAD INTERACTION BETWEEN MIN/MAX AND
|
||||
# "HAVING SUM(DISTINCT)": WRONG RESULTS.
|
||||
#
|
||||
CREATE TABLE t (a INT, b INT, KEY(a,b));
|
||||
INSERT INTO t VALUES (1,1), (2,2), (3,3), (4,4), (1,0), (3,2), (4,5);
|
||||
ANALYZE TABLE t;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t analyze status OK
|
||||
SELECT a, SUM(DISTINCT a), MIN(b) FROM t GROUP BY a;
|
||||
a SUM(DISTINCT a) MIN(b)
|
||||
1 1 0
|
||||
2 2 2
|
||||
3 3 2
|
||||
4 4 4
|
||||
EXPLAIN SELECT a, SUM(DISTINCT a), MIN(b) FROM t GROUP BY a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t index NULL a 10 NULL 7 Using index
|
||||
SELECT a, SUM(DISTINCT a), MAX(b) FROM t GROUP BY a;
|
||||
a SUM(DISTINCT a) MAX(b)
|
||||
1 1 1
|
||||
2 2 2
|
||||
3 3 3
|
||||
4 4 5
|
||||
EXPLAIN SELECT a, SUM(DISTINCT a), MAX(b) FROM t GROUP BY a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t index NULL a 10 NULL 7 Using index
|
||||
SELECT a, MAX(b) FROM t GROUP BY a HAVING SUM(DISTINCT a);
|
||||
a MAX(b)
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
||||
4 5
|
||||
EXPLAIN SELECT a, MAX(b) FROM t GROUP BY a HAVING SUM(DISTINCT a);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t index NULL a 10 NULL 7 Using index
|
||||
SELECT SUM(DISTINCT a), MIN(b), MAX(b) FROM t;
|
||||
SUM(DISTINCT a) MIN(b) MAX(b)
|
||||
10 0 5
|
||||
EXPLAIN SELECT SUM(DISTINCT a), MIN(b), MAX(b) FROM t;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t index NULL a 10 NULL 7 Using index
|
||||
SELECT a, SUM(DISTINCT a), MIN(b), MAX(b) FROM t GROUP BY a;
|
||||
a SUM(DISTINCT a) MIN(b) MAX(b)
|
||||
1 1 0 1
|
||||
2 2 2 2
|
||||
3 3 2 3
|
||||
4 4 4 5
|
||||
EXPLAIN SELECT a, SUM(DISTINCT a), MIN(b), MAX(b) FROM t GROUP BY a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t index NULL a 10 NULL 7 Using index
|
||||
DROP TABLE t;
|
||||
#
|
||||
# MDEV-4219 A simple select query returns random data (upstream bug#68473)
|
||||
#
|
||||
drop table if exists faulty;
|
||||
|
@ -118,3 +118,171 @@ COUNT(DISTINCT a)
|
||||
1
|
||||
DROP TABLE t1;
|
||||
End of 5.5 tests
|
||||
#
|
||||
# Bug#17909656 - WRONG RESULTS FOR A SIMPLE QUERY WITH GROUP BY
|
||||
#
|
||||
CREATE TABLE t0 (
|
||||
i1 INTEGER NOT NULL
|
||||
);
|
||||
INSERT INTO t0 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),
|
||||
(11),(12),(13),(14),(15),(16),(17),(18),(19),(20),
|
||||
(21),(22),(23),(24),(25),(26),(27),(28),(29),(30);
|
||||
CREATE TABLE t1 (
|
||||
c1 CHAR(1) NOT NULL,
|
||||
i1 INTEGER NOT NULL,
|
||||
i2 INTEGER NOT NULL,
|
||||
UNIQUE KEY k1 (c1,i2)
|
||||
) ENGINE=InnoDB;
|
||||
INSERT INTO t1 SELECT 'A',i1,i1 FROM t0;
|
||||
INSERT INTO t1 SELECT 'B',i1,i1 FROM t0;
|
||||
INSERT INTO t1 SELECT 'C',i1,i1 FROM t0;
|
||||
INSERT INTO t1 SELECT 'D',i1,i1 FROM t0;
|
||||
INSERT INTO t1 SELECT 'E',i1,i1 FROM t0;
|
||||
INSERT INTO t1 SELECT 'F',i1,i1 FROM t0;
|
||||
CREATE TABLE t2 (
|
||||
c1 CHAR(1) NOT NULL,
|
||||
i1 INTEGER NOT NULL,
|
||||
i2 INTEGER NOT NULL,
|
||||
UNIQUE KEY k2 (c1,i1,i2)
|
||||
) ENGINE=InnoDB;
|
||||
INSERT INTO t2 SELECT 'A',i1,i1 FROM t0;
|
||||
INSERT INTO t2 SELECT 'B',i1,i1 FROM t0;
|
||||
INSERT INTO t2 SELECT 'C',i1,i1 FROM t0;
|
||||
INSERT INTO t2 SELECT 'D',i1,i1 FROM t0;
|
||||
INSERT INTO t2 SELECT 'E',i1,i1 FROM t0;
|
||||
INSERT INTO t2 SELECT 'F',i1,i1 FROM t0;
|
||||
ANALYZE TABLE t1;
|
||||
ANALYZE TABLE t2;
|
||||
EXPLAIN SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' AND i2 = 17) OR ( c1 = 'F')
|
||||
GROUP BY c1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range k1 k1 5 NULL 31 Using where; Using index
|
||||
SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' AND i2 = 17) OR ( c1 = 'F')
|
||||
GROUP BY c1;
|
||||
c1 max(i2)
|
||||
C 17
|
||||
F 30
|
||||
EXPLAIN SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR ( c1 = 'F' AND i2 = 17))
|
||||
GROUP BY c1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range k1 k1 5 NULL 31 Using where; Using index
|
||||
SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR ( c1 = 'F' AND i2 = 17))
|
||||
GROUP BY c1;
|
||||
c1 max(i2)
|
||||
C 30
|
||||
F 17
|
||||
EXPLAIN SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR c1 = 'F' ) AND ( i2 = 17 )
|
||||
GROUP BY c1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range k1 k1 5 NULL 2 Using where; Using index
|
||||
SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR c1 = 'F' ) AND ( i2 = 17 )
|
||||
GROUP BY c1;
|
||||
c1 max(i2)
|
||||
C 17
|
||||
F 17
|
||||
EXPLAIN SELECT c1, max(i2) FROM t1
|
||||
WHERE ((c1 = 'C' AND (i2 = 40 OR i2 = 30)) OR ( c1 = 'F' AND (i2 = 40 )))
|
||||
GROUP BY c1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range k1 k1 5 NULL 3 Using where; Using index
|
||||
SELECT c1, max(i2) FROM t1
|
||||
WHERE ((c1 = 'C' AND (i2 = 40 OR i2 = 30)) OR ( c1 = 'F' AND (i2 = 40 )))
|
||||
GROUP BY c1;
|
||||
c1 max(i2)
|
||||
C 30
|
||||
EXPLAIN SELECT c1, i1, max(i2) FROM t2
|
||||
WHERE (c1 = 'C' OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 )
|
||||
GROUP BY c1,i1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range k2 k2 5 NULL 59 Using where; Using index
|
||||
SELECT c1, i1, max(i2) FROM t2
|
||||
WHERE (c1 = 'C' OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 )
|
||||
GROUP BY c1,i1;
|
||||
c1 i1 max(i2)
|
||||
C 17 17
|
||||
F 17 17
|
||||
EXPLAIN SELECT c1, i1, max(i2) FROM t2
|
||||
WHERE (((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 ))
|
||||
GROUP BY c1,i1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range k2 k2 5 NULL 58 Using where; Using index
|
||||
SELECT c1, i1, max(i2) FROM t2
|
||||
WHERE (((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 ))
|
||||
GROUP BY c1,i1;
|
||||
c1 i1 max(i2)
|
||||
C 17 17
|
||||
F 17 17
|
||||
EXPLAIN SELECT c1, i1, max(i2) FROM t2
|
||||
WHERE ((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35) OR ( i2 = 17 ))
|
||||
GROUP BY c1,i1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 index k2 k2 9 NULL 180 Using where; Using index
|
||||
SELECT c1, i1, max(i2) FROM t2
|
||||
WHERE ((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35) OR ( i2 = 17 ))
|
||||
GROUP BY c1,i1;
|
||||
c1 i1 max(i2)
|
||||
A 17 17
|
||||
B 17 17
|
||||
C 1 1
|
||||
C 2 2
|
||||
C 3 3
|
||||
C 4 4
|
||||
C 5 5
|
||||
C 6 6
|
||||
C 7 7
|
||||
C 8 8
|
||||
C 9 9
|
||||
C 10 10
|
||||
C 11 11
|
||||
C 12 12
|
||||
C 13 13
|
||||
C 14 14
|
||||
C 15 15
|
||||
C 16 16
|
||||
C 17 17
|
||||
C 18 18
|
||||
C 19 19
|
||||
C 20 20
|
||||
C 21 21
|
||||
C 22 22
|
||||
C 23 23
|
||||
C 24 24
|
||||
C 25 25
|
||||
C 26 26
|
||||
C 27 27
|
||||
C 28 28
|
||||
C 29 29
|
||||
C 30 30
|
||||
D 17 17
|
||||
E 17 17
|
||||
F 1 1
|
||||
F 2 2
|
||||
F 3 3
|
||||
F 4 4
|
||||
F 5 5
|
||||
F 6 6
|
||||
F 7 7
|
||||
F 8 8
|
||||
F 9 9
|
||||
F 10 10
|
||||
F 11 11
|
||||
F 12 12
|
||||
F 13 13
|
||||
F 14 14
|
||||
F 15 15
|
||||
F 16 16
|
||||
F 17 17
|
||||
F 18 18
|
||||
F 19 19
|
||||
F 20 20
|
||||
F 21 21
|
||||
F 22 22
|
||||
F 23 23
|
||||
F 24 24
|
||||
F 25 25
|
||||
F 26 26
|
||||
F 27 27
|
||||
F 28 28
|
||||
F 29 29
|
||||
F 30 30
|
||||
DROP TABLE t0,t1,t2;
|
||||
|
@ -1,2 +0,0 @@
|
||||
have_mysql_upgrade
|
||||
1
|
1
mysql-test/r/huge_frm-6224.result
Normal file
1
mysql-test/r/huge_frm-6224.result
Normal file
@ -0,0 +1 @@
|
||||
ERROR HY000: The definition for table `t1` is too big
|
21
mysql-test/r/innodb_load_xa.result
Normal file
21
mysql-test/r/innodb_load_xa.result
Normal file
@ -0,0 +1,21 @@
|
||||
install plugin innodb soname 'ha_innodb';
|
||||
Warnings:
|
||||
Warning 1105 Cannot enable tc-log at run-time. XA features of InnoDB are disabled
|
||||
select engine,support,transactions,xa from information_schema.engines where engine='innodb';
|
||||
engine support transactions xa
|
||||
InnoDB YES YES NO
|
||||
create table t1 (a int) engine=innodb;
|
||||
start transaction;
|
||||
insert t1 values (1);
|
||||
insert t1 values (2);
|
||||
commit;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
mysqld-bin.000001 # Gtid # # GTID #-#-#
|
||||
mysqld-bin.000001 # Query # # use `test`; create table t1 (a int) engine=innodb
|
||||
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
||||
mysqld-bin.000001 # Query # # use `test`; insert t1 values (1)
|
||||
mysqld-bin.000001 # Query # # use `test`; insert t1 values (2)
|
||||
mysqld-bin.000001 # Query # # COMMIT
|
||||
drop table t1;
|
||||
uninstall plugin innodb;
|
@ -331,13 +331,14 @@ Success: 'update v2 set j= j-10 where j = 3' takes shared row locks on 't1'.
|
||||
# 4.1 SELECT/SET with a stored function which does not
|
||||
# modify data and uses SELECT in its turn.
|
||||
#
|
||||
# In theory there is no need to take row locks on the table
|
||||
# There is no need to take row locks on the table
|
||||
# being selected from in SF as the call to such function
|
||||
# won't get into the binary log. In practice, however, we
|
||||
# discover that fact too late in the process to be able to
|
||||
# affect the decision what locks should be taken.
|
||||
# Hence, strong locks are taken in this case.
|
||||
Success: 'select f1()' takes shared row locks on 't1'.
|
||||
# won't get into the binary log.
|
||||
#
|
||||
# However in practice innodb takes strong lock on tables
|
||||
# being selected from within SF, when SF is called from
|
||||
# non SELECT statements like 'set' statement below.
|
||||
Success: 'select f1()' doesn't take row locks on 't1'.
|
||||
Success: 'set @a:= f1()' takes shared row locks on 't1'.
|
||||
#
|
||||
# 4.2 INSERT (or other statement which modifies data) with
|
||||
@ -364,13 +365,15 @@ Success: 'set @a:= f2()' takes shared row locks on 't1'.
|
||||
# modify data and reads a table through subselect
|
||||
# in a control construct.
|
||||
#
|
||||
# Again, in theory a call to this function won't get to the
|
||||
# binary log and thus no locking is needed. But in practice
|
||||
# we don't detect this fact early enough (get_lock_type_for_table())
|
||||
# to avoid taking row locks.
|
||||
Success: 'select f3()' takes shared row locks on 't1'.
|
||||
# Call to this function won't get to the
|
||||
# binary log and thus no locking is needed.
|
||||
#
|
||||
# However in practice innodb takes strong lock on tables
|
||||
# being selected from within SF, when SF is called from
|
||||
# non SELECT statements like 'set' statement below.
|
||||
Success: 'select f3()' doesn't take row locks on 't1'.
|
||||
Success: 'set @a:= f3()' takes shared row locks on 't1'.
|
||||
Success: 'select f4()' takes shared row locks on 't1'.
|
||||
Success: 'select f4()' doesn't take row locks on 't1'.
|
||||
Success: 'set @a:= f4()' takes shared row locks on 't1'.
|
||||
#
|
||||
# 4.5. INSERT (or other statement which modifies data) with
|
||||
@ -398,13 +401,15 @@ Success: 'set @a:= f5()' takes shared row locks on 't1'.
|
||||
# doesn't modify data and reads tables through
|
||||
# a view.
|
||||
#
|
||||
# Once again, in theory, calls to such functions won't
|
||||
# get into the binary log and thus don't need row
|
||||
# locks. But in practice this fact is discovered
|
||||
# too late to have any effect.
|
||||
Success: 'select f6()' takes shared row locks on 't1'.
|
||||
# Calls to such functions won't get into
|
||||
# the binary log and thus don't need row locks.
|
||||
#
|
||||
# However in practice innodb takes strong lock on tables
|
||||
# being selected from within SF, when SF is called from
|
||||
# non SELECT statements like 'set' statement below.
|
||||
Success: 'select f6()' doesn't take row locks on 't1'.
|
||||
Success: 'set @a:= f6()' takes shared row locks on 't1'.
|
||||
Success: 'select f7()' takes shared row locks on 't1'.
|
||||
Success: 'select f7()' doesn't take row locks on 't1'.
|
||||
Success: 'set @a:= f7()' takes shared row locks on 't1'.
|
||||
#
|
||||
# 4.8 INSERT which uses stored function which
|
||||
@ -431,10 +436,9 @@ Success: 'select f9()' takes shared row locks on 't1'.
|
||||
# data and reads a table indirectly, by calling another
|
||||
# function.
|
||||
#
|
||||
# In theory, calls to such functions won't get into the binary
|
||||
# log and thus don't need to acquire row locks. But in practice
|
||||
# this fact is discovered too late to have any effect.
|
||||
Success: 'select f10()' takes shared row locks on 't1'.
|
||||
# Calls to such functions won't get into the binary
|
||||
# log and thus don't need to acquire row locks.
|
||||
Success: 'select f10()' doesn't take row locks on 't1'.
|
||||
#
|
||||
# 4.11 INSERT which uses a stored function which doesn't modify
|
||||
# data and reads a table indirectly, by calling another
|
||||
@ -494,10 +498,9 @@ Success: 'select f14()' takes shared row locks on 't1'.
|
||||
# 5.3 SELECT that calls a function that doesn't modify data and
|
||||
# uses a CALL statement that reads a table via SELECT.
|
||||
#
|
||||
# In theory, calls to such functions won't get into the binary
|
||||
# log and thus don't need to acquire row locks. But in practice
|
||||
# this fact is discovered too late to have any effect.
|
||||
Success: 'select f15()' takes shared row locks on 't1'.
|
||||
# Calls to such functions won't get into the binary
|
||||
# log and thus don't need to acquire row locks.
|
||||
Success: 'select f15()' doesn't take row locks on 't1'.
|
||||
#
|
||||
# 5.4 INSERT which calls function which doesn't modify data and
|
||||
# uses CALL statement which reads table through SELECT.
|
||||
|
@ -86,7 +86,10 @@ SET DEBUG_SYNC= 'now SIGNAL killed';
|
||||
# Reaping: OPTIMIZE TABLE t1
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
|
||||
test.t1 optimize error Query execution was interrupted
|
||||
test.t1 optimize status Operation failed
|
||||
Warnings:
|
||||
Error 1317 Query execution was interrupted
|
||||
# Connection default
|
||||
DROP TABLE t1;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
|
58
mysql-test/r/ipv4_and_ipv6.result
Normal file
58
mysql-test/r/ipv4_and_ipv6.result
Normal file
@ -0,0 +1,58 @@
|
||||
=============Test of '::1' ========================================
|
||||
mysqld is alive
|
||||
CREATE USER testuser@'::1' identified by '1234';
|
||||
GRANT ALL ON test.* TO testuser@'::1';
|
||||
SHOW GRANTS FOR testuser@'::1';
|
||||
Grants for testuser@::1
|
||||
GRANT USAGE ON *.* TO 'testuser'@'::1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
|
||||
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::1'
|
||||
SET @nip= inet_aton('::1');
|
||||
SELECT @nip;
|
||||
@nip
|
||||
NULL
|
||||
SELECT inet_ntoa(@nip);
|
||||
inet_ntoa(@nip)
|
||||
NULL
|
||||
SELECT USER();
|
||||
USER()
|
||||
root@localhost
|
||||
SELECT current_user();
|
||||
current_user()
|
||||
root@localhost
|
||||
SHOW PROCESSLIST;
|
||||
REVOKE ALL ON test.* FROM testuser@'::1';
|
||||
RENAME USER testuser@'::1' to testuser1@'::1';
|
||||
SET PASSWORD FOR testuser1@'::1' = PASSWORD ('9876');
|
||||
SELECT USER();
|
||||
USER()
|
||||
root@localhost
|
||||
DROP USER testuser1@'::1';
|
||||
=============Test of '127.0.0.1' (IPv4) ===========================
|
||||
mysqld is alive
|
||||
CREATE USER testuser@'127.0.0.1' identified by '1234';
|
||||
GRANT ALL ON test.* TO testuser@'127.0.0.1';
|
||||
SHOW GRANTS FOR testuser@'127.0.0.1';
|
||||
Grants for testuser@127.0.0.1
|
||||
GRANT USAGE ON *.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
|
||||
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'127.0.0.1'
|
||||
SET @nip= inet_aton('127.0.0.1');
|
||||
SELECT @nip;
|
||||
@nip
|
||||
2130706433
|
||||
SELECT inet_ntoa(@nip);
|
||||
inet_ntoa(@nip)
|
||||
127.0.0.1
|
||||
SELECT USER();
|
||||
USER()
|
||||
root@localhost
|
||||
SELECT current_user();
|
||||
current_user()
|
||||
root@localhost
|
||||
SHOW PROCESSLIST;
|
||||
REVOKE ALL ON test.* FROM testuser@'127.0.0.1';
|
||||
RENAME USER testuser@'127.0.0.1' to testuser1@'127.0.0.1';
|
||||
SET PASSWORD FOR testuser1@'127.0.0.1' = PASSWORD ('9876');
|
||||
SELECT USER();
|
||||
USER()
|
||||
root@localhost
|
||||
DROP USER testuser1@'127.0.0.1';
|
@ -5591,7 +5591,7 @@ set optimizer_switch=@tmp_optimizer_switch;
|
||||
DROP TABLE t1,t2,t3;
|
||||
#
|
||||
# Bug #1058071: LEFT JOIN using blobs
|
||||
# (mdev-564) when join buffer size is small
|
||||
# (MDEV-564) when join buffer size is small
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
col269 decimal(31,10) unsigned DEFAULT NULL,
|
||||
@ -5656,6 +5656,154 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 10
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
|
||||
drop table t0,t1,t2;
|
||||
# MDEV-6292: huge performance degradation for a sequence
|
||||
# of LEFT JOIN operations when using join buffer
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
col1 varchar(255) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE=INNODB;
|
||||
CREATE TABLE t2 (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
parent_id smallint(3) NOT NULL DEFAULT '0',
|
||||
col2 varchar(25) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE=INNODB;
|
||||
set join_buffer_size=8192;
|
||||
set join_cache_level=0;
|
||||
set @init_time:=now();
|
||||
SELECT t.*
|
||||
FROM
|
||||
t1 t
|
||||
LEFT JOIN t2 c1 ON c1.parent_id = t.id AND c1.col2 = "val"
|
||||
LEFT JOIN t2 c2 ON c2.parent_id = t.id AND c2.col2 = "val"
|
||||
LEFT JOIN t2 c3 ON c3.parent_id = t.id AND c3.col2 = "val"
|
||||
LEFT JOIN t2 c4 ON c4.parent_id = t.id AND c4.col2 = "val"
|
||||
LEFT JOIN t2 c5 ON c5.parent_id = t.id AND c5.col2 = "val"
|
||||
LEFT JOIN t2 c6 ON c6.parent_id = t.id AND c6.col2 = "val"
|
||||
LEFT JOIN t2 c7 ON c7.parent_id = t.id AND c7.col2 = "val"
|
||||
LEFT JOIN t2 c8 ON c8.parent_id = t.id AND c8.col2 = "val"
|
||||
LEFT JOIN t2 c9 ON c9.parent_id = t.id AND c9.col2 = "val"
|
||||
LEFT JOIN t2 c10 ON c10.parent_id = t.id AND c10.col2 = "val"
|
||||
LEFT JOIN t2 c11 ON c11.parent_id = t.id AND c11.col2 = "val"
|
||||
LEFT JOIN t2 c12 ON c12.parent_id = t.id AND c12.col2 = "val"
|
||||
LEFT JOIN t2 c13 ON c13.parent_id = t.id AND c13.col2 = "val"
|
||||
LEFT JOIN t2 c14 ON c14.parent_id = t.id AND c14.col2 = "val"
|
||||
LEFT JOIN t2 c15 ON c15.parent_id = t.id AND c15.col2 = "val"
|
||||
LEFT JOIN t2 c16 ON c16.parent_id = t.id AND c16.col2 = "val"
|
||||
LEFT JOIN t2 c17 ON c17.parent_id = t.id AND c17.col2 = "val"
|
||||
LEFT JOIN t2 c18 ON c18.parent_id = t.id AND c18.col2 = "val"
|
||||
LEFT JOIN t2 c19 ON c19.parent_id = t.id AND c19.col2 = "val"
|
||||
LEFT JOIN t2 c20 ON c20.parent_id = t.id AND c20.col2 = "val"
|
||||
LEFT JOIN t2 c21 ON c21.parent_id = t.id AND c21.col2 = "val"
|
||||
LEFT JOIN t2 c22 ON c22.parent_id = t.id AND c22.col2 = "val"
|
||||
LEFT JOIN t2 c23 ON c23.parent_id = t.id AND c23.col2 = "val"
|
||||
LEFT JOIN t2 c24 ON c24.parent_id = t.id AND c24.col2 = "val"
|
||||
LEFT JOIN t2 c25 ON c25.parent_id = t.id AND c25.col2 = "val"
|
||||
ORDER BY
|
||||
col1;
|
||||
id col1
|
||||
select timestampdiff(second, @init_time, now()) <= 1;
|
||||
timestampdiff(second, @init_time, now()) <= 1
|
||||
1
|
||||
set join_cache_level=2;
|
||||
set @init_time:=now();
|
||||
SELECT t.*
|
||||
FROM
|
||||
t1 t
|
||||
LEFT JOIN t2 c1 ON c1.parent_id = t.id AND c1.col2 = "val"
|
||||
LEFT JOIN t2 c2 ON c2.parent_id = t.id AND c2.col2 = "val"
|
||||
LEFT JOIN t2 c3 ON c3.parent_id = t.id AND c3.col2 = "val"
|
||||
LEFT JOIN t2 c4 ON c4.parent_id = t.id AND c4.col2 = "val"
|
||||
LEFT JOIN t2 c5 ON c5.parent_id = t.id AND c5.col2 = "val"
|
||||
LEFT JOIN t2 c6 ON c6.parent_id = t.id AND c6.col2 = "val"
|
||||
LEFT JOIN t2 c7 ON c7.parent_id = t.id AND c7.col2 = "val"
|
||||
LEFT JOIN t2 c8 ON c8.parent_id = t.id AND c8.col2 = "val"
|
||||
LEFT JOIN t2 c9 ON c9.parent_id = t.id AND c9.col2 = "val"
|
||||
LEFT JOIN t2 c10 ON c10.parent_id = t.id AND c10.col2 = "val"
|
||||
LEFT JOIN t2 c11 ON c11.parent_id = t.id AND c11.col2 = "val"
|
||||
LEFT JOIN t2 c12 ON c12.parent_id = t.id AND c12.col2 = "val"
|
||||
LEFT JOIN t2 c13 ON c13.parent_id = t.id AND c13.col2 = "val"
|
||||
LEFT JOIN t2 c14 ON c14.parent_id = t.id AND c14.col2 = "val"
|
||||
LEFT JOIN t2 c15 ON c15.parent_id = t.id AND c15.col2 = "val"
|
||||
LEFT JOIN t2 c16 ON c16.parent_id = t.id AND c16.col2 = "val"
|
||||
LEFT JOIN t2 c17 ON c17.parent_id = t.id AND c17.col2 = "val"
|
||||
LEFT JOIN t2 c18 ON c18.parent_id = t.id AND c18.col2 = "val"
|
||||
LEFT JOIN t2 c19 ON c19.parent_id = t.id AND c19.col2 = "val"
|
||||
LEFT JOIN t2 c20 ON c20.parent_id = t.id AND c20.col2 = "val"
|
||||
LEFT JOIN t2 c21 ON c21.parent_id = t.id AND c21.col2 = "val"
|
||||
LEFT JOIN t2 c22 ON c22.parent_id = t.id AND c22.col2 = "val"
|
||||
LEFT JOIN t2 c23 ON c23.parent_id = t.id AND c23.col2 = "val"
|
||||
LEFT JOIN t2 c24 ON c24.parent_id = t.id AND c24.col2 = "val"
|
||||
LEFT JOIN t2 c25 ON c25.parent_id = t.id AND c25.col2 = "val"
|
||||
ORDER BY
|
||||
col1;
|
||||
id col1
|
||||
select timestampdiff(second, @init_time, now()) <= 1;
|
||||
timestampdiff(second, @init_time, now()) <= 1
|
||||
1
|
||||
EXPLAIN
|
||||
SELECT t.*
|
||||
FROM
|
||||
t1 t
|
||||
LEFT JOIN t2 c1 ON c1.parent_id = t.id AND c1.col2 = "val"
|
||||
LEFT JOIN t2 c2 ON c2.parent_id = t.id AND c2.col2 = "val"
|
||||
LEFT JOIN t2 c3 ON c3.parent_id = t.id AND c3.col2 = "val"
|
||||
LEFT JOIN t2 c4 ON c4.parent_id = t.id AND c4.col2 = "val"
|
||||
LEFT JOIN t2 c5 ON c5.parent_id = t.id AND c5.col2 = "val"
|
||||
LEFT JOIN t2 c6 ON c6.parent_id = t.id AND c6.col2 = "val"
|
||||
LEFT JOIN t2 c7 ON c7.parent_id = t.id AND c7.col2 = "val"
|
||||
LEFT JOIN t2 c8 ON c8.parent_id = t.id AND c8.col2 = "val"
|
||||
LEFT JOIN t2 c9 ON c9.parent_id = t.id AND c9.col2 = "val"
|
||||
LEFT JOIN t2 c10 ON c10.parent_id = t.id AND c10.col2 = "val"
|
||||
LEFT JOIN t2 c11 ON c11.parent_id = t.id AND c11.col2 = "val"
|
||||
LEFT JOIN t2 c12 ON c12.parent_id = t.id AND c12.col2 = "val"
|
||||
LEFT JOIN t2 c13 ON c13.parent_id = t.id AND c13.col2 = "val"
|
||||
LEFT JOIN t2 c14 ON c14.parent_id = t.id AND c14.col2 = "val"
|
||||
LEFT JOIN t2 c15 ON c15.parent_id = t.id AND c15.col2 = "val"
|
||||
LEFT JOIN t2 c16 ON c16.parent_id = t.id AND c16.col2 = "val"
|
||||
LEFT JOIN t2 c17 ON c17.parent_id = t.id AND c17.col2 = "val"
|
||||
LEFT JOIN t2 c18 ON c18.parent_id = t.id AND c18.col2 = "val"
|
||||
LEFT JOIN t2 c19 ON c19.parent_id = t.id AND c19.col2 = "val"
|
||||
LEFT JOIN t2 c20 ON c20.parent_id = t.id AND c20.col2 = "val"
|
||||
LEFT JOIN t2 c21 ON c21.parent_id = t.id AND c21.col2 = "val"
|
||||
LEFT JOIN t2 c22 ON c22.parent_id = t.id AND c22.col2 = "val"
|
||||
LEFT JOIN t2 c23 ON c23.parent_id = t.id AND c23.col2 = "val"
|
||||
LEFT JOIN t2 c24 ON c24.parent_id = t.id AND c24.col2 = "val"
|
||||
LEFT JOIN t2 c25 ON c25.parent_id = t.id AND c25.col2 = "val"
|
||||
ORDER BY
|
||||
col1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t ALL NULL NULL NULL NULL 1 Using temporary; Using filesort
|
||||
1 SIMPLE c1 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (flat, BNL join)
|
||||
1 SIMPLE c2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c3 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c4 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c5 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c6 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c7 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c8 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c9 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c10 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c11 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c12 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c13 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c14 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c15 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c16 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c17 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c18 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c19 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c20 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c21 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c22 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c23 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c24 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
1 SIMPLE c25 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
|
||||
set join_buffer_size=default;
|
||||
set join_cache_level = default;
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
# MDEV-5123 Remove duplicated conditions pushed both to join_tab->select_cond and join_tab->cache_select->cond for blocked joins.
|
||||
#
|
||||
@ -5704,7 +5852,7 @@ select @counter;
|
||||
drop table t1,t2,t3;
|
||||
set expensive_subquery_limit=default;
|
||||
#
|
||||
# mdev-6071: EXPLAIN chooses to use join buffer while execution turns it down
|
||||
# MDEV-6071: EXPLAIN chooses to use join buffer while execution turns it down
|
||||
#
|
||||
create table t1 (a int);
|
||||
insert into t1 values
|
||||
|
@ -705,18 +705,18 @@ t0.b=t1.b AND
|
||||
(t8.b=t9.b OR t8.c IS NULL) AND
|
||||
(t9.a=1);
|
||||
a b a b a b a b a b a b a b a b a b a b
|
||||
1 2 3 2 4 2 1 2 3 2 2 2 6 2 2 2 0 2 1 2
|
||||
1 2 3 2 4 2 1 2 4 2 2 2 6 2 2 2 0 2 1 2
|
||||
1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 1
|
||||
1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 1
|
||||
1 2 3 2 4 2 1 2 3 2 2 2 6 2 2 2 0 2 1 2
|
||||
1 2 3 2 4 2 1 2 4 2 2 2 6 2 2 2 0 2 1 2
|
||||
1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 2
|
||||
1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 2
|
||||
1 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 1
|
||||
1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 1
|
||||
1 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 2
|
||||
1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 2
|
||||
1 2 3 2 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2 1 2
|
||||
1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 1
|
||||
1 2 3 2 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2 1 2
|
||||
1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 2
|
||||
1 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 1
|
||||
1 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 2
|
||||
|
@ -696,9 +696,9 @@ insert into t2 values (1,3), (2,3);
|
||||
insert into t3 values (2,4), (3,4);
|
||||
select * from t1 left join t2 on b1 = a1 left join t3 on c1 = a1 and b1 is null;
|
||||
a1 a2 b1 b2 c1 c2
|
||||
3 2 NULL NULL 3 4
|
||||
1 2 1 3 NULL NULL
|
||||
2 2 2 3 NULL NULL
|
||||
3 2 NULL NULL 3 4
|
||||
explain select * from t1 left join t2 on b1 = a1 left join t3 on c1 = a1 and b1 is null;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
|
@ -2,6 +2,7 @@ drop table if exists t1, t2, t3;
|
||||
SET @save_key_buffer_size=@@key_buffer_size;
|
||||
SET @save_key_cache_block_size=@@key_cache_block_size;
|
||||
SET @save_key_cache_segments=@@key_cache_segments;
|
||||
SET @save_key_cache_file_hash_size=@@key_cache_file_hash_size;
|
||||
SELECT @@key_buffer_size, @@small.key_buffer_size;
|
||||
@@key_buffer_size @@small.key_buffer_size
|
||||
2097152 131072
|
||||
@ -84,15 +85,15 @@ select @@key_buffer_size;
|
||||
select @@key_cache_block_size;
|
||||
@@key_cache_block_size
|
||||
1024
|
||||
select @@key_cache_file_hash_size;
|
||||
@@key_cache_file_hash_size
|
||||
512
|
||||
set global keycache1.key_buffer_size=1024*1024;
|
||||
create table t1 (p int primary key, a char(10)) delay_key_write=1;
|
||||
create table t2 (p int primary key, i int, a char(10), key k1(i), key k2(a));
|
||||
show status like 'key_blocks_used';
|
||||
Variable_name Value
|
||||
Key_blocks_used 0
|
||||
show status like 'key_blocks_unused';
|
||||
Variable_name Value
|
||||
Key_blocks_unused KEY_BLOCKS_UNUSED
|
||||
select @org_key_blocks_unused-unused_blocks as key_blocks_unused, used_blocks as key_blocks_used from information_schema.key_caches where key_cache_name="default";
|
||||
key_blocks_unused key_blocks_used
|
||||
0 0
|
||||
insert into t1 values (1, 'qqqq'), (11, 'yyyy');
|
||||
insert into t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'),
|
||||
(3, 1, 'yyyy'), (4, 3, 'zzzz');
|
||||
@ -108,12 +109,9 @@ p i a
|
||||
4 3 zzzz
|
||||
update t1 set p=2 where p=1;
|
||||
update t2 set i=2 where i=1;
|
||||
show status like 'key_blocks_used';
|
||||
Variable_name Value
|
||||
Key_blocks_used 4
|
||||
show status like 'key_blocks_unused';
|
||||
Variable_name Value
|
||||
Key_blocks_unused KEY_BLOCKS_UNUSED
|
||||
select @org_key_blocks_unused-unused_blocks as key_blocks_unused, used_blocks as key_blocks_used from information_schema.key_caches where key_cache_name="default";
|
||||
key_blocks_unused key_blocks_used
|
||||
4 4
|
||||
cache index t1 key (`primary`) in keycache1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 assign_to_keycache status OK
|
||||
@ -270,12 +268,9 @@ Table Op Msg_type Msg_text
|
||||
test.t1 assign_to_keycache status OK
|
||||
test.t2 assign_to_keycache status OK
|
||||
drop table t1,t2,t3;
|
||||
show status like 'key_blocks_used';
|
||||
Variable_name Value
|
||||
Key_blocks_used 4
|
||||
show status like 'key_blocks_unused';
|
||||
Variable_name Value
|
||||
Key_blocks_unused KEY_BLOCKS_UNUSED
|
||||
select @org_key_blocks_unused-unused_blocks as key_blocks_unused, used_blocks as key_blocks_used from information_schema.key_caches where key_cache_name="default";
|
||||
key_blocks_unused key_blocks_used
|
||||
0 4
|
||||
create table t1 (a int primary key);
|
||||
cache index t1 in keycache2;
|
||||
Table Op Msg_type Msg_text
|
||||
@ -558,6 +553,7 @@ KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_B
|
||||
default 1 NULL 2097152 1024 4 # 0 0 0 0 0
|
||||
small NULL NULL 1048576 1024 1 # 0 0 0 0 0
|
||||
set global key_buffer_size=32*1024;
|
||||
set global key_cache_file_hash_size=128;
|
||||
select @@key_buffer_size;
|
||||
@@key_buffer_size
|
||||
32768
|
||||
@ -833,3 +829,4 @@ set global keycache1.key_buffer_size=0;
|
||||
set global keycache2.key_buffer_size=0;
|
||||
set global key_buffer_size=@save_key_buffer_size;
|
||||
set global key_cache_segments=@save_key_cache_segments;
|
||||
set global key_cache_file_hash_size=@save_key_cache_file_hash_size;
|
||||
|
14
mysql-test/r/kill_processlist-6619.result
Normal file
14
mysql-test/r/kill_processlist-6619.result
Normal file
@ -0,0 +1,14 @@
|
||||
connect con1,localhost,root,,;
|
||||
SHOW PROCESSLIST;
|
||||
Id User Host db Command Time State Info Progress
|
||||
# root # test Sleep # # NULL 0.000
|
||||
# root # test Query # # SHOW PROCESSLIST 0.000
|
||||
connection default;
|
||||
KILL QUERY con_id;
|
||||
connection con1;
|
||||
SHOW PROCESSLIST;
|
||||
ERROR 70100: Query execution was interrupted
|
||||
SHOW PROCESSLIST;
|
||||
Id User Host db Command Time State Info Progress
|
||||
# root # test Sleep # # NULL 0.000
|
||||
# root # test Query # # SHOW PROCESSLIST 0.000
|
@ -27,6 +27,7 @@ drop table if exists t0, t1, t2, t3, t4, t5;
|
||||
drop view if exists v1, v2;
|
||||
drop procedure if exists p1;
|
||||
drop procedure if exists p2;
|
||||
drop procedure if exists p3;
|
||||
drop function if exists f1;
|
||||
drop function if exists f2;
|
||||
drop function if exists f3;
|
||||
@ -42,6 +43,8 @@ drop function if exists f12;
|
||||
drop function if exists f13;
|
||||
drop function if exists f14;
|
||||
drop function if exists f15;
|
||||
drop function if exists f16;
|
||||
drop function if exists f17;
|
||||
create table t1 (i int primary key);
|
||||
insert into t1 values (1), (2), (3), (4), (5);
|
||||
create table t2 (j int primary key);
|
||||
@ -146,6 +149,26 @@ declare k int;
|
||||
call p2(k);
|
||||
return k;
|
||||
end|
|
||||
create function f16() returns int
|
||||
begin
|
||||
create temporary table if not exists temp1 (a int);
|
||||
insert into temp1 select * from t1;
|
||||
drop temporary table temp1;
|
||||
return 1;
|
||||
end|
|
||||
create function f17() returns int
|
||||
begin
|
||||
declare j int;
|
||||
select i from t1 where i = 1 into j;
|
||||
call p3;
|
||||
return 1;
|
||||
end|
|
||||
create procedure p3()
|
||||
begin
|
||||
create temporary table if not exists temp1 (a int);
|
||||
insert into temp1 select * from t1;
|
||||
drop temporary table temp1;
|
||||
end|
|
||||
create trigger t4_bi before insert on t4 for each row
|
||||
begin
|
||||
declare k int;
|
||||
@ -185,6 +208,7 @@ end|
|
||||
# once during its execution.
|
||||
show create procedure p1;
|
||||
show create procedure p2;
|
||||
show create procedure p3;
|
||||
show create function f1;
|
||||
show create function f2;
|
||||
show create function f3;
|
||||
@ -200,6 +224,8 @@ show create function f12;
|
||||
show create function f13;
|
||||
show create function f14;
|
||||
show create function f15;
|
||||
show create function f16;
|
||||
show create function f17;
|
||||
# Switch back to connection 'default'.
|
||||
#
|
||||
# 1. Statements that read tables and do not use subqueries.
|
||||
@ -359,14 +385,11 @@ Success: 'update v2 set j= j-10 where j = 3' doesn't allow concurrent inserts in
|
||||
# 4.1 SELECT/SET with a stored function which does not
|
||||
# modify data and uses SELECT in its turn.
|
||||
#
|
||||
# In theory there is no need to take strong locks on the table
|
||||
# There is no need to take strong locks on the table
|
||||
# being selected from in SF as the call to such function
|
||||
# won't get into the binary log. In practice, however, we
|
||||
# discover that fact too late in the process to be able to
|
||||
# affect the decision what locks should be taken.
|
||||
# Hence, strong locks are taken in this case.
|
||||
Success: 'select f1()' doesn't allow concurrent inserts into 't1'.
|
||||
Success: 'set @a:= f1()' doesn't allow concurrent inserts into 't1'.
|
||||
# won't get into the binary log.
|
||||
Success: 'select f1()' allows concurrent inserts into 't1'.
|
||||
Success: 'set @a:= f1()' allows concurrent inserts into 't1'.
|
||||
#
|
||||
# 4.2 INSERT (or other statement which modifies data) with
|
||||
# a stored function which does not modify data and uses
|
||||
@ -392,14 +415,12 @@ Success: 'set @a:= f2()' doesn't allow concurrent inserts into 't1'.
|
||||
# modify data and reads a table through subselect
|
||||
# in a control construct.
|
||||
#
|
||||
# Again, in theory a call to this function won't get to the
|
||||
# binary log and thus no strong lock is needed. But in practice
|
||||
# we don't detect this fact early enough (get_lock_type_for_table())
|
||||
# to avoid taking a strong lock.
|
||||
Success: 'select f3()' doesn't allow concurrent inserts into 't1'.
|
||||
Success: 'set @a:= f3()' doesn't allow concurrent inserts into 't1'.
|
||||
Success: 'select f4()' doesn't allow concurrent inserts into 't1'.
|
||||
Success: 'set @a:= f4()' doesn't allow concurrent inserts into 't1'.
|
||||
# Call to this function won't get to the
|
||||
# binary log and thus no strong lock is needed.
|
||||
Success: 'select f3()' allows concurrent inserts into 't1'.
|
||||
Success: 'set @a:= f3()' allows concurrent inserts into 't1'.
|
||||
Success: 'select f4()' allows concurrent inserts into 't1'.
|
||||
Success: 'set @a:= f4()' allows concurrent inserts into 't1'.
|
||||
#
|
||||
# 4.5. INSERT (or other statement which modifies data) with
|
||||
# a stored function which does not modify data and reads
|
||||
@ -426,14 +447,13 @@ Success: 'set @a:= f5()' doesn't allow concurrent inserts into 't1'.
|
||||
# doesn't modify data and reads tables through
|
||||
# a view.
|
||||
#
|
||||
# Once again, in theory, calls to such functions won't
|
||||
# get into the binary log and thus don't need strong
|
||||
# locks. But in practice this fact is discovered
|
||||
# too late to have any effect.
|
||||
Success: 'select f6()' doesn't allow concurrent inserts into 't1'.
|
||||
Success: 'set @a:= f6()' doesn't allow concurrent inserts into 't1'.
|
||||
Success: 'select f7()' doesn't allow concurrent inserts into 't1'.
|
||||
Success: 'set @a:= f7()' doesn't allow concurrent inserts into 't1'.
|
||||
# Calls to such functions won't get into
|
||||
# the binary log and thus don't need strong
|
||||
# locks.
|
||||
Success: 'select f6()' allows concurrent inserts into 't1'.
|
||||
Success: 'set @a:= f6()' allows concurrent inserts into 't1'.
|
||||
Success: 'select f7()' allows concurrent inserts into 't1'.
|
||||
Success: 'set @a:= f7()' allows concurrent inserts into 't1'.
|
||||
#
|
||||
# 4.8 INSERT which uses stored function which
|
||||
# doesn't modify data and reads a table
|
||||
@ -459,10 +479,9 @@ Success: 'select f9()' doesn't allow concurrent inserts into 't1'.
|
||||
# data and reads a table indirectly, by calling another
|
||||
# function.
|
||||
#
|
||||
# In theory, calls to such functions won't get into the binary
|
||||
# log and thus don't need to acquire strong locks. But in practice
|
||||
# this fact is discovered too late to have any effect.
|
||||
Success: 'select f10()' doesn't allow concurrent inserts into 't1'.
|
||||
# Calls to such functions won't get into the binary
|
||||
# log and thus don't need to acquire strong locks.
|
||||
Success: 'select f10()' allows concurrent inserts into 't1'.
|
||||
#
|
||||
# 4.11 INSERT which uses a stored function which doesn't modify
|
||||
# data and reads a table indirectly, by calling another
|
||||
@ -501,6 +520,26 @@ Success: 'select f12((select i+10 from t1 where i=1))' allows concurrent inserts
|
||||
# uses. Therefore it should take strong locks on the data it reads.
|
||||
Success: 'insert into t2 values (f13((select i+10 from t1 where i=1)))' doesn't allow concurrent inserts into 't1'.
|
||||
#
|
||||
# 4.15 SELECT/SET with a stored function which
|
||||
# inserts data into a temporary table using
|
||||
# SELECT on t1.
|
||||
#
|
||||
# Since this statement is written to the binary log it should
|
||||
# be serialized with concurrent statements affecting the data it
|
||||
# uses. Therefore it should take strong locks on the data it reads.
|
||||
Success: 'select f16()' doesn't allow concurrent inserts into 't1'.
|
||||
Success: 'set @a:= f16()' doesn't allow concurrent inserts into 't1'.
|
||||
#
|
||||
# 4.16 SELECT/SET with a stored function which call procedure
|
||||
# which inserts data into a temporary table using
|
||||
# SELECT on t1.
|
||||
#
|
||||
# Since this statement is written to the binary log it should
|
||||
# be serialized with concurrent statements affecting the data it
|
||||
# uses. Therefore it should take strong locks on the data it reads.
|
||||
Success: 'select f17()' doesn't allow concurrent inserts into 't1'.
|
||||
Success: 'set @a:= f17()' doesn't allow concurrent inserts into 't1'.
|
||||
#
|
||||
# 5. Statements that read tables through stored procedures.
|
||||
#
|
||||
#
|
||||
@ -522,10 +561,9 @@ Success: 'select f14()' doesn't allow concurrent inserts into 't1'.
|
||||
# 5.3 SELECT that calls a function that doesn't modify data and
|
||||
# uses a CALL statement that reads a table via SELECT.
|
||||
#
|
||||
# In theory, calls to such functions won't get into the binary
|
||||
# log and thus don't need to acquire strong locks. But in practice
|
||||
# this fact is discovered too late to have any effect.
|
||||
Success: 'select f15()' doesn't allow concurrent inserts into 't1'.
|
||||
# Calls to such functions won't get into the binary
|
||||
# log and thus don't need to acquire strong locks.
|
||||
Success: 'select f15()' allows concurrent inserts into 't1'.
|
||||
#
|
||||
# 5.4 INSERT which calls function which doesn't modify data and
|
||||
# uses CALL statement which reads table through SELECT.
|
||||
@ -585,9 +623,12 @@ drop function f12;
|
||||
drop function f13;
|
||||
drop function f14;
|
||||
drop function f15;
|
||||
drop function f16;
|
||||
drop function f17;
|
||||
drop view v1, v2;
|
||||
drop procedure p1;
|
||||
drop procedure p2;
|
||||
drop procedure p3;
|
||||
drop table t1, t2, t3, t4, t5;
|
||||
set @@global.concurrent_insert= @old_concurrent_insert;
|
||||
#
|
||||
|
@ -11,13 +11,8 @@ Table Op Msg_type Msg_text
|
||||
test.bug49823 repair status OK
|
||||
RENAME TABLE general_log TO renamed_general_log;
|
||||
RENAME TABLE test.bug49823 TO general_log;
|
||||
Phase 1/3: Fixing table and database names
|
||||
Phase 2/3: Checking and upgrading tables
|
||||
Phase 1/4: Checking mysql database
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
mysql
|
||||
mysql.column_stats OK
|
||||
mysql.columns_priv OK
|
||||
@ -48,9 +43,16 @@ mysql.time_zone_name OK
|
||||
mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
Phase 2/4: Running 'mysql_fix_privilege_tables'...
|
||||
Phase 3/4: Fixing table and database names
|
||||
Phase 4/4: Checking and upgrading tables
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
performance_schema
|
||||
test
|
||||
Phase 3/3: Running 'mysql_fix_privilege_tables'...
|
||||
OK
|
||||
DROP TABLE general_log;
|
||||
RENAME TABLE renamed_general_log TO general_log;
|
||||
|
@ -112,7 +112,7 @@ UPDATE t1 SET a = 2;
|
||||
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Error 1967 Query execution was interrupted (max_statement_time exceeded)
|
||||
Error 1968 Query execution was interrupted (max_statement_time exceeded)
|
||||
ROLLBACK;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
@ -755,6 +755,7 @@ Variable_name Value
|
||||
# Status of "equivalent" SELECT query execution:
|
||||
Variable_name Value
|
||||
Handler_read_rnd_next 11
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
# Status of testing query execution:
|
||||
@ -1231,6 +1232,7 @@ Variable_name Value
|
||||
# Status of "equivalent" SELECT query execution:
|
||||
Variable_name Value
|
||||
Handler_read_rnd_next 27
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 5
|
||||
Sort_scan 1
|
||||
# Status of testing query execution:
|
||||
@ -1275,6 +1277,7 @@ Variable_name Value
|
||||
# Status of "equivalent" SELECT query execution:
|
||||
Variable_name Value
|
||||
Handler_read_rnd_next 27
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
# Status of testing query execution:
|
||||
@ -1361,6 +1364,7 @@ Variable_name Value
|
||||
# Status of "equivalent" SELECT query execution:
|
||||
Variable_name Value
|
||||
Handler_read_rnd_next 27
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
# Status of testing query execution:
|
||||
@ -1407,6 +1411,7 @@ Variable_name Value
|
||||
Variable_name Value
|
||||
Handler_read_rnd 1
|
||||
Handler_read_rnd_next 27
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
# Status of testing query execution:
|
||||
@ -1540,6 +1545,7 @@ Variable_name Value
|
||||
# Status of "equivalent" SELECT query execution:
|
||||
Variable_name Value
|
||||
Handler_read_rnd_next 27
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 5
|
||||
Sort_scan 1
|
||||
# Status of testing query execution:
|
||||
@ -1668,6 +1674,7 @@ Variable_name Value
|
||||
# Status of "equivalent" SELECT query execution:
|
||||
Variable_name Value
|
||||
Handler_read_rnd_next 27
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 5
|
||||
Sort_scan 1
|
||||
# Status of testing query execution:
|
||||
@ -1675,6 +1682,7 @@ Variable_name Value
|
||||
Handler_read_rnd 5
|
||||
Handler_read_rnd_next 27
|
||||
Handler_update 5
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 5
|
||||
Sort_scan 1
|
||||
|
||||
@ -1712,6 +1720,7 @@ Variable_name Value
|
||||
# Status of "equivalent" SELECT query execution:
|
||||
Variable_name Value
|
||||
Handler_read_rnd_next 27
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
# Status of testing query execution:
|
||||
@ -1719,6 +1728,7 @@ Variable_name Value
|
||||
Handler_read_rnd 1
|
||||
Handler_read_rnd_next 27
|
||||
Handler_update 1
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
|
||||
@ -1799,12 +1809,14 @@ Variable_name Value
|
||||
# Status of "equivalent" SELECT query execution:
|
||||
Variable_name Value
|
||||
Handler_read_rnd_next 27
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
# Status of testing query execution:
|
||||
Variable_name Value
|
||||
Handler_read_rnd 1
|
||||
Handler_read_rnd_next 27
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
|
||||
@ -1844,12 +1856,14 @@ Variable_name Value
|
||||
Variable_name Value
|
||||
Handler_read_rnd 1
|
||||
Handler_read_rnd_next 27
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
# Status of testing query execution:
|
||||
Variable_name Value
|
||||
Handler_read_rnd 1
|
||||
Handler_read_rnd_next 27
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
|
||||
@ -1977,6 +1991,7 @@ Variable_name Value
|
||||
# Status of "equivalent" SELECT query execution:
|
||||
Variable_name Value
|
||||
Handler_read_rnd_next 27
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 5
|
||||
Sort_scan 1
|
||||
# Status of testing query execution:
|
||||
@ -1984,6 +1999,7 @@ Variable_name Value
|
||||
Handler_read_rnd 5
|
||||
Handler_read_rnd_next 27
|
||||
Handler_update 4
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 5
|
||||
Sort_scan 1
|
||||
|
||||
@ -2067,6 +2083,7 @@ Variable_name Value
|
||||
Variable_name Value
|
||||
Handler_read_key 1
|
||||
Handler_read_next 2
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 1
|
||||
Sort_rows 2
|
||||
# Status of testing query execution:
|
||||
@ -2075,6 +2092,7 @@ Handler_read_key 1
|
||||
Handler_read_next 2
|
||||
Handler_read_rnd 2
|
||||
Handler_update 2
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 1
|
||||
Sort_rows 2
|
||||
|
||||
@ -2105,6 +2123,7 @@ Variable_name Value
|
||||
Variable_name Value
|
||||
Handler_read_key 1
|
||||
Handler_read_next 2
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 1
|
||||
Sort_rows 2
|
||||
# Status of testing query execution:
|
||||
@ -2625,6 +2644,7 @@ Variable_name Value
|
||||
Variable_name Value
|
||||
Handler_read_key 3
|
||||
Handler_read_rnd_next 10
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 3
|
||||
Sort_scan 1
|
||||
# Status of testing query execution:
|
||||
@ -2632,6 +2652,7 @@ Variable_name Value
|
||||
Handler_read_key 3
|
||||
Handler_read_rnd_next 8
|
||||
Handler_update 1
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 3
|
||||
Sort_scan 1
|
||||
|
||||
@ -2674,12 +2695,14 @@ Variable_name Value
|
||||
Variable_name Value
|
||||
Handler_read_key 3
|
||||
Handler_read_rnd_next 10
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 3
|
||||
Sort_scan 1
|
||||
# Status of testing query execution:
|
||||
Variable_name Value
|
||||
Handler_read_key 3
|
||||
Handler_read_rnd_next 10
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 3
|
||||
Sort_scan 1
|
||||
|
||||
@ -2724,12 +2747,14 @@ Variable_name Value
|
||||
Variable_name Value
|
||||
Handler_read_key 3
|
||||
Handler_read_rnd_next 10
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 3
|
||||
Sort_scan 1
|
||||
# Status of testing query execution:
|
||||
Variable_name Value
|
||||
Handler_read_key 3
|
||||
Handler_read_rnd_next 10
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_rows 3
|
||||
Sort_scan 1
|
||||
|
||||
|
4
mysql-test/r/mysql_client_test_comp.result
Normal file
4
mysql-test/r/mysql_client_test_comp.result
Normal file
@ -0,0 +1,4 @@
|
||||
SET @old_slow_query_log= @@global.slow_query_log;
|
||||
call mtr.add_suppression(" Error reading file './client_test_db/test_frm_bug.frm'");
|
||||
ok
|
||||
SET @@global.slow_query_log= @old_slow_query_log;
|
@ -1,11 +1,6 @@
|
||||
Run mysql_upgrade once
|
||||
Phase 1/3: Fixing table and database names
|
||||
Phase 2/3: Checking and upgrading tables
|
||||
Phase 1/4: Checking mysql database
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
mysql
|
||||
mysql.column_stats OK
|
||||
mysql.columns_priv OK
|
||||
@ -35,20 +30,22 @@ mysql.time_zone_name OK
|
||||
mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
Phase 2/4: Running 'mysql_fix_privilege_tables'...
|
||||
Phase 3/4: Fixing table and database names
|
||||
Phase 4/4: Checking and upgrading tables
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
performance_schema
|
||||
test
|
||||
Phase 3/3: Running 'mysql_fix_privilege_tables'...
|
||||
OK
|
||||
Run it again - should say already completed
|
||||
This installation of MySQL is already upgraded to VERSION, use --force if you still need to run mysql_upgrade
|
||||
Force should run it regardless of wether it's been run before
|
||||
Phase 1/3: Fixing table and database names
|
||||
Phase 2/3: Checking and upgrading tables
|
||||
Phase 1/4: Checking mysql database
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
mysql
|
||||
mysql.column_stats OK
|
||||
mysql.columns_priv OK
|
||||
@ -78,20 +75,22 @@ mysql.time_zone_name OK
|
||||
mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
Phase 2/4: Running 'mysql_fix_privilege_tables'...
|
||||
Phase 3/4: Fixing table and database names
|
||||
Phase 4/4: Checking and upgrading tables
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
performance_schema
|
||||
test
|
||||
Phase 3/3: Running 'mysql_fix_privilege_tables'...
|
||||
OK
|
||||
CREATE USER mysqltest1@'%' IDENTIFIED by 'sakila';
|
||||
GRANT ALL ON *.* TO mysqltest1@'%';
|
||||
Run mysql_upgrade with password protected account
|
||||
Phase 1/3: Fixing table and database names
|
||||
Phase 2/3: Checking and upgrading tables
|
||||
Phase 1/4: Checking mysql database
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
mysql
|
||||
mysql.column_stats OK
|
||||
mysql.columns_priv OK
|
||||
@ -121,9 +120,16 @@ mysql.time_zone_name OK
|
||||
mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
Phase 2/4: Running 'mysql_fix_privilege_tables'...
|
||||
Phase 3/4: Fixing table and database names
|
||||
Phase 4/4: Checking and upgrading tables
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
performance_schema
|
||||
test
|
||||
Phase 3/3: Running 'mysql_fix_privilege_tables'...
|
||||
OK
|
||||
DROP USER mysqltest1@'%';
|
||||
Version check failed. Got the following error when calling the 'mysql' command line client
|
||||
@ -133,13 +139,8 @@ Run mysql_upgrade with a non existing server socket
|
||||
mysqlcheck: Got error: 2005: Unknown MySQL server host 'not_existing_host' (errno) when trying to connect
|
||||
FATAL ERROR: Upgrade failed
|
||||
set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE';
|
||||
Phase 1/3: Fixing table and database names
|
||||
Phase 2/3: Checking and upgrading tables
|
||||
Phase 1/4: Checking mysql database
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
mysql
|
||||
mysql.column_stats OK
|
||||
mysql.columns_priv OK
|
||||
@ -169,9 +170,16 @@ mysql.time_zone_name OK
|
||||
mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
Phase 2/4: Running 'mysql_fix_privilege_tables'...
|
||||
Phase 3/4: Fixing table and database names
|
||||
Phase 4/4: Checking and upgrading tables
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
performance_schema
|
||||
test
|
||||
Phase 3/3: Running 'mysql_fix_privilege_tables'...
|
||||
OK
|
||||
set GLOBAL sql_mode=default;
|
||||
#
|
||||
@ -182,13 +190,8 @@ CREATE PROCEDURE testproc() BEGIN END;
|
||||
UPDATE mysql.proc SET character_set_client = NULL WHERE name LIKE 'testproc';
|
||||
UPDATE mysql.proc SET collation_connection = NULL WHERE name LIKE 'testproc';
|
||||
UPDATE mysql.proc SET db_collation = NULL WHERE name LIKE 'testproc';
|
||||
Phase 1/3: Fixing table and database names
|
||||
Phase 2/3: Checking and upgrading tables
|
||||
Phase 1/4: Checking mysql database
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
mysql
|
||||
mysql.column_stats OK
|
||||
mysql.columns_priv OK
|
||||
@ -218,9 +221,16 @@ mysql.time_zone_name OK
|
||||
mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
Phase 2/4: Running 'mysql_fix_privilege_tables'...
|
||||
Phase 3/4: Fixing table and database names
|
||||
Phase 4/4: Checking and upgrading tables
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
performance_schema
|
||||
test
|
||||
Phase 3/3: Running 'mysql_fix_privilege_tables'...
|
||||
OK
|
||||
CALL testproc();
|
||||
DROP PROCEDURE testproc;
|
||||
@ -234,13 +244,8 @@ WARNING: NULL values of the 'db_collation' column ('mysql.proc' table) have been
|
||||
GRANT USAGE ON *.* TO 'user3'@'%';
|
||||
GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%';
|
||||
Run mysql_upgrade with all privileges on a user
|
||||
Phase 1/3: Fixing table and database names
|
||||
Phase 2/3: Checking and upgrading tables
|
||||
Phase 1/4: Checking mysql database
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
mysql
|
||||
mysql.column_stats OK
|
||||
mysql.columns_priv OK
|
||||
@ -270,9 +275,16 @@ mysql.time_zone_name OK
|
||||
mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
Phase 2/4: Running 'mysql_fix_privilege_tables'...
|
||||
Phase 3/4: Fixing table and database names
|
||||
Phase 4/4: Checking and upgrading tables
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
performance_schema
|
||||
test
|
||||
Phase 3/3: Running 'mysql_fix_privilege_tables'...
|
||||
OK
|
||||
SHOW GRANTS FOR 'user3'@'%';
|
||||
Grants for user3@%
|
||||
@ -280,22 +292,9 @@ GRANT USAGE ON *.* TO 'user3'@'%'
|
||||
GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%'
|
||||
DROP USER 'user3'@'%';
|
||||
End of 5.1 tests
|
||||
The --upgrade-system-tables option was used, databases won't be touched.
|
||||
Phase 3/3: Running 'mysql_fix_privilege_tables'...
|
||||
OK
|
||||
#
|
||||
# Bug#11827359 60223: MYSQL_UPGRADE PROBLEM WITH OPTION
|
||||
# SKIP-WRITE-BINLOG
|
||||
#
|
||||
# Droping the previously created mysql_upgrade_info file..
|
||||
# Running mysql_upgrade with --skip-write-binlog..
|
||||
Phase 1/3: Fixing table and database names
|
||||
Phase 2/3: Checking and upgrading tables
|
||||
The --upgrade-system-tables option was used, user tables won't be touched.
|
||||
Phase 1/4: Checking mysql database
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
mysql
|
||||
mysql.column_stats OK
|
||||
mysql.columns_priv OK
|
||||
@ -325,9 +324,55 @@ mysql.time_zone_name OK
|
||||
mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
Phase 2/4: Running 'mysql_fix_privilege_tables'...
|
||||
OK
|
||||
#
|
||||
# Bug#11827359 60223: MYSQL_UPGRADE PROBLEM WITH OPTION
|
||||
# SKIP-WRITE-BINLOG
|
||||
#
|
||||
# Droping the previously created mysql_upgrade_info file..
|
||||
# Running mysql_upgrade with --skip-write-binlog..
|
||||
Phase 1/4: Checking mysql database
|
||||
Processing databases
|
||||
mysql
|
||||
mysql.column_stats OK
|
||||
mysql.columns_priv OK
|
||||
mysql.db OK
|
||||
mysql.event OK
|
||||
mysql.func OK
|
||||
mysql.gtid_slave_pos OK
|
||||
mysql.help_category OK
|
||||
mysql.help_keyword OK
|
||||
mysql.help_relation OK
|
||||
mysql.help_topic OK
|
||||
mysql.host OK
|
||||
mysql.index_stats OK
|
||||
mysql.innodb_index_stats OK
|
||||
mysql.innodb_table_stats OK
|
||||
mysql.plugin OK
|
||||
mysql.proc OK
|
||||
mysql.procs_priv OK
|
||||
mysql.proxies_priv OK
|
||||
mysql.roles_mapping OK
|
||||
mysql.servers OK
|
||||
mysql.table_stats OK
|
||||
mysql.tables_priv OK
|
||||
mysql.time_zone OK
|
||||
mysql.time_zone_leap_second OK
|
||||
mysql.time_zone_name OK
|
||||
mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
Phase 2/4: Running 'mysql_fix_privilege_tables'...
|
||||
Phase 3/4: Fixing table and database names
|
||||
Phase 4/4: Checking and upgrading tables
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
performance_schema
|
||||
test
|
||||
Phase 3/3: Running 'mysql_fix_privilege_tables'...
|
||||
OK
|
||||
#
|
||||
# MDEV-4332 Increase username length from 16 characters
|
||||
@ -341,13 +386,8 @@ GRANT INSERT ON mysql.user TO very_long_user_name_number_2;
|
||||
GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_1;
|
||||
GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_2;
|
||||
CREATE PROCEDURE test.pr() BEGIN END;
|
||||
Phase 1/3: Fixing table and database names
|
||||
Phase 2/3: Checking and upgrading tables
|
||||
Phase 1/4: Checking mysql database
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
mysql
|
||||
mysql.column_stats OK
|
||||
mysql.columns_priv OK
|
||||
@ -377,9 +417,16 @@ mysql.time_zone_name OK
|
||||
mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
Phase 2/4: Running 'mysql_fix_privilege_tables'...
|
||||
Phase 3/4: Fixing table and database names
|
||||
Phase 4/4: Checking and upgrading tables
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
performance_schema
|
||||
test
|
||||
Phase 3/3: Running 'mysql_fix_privilege_tables'...
|
||||
OK
|
||||
SELECT definer FROM mysql.proc WHERE db = 'test' AND name = 'pr';
|
||||
definer
|
||||
|
@ -1,3 +1,46 @@
|
||||
The --upgrade-system-tables option was used, databases won't be touched.
|
||||
Phase 3/3: Running 'mysql_fix_privilege_tables'...
|
||||
The --upgrade-system-tables option was used, user tables won't be touched.
|
||||
Phase 1/4: Checking mysql database
|
||||
Processing databases
|
||||
mysql
|
||||
mysql.column_stats OK
|
||||
mysql.columns_priv OK
|
||||
mysql.db OK
|
||||
mysql.event OK
|
||||
mysql.func OK
|
||||
mysql.gtid_slave_pos OK
|
||||
mysql.help_category OK
|
||||
mysql.help_keyword OK
|
||||
mysql.help_relation OK
|
||||
mysql.help_topic OK
|
||||
mysql.host OK
|
||||
mysql.index_stats OK
|
||||
mysql.innodb_index_stats
|
||||
Error : Unknown storage engine 'InnoDB'
|
||||
error : Corrupt
|
||||
mysql.innodb_table_stats
|
||||
Error : Unknown storage engine 'InnoDB'
|
||||
error : Corrupt
|
||||
mysql.plugin OK
|
||||
mysql.proc OK
|
||||
mysql.procs_priv OK
|
||||
mysql.proxies_priv OK
|
||||
mysql.roles_mapping OK
|
||||
mysql.servers OK
|
||||
mysql.table_stats OK
|
||||
mysql.tables_priv OK
|
||||
mysql.time_zone OK
|
||||
mysql.time_zone_leap_second OK
|
||||
mysql.time_zone_name OK
|
||||
mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
|
||||
Repairing tables
|
||||
mysql.innodb_index_stats
|
||||
Error : Unknown storage engine 'InnoDB'
|
||||
error : Corrupt
|
||||
mysql.innodb_table_stats
|
||||
Error : Unknown storage engine 'InnoDB'
|
||||
error : Corrupt
|
||||
Phase 2/4: Running 'mysql_fix_privilege_tables'...
|
||||
OK
|
||||
|
@ -1,13 +1,8 @@
|
||||
#
|
||||
# Bug#55672 mysql_upgrade dies with internal error
|
||||
#
|
||||
Phase 1/3: Fixing table and database names
|
||||
Phase 2/3: Checking and upgrading tables
|
||||
Phase 1/4: Checking mysql database
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
mysql
|
||||
mysql.column_stats OK
|
||||
mysql.columns_priv OK
|
||||
@ -37,7 +32,14 @@ mysql.time_zone_name OK
|
||||
mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
Phase 2/4: Running 'mysql_fix_privilege_tables'...
|
||||
Phase 3/4: Fixing table and database names
|
||||
Phase 4/4: Checking and upgrading tables
|
||||
Processing databases
|
||||
information_schema
|
||||
mtr
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
performance_schema
|
||||
test
|
||||
Phase 3/3: Running 'mysql_fix_privilege_tables'...
|
||||
OK
|
||||
|
@ -279,6 +279,11 @@ The following options may be given as the first argument:
|
||||
The default size of key cache blocks
|
||||
--key-cache-division-limit=#
|
||||
The minimum percentage of warm blocks in key cache
|
||||
--key-cache-file-hash-size=#
|
||||
Number of hash buckets for open and changed files. If
|
||||
you have a lot of MyISAM files open you should increase
|
||||
this for faster flush of changes. A good value is
|
||||
probably 1/10 of number of possible open MyISAM files.
|
||||
--key-cache-segments=#
|
||||
The number of segments in a key cache
|
||||
-L, --language=name Client error messages in given language. May be given as
|
||||
@ -1031,8 +1036,8 @@ The following options may be given as the first argument:
|
||||
created to handle remaining clients.
|
||||
--thread-stack=# The stack size for each thread
|
||||
--time-format=name The TIME format (ignored)
|
||||
--timed-mutexes Specify whether to time mutexes (only InnoDB mutexes are
|
||||
currently supported)
|
||||
--timed-mutexes Specify whether to time mutexes. Deprecated, has no
|
||||
effect.
|
||||
--tmp-table-size=# If an internal in-memory temporary table exceeds this
|
||||
size, MySQL will automatically convert it to an on-disk
|
||||
MyISAM or Aria table
|
||||
@ -1154,6 +1159,7 @@ key-buffer-size 134217728
|
||||
key-cache-age-threshold 300
|
||||
key-cache-block-size 1024
|
||||
key-cache-division-limit 100
|
||||
key-cache-file-hash-size 512
|
||||
key-cache-segments 0
|
||||
large-pages FALSE
|
||||
lc-messages en_US
|
||||
|
@ -680,6 +680,9 @@ txt
|
||||
b is b and more is more
|
||||
txt
|
||||
a is a and less is more
|
||||
sflfdt 'ABCDfF bbddff h' bs txt;
|
||||
txt
|
||||
ABCDfF bbddff h
|
||||
create table t2 ( a char(10));
|
||||
garbage;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'garbage' at line 1
|
||||
|
13
mysql-test/r/order_by_innodb.result
Normal file
13
mysql-test/r/order_by_innodb.result
Normal file
@ -0,0 +1,13 @@
|
||||
drop table if exists t0,t1,t2,t3;
|
||||
#
|
||||
# MDEV-6434: Wrong result (extra rows) with ORDER BY, multiple-column index, InnoDB
|
||||
#
|
||||
CREATE TABLE t1 (a INT, b INT, c INT, d TEXT, KEY idx(a,b,c)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 (a,c) VALUES
|
||||
(8, 9),(8, 10),(13, 15),(16, 17),(16, 18),(16, 19),(20, 21),
|
||||
(20, 22),(20, 24),(20, 25),(20, 26),(20, 27),(20, 28);
|
||||
SELECT * FROM t1 WHERE a = 8 AND (b = 1 OR b IS NULL) ORDER BY c;
|
||||
a b c d
|
||||
8 NULL 9 NULL
|
||||
8 NULL 10 NULL
|
||||
DROP TABLE t1;
|
@ -45,6 +45,7 @@ FLUSH STATUS;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -153,6 +154,7 @@ f0 f1 f2
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 0
|
||||
Sort_rows 100
|
||||
Sort_scan 1
|
||||
|
@ -2562,6 +2562,50 @@ id id2 dob address city hours_worked_per_week weeks_worked_last_year
|
||||
16 16 1949-11-07 address16 city16 40 52
|
||||
50 50 1923-09-08 address50 city50 40 52
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-6322: The PARTITION engine can return wrong query results
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
CustomerID varchar(5) DEFAULT NULL,
|
||||
CompanyName varchar(40) DEFAULT NULL,
|
||||
ContactName varchar(30) DEFAULT NULL,
|
||||
ContactTitle varchar(30) DEFAULT NULL,
|
||||
Address varchar(60) DEFAULT NULL,
|
||||
City varchar(15) DEFAULT NULL,
|
||||
Region varchar(15) DEFAULT NULL,
|
||||
PostalCode varchar(10) DEFAULT NULL,
|
||||
Country varchar(15) NOT NULL,
|
||||
Phone varchar(24) DEFAULT NULL,
|
||||
Fax varchar(24) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
PARTITION BY LIST COLUMNS(Country)
|
||||
(PARTITION p1 VALUES IN ('Germany','Austria','Switzerland','Poland'),
|
||||
PARTITION p2 VALUES IN ('USA','Canada','Mexico'),
|
||||
PARTITION p3 VALUES IN ('Spain','Portugal','Italy'),
|
||||
PARTITION p4 VALUES IN ('UK','Ireland'),
|
||||
PARTITION p5 VALUES IN ('France','Belgium'),
|
||||
PARTITION p6 VALUES IN ('Sweden','Finland','Denmark','Norway'),
|
||||
PARTITION p7 VALUES IN ('Venezuela','Argentina','Brazil')
|
||||
);
|
||||
INSERT INTO t1 (CustomerID, City, Country) VALUES
|
||||
('ANATR','México D.F','Mexico'),
|
||||
('ANTON','México D.F','Mexico'),
|
||||
('BOTTM','Tsawassen','Canada'),
|
||||
('CENTC','México D.F','Mexico'),
|
||||
('GREAL','Eugene','USA'),
|
||||
('HUNGC','Elgin','USA'),
|
||||
('LAUGB','Vancouver','Canada'),
|
||||
('LAZYK','Walla Walla','USA'),
|
||||
('LETSS','San Francisco','USA'),
|
||||
('LONEP','Portland','USA');
|
||||
SELECT * FROM t1 WHERE Country = 'USA';
|
||||
CustomerID CompanyName ContactName ContactTitle Address City Region PostalCode Country Phone Fax
|
||||
GREAL NULL NULL NULL NULL Eugene NULL NULL USA NULL NULL
|
||||
HUNGC NULL NULL NULL NULL Elgin NULL NULL USA NULL NULL
|
||||
LAZYK NULL NULL NULL NULL Walla Walla NULL NULL USA NULL NULL
|
||||
LETSS NULL NULL NULL NULL San Francisco NULL NULL USA NULL NULL
|
||||
LONEP NULL NULL NULL NULL Portland NULL NULL USA NULL NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 ( d DATE NOT NULL)
|
||||
PARTITION BY RANGE( YEAR(d) ) (
|
||||
PARTITION p0 VALUES LESS THAN (1960),
|
||||
|
@ -694,6 +694,34 @@ count(*)
|
||||
drop table t3;
|
||||
drop table t1,t2;
|
||||
#
|
||||
# MySQL Bug#71095: Wrong results with PARTITION BY LIST COLUMNS()
|
||||
#
|
||||
create table t1(c1 int, c2 int, c3 int, c4 int,
|
||||
primary key(c1,c2)) engine=InnoDB
|
||||
partition by list columns(c2)
|
||||
(partition p1 values in (1,2) engine=InnoDB,
|
||||
partition p2 values in (3,4) engine=InnoDB);
|
||||
insert into t1 values (1,1,1,1),(2,3,1,1);
|
||||
select * from t1 where c1=2 and c2=3;
|
||||
c1 c2 c3 c4
|
||||
2 3 1 1
|
||||
drop table t1;
|
||||
#
|
||||
# MySQL Bug#72803: Wrong "Impossible where" with LIST partitioning
|
||||
# also MDEV-6240: Wrong "Impossible where" with LIST partitioning
|
||||
#
|
||||
CREATE TABLE t1 ( d DATE) ENGINE = InnoDB
|
||||
PARTITION BY LIST COLUMNS (d)
|
||||
(
|
||||
PARTITION p0 VALUES IN ('1990-01-01','1991-01-01'),
|
||||
PARTITION p1 VALUES IN ('1981-01-01')
|
||||
);
|
||||
INSERT INTO t1 (d) VALUES ('1991-01-01');
|
||||
SELECT * FROM t1 WHERE d = '1991-01-01';
|
||||
d
|
||||
1991-01-01
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-5963: InnoDB: Assertion failure in file row0sel.cc line 2503,
|
||||
# Failing assertion: 0 with "key ptr now exceeds key end by 762 bytes"
|
||||
# (independent testcase for Oracle Bug#13947868)
|
||||
|
@ -3302,6 +3302,120 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0,p1,p2 ALL NULL NULL NULL NULL 100 Using where
|
||||
drop table t0, t1;
|
||||
#
|
||||
# Bug#71095: Wrong results with PARTITION BY LIST COLUMNS()
|
||||
#
|
||||
CREATE TABLE t1
|
||||
(c1 int,
|
||||
c2 int,
|
||||
c3 int,
|
||||
c4 int,
|
||||
PRIMARY KEY (c1,c2))
|
||||
PARTITION BY LIST COLUMNS (c2)
|
||||
(PARTITION p1 VALUES IN (1,2),
|
||||
PARTITION p2 VALUES IN (3,4));
|
||||
INSERT INTO t1 VALUES (1, 1, 1, 1), (2, 3, 1, 1);
|
||||
INSERT INTO t1 VALUES (1, 2, 1, 1), (2, 4, 1, 1);
|
||||
SELECT * FROM t1 WHERE c1 = 1 AND c2 < 1;
|
||||
c1 c2 c3 c4
|
||||
SELECT * FROM t1 WHERE c1 = 1 AND c2 <= 1;
|
||||
c1 c2 c3 c4
|
||||
1 1 1 1
|
||||
SELECT * FROM t1 WHERE c1 = 1 AND c2 = 1;
|
||||
c1 c2 c3 c4
|
||||
1 1 1 1
|
||||
SELECT * FROM t1 WHERE c1 = 1 AND c2 >= 1;
|
||||
c1 c2 c3 c4
|
||||
1 1 1 1
|
||||
1 2 1 1
|
||||
SELECT * FROM t1 WHERE c1 = 1 AND c2 > 1;
|
||||
c1 c2 c3 c4
|
||||
1 2 1 1
|
||||
SELECT * FROM t1 WHERE c1 = 1 AND c2 < 3;
|
||||
c1 c2 c3 c4
|
||||
1 1 1 1
|
||||
1 2 1 1
|
||||
SELECT * FROM t1 WHERE c1 = 1 AND c2 <= 3;
|
||||
c1 c2 c3 c4
|
||||
1 1 1 1
|
||||
1 2 1 1
|
||||
SELECT * FROM t1 WHERE c1 = 2 AND c2 <= 3;
|
||||
c1 c2 c3 c4
|
||||
2 3 1 1
|
||||
SELECT * FROM t1 WHERE c1 = 2 AND c2 = 3;
|
||||
c1 c2 c3 c4
|
||||
2 3 1 1
|
||||
SELECT * FROM t1 WHERE c1 = 2 AND c2 >= 3;
|
||||
c1 c2 c3 c4
|
||||
2 3 1 1
|
||||
2 4 1 1
|
||||
SELECT * FROM t1 WHERE c1 = 2 AND c2 > 3;
|
||||
c1 c2 c3 c4
|
||||
2 4 1 1
|
||||
SELECT * FROM t1 WHERE c1 = 2 AND c2 < 4;
|
||||
c1 c2 c3 c4
|
||||
2 3 1 1
|
||||
SELECT * FROM t1 WHERE c1 = 2 AND c2 <= 4;
|
||||
c1 c2 c3 c4
|
||||
2 3 1 1
|
||||
2 4 1 1
|
||||
SELECT * FROM t1 WHERE c1 = 2 AND c2 = 4;
|
||||
c1 c2 c3 c4
|
||||
2 4 1 1
|
||||
SELECT * FROM t1 WHERE c1 = 2 AND c2 >= 4;
|
||||
c1 c2 c3 c4
|
||||
2 4 1 1
|
||||
SELECT * FROM t1 WHERE c1 = 2 AND c2 > 4;
|
||||
c1 c2 c3 c4
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 < 1;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 <= 1;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p1 range PRIMARY PRIMARY 8 NULL 1 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 = 1;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p1 const PRIMARY PRIMARY 8 const,const 1
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 >= 1;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 2 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 > 1;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 2 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 < 3;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p1 range PRIMARY PRIMARY 8 NULL 1 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 <= 3;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 2 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 <= 3;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 2 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 = 3;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2 const PRIMARY PRIMARY 8 const,const 1
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 >= 3;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2 range PRIMARY PRIMARY 8 NULL 1 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 > 3;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2 range PRIMARY PRIMARY 8 NULL 1 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 < 4;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 2 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 <= 4;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 2 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 = 4;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2 const PRIMARY PRIMARY 8 const,const 1
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 >= 4;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2 range PRIMARY PRIMARY 8 NULL 1 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 > 4;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-6239: Partition pruning is not working as expected in an inner query
|
||||
#
|
||||
create table t1
|
||||
|
@ -8,3 +8,6 @@ PLUGIN_TYPE STORAGE ENGINE
|
||||
PLUGIN_LIBRARY NULL
|
||||
PLUGIN_LIBRARY_VERSION NULL
|
||||
LOAD_OPTION ON
|
||||
#
|
||||
# MDEV-6351 --plugin=force has no effect for built-in plugins
|
||||
#
|
||||
|
@ -4,18 +4,59 @@ include/master-slave.inc
|
||||
# New --dump-slave, --apply-slave-statements functionality
|
||||
#
|
||||
use test;
|
||||
-- SET GLOBAL gtid_slave_pos='';
|
||||
CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
|
||||
STOP ALL SLAVES;
|
||||
-- SET GLOBAL gtid_slave_pos='';
|
||||
CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
|
||||
START ALL SLAVES;
|
||||
STOP ALL SLAVES;
|
||||
-- SET GLOBAL gtid_slave_pos='';
|
||||
CHANGE MASTER '' TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
|
||||
START ALL SLAVES;
|
||||
start slave;
|
||||
Warnings:
|
||||
Note 1254 Slave is already running
|
||||
-- SET GLOBAL gtid_slave_pos='';
|
||||
CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
|
||||
start slave;
|
||||
Warnings:
|
||||
Note 1254 Slave is already running
|
||||
*** Test mysqldump --dump-slave GTID functionality.
|
||||
SET gtid_seq_no = 1000;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY);
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t2 (a INT PRIMARY KEY);
|
||||
DROP TABLE t2;
|
||||
|
||||
1. --dump-slave=1
|
||||
|
||||
SET GLOBAL gtid_slave_pos='0-1-1001';
|
||||
CHANGE MASTER '' TO MASTER_USE_GTID=slave_pos;
|
||||
-- CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
|
||||
|
||||
2. --dump-slave=2
|
||||
|
||||
-- SET GLOBAL gtid_slave_pos='0-1-1001';
|
||||
-- CHANGE MASTER '' TO MASTER_USE_GTID=slave_pos;
|
||||
-- CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
|
||||
*** Test mysqldump --master-data GTID functionality.
|
||||
|
||||
1. --master-data=1
|
||||
|
||||
-- CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
|
||||
CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
|
||||
SET GLOBAL gtid_slave_pos='0-2-1003';
|
||||
|
||||
2. --master-data=2
|
||||
|
||||
-- CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
|
||||
-- CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
|
||||
-- SET GLOBAL gtid_slave_pos='0-2-1003';
|
||||
|
||||
3. --master-data --single-transaction
|
||||
|
||||
-- CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
|
||||
CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
|
||||
SET GLOBAL gtid_slave_pos='0-2-1003';
|
||||
include/rpl_end.inc
|
||||
|
3
mysql-test/r/sighup-6580.result
Normal file
3
mysql-test/r/sighup-6580.result
Normal file
@ -0,0 +1,3 @@
|
||||
select 'ok';
|
||||
ok
|
||||
ok
|
@ -18,6 +18,7 @@ NULL 15
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -36,6 +37,7 @@ DELETE FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -71,6 +73,7 @@ NULL 15
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 0
|
||||
Sort_rows 5
|
||||
Sort_scan 1
|
||||
@ -89,6 +92,7 @@ DELETE FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 8
|
||||
Sort_scan 1
|
||||
@ -121,6 +125,7 @@ a b c d
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 0
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
@ -139,6 +144,7 @@ DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
@ -175,6 +181,7 @@ a b c d
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -193,6 +200,7 @@ DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -223,6 +231,7 @@ a b c d
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 0
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
@ -241,6 +250,7 @@ DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
@ -269,6 +279,7 @@ a b c d
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 0
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
@ -287,6 +298,7 @@ DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
@ -318,6 +330,7 @@ NULL 13 13
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 1
|
||||
Sort_rows 4
|
||||
Sort_scan 0
|
||||
@ -341,6 +354,7 @@ DELETE FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 1
|
||||
Sort_rows 4
|
||||
Sort_scan 0
|
||||
@ -378,6 +392,7 @@ NULL 14
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -396,6 +411,7 @@ DELETE FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i DESC LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -431,6 +447,7 @@ a b c
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 0
|
||||
Sort_rows 5
|
||||
Sort_scan 1
|
||||
@ -449,6 +466,7 @@ DELETE FROM t2 ORDER BY a, b DESC LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 16
|
||||
Sort_scan 1
|
||||
@ -493,6 +511,7 @@ a b c
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -517,6 +536,7 @@ a b c
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -535,6 +555,7 @@ DELETE FROM t2 ORDER BY a DESC, b DESC LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -571,6 +592,7 @@ NULL 15
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -589,6 +611,7 @@ UPDATE t2 SET a = 10 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -629,6 +652,7 @@ NULL 15
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 0
|
||||
Sort_rows 5
|
||||
Sort_scan 1
|
||||
@ -647,6 +671,7 @@ UPDATE t2 SET a = 10 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 0
|
||||
Sort_rows 5
|
||||
Sort_scan 1
|
||||
@ -684,6 +709,7 @@ a b c d
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 0
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
@ -702,6 +728,7 @@ UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 0
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
@ -738,6 +765,7 @@ a b c d
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -756,6 +784,7 @@ UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -786,6 +815,7 @@ a b c d
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 0
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
@ -804,6 +834,7 @@ UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 0
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
@ -833,6 +864,7 @@ a b c d
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 0
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
@ -851,6 +883,7 @@ UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 0
|
||||
Sort_rows 1
|
||||
Sort_scan 1
|
||||
@ -883,6 +916,7 @@ NULL 13 13
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 1
|
||||
Sort_rows 4
|
||||
Sort_scan 0
|
||||
@ -906,6 +940,7 @@ UPDATE t2 SET i = 123 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 1
|
||||
Sort_rows 4
|
||||
Sort_scan 0
|
||||
@ -947,6 +982,7 @@ NULL 14
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -965,6 +1001,7 @@ UPDATE t2 SET a = 10 WHERE i > 10 AND i <= 18 ORDER BY i DESC LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -1005,6 +1042,7 @@ a b c
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 0
|
||||
Sort_rows 5
|
||||
Sort_scan 1
|
||||
@ -1023,6 +1061,7 @@ UPDATE t2 SET c = 10 ORDER BY a, b DESC LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 1
|
||||
Sort_range 0
|
||||
Sort_rows 5
|
||||
Sort_scan 1
|
||||
@ -1061,6 +1100,7 @@ a b c
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -1085,6 +1125,7 @@ a b c
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
@ -1103,6 +1144,7 @@ UPDATE t2 SET c = 10 ORDER BY a DESC, b DESC LIMIT 5;
|
||||
SHOW SESSION STATUS LIKE 'Sort%';
|
||||
Variable_name Value
|
||||
Sort_merge_passes 0
|
||||
Sort_priority_queue_sorts 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
|
@ -275,3 +275,9 @@ END $$
|
||||
CALL test_5531(1);
|
||||
DROP PROCEDURE test_5531;
|
||||
DROP TABLE t1;
|
||||
create procedure sp() begin
|
||||
commit;
|
||||
end|
|
||||
start transaction;
|
||||
call sp();
|
||||
drop procedure sp;
|
||||
|
23
mysql-test/r/sp-bugs2.result
Normal file
23
mysql-test/r/sp-bugs2.result
Normal file
@ -0,0 +1,23 @@
|
||||
CREATE TABLE t1 (i INT);
|
||||
SET @a = 2;
|
||||
CREATE TABLE IF NOT EXISTS t2 (i INT) ENGINE = MyISAM
|
||||
AS SELECT * FROM t1;
|
||||
CREATE TABLE IF NOT EXISTS t2 (i INT) ENGINE = MyISAM
|
||||
AS SELECT * FROM t1;
|
||||
Warnings:
|
||||
Note 1050 Table 't2' already exists
|
||||
DROP TABLE t2;
|
||||
CREATE PROCEDURE sp()
|
||||
BEGIN
|
||||
REPEAT
|
||||
CREATE TABLE IF NOT EXISTS t2 (i INT) ENGINE = MyISAM
|
||||
AS SELECT * FROM t1;
|
||||
SET @a = @a - 1;
|
||||
UNTIL @a = 0
|
||||
END REPEAT ;
|
||||
END |
|
||||
CALL sp();
|
||||
Warnings:
|
||||
Note 1050 Table 't2' already exists
|
||||
DROP PROCEDURE sp;
|
||||
DROP TABLE t1, t2;
|
10
mysql-test/r/stat_tables-enospc.result
Normal file
10
mysql-test/r/stat_tables-enospc.result
Normal file
@ -0,0 +1,10 @@
|
||||
call mtr.add_suppression("No space left on device");
|
||||
create table t1 (a varchar(255), b varchar(255), c varchar(255));
|
||||
set use_stat_tables=PREFERABLY, optimizer_use_condition_selectivity=3;
|
||||
set debug_dbug='+d,simulate_file_write_error';
|
||||
analyze table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze Error Error writing file 'tmp-file' (Errcode: 28 "No space left on device")
|
||||
test.t1 analyze status Operation failed
|
||||
set debug_dbug='';
|
||||
drop table t1;
|
@ -2108,6 +2108,43 @@ EXECUTE stmt;
|
||||
a
|
||||
DROP TABLE t1, t2;
|
||||
DROP VIEW v2;
|
||||
#
|
||||
# MDEV-6289 : Unexpected results when querying information_schema
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
id int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
db varchar(254) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY db (db)
|
||||
) DEFAULT CHARSET=utf8;
|
||||
INSERT INTO t1 (db) VALUES ('mysqltest1'),('mysqltest2'),('mysqltest3'),('mysqltest4');
|
||||
drop database if exists mysqltest1;
|
||||
drop database if exists mysqltest2;
|
||||
drop database if exists mysqltest3;
|
||||
drop database if exists mysqltest4;
|
||||
create database mysqltest1;
|
||||
create database mysqltest2;
|
||||
create database mysqltest3;
|
||||
create database mysqltest4;
|
||||
SELECT db FROM t1 WHERE db IN (SELECT SCHEMA_NAME FROM information_schema.schemata) ORDER BY db DESC;
|
||||
db
|
||||
mysqltest4
|
||||
mysqltest3
|
||||
mysqltest2
|
||||
mysqltest1
|
||||
EXPLAIN EXTENDED
|
||||
SELECT db FROM t1 WHERE db IN (SELECT SCHEMA_NAME FROM information_schema.schemata) ORDER BY db DESC;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2 100.00 Using temporary; Using filesort
|
||||
1 PRIMARY t1 eq_ref db db 764 information_schema.schemata.SCHEMA_NAME 1 100.00 Using where; Using index
|
||||
2 MATERIALIZED schemata ALL NULL NULL NULL NULL NULL NULL
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`db` AS `db` from `test`.`t1` semi join (`information_schema`.`schemata`) where (`test`.`t1`.`db` = `information_schema`.`schemata`.`SCHEMA_NAME`) order by `test`.`t1`.`db` desc
|
||||
drop table t1;
|
||||
drop database mysqltest1;
|
||||
drop database mysqltest2;
|
||||
drop database mysqltest3;
|
||||
drop database mysqltest4;
|
||||
# End of 5.5 tests
|
||||
set @subselect_mat_test_optimizer_switch_value=null;
|
||||
set @@optimizer_switch='materialization=on,in_to_exists=off,semijoin=off';
|
||||
|
@ -2148,4 +2148,41 @@ EXECUTE stmt;
|
||||
a
|
||||
DROP TABLE t1, t2;
|
||||
DROP VIEW v2;
|
||||
#
|
||||
# MDEV-6289 : Unexpected results when querying information_schema
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
id int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
db varchar(254) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY db (db)
|
||||
) DEFAULT CHARSET=utf8;
|
||||
INSERT INTO t1 (db) VALUES ('mysqltest1'),('mysqltest2'),('mysqltest3'),('mysqltest4');
|
||||
drop database if exists mysqltest1;
|
||||
drop database if exists mysqltest2;
|
||||
drop database if exists mysqltest3;
|
||||
drop database if exists mysqltest4;
|
||||
create database mysqltest1;
|
||||
create database mysqltest2;
|
||||
create database mysqltest3;
|
||||
create database mysqltest4;
|
||||
SELECT db FROM t1 WHERE db IN (SELECT SCHEMA_NAME FROM information_schema.schemata) ORDER BY db DESC;
|
||||
db
|
||||
mysqltest4
|
||||
mysqltest3
|
||||
mysqltest2
|
||||
mysqltest1
|
||||
EXPLAIN EXTENDED
|
||||
SELECT db FROM t1 WHERE db IN (SELECT SCHEMA_NAME FROM information_schema.schemata) ORDER BY db DESC;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2 100.00 Using temporary; Using filesort
|
||||
1 PRIMARY t1 eq_ref db db 764 information_schema.schemata.SCHEMA_NAME 1 100.00 Using where; Using index
|
||||
2 MATERIALIZED schemata ALL NULL NULL NULL NULL NULL NULL
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`db` AS `db` from `test`.`t1` semi join (`information_schema`.`schemata`) where (`test`.`t1`.`db` = `information_schema`.`schemata`.`SCHEMA_NAME`) order by `test`.`t1`.`db` desc
|
||||
drop table t1;
|
||||
drop database mysqltest1;
|
||||
drop database mysqltest2;
|
||||
drop database mysqltest3;
|
||||
drop database mysqltest4;
|
||||
# End of 5.5 tests
|
||||
|
37
mysql-test/r/table_options-5867.result
Normal file
37
mysql-test/r/table_options-5867.result
Normal file
@ -0,0 +1,37 @@
|
||||
install soname 'ha_example';
|
||||
set sql_mode='ignore_bad_table_options';
|
||||
create table t1 (
|
||||
a int complex='c,f,f,f' invalid=3
|
||||
) engine=example ull=10000 str='dskj' one_or_two='one' yesno=0
|
||||
foobar=barfoo;
|
||||
Warnings:
|
||||
Warning 1911 Unknown option 'invalid'
|
||||
Warning 1911 Unknown option 'foobar'
|
||||
create table t2 (a int, key (a) some_option=2014);
|
||||
Warnings:
|
||||
Warning 1911 Unknown option 'some_option'
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL `complex`='c,f,f,f' `invalid`=3
|
||||
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=10000 `str`='dskj' `one_or_two`='one' `yesno`=0 `foobar`=barfoo `VAROPT`='5'
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
KEY `a` (`a`) `some_option`=2014
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
set sql_mode='';
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL `complex`='c,f,f,f' /* `invalid`=3 */
|
||||
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=10000 `str`='dskj' `one_or_two`='one' `yesno`=0 /* `foobar`=barfoo */ `VAROPT`='5'
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
KEY `a` (`a`) /* `some_option`=2014 */
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1, t2;
|
||||
uninstall soname 'ha_example';
|
@ -722,7 +722,12 @@ DROP TABLE t1;
|
||||
CREATE TABLE IF NOT EXISTS t1 (
|
||||
f1 bit(2) NOT NULL default b''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
||||
ERROR 42000: Invalid default value for 'f1'
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` bit(2) NOT NULL DEFAULT b'0'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
|
||||
DROP TABLE t1;
|
||||
create table t1bit7 (a1 bit(7) not null) engine=MyISAM;
|
||||
create table t2bit7 (b1 bit(7)) engine=MyISAM;
|
||||
insert into t1bit7 values (b'1100000');
|
||||
|
@ -413,3 +413,12 @@ a
|
||||
`
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
create table t1(f1 bit(2) not null default b'10',f2 bit(14) not null default b'11110000111100');
|
||||
insert into t1 (f1) values (default);
|
||||
insert into t1 values (b'',b''),('','');
|
||||
select hex(f1), hex(f2) from t1;
|
||||
hex(f1) hex(f2)
|
||||
2 3C3C
|
||||
0 0
|
||||
0 0
|
||||
drop table t1;
|
||||
|
@ -810,10 +810,10 @@ c1
|
||||
drop table t1;
|
||||
SELECT 1 % .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS '%';
|
||||
%
|
||||
0.012345687012345687012345687012345687012345687012345687012345687012345687000000000
|
||||
0.012345687012345687012345687012
|
||||
SELECT MOD(1, .123456789123456789123456789123456789123456789123456789123456789123456789123456789) AS 'MOD()';
|
||||
MOD()
|
||||
0.012345687012345687012345687012345687012345687012345687012345687012345687000000000
|
||||
0.012345687012345687012345687012
|
||||
create table t1 (f1 decimal(6,6),f2 decimal(6,6) zerofill);
|
||||
insert into t1 values (-0.123456,0.123456);
|
||||
select group_concat(f1),group_concat(f2) from t1;
|
||||
|
@ -703,7 +703,7 @@ select .7777777777777777777777777777777777777 *
|
||||
777777777777777777.777777777777777777700000000000
|
||||
select .7777777777777777777777777777777777777 - 0.1;
|
||||
.7777777777777777777777777777777777777 - 0.1
|
||||
0.6777777777777777777777777777777777777
|
||||
0.677777777777777777777777777778
|
||||
select .343434343434343434 + .343434343434343434;
|
||||
.343434343434343434 + .343434343434343434
|
||||
0.686868686868686868
|
||||
@ -1840,7 +1840,7 @@ Warnings:
|
||||
Note 1265 Data truncated for column 'c1' at row 4
|
||||
DESC t2;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(32,30) YES NULL
|
||||
c1 decimal(33,30) YES NULL
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a DECIMAL(30,30));
|
||||
INSERT INTO t1 VALUES (0.1),(0.2),(0.3);
|
||||
@ -1851,7 +1851,7 @@ Note 1265 Data truncated for column 'c1' at row 2
|
||||
Note 1265 Data truncated for column 'c1' at row 3
|
||||
DESC t2;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(34,0) YES NULL
|
||||
c1 decimal(33,30) YES NULL
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a DECIMAL(30,30));
|
||||
INSERT INTO t1 VALUES (0.1),(0.2),(0.3);
|
||||
|
@ -1876,6 +1876,40 @@ SELECT(SELECT 1 AS a FROM dual ORDER BY a DESC LIMIT 1) AS dev;
|
||||
dev
|
||||
1
|
||||
#
|
||||
# Bug #17059925 : UNIONS COMPUTES ROWS_EXAMINED INCORRECTLY
|
||||
#
|
||||
SET @old_slow_query_log= @@global.slow_query_log;
|
||||
SET @old_log_output= @@global.log_output;
|
||||
SET @old_long_query_time= @@long_query_time;
|
||||
SET GLOBAL log_output= "TABLE";
|
||||
SET GLOBAL slow_query_log= ON;
|
||||
SET SESSION long_query_time= 0;
|
||||
CREATE TABLE t17059925 (a INT);
|
||||
CREATE TABLE t2 (b INT);
|
||||
CREATE TABLE t3 (c INT);
|
||||
INSERT INTO t17059925 VALUES (1), (2), (3);
|
||||
INSERT INTO t2 VALUES (4), (5), (6);
|
||||
INSERT INTO t3 VALUES (7), (8), (9);
|
||||
TRUNCATE table mysql.slow_log;
|
||||
SELECT * FROM t17059925 UNION SELECT * FROM t2 UNION SELECT * FROM t3;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
SELECT sql_text, rows_examined FROM mysql.slow_log WHERE sql_text LIKE '%SELECT%t17059925%';
|
||||
sql_text rows_examined
|
||||
SELECT * FROM t17059925 UNION SELECT * FROM t2 UNION SELECT * FROM t3 18
|
||||
DROP TABLE t17059925, t2, t3;
|
||||
SET @@long_query_time= @old_long_query_time;
|
||||
SET @@global.log_output= @old_log_output;
|
||||
SET @@global.slow_query_log= @old_slow_query_log;
|
||||
#
|
||||
# lp:1010729: Unexpected syntax error from UNION
|
||||
# (bug #54382) with single-table join nest
|
||||
#
|
||||
|
@ -189,6 +189,8 @@ select @@concurrent_insert;
|
||||
@@concurrent_insert
|
||||
AUTO
|
||||
set global timed_mutexes=ON;
|
||||
Warnings:
|
||||
Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release.
|
||||
show variables like 'timed_mutexes';
|
||||
Variable_name Value
|
||||
timed_mutexes ON
|
||||
@ -196,6 +198,8 @@ select * from information_schema.session_variables where variable_name like 'tim
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
TIMED_MUTEXES ON
|
||||
set global timed_mutexes=0;
|
||||
Warnings:
|
||||
Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release.
|
||||
show variables like 'timed_mutexes';
|
||||
Variable_name Value
|
||||
timed_mutexes OFF
|
||||
@ -1789,4 +1793,13 @@ set session rand_seed1=DEFAULT;
|
||||
ERROR 42000: Variable 'rand_seed1' doesn't have a default value
|
||||
set autocommit = values(v);
|
||||
ERROR 42S22: Unknown column 'v' in 'field list'
|
||||
set session sql_mode=ansi_quotes;
|
||||
select * from information_schema.session_variables where variable_name='sql_mode';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
SQL_MODE ANSI_QUOTES
|
||||
show global status like 'foobar';
|
||||
Variable_name Value
|
||||
select * from information_schema.session_variables where variable_name='sql_mode';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
SQL_MODE ANSI_QUOTES
|
||||
End of 5.5 tests
|
||||
|
@ -4789,6 +4789,45 @@ DROP DATABASE IF EXISTS nodb;
|
||||
CREATE VIEW nodb.a AS SELECT 1;
|
||||
ERROR 42000: Unknown database 'nodb'
|
||||
#
|
||||
# BUG#14117018 - MYSQL SERVER CREATES INVALID VIEW DEFINITION
|
||||
# BUG#18405221 - SHOW CREATE VIEW OUTPUT INCORRECT
|
||||
#
|
||||
CREATE VIEW v1 AS (SELECT '' FROM DUAL);
|
||||
CREATE VIEW v2 AS (SELECT 'BUG#14117018' AS col1 FROM DUAL) UNION ALL
|
||||
(SELECT '' FROM DUAL);
|
||||
CREATE VIEW v3 AS (SELECT 'BUG#14117018' AS col1 FROM DUAL) UNION ALL
|
||||
(SELECT '' FROM DUAL) UNION ALL
|
||||
(SELECT '' FROM DUAL);
|
||||
CREATE VIEW v4 AS (SELECT 'BUG#14117018' AS col1 FROM DUAL) UNION ALL
|
||||
(SELECT '' AS col2 FROM DUAL) UNION ALL
|
||||
(SELECT '' FROM DUAL);
|
||||
CREATE VIEW v5 AS (SELECT 'buggy' AS col1, 'fix' as col2 FROM DUAL) UNION ALL
|
||||
(SELECT 'buggy' as a, 'fix' as a FROM DUAL);
|
||||
# Name for the column in select1 is set properly with or
|
||||
# without this fix.
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select '' AS `Name_exp_1`) latin1 latin1_swedish_ci
|
||||
# Name for the column in select2 is set with this fix.
|
||||
# Without this fix, name would not have set for the
|
||||
# columns in select2.
|
||||
SHOW CREATE VIEW v2;
|
||||
View Create View character_set_client collation_connection
|
||||
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS (select 'BUG#14117018' AS `col1`) union all (select '' AS `Name_exp_1`) latin1 latin1_swedish_ci
|
||||
# Name for the field item in select2 & select3 is set with this fix.
|
||||
# Without this fix, name would not have set for the
|
||||
# columns in select2 & select3.
|
||||
SHOW CREATE VIEW v3;
|
||||
View Create View character_set_client collation_connection
|
||||
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS (select 'BUG#14117018' AS `col1`) union all (select '' AS `Name_exp_1`) union all (select '' AS `Name_exp_1`) latin1 latin1_swedish_ci
|
||||
# Name for the field item in select3 is set with this fix.
|
||||
# Without this fix, name would not have set for the
|
||||
# columns in select3.
|
||||
SHOW CREATE VIEW v4;
|
||||
View Create View character_set_client collation_connection
|
||||
v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS (select 'BUG#14117018' AS `col1`) union all (select '' AS `col2`) union all (select '' AS `Name_exp_1`) latin1 latin1_swedish_ci
|
||||
DROP VIEW v1, v2, v3, v4, v5;
|
||||
#
|
||||
# lp:833600 Wrong result with view + outer join + uncorrelated subquery (non-semijoin)
|
||||
#
|
||||
CREATE TABLE t1 ( a int, b int );
|
||||
@ -5300,6 +5339,61 @@ NULL 8
|
||||
drop view v1;
|
||||
drop table t1,t2,t3;
|
||||
SET optimizer_switch=@save_optimizer_switch_MDEV_3874;
|
||||
CREATE TABLE `t1` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`f0` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
`f1` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `id` (`id`)
|
||||
);
|
||||
CREATE TABLE `t2` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`f02` bigint(20) unsigned NOT NULL DEFAULT '0',
|
||||
`f03` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `id` (`id`)
|
||||
);
|
||||
CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `v1` AS
|
||||
SELECT
|
||||
`t1`.`f0` AS `f0`,
|
||||
`t1`.`f1` AS `f1`,
|
||||
`t2`.`f02` AS `f02`,
|
||||
`t2`.`f03` AS `f03`
|
||||
FROM
|
||||
(`t1` LEFT JOIN `t2` ON((`t1`.`id` = `t2`.`f02`)));
|
||||
CREATE FUNCTION `f1`(
|
||||
p0 BIGINT(20) UNSIGNED
|
||||
)
|
||||
RETURNS bigint(20) unsigned
|
||||
DETERMINISTIC
|
||||
CONTAINS SQL
|
||||
SQL SECURITY DEFINER
|
||||
COMMENT ''
|
||||
BEGIN
|
||||
DECLARE k0 INTEGER UNSIGNED DEFAULT 0;
|
||||
DECLARE lResult INTEGER UNSIGNED DEFAULT 0;
|
||||
SET k0 = 0;
|
||||
WHILE k0 < 1 DO
|
||||
SELECT COUNT(*) as `f00` INTO lResult FROM `v1` WHERE `v1`.`f0` = p0; -- BUG
|
||||
SET k0 = k0 + 1;
|
||||
END WHILE;
|
||||
RETURN(k0);
|
||||
END|
|
||||
SELECT `f1`(1);
|
||||
`f1`(1)
|
||||
1
|
||||
SELECT `f1`(1);
|
||||
`f1`(1)
|
||||
1
|
||||
SELECT `f1`(1);
|
||||
`f1`(1)
|
||||
1
|
||||
SELECT `f1`(1);
|
||||
`f1`(1)
|
||||
1
|
||||
DROP FUNCTION f1;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1, t2;
|
||||
# -----------------------------------------------------------------
|
||||
# -- End of 5.5 tests.
|
||||
# -----------------------------------------------------------------
|
||||
|
BIN
mysql-test/std_data/mdev6020-mysql-bin.000001
Normal file
BIN
mysql-test/std_data/mdev6020-mysql-bin.000001
Normal file
Binary file not shown.
6
mysql-test/std_data/new-format-relay-log-win.info
Normal file
6
mysql-test/std_data/new-format-relay-log-win.info
Normal file
@ -0,0 +1,6 @@
|
||||
5
|
||||
.\slave-relay-bin.000001
|
||||
4
|
||||
|
||||
0
|
||||
0
|
6
mysql-test/std_data/new-format-relay-log.info
Normal file
6
mysql-test/std_data/new-format-relay-log.info
Normal file
@ -0,0 +1,6 @@
|
||||
5
|
||||
./slave-relay-bin.000001
|
||||
4
|
||||
|
||||
0
|
||||
0
|
4
mysql-test/std_data/old-format-relay-log-win.info
Normal file
4
mysql-test/std_data/old-format-relay-log-win.info
Normal file
@ -0,0 +1,4 @@
|
||||
.\slave-relay-bin.000001
|
||||
4
|
||||
|
||||
0
|
4
mysql-test/std_data/old-format-relay-log.info
Normal file
4
mysql-test/std_data/old-format-relay-log.info
Normal file
@ -0,0 +1,4 @@
|
||||
./slave-relay-bin.000001
|
||||
4
|
||||
|
||||
0
|
@ -127,3 +127,29 @@ select count(*) from t1;
|
||||
count(*)
|
||||
100
|
||||
drop table t1;
|
||||
#
|
||||
#BUG 18618561: FAILED ALTER TABLE ENGINE CHANGE WITH PARTITIONS
|
||||
# CORRUPTS FRM
|
||||
CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE= MYISAM PARTITION BY HASH(fld1)
|
||||
PARTITIONS 5;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`fld1` int(11) NOT NULL,
|
||||
PRIMARY KEY (`fld1`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY HASH (fld1)
|
||||
PARTITIONS 5 */
|
||||
ALTER TABLE t1 ENGINE= ARCHIVE;
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options")
|
||||
#After the patch, the ENGINE is correctly displayed as MyISAM
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`fld1` int(11) NOT NULL,
|
||||
PRIMARY KEY (`fld1`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY HASH (fld1)
|
||||
PARTITIONS 5 */
|
||||
#Cleanup.
|
||||
DROP TABLE t1;
|
||||
|
@ -129,3 +129,21 @@ show create table t1;
|
||||
select count(*) from t1;
|
||||
drop table t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo #BUG 18618561: FAILED ALTER TABLE ENGINE CHANGE WITH PARTITIONS
|
||||
--echo # CORRUPTS FRM
|
||||
|
||||
CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE= MYISAM PARTITION BY HASH(fld1)
|
||||
PARTITIONS 5;
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
ALTER TABLE t1 ENGINE= ARCHIVE;
|
||||
|
||||
--echo #After the patch, the ENGINE is correctly displayed as MyISAM
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
--echo #Cleanup.
|
||||
DROP TABLE t1;
|
||||
|
@ -2706,8 +2706,6 @@ Warnings:
|
||||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. CREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
|
||||
INSERT INTO insert_2_keys VALUES (1, 2)
|
||||
ON DUPLICATE KEY UPDATE a=VALUES(a)+10, b=VALUES(b)+10;
|
||||
Warnings:
|
||||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
|
||||
DROP TABLE filler_table;
|
||||
DROP TABLE insert_table;
|
||||
DROP TABLE update_table;
|
||||
|
@ -353,6 +353,10 @@ drop function bug27563;
|
||||
# common cleanup
|
||||
#
|
||||
|
||||
connection default;
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
|
||||
drop table t1,t2,t3;
|
||||
|
||||
--echo end of the tests
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user