mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-30 04:26:45 +03:00 
			
		
		
		
	Issue was two fold (both in MyISAM and Aria) - optimize and repair failed if there was an old .TMM file around. As optimized and repair are protected against multiple execution, I decided to change so that we just truncate the file if it exists. - I had missed to check for error condition if creation of the temporary index file failed. This caused the strange behaviour that it looked as if optimized would have worked once.
		
			
				
	
	
		
			59 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			59 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| --echo #
 | |
| --echo # MDEV-8475 stale .TMM file causes Aria engine to stop serving the table
 | |
| --echo #
 | |
| create table t1 (pk int primary key, i int) engine=MyISAM;
 | |
| insert into t1 values (1,1),(2,2);
 | |
| --let $datadir=`SELECT @@datadir`
 | |
| 
 | |
| --write_file $datadir/test/t1.TMM
 | |
| EOF
 | |
| 
 | |
| --connect (con1,localhost,root,,)
 | |
| SHOW CREATE TABLE t1;
 | |
| OPTIMIZE TABLE t1;
 | |
| --disconnect con1
 | |
| 
 | |
| --connect (con1,localhost,root,,)
 | |
| SHOW CREATE TABLE t1;
 | |
| OPTIMIZE TABLE t1;
 | |
| --disconnect con1
 | |
| 
 | |
| --connect (con1,localhost,root,,)
 | |
| SHOW CREATE TABLE t1;
 | |
| OPTIMIZE TABLE t1;
 | |
| --disconnect con1
 | |
| 
 | |
| # Cleanup
 | |
| --connection default
 | |
| DROP TABLE t1;
 | |
| 
 | |
| #
 | |
| # Test also Aria
 | |
| #
 | |
| 
 | |
| create table t1 (pk int primary key, i int) engine=aria;
 | |
| insert into t1 values (1,1),(2,2);
 | |
| --let $datadir=`SELECT @@datadir`
 | |
| 
 | |
| --write_file $datadir/test/t1.TMM
 | |
| EOF
 | |
| 
 | |
| --connect (con1,localhost,root,,)
 | |
| SHOW CREATE TABLE t1;
 | |
| OPTIMIZE TABLE t1;
 | |
| --disconnect con1
 | |
| 
 | |
| --connect (con1,localhost,root,,)
 | |
| SHOW CREATE TABLE t1;
 | |
| OPTIMIZE TABLE t1;
 | |
| --disconnect con1
 | |
| 
 | |
| --connect (con1,localhost,root,,)
 | |
| SHOW CREATE TABLE t1;
 | |
| OPTIMIZE TABLE t1;
 | |
| --disconnect con1
 | |
| 
 | |
| # Cleanup
 | |
| --connection default
 | |
| DROP TABLE t1;
 |