summaryrefslogtreecommitdiff
path: root/mysql-test/main
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-08-10 18:40:57 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-08-10 18:40:57 +0300
commitbafc5c1321a7dff5f2da292111bf98fed9d1658d (patch)
treeb674bceb1f1fe8b2dc9a8fb7c1aeca6fd1b95dde /mysql-test/main
parent0025eb3f963fdca88028ff14a27d9b9638079337 (diff)
parent3b6dadb5ebedab71bf1870579745ff3cd05e498a (diff)
downloadmariadb-git-bafc5c1321a7dff5f2da292111bf98fed9d1658d.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main')
-rw-r--r--mysql-test/main/grant.result18
-rw-r--r--mysql-test/main/grant.test25
-rw-r--r--mysql-test/main/information_schema.result15
-rw-r--r--mysql-test/main/information_schema.test14
-rw-r--r--mysql-test/main/mysql_tzinfo_to_sql_symlink.result18
-rw-r--r--mysql-test/main/mysqld--help,win.rdiff14
-rw-r--r--mysql-test/main/mysqld--help.result4
-rw-r--r--mysql-test/main/mysqld--help.test4
-rw-r--r--mysql-test/main/subselect4.result66
-rw-r--r--mysql-test/main/subselect4.test48
-rw-r--r--mysql-test/main/type_newdecimal.result47
-rw-r--r--mysql-test/main/type_newdecimal.test26
-rw-r--r--mysql-test/main/win.result16
-rw-r--r--mysql-test/main/win.test16
14 files changed, 312 insertions, 19 deletions
diff --git a/mysql-test/main/grant.result b/mysql-test/main/grant.result
index a1c78483643..3d609cf2d4a 100644
--- a/mysql-test/main/grant.result
+++ b/mysql-test/main/grant.result
@@ -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
#
#
diff --git a/mysql-test/main/grant.test b/mysql-test/main/grant.test
index 7c09236e224..eb677441e15 100644
--- a/mysql-test/main/grant.test
+++ b/mysql-test/main/grant.test
@@ -2268,6 +2268,31 @@ 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 #
diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result
index 20b5985deb6..94e7244a316 100644
--- a/mysql-test/main/information_schema.result
+++ b/mysql-test/main/information_schema.result
@@ -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
#
diff --git a/mysql-test/main/information_schema.test b/mysql-test/main/information_schema.test
index dbb0622baf3..dd2b723e6ee 100644
--- a/mysql-test/main/information_schema.test
+++ b/mysql-test/main/information_schema.test
@@ -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,
diff --git a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result
index fc9ddce08b1..06e21beace1 100644
--- a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result
+++ b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result
@@ -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);
@@ -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 ;
diff --git a/mysql-test/main/mysqld--help,win.rdiff b/mysql-test/main/mysqld--help,win.rdiff
index 880627631bd..34ed5df7074 100644
--- a/mysql-test/main/mysqld--help,win.rdiff
+++ b/mysql-test/main/mysqld--help,win.rdiff
@@ -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
diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result
index dcfbc2cd65d..54389a78f73 100644
--- a/mysql-test/main/mysqld--help.result
+++ b/mysql-test/main/mysqld--help.result
@@ -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
@@ -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
diff --git a/mysql-test/main/mysqld--help.test b/mysql-test/main/mysqld--help.test
index 6e5ad058330..4077cbb548e 100644
--- a/mysql-test/main/mysqld--help.test
+++ b/mysql-test/main/mysqld--help.test
@@ -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
diff --git a/mysql-test/main/subselect4.result b/mysql-test/main/subselect4.result
index 26770c79d8d..d1d3b514549 100644
--- a/mysql-test/main/subselect4.result
+++ b/mysql-test/main/subselect4.result
@@ -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;
@@ -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
diff --git a/mysql-test/main/subselect4.test b/mysql-test/main/subselect4.test
index c33fe15bdcc..6eada9b27d9 100644
--- a/mysql-test/main/subselect4.test
+++ b/mysql-test/main/subselect4.test
@@ -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';
@@ -2142,6 +2144,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 #
@@ -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
diff --git a/mysql-test/main/type_newdecimal.result b/mysql-test/main/type_newdecimal.result
index 07ecef95e5d..85ac75351c0 100644
--- a/mysql-test/main/type_newdecimal.result
+++ b/mysql-test/main/type_newdecimal.result
@@ -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
#
diff --git a/mysql-test/main/type_newdecimal.test b/mysql-test/main/type_newdecimal.test
index 2f3409f56e9..e5d903e95cd 100644
--- a/mysql-test/main/type_newdecimal.test
+++ b/mysql-test/main/type_newdecimal.test
@@ -1825,6 +1825,32 @@ SHOW CREATE TABLE t1;
DROP TABLE t1;
--echo #
+--echo # MDEV-23105 Cast number string with many leading zeros to decimal gives unexpected result
+--echo #
+
+SELECT CAST(0000000000000000000000000000000000000000000000000000000000000000000000000000000020.01 AS DECIMAL(15,2)) as val;
+
+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;
+INSERT IGNORE INTO t2 (a,d) SELECT CONCAT('-',a), CONCAT('-',a) FROM t1;
+SELECT d, a FROM t2 ORDER BY d,a;
+DROP TABLE t1, t2;
+SET sql_mode=DEFAULT;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
+
+--echo #
--echo # Bug#18408499 UNSIGNED BIGINT HIGH VALUES
--echo # WRONG NUMERICAL COMPARISON RESULTS
--echo #
diff --git a/mysql-test/main/win.result b/mysql-test/main/win.result
index 24aa29598cd..08668965cf6 100644
--- a/mysql-test/main/win.result
+++ b/mysql-test/main/win.result
@@ -3850,6 +3850,22 @@ ERROR 42000: Too big scale 56 specified for 'rank() over w1'. Maximum is 38
SELECT cast((rank() over w1) as decimal (53,30));
ERROR HY000: Window specification with name 'w1' is not defined
#
+# MDEV-15180: server crashed with NTH_VALUE()
+#
+CREATE TABLE t1 (i1 int, a int);
+INSERT INTO t1 VALUES (1, 1), (2, 2),(3, 3);
+CREATE TABLE t2 (i2 int);
+INSERT INTO t2 VALUES (1),(2),(5),(1),(7),(4),(3);
+CREATE VIEW v1 AS (SELECT * FROM t1,t2 WHERE t1.i1=t2.i2) ;
+SELECT NTH_VALUE(i1, i1) OVER (PARTITION BY i1) FROM v1;
+NTH_VALUE(i1, i1) OVER (PARTITION BY i1)
+1
+1
+NULL
+NULL
+DROP VIEW v1;
+DROP TABLE t1,t2;
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/main/win.test b/mysql-test/main/win.test
index 37d2b616dda..bc2f6144985 100644
--- a/mysql-test/main/win.test
+++ b/mysql-test/main/win.test
@@ -2507,6 +2507,22 @@ SELECT cast((rank() over w1) as decimal (53,56));
SELECT cast((rank() over w1) as decimal (53,30));
--echo #
+--echo # MDEV-15180: server crashed with NTH_VALUE()
+--echo #
+
+CREATE TABLE t1 (i1 int, a int);
+INSERT INTO t1 VALUES (1, 1), (2, 2),(3, 3);
+
+CREATE TABLE t2 (i2 int);
+INSERT INTO t2 VALUES (1),(2),(5),(1),(7),(4),(3);
+
+CREATE VIEW v1 AS (SELECT * FROM t1,t2 WHERE t1.i1=t2.i2) ;
+SELECT NTH_VALUE(i1, i1) OVER (PARTITION BY i1) FROM v1;
+
+DROP VIEW v1;
+DROP TABLE t1,t2;
+
+--echo #
--echo # End of 10.2 tests
--echo #