1#
2# BUG#11747548:DETECT ORPHAN TEMP-POOL FILES, AND HANDLE GRACEFULLY.
3#
4#Set up.
5CREATE TABLE pid_table(pid_no INT);
6CREATE TABLE t1 (a BLOB);
7INSERT INTO t1 VALUES (1), (2);
8#Create MYD and MYI files for intrinsic temp table.
9LOAD DATA LOCAL INFILE 'pid_file' INTO TABLE pid_table;
10#Reports an error since the temp file already exists.
11SELECT a FROM t1 ORDER BY rand(1);
12ERROR HY000: Can't create or write to file
13#With patch, the query executes successfully.
14SELECT a FROM t1 ORDER BY rand(1);
15a
161
172
18#cleanup
19DROP TABLE t1, pid_table;
20