mirror of
				https://github.com/MariaDB/server.git
				synced 2025-11-03 14:33:32 +03:00 
			
		
		
		
	(temporary) TABLE, crash Problem: if one has an open "HANDLER t1", further "TRUNCATE t1" doesn't close the handler and leaves handler table hash in an inconsistent state, that may lead to a server crash. Fix: TRUNCATE should implicitly close all open handlers. Doc. request: the fact should be described in the manual accordingly.
		
			
				
	
	
		
			41 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
# t/handler_myisam.test
 | 
						|
#
 | 
						|
# test of HANDLER ...
 | 
						|
#
 | 
						|
# Last update:
 | 
						|
# 2006-07-31 ML test refactored (MySQL 5.1)
 | 
						|
#               code of t/handler.test and t/innodb_handler.test united
 | 
						|
#               main testing code put into include/handler.inc
 | 
						|
#               rename t/handler.test to t/handler_myisam.test
 | 
						|
#
 | 
						|
 | 
						|
# should work in embedded server after mysqltest is fixed
 | 
						|
--source include/not_embedded.inc
 | 
						|
 | 
						|
let $engine_type= MyISAM;
 | 
						|
let $other_engine_type= MEMORY;
 | 
						|
# There is unfortunately no other all time available storage engine
 | 
						|
# which supports the handler interface
 | 
						|
let $other_handler_engine_type= MyISAM;
 | 
						|
 | 
						|
--source include/handler.inc
 | 
						|
 | 
						|
--echo #
 | 
						|
--echo # BUG #46456: HANDLER OPEN + TRUNCATE + DROP (temporary) TABLE, crash 
 | 
						|
--echo #
 | 
						|
CREATE TABLE t1 AS SELECT 1 AS f1; 
 | 
						|
HANDLER t1 OPEN;
 | 
						|
TRUNCATE t1;
 | 
						|
--error ER_UNKNOWN_TABLE
 | 
						|
HANDLER t1 READ FIRST;
 | 
						|
DROP TABLE t1;
 | 
						|
 | 
						|
CREATE TEMPORARY TABLE t1 AS SELECT 1 AS f1; 
 | 
						|
HANDLER t1 OPEN;
 | 
						|
TRUNCATE t1;
 | 
						|
--error ER_UNKNOWN_TABLE
 | 
						|
HANDLER t1 READ FIRST;
 | 
						|
DROP TABLE t1;
 | 
						|
 | 
						|
--echo End of 5.1 tests
 |