mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 02:46:29 +01:00 
			
		
		
		
	 aef0468c18
			
		
	
	
	aef0468c18
	
	
	
		
			
			* automatically disable ps2 and cursor protocol when the
  select statement returns no result set
* remove manual {disable|enable}_{ps2|cursor}_protocol from around
  `select ... into` in tests
* other misc collateral test cleanups
Cherry-pick from 11.8
		
	
			
		
			
				
	
	
		
			51 lines
		
	
	
	
		
			1.7 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			51 lines
		
	
	
	
		
			1.7 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| --echo #
 | |
| --echo # Bug50373 --secure-file-priv=""
 | |
| --echo #
 | |
| CREATE TABLE t1 (c1 VARCHAR(50));
 | |
| INSERT INTO t1 VALUES ("one"),("two"),("three"),("four"),("five");
 | |
| SHOW VARIABLES LIKE 'secure_file_priv';
 | |
| --disable_query_log
 | |
| 
 | |
| # Attempt to create a file where we normally aren't allowed to create one.
 | |
| #
 | |
| # Doing this in a portable manner is difficult but we should be able to
 | |
| # count on the directory hierarchy used. A step up from MYSQLTEST_VARDIR
 | |
| # should definitely lead us to a "protected" directory, 
 | |
| # but at the same time should still be writable since MTR was able
 | |
| # to create the vardir itself there. 
 | |
| # If we run tests normally, it will be mysql-test directory.
 | |
| # If we run tests with --mem, it will be /dev/shm.
 | |
| # If we run tests with --parallel, it will be mysql-test/var
 | |
| # (because MYSQLTEST_VARDIR in this case is mysql-test/var/N).
 | |
| --disable_cursor_protocol
 | |
| 
 | |
| --perl
 | |
| use File::Basename;
 | |
| my $protected_file= dirname($ENV{MYSQLTEST_VARDIR}).'/bug50373.txt';
 | |
| # Ensure bug50373.txt does not exist (e.g. leftover from previous
 | |
| # test runs).
 | |
| unlink $protected_file;
 | |
| open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/bug50373.inc") or die;
 | |
| print FILE "SELECT * FROM t1 INTO OUTFILE '".$protected_file."';\n";
 | |
| print FILE "DELETE FROM t1;\n";
 | |
| print FILE "LOAD DATA INFILE '".$protected_file."' INTO TABLE t1;\n";
 | |
| print FILE "SELECT * FROM t1;\n";
 | |
| print FILE "SELECT load_file('",$protected_file,"') AS loaded_file;\n";
 | |
| close(FILE);
 | |
| EOF
 | |
| 
 | |
| --enable_prepare_warnings
 | |
| --source $MYSQL_TMP_DIR/bug50373.inc
 | |
| --disable_prepare_warnings
 | |
| --remove_file $MYSQL_TMP_DIR/bug50373.inc
 | |
| --enable_query_log
 | |
| 
 | |
| --enable_cursor_protocol
 | |
| 
 | |
| DROP TABLE t1;
 | |
| 
 | |
| --perl
 | |
| use File::Basename;
 | |
| unlink dirname($ENV{MYSQLTEST_VARDIR}).'/bug50373.txt';
 | |
| EOF
 | |
| 
 |