mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Manual merge from mysql-trunk-merge.
Conflicts: - extra/comp_err.c - mysql-test/collections/default.experimental - mysql-test/r/archive.result - mysql-test/r/select.result - mysql-test/suite/binlog/r/binlog_unsafe.result - mysql-test/suite/binlog/t/binlog_unsafe.test - mysql-test/suite/rpl/t/disabled.def - mysql-test/t/archive.test - mysql-test/t/select.test - sql/item.cc - sql/item.h - sql/item_timefunc.cc - sql/sql_base.cc - sql/sql_delete.cc - sql/sql_load.cc - sql/sql_partition.cc - sql/sql_table.cc - storage/innobase/handler/ha_innodb.cc - vio/vio.c
This commit is contained in:
@ -456,4 +456,55 @@ eval SHOW BINLOG EVENTS FROM $pos1_master;
|
||||
# clean up
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
||||
#
|
||||
# BUG#47995: Mark user functions as unsafe
|
||||
#
|
||||
# Test that the system functions that are supposed to be marked unsafe
|
||||
# generate a warning. Each INSERT statement below should generate a
|
||||
# warning.
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (a VARCHAR(1000));
|
||||
INSERT INTO t1 VALUES (CURRENT_USER()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (FOUND_ROWS()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (GET_LOCK('tmp', 1));
|
||||
INSERT INTO t1 VALUES (IS_FREE_LOCK('tmp'));
|
||||
INSERT INTO t1 VALUES (IS_USED_LOCK('tmp'));
|
||||
INSERT INTO t1 VALUES (LOAD_FILE('../../std_data/words2.dat')); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (MASTER_POS_WAIT('dummy arg', 4711, 1));
|
||||
INSERT INTO t1 VALUES (RELEASE_LOCK('tmp'));
|
||||
INSERT INTO t1 VALUES (ROW_COUNT()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (SESSION_USER()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (SLEEP(1));
|
||||
INSERT INTO t1 VALUES (SYSDATE());
|
||||
INSERT INTO t1 VALUES (SYSTEM_USER()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (USER()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (UUID()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (UUID_SHORT()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (VERSION());
|
||||
DELETE FROM t1;
|
||||
|
||||
# Since we replicate the TIMESTAMP variable, functions affected by the
|
||||
# TIMESTAMP variable are safe to replicate. So we check that the
|
||||
# following following functions depend on the TIMESTAMP variable and
|
||||
# don't generate a warning.
|
||||
|
||||
SET TIMESTAMP=1000000;
|
||||
INSERT INTO t1 VALUES
|
||||
(CURDATE()),
|
||||
(CURRENT_DATE()),
|
||||
(CURRENT_TIME()),
|
||||
(CURRENT_TIMESTAMP()),
|
||||
(CURTIME()),
|
||||
(LOCALTIME()),
|
||||
(LOCALTIMESTAMP()),
|
||||
(NOW()),
|
||||
(UNIX_TIMESTAMP()),
|
||||
(UTC_DATE()),
|
||||
(UTC_TIME()),
|
||||
(UTC_TIMESTAMP());
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo "End of tests"
|
||||
|
Reference in New Issue
Block a user