mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 19:06:14 +01:00 
			
		
		
		
	 81258f1432
			
		
	
	
	81258f1432
	
	
	
		
			
			This was because of a wrong test in encryption code that wrote random numbers over the LSN for pages for transactional Aria tables during repair. The effect was that after an ALTER TABLE ENABLE KEYS of a encrypted recovery of the tables would not work. Fixed by changing testing of !share->now_transactional to !share->base.born_transactional. Other things: - Extended Aria check_table() to check for wrong (= too big) LSN numbers. - If check_table() failed just because of wrong LSN or TRN numbers, a following repair table will just do a zerofill which is much faster. - Limit number of LSN errors in one check table to MAX_LSN_ERROR (10). - Removed old obsolete test of 'if (error_count & 2)'. Changed error_count and warning_count from bits to numbers of errors/warnings as this is more useful.
		
			
				
	
	
		
			83 lines
		
	
	
	
		
			2.5 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			83 lines
		
	
	
	
		
			2.5 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| call mtr.add_suppression("Table 't1' is marked as crashed and should be repaired");
 | |
| drop database if exists mysqltest;
 | |
| create database mysqltest;
 | |
| connect  admin, localhost, root,,mysqltest,,;
 | |
| connection default;
 | |
| use mysqltest;
 | |
| create table t1(a int) engine=aria;
 | |
| insert into t1 values(1);
 | |
| create table t2 (a int) engine=aria;
 | |
| INSERT INTO t2 VALUES (1),(2);
 | |
| create table t3 (a int) engine=aria;
 | |
| INSERT INTO t3 VALUES (1),(2);
 | |
| create table t4 (a int) engine=aria;
 | |
| INSERT INTO t4 VALUES (1),(2);
 | |
| create table t5 (a int) engine=aria;
 | |
| INSERT INTO t5 VALUES (1),(2);
 | |
| create table t6 (a int) engine=aria;
 | |
| INSERT INTO t6 VALUES (1),(2);
 | |
| flush tables;
 | |
| create_rename_lsn has non-magic value
 | |
| connection default;
 | |
| connection admin;
 | |
| * shut down mysqld, removed logs, restarted it
 | |
| connection default;
 | |
| select * from t1;
 | |
| a
 | |
| 1
 | |
| Warnings:
 | |
| Note	1194	Zerofilling moved table ./mysqltest/t1
 | |
| flush table t1;
 | |
| Status:              changed,sorted index pages,zerofilled
 | |
| insert into t1 values(2);
 | |
| flush table t1;
 | |
| create_rename_lsn has non-magic value
 | |
| #
 | |
| # BUG#44422 "mysql_upgrade destroys Maria tables?"
 | |
| # Check repair and optimize of moved table
 | |
| #
 | |
| check table t2;
 | |
| Table	Op	Msg_type	Msg_text
 | |
| mysqltest.t2	check	error	Table is probably from another system and must be zerofilled or repaired ('REPAIR TABLE table_name') to be usable on this system
 | |
| mysqltest.t2	check	error	Corrupt
 | |
| check table t2;
 | |
| Table	Op	Msg_type	Msg_text
 | |
| mysqltest.t2	check	error	Table is probably from another system and must be zerofilled or repaired ('REPAIR TABLE table_name') to be usable on this system
 | |
| mysqltest.t2	check	error	Corrupt
 | |
| repair table t2;
 | |
| Table	Op	Msg_type	Msg_text
 | |
| mysqltest.t2	repair	info	Running zerofill on moved table
 | |
| mysqltest.t2	repair	status	OK
 | |
| check table t2;
 | |
| Table	Op	Msg_type	Msg_text
 | |
| mysqltest.t2	check	status	OK
 | |
| optimize table t3;
 | |
| Table	Op	Msg_type	Msg_text
 | |
| mysqltest.t3	optimize	Note	Zerofilling moved table ./mysqltest/t3
 | |
| mysqltest.t3	optimize	status	OK
 | |
| analyze table t4;
 | |
| Table	Op	Msg_type	Msg_text
 | |
| mysqltest.t4	analyze	status	Engine-independent statistics collected
 | |
| mysqltest.t4	analyze	Note	Zerofilling moved table ./mysqltest/t4
 | |
| mysqltest.t4	analyze	status	OK
 | |
| repair table t5;
 | |
| Table	Op	Msg_type	Msg_text
 | |
| mysqltest.t5	repair	info	Running zerofill on moved table
 | |
| mysqltest.t5	repair	status	OK
 | |
| check table t5;
 | |
| Table	Op	Msg_type	Msg_text
 | |
| mysqltest.t5	check	status	OK
 | |
| repair table t5;
 | |
| Table	Op	Msg_type	Msg_text
 | |
| mysqltest.t5	repair	status	OK
 | |
| check table t5;
 | |
| Table	Op	Msg_type	Msg_text
 | |
| mysqltest.t5	check	status	OK
 | |
| select * from t6;
 | |
| a
 | |
| 1
 | |
| 2
 | |
| check table t6;
 | |
| Table	Op	Msg_type	Msg_text
 | |
| mysqltest.t6	check	status	OK
 | |
| drop database mysqltest;
 |