summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-09-23 12:58:11 +0200
committerSergei Golubchik <serg@mariadb.org>2018-09-23 12:58:11 +0200
commit1fc5a6f30c3a9c047dcf9a36b00026d98f286f6b (patch)
tree0aa792118101ee3130b25b47316159aaccec52e2 /mysql-test/t
parent87dc4e98dda26ff99a3b3aeae2fce9fd2f2fdf24 (diff)
parent1144acbcbdf9b7bdf18c31f88cbe859d99658b53 (diff)
downloadmariadb-git-1fc5a6f30c3a9c047dcf9a36b00026d98f286f6b.tar.gz
Merge branch '10.0' into 10.1
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/create_or_replace.test21
-rw-r--r--mysql-test/t/func_time.test49
-rw-r--r--mysql-test/t/grant.test22
-rw-r--r--mysql-test/t/sp-security.test28
-rw-r--r--mysql-test/t/type_float.test30
5 files changed, 150 insertions, 0 deletions
diff --git a/mysql-test/t/create_or_replace.test b/mysql-test/t/create_or_replace.test
index c1441d218cf..455f079b58d 100644
--- a/mysql-test/t/create_or_replace.test
+++ b/mysql-test/t/create_or_replace.test
@@ -421,3 +421,24 @@ UNLOCK TABLES;
DROP FUNCTION f1;
DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-14410 - Assertion `table->pos_in_locked_tables == __null ||
+--echo # table->pos_in_locked_tables->table == table' failed in
+--echo # mark_used_tables_as_free_for_reuse
+--echo #
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT);
+CREATE TABLE t3 (c INT);
+
+CREATE TRIGGER tr1 BEFORE INSERT ON t3 FOR EACH ROW INSERT INTO t1 VALUES ();
+CREATE TRIGGER tr2 BEFORE INSERT ON t2 FOR EACH ROW INSERT INTO t3 SELECT * FROM t1;
+
+LOCK TABLE t1 WRITE, t2 WRITE;
+CREATE OR REPLACE TABLE t1 (i INT);
+UNLOCK TABLES;
+INSERT INTO t2 VALUES (1);
+
+# Cleanup
+DROP TABLE t1, t2, t3;
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 80ee18b6b1f..0a4b85c2a81 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -1706,6 +1706,55 @@ SELECT SEC_TO_TIME(MAKEDATE(0,RAND(~0)));
#
SELECT PERIOD_DIFF(2018, AES_ENCRYPT('Rae Bareli', 'Rae Bareli'));
+
+--echo #
+--echo # MDEV-17249 MAKETIME(-1e50,0,0) returns a wrong result
+--echo #
+
+--vertical_results
+SELECT
+ MAKETIME(1e10,0,0),
+ MAKETIME(-1e10,0,0),
+ MAKETIME(1e50,0,0),
+ MAKETIME(-1e50,0,0),
+ MAKETIME(COALESCE(1e50),0,0),
+ MAKETIME(COALESCE(-1e50),0,0);
+--horizontal_results
+
+CREATE TABLE t1 (a FLOAT);
+INSERT INTO t1 VALUES (1e30),(-1e30);
+SELECT MAKETIME(a,0,0) FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-17244 MAKETIME(900,0,0.111) returns a wrong result
+--echo #
+
+SELECT MAKETIME(900,0,0);
+SELECT MAKETIME(900,0,0.1);
+SELECT MAKETIME(900,0,0.11);
+SELECT MAKETIME(900,0,0.111);
+SELECT MAKETIME(900,0,0.1111);
+SELECT MAKETIME(900,0,0.11111);
+SELECT MAKETIME(900,0,0.111111);
+SELECT MAKETIME(900,0,0.1111111);
+SELECT MAKETIME(900,0,0.11111111);
+SELECT MAKETIME(900,0,0.111111111);
+SELECT MAKETIME(900,0,EXP(1));
+
+SELECT MAKETIME(-900,0,0);
+SELECT MAKETIME(-900,0,0.1);
+SELECT MAKETIME(-900,0,0.11);
+SELECT MAKETIME(-900,0,0.111);
+SELECT MAKETIME(-900,0,0.1111);
+SELECT MAKETIME(-900,0,0.11111);
+SELECT MAKETIME(-900,0,0.111111);
+SELECT MAKETIME(-900,0,0.1111111);
+SELECT MAKETIME(-900,0,0.11111111);
+SELECT MAKETIME(-900,0,0.111111111);
+SELECT MAKETIME(-900,0,EXP(1));
+
+
--echo #
--echo # End of 5.5 tests
--echo #
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 837484c6929..e4a7d62f85e 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -2234,6 +2234,28 @@ DROP USER foo@'127.0.0.1';
--echo # End of Bug#12766319
+#
+# Bug#27230925: HANDLE_FATAL_SIGNAL (SIG=11) IN SHOW_ROUTINE_GRANTS
+#
+create user foo@localhost;
+create database foodb;
+grant create routine on foodb.* to foo@localhost;
+connect con1,localhost,foo;
+create procedure fooproc() select 'i am fooproc';
+show grants;
+disconnect con1;
+connection default;
+rename table mysql.procs_priv to mysql.procs_priv1;
+flush privileges;
+show grants for foo@localhost;
+rename table mysql.procs_priv1 to mysql.procs_priv;
+show grants for foo@localhost;
+flush privileges;
+show grants for foo@localhost;
+drop user foo@localhost;
+drop procedure fooproc;
+drop database foodb;
+
--echo #
--echo # Bug#11756966 - 48958: STORED PROCEDURES CAN BE LEVERAGED TO BYPASS
diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test
index a5df4859d6b..417e3a3050a 100644
--- a/mysql-test/t/sp-security.test
+++ b/mysql-test/t/sp-security.test
@@ -1005,6 +1005,34 @@ disconnect con2;
DROP USER user2@localhost;
DROP DATABASE db1;
+#
+# Bug#27407480: AUTOMATIC_SP_PRIVILEGES REQUIRES NEED THE INSERT PRIVILEGES FOR MYSQL.USER TABLE
+#
+create user foo@local_ost;
+#
+# Create a user with an authentification plugin 'foobar'.
+# Instead of using a normal "CREATE USER <user> IDENTIFIED VIA <plugin>"
+# we do CREATE (without VIA) followed by UPDATE and FLUSH.
+# This is to avoid installing a real plugin and thus avoid the test dependency.
+# We won't login under this user in the below test, so this is fine.
+#
+create user foo@`local\_ost`;
+update mysql.user set plugin='foobar' where host='local\\_ost';
+flush privileges;
+create database foodb;
+grant create routine on foodb.* to foo@local_ost;
+connect con1,localhost,foo;
+select user(), current_user();
+show grants;
+create procedure fooproc() select 'i am fooproc';
+show grants;
+disconnect con1;
+connection default;
+drop user foo@local_ost;
+drop user foo@`local\_ost`;
+drop procedure fooproc;
+drop database foodb;
+
--echo #
--echo # Test for bug#12602983 - User without privilege on routine can discover
--echo # its existence by executing "select non_existing_func();" or by
diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test
index 3717dc028ba..228812c2ae5 100644
--- a/mysql-test/t/type_float.test
+++ b/mysql-test/t/type_float.test
@@ -332,6 +332,36 @@ eval select concat((truncate((-1.7976931348623157E+307),(0x1e))),
select format(truncate('1.7976931348623157E+308',-12),1,'fr_BE') as foo;
+
+--echo #
+--echo # MDEV-17249 MAKETIME(-1e50,0,0) returns a wrong result
+--echo #
+
+SELECT LEFT('a',EXP(50));
+SELECT LEFT('a', COALESCE(1e30));
+
+CREATE TABLE t1 (a FLOAT);
+INSERT INTO t1 VALUES (1e30);
+SELECT LEFT('a',a), LEFT('a',1e30) FROM t1;
+DROP TABLE t1;
+
+PREPARE stmt FROM 'SELECT LEFT(111,?)';
+SET @a=1e30;
+EXECUTE stmt USING @a;
+DEALLOCATE PREPARE stmt;
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT LEFT('a',(SELECT 1e30 FROM t1 LIMIT 1));
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES (1e30),(0);
+SELECT LEFT('a', SUM(a)) FROM t1;
+SELECT LEFT('a', AVG(a)) FROM t1;
+DROP TABLE t1;
+
+
--echo #
--echo # Bug #13500371 63704: CONVERSION OF '1.' TO A NUMBER GIVES ERROR 1265
--echo # (WARN_DATA_TRUNCATED)