mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
b050df4fd3
Problem was that if copy_data_between_tables() didn't do proper clean up in case of failures: - copy object was not properly freed - end_bulk_insert() was not called - mysql_trans_prepare_alter_copy_data() set THD->transaction.on to false which was not properly restored The last part caused a crash in Aria as Aria depends on that THD is correct. Other things: - Reset info->switched_transactional after usage (safety) - Reset bulk_insert_single_undo (safety)
49 lines
1.5 KiB
Text
49 lines
1.5 KiB
Text
drop table if exists t1;
|
|
Warnings:
|
|
Note 1051 Unknown table 'test.t1'
|
|
CREATE TABLE t1 (pk INT, d DATETIME, PRIMARY KEY(pk), KEY(d)) ENGINE=Aria;
|
|
ALTER TABLE t1 DISABLE KEYS;
|
|
INSERT INTO t1 VALUES (1,'2000-01-01 22:22:22'),(2,'2012-12-21 12:12:12');
|
|
INSERT INTO t1 VALUES (3, '2008-07-24');
|
|
ALTER TABLE t1 ENABLE KEYS;
|
|
SELECT t1a.pk FROM t1 AS t1a LEFT JOIN t1 AS t1b ON t1a.pk = t1b.pk;
|
|
pk
|
|
1
|
|
2
|
|
3
|
|
SELECT * FROM t1 AS t1a LEFT JOIN t1 AS t1b ON t1a.pk = t1b.pk;
|
|
pk d pk d
|
|
1 2000-01-01 22:22:22 1 2000-01-01 22:22:22
|
|
2 2012-12-21 12:12:12 2 2012-12-21 12:12:12
|
|
3 2008-07-24 00:00:00 3 2008-07-24 00:00:00
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1 (pk INT PRIMARY KEY, i INT, KEY(i)) ENGINE=Aria;
|
|
ALTER TABLE t1 DISABLE KEYS;
|
|
INSERT INTO t1 VALUES (1,11);
|
|
INSERT INTO t1 VALUES (2,0),(3,33),(4,0),(5,55),(6,66),(7,0),(8,88),(9,99);
|
|
ALTER TABLE t1 ENABLE KEYS;
|
|
SELECT * FROM t1 WHERE i = 0 OR pk BETWEEN 6 AND 10;
|
|
pk i
|
|
2 0
|
|
4 0
|
|
6 66
|
|
7 0
|
|
8 88
|
|
9 99
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1 (f INT) ENGINE=Aria transactional=1;
|
|
SHOW CREATE TABLE t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`f` int(11) DEFAULT NULL
|
|
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 TRANSACTIONAL=1
|
|
INSERT INTO t1 VALUES (1),(2);
|
|
ALTER TABLE t1 ORDER BY unknown_column;
|
|
ERROR 42S22: Unknown column 'unknown_column' in 'order clause'
|
|
SHOW CREATE TABLE t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`f` int(11) DEFAULT NULL
|
|
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 TRANSACTIONAL=1
|
|
CREATE TABLE t2 SELECT * FROM t1;
|
|
DROP TABLE t1, t2;
|