mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge from mysql-5.1.55-release
This commit is contained in:
@ -2055,6 +2055,16 @@ sub environment_setup {
|
||||
$ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'master-port'} || 3306;
|
||||
$ENV{'MYSQL_TMP_DIR'}= $opt_tmpdir;
|
||||
$ENV{'MYSQLTEST_VARDIR'}= $opt_vardir;
|
||||
|
||||
if (IS_WINDOWS)
|
||||
{
|
||||
$ENV{'SECURE_LOAD_PATH'}= $glob_mysql_test_dir."\\std_data";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ENV{'SECURE_LOAD_PATH'}= $glob_mysql_test_dir."/std_data";
|
||||
}
|
||||
|
||||
|
||||
# ----------------------------------------------------
|
||||
# Setup env for NDB
|
||||
|
@ -1252,6 +1252,80 @@ CURRENT_USER()
|
||||
root@localhost
|
||||
SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin");
|
||||
SET PASSWORD FOR CURRENT_USER() = PASSWORD("");
|
||||
|
||||
# Bug#57952
|
||||
|
||||
DROP DATABASE IF EXISTS mysqltest1;
|
||||
DROP DATABASE IF EXISTS mysqltest2;
|
||||
CREATE DATABASE mysqltest1;
|
||||
CREATE DATABASE mysqltest2;
|
||||
use mysqltest1;
|
||||
CREATE TABLE t1(a INT, b INT);
|
||||
INSERT INTO t1 VALUES (1, 1);
|
||||
CREATE TABLE t2(a INT);
|
||||
INSERT INTO t2 VALUES (2);
|
||||
CREATE TABLE mysqltest2.t3(a INT);
|
||||
INSERT INTO mysqltest2.t3 VALUES (4);
|
||||
CREATE USER testuser@localhost;
|
||||
GRANT CREATE ROUTINE, EXECUTE ON mysqltest1.* TO testuser@localhost;
|
||||
GRANT SELECT(b) ON t1 TO testuser@localhost;
|
||||
GRANT SELECT ON t2 TO testuser@localhost;
|
||||
GRANT SELECT ON mysqltest2.* TO testuser@localhost;
|
||||
|
||||
# Connection: bug57952_con1 (testuser@localhost, db: mysqltest1)
|
||||
PREPARE s1 FROM 'SELECT b FROM t1';
|
||||
PREPARE s2 FROM 'SELECT a FROM t2';
|
||||
PREPARE s3 FROM 'SHOW TABLES FROM mysqltest2';
|
||||
CREATE PROCEDURE p1() SELECT b FROM t1;
|
||||
CREATE PROCEDURE p2() SELECT a FROM t2;
|
||||
CREATE PROCEDURE p3() SHOW TABLES FROM mysqltest2;
|
||||
CALL p1;
|
||||
b
|
||||
1
|
||||
CALL p2;
|
||||
a
|
||||
2
|
||||
CALL p3;
|
||||
Tables_in_mysqltest2
|
||||
t3
|
||||
|
||||
# Connection: default
|
||||
REVOKE SELECT ON t1 FROM testuser@localhost;
|
||||
GRANT SELECT(a) ON t1 TO testuser@localhost;
|
||||
REVOKE SELECT ON t2 FROM testuser@localhost;
|
||||
REVOKE SELECT ON mysqltest2.* FROM testuser@localhost;
|
||||
|
||||
# Connection: bug57952_con1 (testuser@localhost, db: mysqltest1)
|
||||
# - Check column-level privileges...
|
||||
EXECUTE s1;
|
||||
ERROR 42000: SELECT command denied to user 'testuser'@'localhost' for column 'b' in table 't1'
|
||||
SELECT b FROM t1;
|
||||
ERROR 42000: SELECT command denied to user 'testuser'@'localhost' for column 'b' in table 't1'
|
||||
EXECUTE s1;
|
||||
ERROR 42000: SELECT command denied to user 'testuser'@'localhost' for column 'b' in table 't1'
|
||||
CALL p1;
|
||||
ERROR 42000: SELECT command denied to user 'testuser'@'localhost' for column 'b' in table 't1'
|
||||
# - Check table-level privileges...
|
||||
SELECT a FROM t2;
|
||||
ERROR 42000: SELECT command denied to user 'testuser'@'localhost' for table 't2'
|
||||
EXECUTE s2;
|
||||
ERROR 42000: SELECT command denied to user 'testuser'@'localhost' for table 't2'
|
||||
CALL p2;
|
||||
ERROR 42000: SELECT command denied to user 'testuser'@'localhost' for table 't2'
|
||||
# - Check database-level privileges...
|
||||
SHOW TABLES FROM mysqltest2;
|
||||
ERROR 42000: Access denied for user 'testuser'@'localhost' to database 'mysqltest2'
|
||||
EXECUTE s3;
|
||||
ERROR 42000: Access denied for user 'testuser'@'localhost' to database 'mysqltest2'
|
||||
CALL p3;
|
||||
ERROR 42000: Access denied for user 'testuser'@'localhost' to database 'mysqltest2'
|
||||
|
||||
# Connection: default
|
||||
DROP DATABASE mysqltest1;
|
||||
DROP DATABASE mysqltest2;
|
||||
DROP USER testuser@localhost;
|
||||
use test;
|
||||
|
||||
End of 5.0 tests
|
||||
set names utf8;
|
||||
grant select on test.* to юзер_юзер@localhost;
|
||||
|
@ -341,4 +341,18 @@ ta_y s tb_y s
|
||||
2001 2001 2001 2001
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #59211: Select Returns Different Value for min(year) Function
|
||||
#
|
||||
CREATE TABLE t1(c1 YEAR(4));
|
||||
INSERT INTO t1 VALUES (1901),(2155),(0000);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1901
|
||||
2155
|
||||
0000
|
||||
SELECT COUNT(*) AS total_rows, MIN(c1) AS min_value, MAX(c1) FROM t1;
|
||||
total_rows min_value MAX(c1)
|
||||
3 0 2155
|
||||
DROP TABLE t1;
|
||||
#
|
||||
End of 5.1 tests
|
||||
|
@ -450,4 +450,10 @@ DROP TABLE t1;
|
||||
select @v:=@v:=sum(1) from dual;
|
||||
@v:=@v:=sum(1)
|
||||
1
|
||||
CREATE TABLE t1(a DECIMAL(31,21));
|
||||
INSERT INTO t1 VALUES (0);
|
||||
SELECT (@v:=a) <> (@v:=1) FROM t1;
|
||||
(@v:=a) <> (@v:=1)
|
||||
1
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -271,7 +271,7 @@ INSERT INTO t1 SELECT * FROM t2 LIMIT 1;
|
||||
DROP TABLE t1,t2;
|
||||
"Should NOT have any warning message issued in the following func7() and trig"
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (a CHAR(40));
|
||||
CREATE TABLE t2 (a TEXT);
|
||||
CREATE TABLE trigger_table (a CHAR(7));
|
||||
CREATE FUNCTION func7()
|
||||
RETURNS INT
|
||||
|
@ -329,7 +329,7 @@ DROP TABLE t1,t2;
|
||||
|
||||
--echo "Should NOT have any warning message issued in the following func7() and trig"
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (a CHAR(40));
|
||||
CREATE TABLE t2 (a TEXT);
|
||||
CREATE TABLE trigger_table (a CHAR(7));
|
||||
DELIMITER |;
|
||||
CREATE FUNCTION func7()
|
||||
|
30
mysql-test/suite/innodb_plugin/r/innodb-autoinc-56228.result
Normal file
30
mysql-test/suite/innodb_plugin/r/innodb-autoinc-56228.result
Normal file
@ -0,0 +1,30 @@
|
||||
DROP TABLE IF EXISTS t1_56228;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1_56228'
|
||||
DROP TABLE IF EXISTS t2_56228;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't2_56228'
|
||||
DROP FUNCTION IF EXISTS bug56228;
|
||||
Warnings:
|
||||
Note 1305 FUNCTION bug56228 does not exist
|
||||
CREATE TEMPORARY TABLE t1_56228(
|
||||
c1 iNT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE TEMPORARY TABLE t2_56228(
|
||||
c1 iNT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE FUNCTION bug56228() RETURNS INT DETERMINISTIC
|
||||
BEGIN
|
||||
INSERT INTO t1_56228 VALUES(NULL);
|
||||
INSERT INTO t2_56228 VALUES(NULL);
|
||||
INSERT INTO t1_56228 VALUES(NULL);
|
||||
INSERT INTO t2_56228 VALUES(NULL);
|
||||
DROP TEMPORARY TABLE t1_56228;
|
||||
RETURN 42;
|
||||
END //
|
||||
SELECT bug56228();
|
||||
bug56228()
|
||||
42
|
||||
DROP FUNCTION bug56228;
|
||||
DROP TEMPORARY TABLE t2_56228;
|
||||
DROP TEMPORARY TABLE IF EXISTS t1_56228;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1_56228'
|
@ -0,0 +1 @@
|
||||
--innodb_autoinc_lock_mode=0
|
42
mysql-test/suite/innodb_plugin/t/innodb-autoinc-56228.test
Normal file
42
mysql-test/suite/innodb_plugin/t/innodb-autoinc-56228.test
Normal file
@ -0,0 +1,42 @@
|
||||
-- source include/have_innodb_plugin.inc
|
||||
|
||||
let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
|
||||
|
||||
##
|
||||
# Bug #56228: dropping tables from within an active statement crashes server
|
||||
#
|
||||
DROP TABLE IF EXISTS t1_56228;
|
||||
DROP TABLE IF EXISTS t2_56228;
|
||||
DROP FUNCTION IF EXISTS bug56228;
|
||||
|
||||
CREATE TEMPORARY TABLE t1_56228(
|
||||
c1 iNT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE TEMPORARY TABLE t2_56228(
|
||||
c1 iNT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
|
||||
|
||||
DELIMITER //;
|
||||
|
||||
CREATE FUNCTION bug56228() RETURNS INT DETERMINISTIC
|
||||
BEGIN
|
||||
INSERT INTO t1_56228 VALUES(NULL);
|
||||
INSERT INTO t2_56228 VALUES(NULL);
|
||||
INSERT INTO t1_56228 VALUES(NULL);
|
||||
INSERT INTO t2_56228 VALUES(NULL);
|
||||
DROP TEMPORARY TABLE t1_56228;
|
||||
RETURN 42;
|
||||
END //
|
||||
|
||||
DELIMITER ;//
|
||||
|
||||
SELECT bug56228();
|
||||
|
||||
DROP FUNCTION bug56228;
|
||||
DROP TEMPORARY TABLE t2_56228;
|
||||
DROP TEMPORARY TABLE IF EXISTS t1_56228;
|
||||
|
||||
#
|
||||
# restore environment to the state it was before this test execution
|
||||
#
|
||||
|
||||
-- disable_query_log
|
||||
eval set global innodb_file_format_check=$innodb_file_format_check_orig;
|
6
mysql-test/suite/sys_vars/r/secure_file_priv2.result
Normal file
6
mysql-test/suite/sys_vars/r/secure_file_priv2.result
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE TABLE t1 (c1 INT);
|
||||
LOAD DATA INFILE "t1.MYI" into table t1;
|
||||
ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
|
||||
LOAD DATA INFILE "/test" into table t1;
|
||||
ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
|
||||
DROP TABLE t1;
|
1
mysql-test/suite/sys_vars/t/secure_file_priv2-master.opt
Normal file
1
mysql-test/suite/sys_vars/t/secure_file_priv2-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--secure_file_priv=$SECURE_LOAD_PATH
|
23
mysql-test/suite/sys_vars/t/secure_file_priv2.test
Normal file
23
mysql-test/suite/sys_vars/t/secure_file_priv2.test
Normal file
@ -0,0 +1,23 @@
|
||||
#
|
||||
# Bug58747 breaks secure_file_priv+not secure yet+still accesses other folders
|
||||
#
|
||||
CREATE TABLE t1 (c1 INT);
|
||||
#
|
||||
# Before the patch this statement failed with
|
||||
# Linux:
|
||||
# -> errno 13: 'Can't get stat of '
|
||||
# Windows:
|
||||
# -> Warning 1366 Incorrect integer value: '■■☺' for
|
||||
# -> column 'c1' at row 1
|
||||
# Now it should consistently fail with ER_OPTION_PREVENTS_STATEMENT
|
||||
# on all platforms.
|
||||
--error ER_OPTION_PREVENTS_STATEMENT
|
||||
LOAD DATA INFILE "t1.MYI" into table t1;
|
||||
|
||||
#
|
||||
# The following test makes the assuption that /test isn't a valid path in any
|
||||
# operating system running the test suite.
|
||||
--error ER_OPTION_PREVENTS_STATEMENT
|
||||
LOAD DATA INFILE "/test" into table t1;
|
||||
|
||||
DROP TABLE t1;
|
@ -1295,6 +1295,107 @@ SELECT CURRENT_USER();
|
||||
SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin");
|
||||
SET PASSWORD FOR CURRENT_USER() = PASSWORD("");
|
||||
|
||||
#
|
||||
# Bug#57952: privilege change is not taken into account by EXECUTE.
|
||||
#
|
||||
|
||||
--echo
|
||||
--echo # Bug#57952
|
||||
--echo
|
||||
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS mysqltest1;
|
||||
DROP DATABASE IF EXISTS mysqltest2;
|
||||
--enable_warnings
|
||||
|
||||
CREATE DATABASE mysqltest1;
|
||||
CREATE DATABASE mysqltest2;
|
||||
|
||||
use mysqltest1;
|
||||
CREATE TABLE t1(a INT, b INT);
|
||||
INSERT INTO t1 VALUES (1, 1);
|
||||
|
||||
CREATE TABLE t2(a INT);
|
||||
INSERT INTO t2 VALUES (2);
|
||||
|
||||
CREATE TABLE mysqltest2.t3(a INT);
|
||||
INSERT INTO mysqltest2.t3 VALUES (4);
|
||||
|
||||
CREATE USER testuser@localhost;
|
||||
GRANT CREATE ROUTINE, EXECUTE ON mysqltest1.* TO testuser@localhost;
|
||||
GRANT SELECT(b) ON t1 TO testuser@localhost;
|
||||
GRANT SELECT ON t2 TO testuser@localhost;
|
||||
GRANT SELECT ON mysqltest2.* TO testuser@localhost;
|
||||
|
||||
--echo
|
||||
--echo # Connection: bug57952_con1 (testuser@localhost, db: mysqltest1)
|
||||
--connect (bug57952_con1,localhost,testuser,,mysqltest1)
|
||||
PREPARE s1 FROM 'SELECT b FROM t1';
|
||||
PREPARE s2 FROM 'SELECT a FROM t2';
|
||||
PREPARE s3 FROM 'SHOW TABLES FROM mysqltest2';
|
||||
|
||||
CREATE PROCEDURE p1() SELECT b FROM t1;
|
||||
CREATE PROCEDURE p2() SELECT a FROM t2;
|
||||
CREATE PROCEDURE p3() SHOW TABLES FROM mysqltest2;
|
||||
|
||||
CALL p1;
|
||||
CALL p2;
|
||||
CALL p3;
|
||||
|
||||
--echo
|
||||
--echo # Connection: default
|
||||
--connection default
|
||||
REVOKE SELECT ON t1 FROM testuser@localhost;
|
||||
GRANT SELECT(a) ON t1 TO testuser@localhost;
|
||||
REVOKE SELECT ON t2 FROM testuser@localhost;
|
||||
REVOKE SELECT ON mysqltest2.* FROM testuser@localhost;
|
||||
|
||||
--echo
|
||||
--echo # Connection: bug57952_con1 (testuser@localhost, db: mysqltest1)
|
||||
--connection bug57952_con1
|
||||
--echo # - Check column-level privileges...
|
||||
--error ER_COLUMNACCESS_DENIED_ERROR
|
||||
EXECUTE s1;
|
||||
|
||||
--error ER_COLUMNACCESS_DENIED_ERROR
|
||||
SELECT b FROM t1;
|
||||
|
||||
--error ER_COLUMNACCESS_DENIED_ERROR
|
||||
EXECUTE s1;
|
||||
|
||||
--error ER_COLUMNACCESS_DENIED_ERROR
|
||||
CALL p1;
|
||||
|
||||
--echo # - Check table-level privileges...
|
||||
--error ER_TABLEACCESS_DENIED_ERROR
|
||||
SELECT a FROM t2;
|
||||
|
||||
--error ER_TABLEACCESS_DENIED_ERROR
|
||||
EXECUTE s2;
|
||||
|
||||
--error ER_TABLEACCESS_DENIED_ERROR
|
||||
CALL p2;
|
||||
|
||||
--echo # - Check database-level privileges...
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
SHOW TABLES FROM mysqltest2;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
EXECUTE s3;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
CALL p3;
|
||||
|
||||
--echo
|
||||
--echo # Connection: default
|
||||
--connection default
|
||||
--disconnect bug57952_con1
|
||||
DROP DATABASE mysqltest1;
|
||||
DROP DATABASE mysqltest2;
|
||||
DROP USER testuser@localhost;
|
||||
use test;
|
||||
--echo
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
#
|
||||
|
@ -149,6 +149,16 @@ SELECT ta.y AS ta_y, ta.s, tb.y AS tb_y, tb.s FROM t1 ta, t1 tb HAVING ta_y = tb
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #59211: Select Returns Different Value for min(year) Function
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(c1 YEAR(4));
|
||||
INSERT INTO t1 VALUES (1901),(2155),(0000);
|
||||
SELECT * FROM t1;
|
||||
SELECT COUNT(*) AS total_rows, MIN(c1) AS min_value, MAX(c1) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -353,4 +353,16 @@ DROP TABLE t1;
|
||||
|
||||
select @v:=@v:=sum(1) from dual;
|
||||
|
||||
#
|
||||
# Bug #57187: more user variable fun with multiple assignments and
|
||||
# comparison in query
|
||||
#
|
||||
|
||||
CREATE TABLE t1(a DECIMAL(31,21));
|
||||
INSERT INTO t1 VALUES (0);
|
||||
|
||||
SELECT (@v:=a) <> (@v:=1) FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
Reference in New Issue
Block a user