mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
b56ad494b4
in ha_delete_table() * only convert ENOENT and HA_ERR_NO_SUCH_TABLE to warnings * only return real error codes (that is, not ENOENT and not HA_ERR_NO_SUCH_TABLE) * intercept HA_ERR_ROW_IS_REFERENCED to generate backward compatible ER_ROW_IS_REFERENCED in mysql_rm_table_no_locks() * no special code to handle HA_ERR_ROW_IS_REFERENCED * no special code to handle ENOENT and HA_ERR_NO_SUCH_TABLE * return multi-table error ER_BAD_TABLE_ERROR <table list> only when there were many errors, not when there were many tables to drop (but only one table generated an error)
55 lines
1.7 KiB
Text
55 lines
1.7 KiB
Text
DROP TABLE IF EXISTS t1;
|
|
# Checking variables
|
|
SHOW VARIABLES LIKE 'innodb_fake_changes';
|
|
Variable_name Value
|
|
innodb_fake_changes OFF
|
|
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
|
|
VARIABLE_VALUE
|
|
OFF
|
|
SET innodb_fake_changes=1;
|
|
SHOW VARIABLES LIKE 'innodb_fake_changes';
|
|
Variable_name Value
|
|
innodb_fake_changes ON
|
|
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
|
|
VARIABLE_VALUE
|
|
ON
|
|
SET innodb_fake_changes=default;
|
|
SHOW VARIABLES LIKE 'innodb_fake_changes';
|
|
Variable_name Value
|
|
innodb_fake_changes OFF
|
|
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
|
|
VARIABLE_VALUE
|
|
OFF
|
|
# Explicit COMMIT should fail when innodb_fake_changes is enabled
|
|
# DML should be fine
|
|
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
|
INSERT INTO t1 VALUES (1);
|
|
SET autocommit=0;
|
|
SET innodb_fake_changes=1;
|
|
BEGIN;
|
|
INSERT INTO t1 VALUES (2);
|
|
UPDATE t1 SET a=0;
|
|
DELETE FROM t1 LIMIT 1;
|
|
SELECT * FROM t1;
|
|
a
|
|
1
|
|
COMMIT;
|
|
ERROR HY000: Got error 131 "Command not supported by database" during COMMIT
|
|
SET innodb_fake_changes=default;
|
|
DROP TABLE t1;
|
|
# DDL must result in error
|
|
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
|
SET autocommit=0;
|
|
SET innodb_fake_changes=1;
|
|
BEGIN;
|
|
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
|
|
ERROR HY000: Can't create table `test`.`t2` (errno: 131 "Command not supported by database")
|
|
DROP TABLE t1;
|
|
ERROR HY000: Storage engine InnoDB of the table `test`.`t1` doesn't have this option
|
|
TRUNCATE TABLE t1;
|
|
ERROR HY000: Got error 131 "Command not supported by database" during COMMIT
|
|
ALTER TABLE t1 ENGINE=MyISAM;
|
|
ERROR HY000: Got error 131 "Command not supported by database" during COMMIT
|
|
ROLLBACK;
|
|
SET innodb_fake_changes=default;
|
|
DROP TABLE t1;
|