mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
cc8eefb0dc
- During copy algorithm, InnoDB should use bulk insert operation for row by row insert operation. By doing this, copy algorithm can effectively build indexes. This optimization is disabled for temporary table, versioning table and table which has foreign key relation. Introduced the variable innodb_alter_copy_bulk to allow the bulk insert operation for copy alter operation inside InnoDB. This is enabled by default ha_innobase::extra(): HA_EXTRA_END_ALTER_COPY mode tries to apply the buffered bulk insert operation, updates the non-persistent table stats. row_merge_bulk_t::write_to_index(): Update stat_n_rows after applying the bulk insert operation row_ins_clust_index_entry_low(): In case of copy algorithm, switch to bulk insert operation. copy_data_error_ignore(): Handles the error while copying the data from source to target file.
11 lines
463 B
Text
11 lines
463 B
Text
--- bulk_copy_alter.result
|
|
+++ bulk_copy_alter,non_bulk_alter_copy.result
|
|
@@ -5,7 +5,7 @@
|
|
INSERT INTO t1 SELECT repeat('b', 200), seq FROM seq_3_to_65536;
|
|
ALTER TABLE t1 ADD INDEX(f2);
|
|
ALTER TABLE t1 ADD PRIMARY KEY(f1(2));
|
|
-ERROR 23000: Duplicate entry 'bb' for key 'PRIMARY'
|
|
+ERROR 23000: Duplicate entry 'aa' for key 'PRIMARY'
|
|
INSERT INTO t1 VALUES(repeat('a', 200), 1);
|
|
ALTER TABLE t1 ADD UNIQUE KEY(f2);
|
|
ERROR 23000: Duplicate entry '1' for key 'f2_2'
|