diff options
author | unknown <sergefp@mysql.com> | 2007-07-26 20:52:53 +0400 |
---|---|---|
committer | unknown <sergefp@mysql.com> | 2007-07-26 20:52:53 +0400 |
commit | 9206f6847742a208500da660a2e76306e3fadae3 (patch) | |
tree | e329846ca4795ac7e29eba12011f218496014ad8 | |
parent | 935ce76278477061d07b8e9b441762e90e781e34 (diff) | |
download | mariadb-git-9206f6847742a208500da660a2e76306e3fadae3.tar.gz |
BUG#28591: make the fix work for BDB tables too:
- make ha_berkeley::cmp_ref() take into account that auto-generated PKs
are stored in LSB-first order.
- Remove the temporary code that made the bugfix work for innodb only
mysql-test/r/bdb.result:
Adjust test-results.
sql/ha_berkeley.cc:
BUG#28591: make the fix work for BDB tables too:
- make ha_berkeley::cmp_ref() take into account that auto-generated PKs
are stored in LSB-first order.
sql/sql_select.cc:
BUG#28591: Remove "innodb only" clause as the fix now works for BDB too
sql/table.cc:
BUG#28591: Remove "innodb only" clause as the fix now works for BDB too
-rw-r--r-- | mysql-test/r/bdb.result | 2 | ||||
-rw-r--r-- | sql/ha_berkeley.cc | 6 | ||||
-rw-r--r-- | sql/sql_select.cc | 1 | ||||
-rw-r--r-- | sql/table.cc | 3 |
4 files changed, 7 insertions, 5 deletions
diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index 91c385112b4..3356d23053f 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -136,8 +136,8 @@ update ignore t1 set id=1023 where id=1010; select * from t1 where parent_id=102 order by parent_id,id; id parent_id level 1008 102 2 -1010 102 2 1015 102 2 +1010 102 2 explain select level from t1 where level=1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref level level 1 const X Using index diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 2a5fe775ca6..fbfd5031656 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -2646,7 +2646,11 @@ ha_rows ha_berkeley::estimate_rows_upper_bound() int ha_berkeley::cmp_ref(const byte *ref1, const byte *ref2) { if (hidden_primary_key) - return memcmp(ref1, ref2, BDB_HIDDEN_PRIMARY_KEY_LENGTH); + { + ulonglong a=uint5korr((char*) ref1); + ulonglong b=uint5korr((char*) ref2); + return a < b ? -1 : (a > b ? 1 : 0); + } int result; Field *field; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2d9d261bb31..d82a0fdcf41 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -12033,7 +12033,6 @@ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx, */ if (!on_primary_key && (table->file->table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX) && - table->s->db_type == DB_TYPE_INNODB && table->s->primary_key != MAX_KEY) { on_primary_key= TRUE; diff --git a/sql/table.cc b/sql/table.cc index ce894e6910f..18a395d69af 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -782,8 +782,7 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, if (ha_option & HA_PRIMARY_KEY_IN_READ_INDEX) { field->part_of_key= share->keys_in_use; - if (share->db_type == DB_TYPE_INNODB && - field->part_of_sortkey.is_set(key)) + if (field->part_of_sortkey.is_set(key)) field->part_of_sortkey= share->keys_in_use; } } |