Skip to content

Commit

Permalink
Merge 10.2 into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Aug 10, 2020
2 parents 0025eb3 + 3b6dadb commit bafc5c1
Show file tree
Hide file tree
Showing 35 changed files with 665 additions and 292 deletions.
18 changes: 18 additions & 0 deletions mysql-test/main/grant.result
Expand Up @@ -2771,6 +2771,24 @@ root@localhost
DROP TABLE t1;
DROP USER dummy@localhost;
#
# MDEV-23082: ER_TABLEACCESS_DENIED_ERROR error message is truncated, and
# inaccurately
#
CREATE USER foo;
CREATE DATABASE db;
CREATE TABLE db.t (a INT);
connect con1,localhost,foo,,;
GRANT ALL ON db.t TO foo;
ERROR 42000: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, GRANT, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW ... command denied to user 'foo'@'localhost' for table 't'
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, GRANT OPTION, REFERENCES,
INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON db.t TO foo;
ERROR 42000: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, GRANT, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW ... command denied to user 'foo'@'localhost' for table 't'
connection default;
disconnect con1;
DROP USER foo;
DROP TABLE db.t;
DROP DATABASE db;
#
# End of 10.2 tests
#
#
Expand Down
25 changes: 25 additions & 0 deletions mysql-test/main/grant.test
Expand Up @@ -2267,6 +2267,31 @@ SELECT * FROM t1;
DROP TABLE t1;
DROP USER dummy@localhost;

--echo #
--echo # MDEV-23082: ER_TABLEACCESS_DENIED_ERROR error message is truncated, and
--echo # inaccurately
--echo #

CREATE USER foo;
CREATE DATABASE db;
CREATE TABLE db.t (a INT);

--connect (con1,localhost,foo,,)

--error ER_TABLEACCESS_DENIED_ERROR
GRANT ALL ON db.t TO foo;

--error ER_TABLEACCESS_DENIED_ERROR
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, GRANT OPTION, REFERENCES,
INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON db.t TO foo;

--connection default
--disconnect con1

DROP USER foo;
DROP TABLE db.t;
DROP DATABASE db;

--echo #
--echo # End of 10.2 tests
--echo #
Expand Down
15 changes: 15 additions & 0 deletions mysql-test/main/information_schema.result
Expand Up @@ -2202,6 +2202,21 @@ SCHEMA_NAME
# End of 10.1 tests
#
#
# Start of 10.2 Test
#
# MDEV-14836: Assertion `m_status == DA_ERROR' failed in
# Diagnostics_area::sql_errno upon query from I_S with LIMIT ROWS EXAMINED
#
SELECT * FROM INFORMATION_SCHEMA.`COLUMNS` LIMIT ROWS EXAMINED 10;
ERROR HY000: Unknown error
SHOW WARNINGS;
Level Code Message
Error 1105 Unknown error
Warning 1931 Query execution was interrupted. The query examined at least 11 rows, which exceeds LIMIT ROWS EXAMINED (10). The query result may be incomplete
#
# End of 10.2 Test
#
#
# MDEV-21201:No records produced in information_schema query,
# depending on projection
#
Expand Down
14 changes: 14 additions & 0 deletions mysql-test/main/information_schema.test
Expand Up @@ -1923,6 +1923,20 @@ SELECT SCHEMA_NAME from information_schema.schemata where schema_name=REPEAT('a'
--echo # End of 10.1 tests
--echo #

--echo #
--echo # Start of 10.2 Test
--echo #
--echo # MDEV-14836: Assertion `m_status == DA_ERROR' failed in
--echo # Diagnostics_area::sql_errno upon query from I_S with LIMIT ROWS EXAMINED
--echo #

--error ER_UNKNOWN_ERROR
SELECT * FROM INFORMATION_SCHEMA.`COLUMNS` LIMIT ROWS EXAMINED 10;
SHOW WARNINGS;

--echo #
--echo # End of 10.2 Test
--echo #

--echo #
--echo # MDEV-21201:No records produced in information_schema query,
Expand Down
18 changes: 18 additions & 0 deletions mysql-test/main/mysql_tzinfo_to_sql_symlink.result
Expand Up @@ -85,6 +85,15 @@ END IF|
#
# Testing with explicit timezonefile
#
\d |
IF (select count(*) from information_schema.global_variables where
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=InnoDB;
ALTER TABLE time_zone_name ENGINE=InnoDB;
ALTER TABLE time_zone_transition ENGINE=InnoDB;
ALTER TABLE time_zone_transition_type ENGINE=InnoDB;
END IF|
\d ;
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
SET @time_zone_id= LAST_INSERT_ID();
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id);
Expand All @@ -106,6 +115,15 @@ END IF|
\d |
IF (select count(*) from information_schema.global_variables where
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=InnoDB;
ALTER TABLE time_zone_name ENGINE=InnoDB;
ALTER TABLE time_zone_transition ENGINE=InnoDB;
ALTER TABLE time_zone_transition_type ENGINE=InnoDB;
END IF|
\d ;
\d |
IF (select count(*) from information_schema.global_variables where
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone_leap_second ENGINE=InnoDB;
END IF|
\d ;
Expand Down
14 changes: 0 additions & 14 deletions mysql-test/main/mysqld--help,win.rdiff
Expand Up @@ -101,20 +101,6 @@
sort-buffer-size 2097152
sql-mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
sql-safe-updates FALSE
@@ -1686,10 +1702,10 @@
sync-relay-log-info 10000
sysdate-is-now FALSE
system-versioning-alter-history ERROR
-table-cache 421
+table-cache 2000
table-definition-cache 400
-table-open-cache 421
-table-open-cache-instances 1
+table-open-cache 2000
+table-open-cache-instances 8
tc-heuristic-recover OFF
tcp-keepalive-interval 0
tcp-keepalive-probes 0
@@ -1697,6 +1713,8 @@
thread-cache-size 151
thread-pool-idle-timeout 60
Expand Down
4 changes: 0 additions & 4 deletions mysql-test/main/mysqld--help.result
Expand Up @@ -1499,7 +1499,6 @@ max-binlog-cache-size 18446744073709547520
max-binlog-size 1073741824
max-binlog-stmt-cache-size 18446744073709547520
max-connect-errors 100
max-connections 151
max-delayed-threads 20
max-digest-length 1024
max-error-count 64
Expand Down Expand Up @@ -1686,10 +1685,7 @@ sync-relay-log 10000
sync-relay-log-info 10000
sysdate-is-now FALSE
system-versioning-alter-history ERROR
table-cache 421
table-definition-cache 400
table-open-cache 421
table-open-cache-instances 1
tc-heuristic-recover OFF
tcp-keepalive-interval 0
tcp-keepalive-probes 0
Expand Down
4 changes: 3 additions & 1 deletion mysql-test/main/mysqld--help.test
Expand Up @@ -23,7 +23,9 @@ perl;
log-slow-queries pid-file slow-query-log-file log-basename
datadir slave-load-tmpdir tmpdir socket thread-pool-size
large-files-support lower-case-file-system system-time-zone
collation-server character-set-server log-tc-size version.*/;
collation-server character-set-server log-tc-size table-cache
table-open-cache table-open-cache-instances max-connections
version.*/;

# Plugins which may or may not be there:
@plugins=qw/innodb archive blackhole federated partition
Expand Down
66 changes: 66 additions & 0 deletions mysql-test/main/subselect4.result
Expand Up @@ -2609,6 +2609,47 @@ Central America and the Caribbean 442 66422
SET @@optimizer_switch= @save_optimizer_switch;
DROP TABLE t1;
#
# MDEV-9513: Assertion `join->group_list || !join->is_in_subquery()' failed in create_sort_index
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (a INT);
INSERT INTO t2 VALUES (2),(3);
EXPLAIN
SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY A ALL NULL NULL NULL NULL 2 Using where
3 DEPENDENT UNION B ALL NULL NULL NULL NULL 2 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1);
a
1
2
EXPLAIN
SELECT t1.a FROM t1 WHERE EXISTS (SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
2 SUBQUERY A ALL NULL NULL NULL NULL 2
3 UNION B ALL NULL NULL NULL NULL 2
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
SELECT t1.a FROM t1 WHERE EXISTS (SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1);
a
1
2
EXPLAIN
SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION ALL SELECT B.a FROM t2 B ORDER BY 1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY A ALL NULL NULL NULL NULL 2 Using where
3 DEPENDENT UNION B ALL NULL NULL NULL NULL 2 Using where
SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION ALL SELECT B.a FROM t2 B ORDER BY 1);
a
1
2
DROP TABLE t1,t2;
# end of 10.1 tests
#
# MDEV-22852: SIGSEGV in sortlength (optimized builds)
#
SET @save_optimizer_switch=@@optimizer_switch;
Expand All @@ -2620,4 +2661,29 @@ SELECT (SELECT DISTINCT t1i.b FROM t1 t1i GROUP BY t1i.a ORDER BY MAX(t1o.b)) FR
0
SET @@optimizer_switch= @save_optimizer_switch;
DROP TABLE t1;
#
# MDEV-17066: Bytes lost or Assertion `status_var.local_memory_used == 0 after DELETE
# with subquery with ROLLUP
#
CREATE TABLE t1 (i INT DEFAULT 0, c VARCHAR(2048));
INSERT INTO t1 SELECT 0, seq FROM seq_1_to_6000;
CREATE TABLE t2 (f VARCHAR(2048) DEFAULT '');
INSERT INTO t2 VALUES ('1'),('bar');
EXPLAIN
SELECT * FROM t2 WHERE f IN ( SELECT MAX(c) FROM t1 GROUP BY c WITH ROLLUP);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 6000 Using filesort
SELECT * FROM t2 WHERE f IN ( SELECT MAX(c) FROM t1 GROUP BY c WITH ROLLUP);
f
1
SELECT * FROM t2;
f
1
bar
DELETE FROM t2 WHERE f IN ( SELECT MAX(c) FROM t1 GROUP BY c WITH ROLLUP );
SELECT * FROM t2;
f
bar
DROP TABLE t1, t2;
# End of 10.2 tests
48 changes: 48 additions & 0 deletions mysql-test/main/subselect4.test
Expand Up @@ -7,6 +7,8 @@ drop table if exists t0,t1,t2,t3,t4,t5,t6;
drop view if exists v1, v2;
--enable_warnings

--source include/have_sequence.inc

set @subselect4_tmp= @@optimizer_switch;
set optimizer_switch='semijoin=on,firstmatch=on,loosescan=on';
set optimizer_switch='semijoin_with_cache=on';
Expand Down Expand Up @@ -2141,6 +2143,31 @@ SET @@optimizer_switch= @save_optimizer_switch;

DROP TABLE t1;

--echo #
--echo # MDEV-9513: Assertion `join->group_list || !join->is_in_subquery()' failed in create_sort_index
--echo #

CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);

CREATE TABLE t2 (a INT);
INSERT INTO t2 VALUES (2),(3);
EXPLAIN
SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1);
SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1);

EXPLAIN
SELECT t1.a FROM t1 WHERE EXISTS (SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1);
SELECT t1.a FROM t1 WHERE EXISTS (SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1);

EXPLAIN
SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION ALL SELECT B.a FROM t2 B ORDER BY 1);
SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION ALL SELECT B.a FROM t2 B ORDER BY 1);

DROP TABLE t1,t2;

--echo # end of 10.1 tests

--echo #
--echo # MDEV-22852: SIGSEGV in sortlength (optimized builds)
--echo #
Expand All @@ -2153,4 +2180,25 @@ SELECT (SELECT DISTINCT t1i.b FROM t1 t1i GROUP BY t1i.a ORDER BY MAX(t1o.b)) FR
SET @@optimizer_switch= @save_optimizer_switch;
DROP TABLE t1;

--echo #
--echo # MDEV-17066: Bytes lost or Assertion `status_var.local_memory_used == 0 after DELETE
--echo # with subquery with ROLLUP
--echo #

CREATE TABLE t1 (i INT DEFAULT 0, c VARCHAR(2048));
INSERT INTO t1 SELECT 0, seq FROM seq_1_to_6000;

CREATE TABLE t2 (f VARCHAR(2048) DEFAULT '');
INSERT INTO t2 VALUES ('1'),('bar');

EXPLAIN
SELECT * FROM t2 WHERE f IN ( SELECT MAX(c) FROM t1 GROUP BY c WITH ROLLUP);
SELECT * FROM t2 WHERE f IN ( SELECT MAX(c) FROM t1 GROUP BY c WITH ROLLUP);

SELECT * FROM t2;
DELETE FROM t2 WHERE f IN ( SELECT MAX(c) FROM t1 GROUP BY c WITH ROLLUP );
SELECT * FROM t2;

DROP TABLE t1, t2;

--echo # End of 10.2 tests
47 changes: 47 additions & 0 deletions mysql-test/main/type_newdecimal.result
Expand Up @@ -2340,6 +2340,53 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# MDEV-23105 Cast number string with many leading zeros to decimal gives unexpected result
#
SELECT CAST(0000000000000000000000000000000000000000000000000000000000000000000000000000000020.01 AS DECIMAL(15,2)) as val;
val
20.01
SET sql_mode='';
CREATE TABLE t1 (a TEXT);
INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1));
INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.0'));
INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.9'));
INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.99'));
INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.994'));
INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.995'));
INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.999'));
CREATE TABLE t2 (a TEXT, d DECIMAL(15,2));
INSERT IGNORE INTO t2 (a,d) SELECT a, a FROM t1;
Warnings:
Note 1265 Data truncated for column 'd' at row 5
Note 1265 Data truncated for column 'd' at row 6
Note 1265 Data truncated for column 'd' at row 7
INSERT IGNORE INTO t2 (a,d) SELECT CONCAT('-',a), CONCAT('-',a) FROM t1;
Warnings:
Note 1265 Data truncated for column 'd' at row 5
Note 1265 Data truncated for column 'd' at row 6
Note 1265 Data truncated for column 'd' at row 7
SELECT d, a FROM t2 ORDER BY d,a;
d a
-2.00 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.995
-2.00 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.999
-1.99 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.99
-1.99 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.994
-1.90 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.9
-1.00 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
-1.00 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.0
1.00 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
1.00 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.0
1.90 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.9
1.99 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.99
1.99 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.994
2.00 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.995
2.00 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.999
DROP TABLE t1, t2;
SET sql_mode=DEFAULT;
#
# End of 10.1 tests
#
#
# Bug#18408499 UNSIGNED BIGINT HIGH VALUES
# WRONG NUMERICAL COMPARISON RESULTS
#
Expand Down

0 comments on commit bafc5c1

Please sign in to comment.