mirror of
				https://github.com/MariaDB/server.git
				synced 2025-11-03 14:33:32 +03:00 
			
		
		
		
	Description:- Replace, the string replacement utility fails on the windows platform. Analysis:- The utility takes files and multiple string pairs as input. In the windows platform, the utility maps the standard input incorrectly (Considers 0 as the fd for standard input instead of 2048 on windows). Hence when the input file is supplied to the utility due to the incorrect mapping, a bad file descriptor error is generated causing the utility to exit with an error. Fix:- "my_fileno()" is used for getting the correct file despscriptor for standard input.
		
			
				
	
	
		
			117 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			117 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
# Windows-specific tests
 | 
						|
--source include/windows.inc
 | 
						|
 | 
						|
#
 | 
						|
# Bug 9148: Denial of service
 | 
						|
#
 | 
						|
--error 1049
 | 
						|
use lpt1;
 | 
						|
--error 1049
 | 
						|
use com1;
 | 
						|
--error 1049
 | 
						|
use prn;
 | 
						|
 | 
						|
#
 | 
						|
# Bug #12325: Can't create table named 'nu'
 | 
						|
#
 | 
						|
create table nu (a int);
 | 
						|
drop table nu;
 | 
						|
 | 
						|
#
 | 
						|
# Bug17489: ailed to put data file in custom directory use "data directory" option
 | 
						|
#
 | 
						|
--disable_warnings
 | 
						|
drop table if exists t1;
 | 
						|
--enable_warnings
 | 
						|
CREATE TABLE t1 ( `ID` int(6) ) data directory 'c:/tmp/' index directory 'c:/tmp/' engine=MyISAM;
 | 
						|
drop table t1;
 | 
						|
 | 
						|
# End of 4.1 tests
 | 
						|
 | 
						|
#
 | 
						|
# Bug #27811: The variable 'join_tab' is being used without being defined
 | 
						|
#
 | 
						|
CREATE TABLE t1 (a int, b int); INSERT INTO t1 VALUES (1,1);
 | 
						|
EXPLAIN SELECT * FROM t1 WHERE b =  (SELECT max(2));
 | 
						|
DROP TABLE t1;
 | 
						|
 | 
						|
#
 | 
						|
# Bug #33813: Schema names are case-sensitive in DROP FUNCTION
 | 
						|
#
 | 
						|
 | 
						|
CREATE DATABASE `TESTDB`;
 | 
						|
 | 
						|
USE `TESTDB`;
 | 
						|
DELIMITER //;
 | 
						|
 | 
						|
CREATE FUNCTION test_fn() RETURNS INTEGER
 | 
						|
BEGIN
 | 
						|
DECLARE rId bigint;
 | 
						|
RETURN rId;
 | 
						|
END
 | 
						|
//
 | 
						|
 | 
						|
CREATE FUNCTION test_fn2() RETURNS INTEGER
 | 
						|
BEGIN
 | 
						|
DECLARE rId bigint;
 | 
						|
RETURN rId;
 | 
						|
END
 | 
						|
//
 | 
						|
 | 
						|
DELIMITER ;//
 | 
						|
 | 
						|
DROP FUNCTION `TESTDB`.`test_fn`;
 | 
						|
DROP FUNCTION `testdb`.`test_fn2`;
 | 
						|
 | 
						|
USE test;
 | 
						|
DROP DATABASE `TESTDB`;
 | 
						|
 | 
						|
--echo End of 5.0 tests.
 | 
						|
 | 
						|
--disable_warnings
 | 
						|
drop procedure if exists proc_1;
 | 
						|
--enable_warnings
 | 
						|
#
 | 
						|
# Bug #20665: All commands supported in Stored Procedures should work in
 | 
						|
# Prepared Statements
 | 
						|
#
 | 
						|
 | 
						|
create procedure proc_1() install plugin my_plug soname '\\root\\some_plugin.dll';
 | 
						|
--error ER_UDF_NO_PATHS
 | 
						|
call proc_1();
 | 
						|
--error ER_UDF_NO_PATHS
 | 
						|
call proc_1();
 | 
						|
--error ER_UDF_NO_PATHS
 | 
						|
call proc_1();
 | 
						|
drop procedure proc_1;
 | 
						|
 | 
						|
prepare abc from "install plugin my_plug soname '\\\\root\\\\some_plugin.dll'";
 | 
						|
--error ER_UDF_NO_PATHS
 | 
						|
execute abc;
 | 
						|
--error ER_UDF_NO_PATHS
 | 
						|
execute abc;
 | 
						|
deallocate prepare abc;
 | 
						|
 | 
						|
--echo #
 | 
						|
--echo # Bug#45498: Socket variable not available on Windows
 | 
						|
--echo #
 | 
						|
 | 
						|
SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 | 
						|
  WHERE VARIABLE_NAME = 'socket';
 | 
						|
 | 
						|
--echo #
 | 
						|
--echo # Bug#16581605: REPLACE.EXE UTILITY IS BROKEN IN 5.5
 | 
						|
--echo #
 | 
						|
 | 
						|
# Creating a temporary text file.
 | 
						|
--write_file $MYSQL_TMP_DIR/bug16581605.txt
 | 
						|
abc
 | 
						|
def
 | 
						|
EOF
 | 
						|
 | 
						|
#REPLACE.EXE UTILITY will work fine after the fix.
 | 
						|
--exec $REPLACE abc xyz < $MYSQL_TMP_DIR/bug16581605.txt
 | 
						|
 | 
						|
#Cleanup
 | 
						|
remove_file $MYSQL_TMP_DIR/bug16581605.txt;
 |