Description:
I want import large data into partitioned tables quickly, so did ALTER TABLE table_name DISABLE KEYS, and bulk-inserted by LOAD DATA (to be repeated). But after executing LOAD DATA, it was disappeared "disabled" at "Comment:" in output of SHOW INDEX FROM table_name.
How to repeat:
shell> seq 1 1000 > /home/ichii386/test.dat
mysql> create database foo;
Query OK, 1 row affected (0.00 sec)
mysql> use foo;
Database changed
mysql> create table foo (bar int, key (bar)) engine=myisam partition by hash(bar) partitions 2;
Query OK, 0 rows affected (0.00 sec)
mysql> alter table foo disable keys;
Query OK, 0 rows affected (0.00 sec)
mysql> show index from foo\G
*************************** 1. row ***************************
Table: foo
Non_unique: 1
Key_name: bar
Seq_in_index: 1
Column_name: bar
Collation: A
Cardinality: NULL
Sub_part: NULL
Packed: NULL
Null: YES
Index_type: BTREE
Comment: disabled
1 row in set (0.00 sec)
mysql> load data local infile '/home/ichii386/test.dat' into table foo;
Query OK, 1000 rows affected (0.03 sec)
Records: 1000 Deleted: 0 Skipped: 0 Warnings: 0
mysql> show index from foo\G
*************************** 1. row ***************************
Table: foo
Non_unique: 1
Key_name: bar
Seq_in_index: 1
Column_name: bar
Collation: A
Cardinality: 1000
Sub_part: NULL
Packed: NULL
Null: YES
Index_type: BTREE
Comment:
1 row in set (0.00 sec)
Suggested fix:
line 2915 in sql/ha_partition.cc:
> rows= rows/m_tot_parts + 1;
sets rows 1 if rows == 0, i think something wrong around here...
Description: I want import large data into partitioned tables quickly, so did ALTER TABLE table_name DISABLE KEYS, and bulk-inserted by LOAD DATA (to be repeated). But after executing LOAD DATA, it was disappeared "disabled" at "Comment:" in output of SHOW INDEX FROM table_name. How to repeat: shell> seq 1 1000 > /home/ichii386/test.dat mysql> create database foo; Query OK, 1 row affected (0.00 sec) mysql> use foo; Database changed mysql> create table foo (bar int, key (bar)) engine=myisam partition by hash(bar) partitions 2; Query OK, 0 rows affected (0.00 sec) mysql> alter table foo disable keys; Query OK, 0 rows affected (0.00 sec) mysql> show index from foo\G *************************** 1. row *************************** Table: foo Non_unique: 1 Key_name: bar Seq_in_index: 1 Column_name: bar Collation: A Cardinality: NULL Sub_part: NULL Packed: NULL Null: YES Index_type: BTREE Comment: disabled 1 row in set (0.00 sec) mysql> load data local infile '/home/ichii386/test.dat' into table foo; Query OK, 1000 rows affected (0.03 sec) Records: 1000 Deleted: 0 Skipped: 0 Warnings: 0 mysql> show index from foo\G *************************** 1. row *************************** Table: foo Non_unique: 1 Key_name: bar Seq_in_index: 1 Column_name: bar Collation: A Cardinality: 1000 Sub_part: NULL Packed: NULL Null: YES Index_type: BTREE Comment: 1 row in set (0.00 sec) Suggested fix: line 2915 in sql/ha_partition.cc: > rows= rows/m_tot_parts + 1; sets rows 1 if rows == 0, i think something wrong around here...