mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 10:56:12 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			66 lines
		
	
	
	
		
			2 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			66 lines
		
	
	
	
		
			2 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| --source include/have_innodb.inc
 | |
| --source include/not_embedded.inc
 | |
| 
 | |
| call mtr.add_suppression("InnoDB: In RENAME TABLE table `test`.`t4` is referenced in foreign key constraints which are not compatible with the new table definition.");
 | |
| 
 | |
| CREATE DATABASE test_jfg;
 | |
| CREATE DATABASE test_jfg2;
 | |
| CREATE TABLE test_jfg.test (a int unsigned PRIMARY KEY) ENGINE=InnoDB;
 | |
| RENAME TABLE test_jfg.test TO test_jfg2.test;
 | |
| 
 | |
| SELECT REPLACE(filename,'\\','/') path
 | |
| FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE filename LIKE '%test%';
 | |
| 
 | |
| DROP DATABASE test_jfg;
 | |
| 
 | |
| --source include/restart_mysqld.inc
 | |
| 
 | |
| DROP DATABASE test_jfg2;
 | |
| 
 | |
| CREATE DATABASE abc_def;
 | |
| CREATE DATABASE abc_def2;
 | |
| 
 | |
| CREATE TABLE abc_def.test (a int unsigned PRIMARY KEY) ENGINE=InnoDB;
 | |
| RENAME TABLE abc_def.test TO abc_def2.test1;
 | |
| 
 | |
| SELECT REPLACE(filename,'\\','/') path
 | |
| FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE filename LIKE '%test%';
 | |
| 
 | |
| DROP DATABASE abc_def;
 | |
| 
 | |
| --source include/restart_mysqld.inc
 | |
| 
 | |
| DROP DATABASE abc_def2;
 | |
| 
 | |
| call mtr.add_suppression("InnoDB: Cannot rename '.*t1.ibd' to '.*non_existing_db.*' because the target schema directory doesn't exist");
 | |
| 
 | |
| CREATE TABLE t1 (a INT) ENGINE=InnoDB;
 | |
| INSERT INTO t1 VALUES(100);
 | |
| --replace_result "\\" "/"
 | |
| --error ER_ERROR_ON_RENAME
 | |
| RENAME TABLE t1 TO non_existing_db.t1;
 | |
| 
 | |
| --let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot rename '.*t1\.ibd' to '.*non_existing_db
 | |
| let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
 | |
| --source include/search_pattern_in_file.inc
 | |
| 
 | |
| SET GLOBAL innodb_fast_shutdown=2;
 | |
| --source include/restart_mysqld.inc
 | |
| 
 | |
| SELECT * FROM t1;
 | |
| # Cleanup
 | |
| DROP TABLE t1;
 | |
| 
 | |
| --echo #
 | |
| --echo # MDEV-25509 Atomic DDL: Assertion `err != DB_DUPLICATE_KEY'
 | |
| --echo #	fails after previous error upon multi-RENAME
 | |
| --echo #
 | |
| SET FOREIGN_KEY_CHECKS= OFF;
 | |
| CREATE TABLE t1 (pk INT PRIMARY KEY, f INT, FOREIGN KEY (f) REFERENCES t4 (x)) ENGINE=InnoDB;
 | |
| ALTER TABLE t1 DROP KEY f;
 | |
| CREATE TABLE t2 (a INT) ENGINE=InnoDB;
 | |
| --error ER_ERROR_ON_RENAME
 | |
| RENAME TABLE t1 TO t3, t3 TO t4;
 | |
| RENAME TABLE t2 TO t3;
 | |
| DROP TABLE t3, t1;
 | |
| SET FOREIGN_KEY_CHECKS=DEFAULT;
 | 
