mirror of
https://github.com/MariaDB/server.git
synced 2025-11-09 11:41:36 +03:00
The problem appeared because the same values produced different hash during INSERT and SELECT for VARCHAR data type. Fix: VARCHAR required special treatment to avoid hashing of length bytes (leftmost one or two bytes) as well as trailing bytes beyond real length, which could contain garbage. Fix is done by introducing hash() - new method in the Field class. mysql-test/r/partition_innodb.result: Adding test case mysql-test/r/partition_pruning.result: Fixing test results (results differ due to changes in hash function) mysql-test/t/partition_innodb.test: Adding test case sql/field.cc: Adding generic hash() method, and a special method for VARCHAR. sql/field.h: Adding prototypes for new methods sql/key.cc: Mark columns for write before executinf of set_key_image(). Thanks for Mikael for suggesting this fix. sql/sql_partition.cc: Removing old hash code. Using new methid field->hash() instead.
6 lines
395 B
Plaintext
6 lines
395 B
Plaintext
create table t1 (a int) engine=innodb partition by hash(a) ;
|
|
show table status like 't1';
|
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
|
t1 InnoDB 10 Compact 2 8192 16384 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
|
|
drop table t1;
|