Commit ac995231 authored by Rich Prohaska's avatar Rich Prohaska

DB-746 merge clustering key is covering key for mariadb 10

parent ad4af102
...@@ -4485,6 +4485,11 @@ int ha_tokudb::index_init(uint keynr, bool sorted) { ...@@ -4485,6 +4485,11 @@ int ha_tokudb::index_init(uint keynr, bool sorted) {
} }
tokudb_active_index = keynr; tokudb_active_index = keynr;
#if TOKU_CLUSTERING_IS_COVERING
if (keynr < table->s->keys && table->key_info[keynr].option_struct->clustering)
key_read = false;
#endif
last_cursor_error = 0; last_cursor_error = 0;
range_lock_grabbed = false; range_lock_grabbed = false;
range_lock_grabbed_null = false; range_lock_grabbed_null = false;
...@@ -5834,11 +5839,14 @@ void ha_tokudb::position(const uchar * record) { ...@@ -5834,11 +5839,14 @@ void ha_tokudb::position(const uchar * record) {
// 0, always success // 0, always success
// //
int ha_tokudb::info(uint flag) { int ha_tokudb::info(uint flag) {
TOKUDB_HANDLER_DBUG_ENTER("%d %lld", flag, (long long) share->rows); TOKUDB_HANDLER_DBUG_ENTER("%d", flag);
int error; int error = 0;
#if TOKU_CLUSTERING_IS_COVERING
for (uint i=0; i < table->s->keys; i++)
if (table->key_info[i].option_struct->clustering)
table->covering_keys.set_bit(i);
#endif
DB_TXN* txn = NULL; DB_TXN* txn = NULL;
uint curr_num_DBs = table->s->keys + tokudb_test(hidden_primary_key);
DB_BTREE_STAT64 dict_stats;
if (flag & HA_STATUS_VARIABLE) { if (flag & HA_STATUS_VARIABLE) {
// Just to get optimizations right // Just to get optimizations right
stats.records = share->rows + share->rows_from_locked_table; stats.records = share->rows + share->rows_from_locked_table;
...@@ -5868,18 +5876,12 @@ int ha_tokudb::info(uint flag) { ...@@ -5868,18 +5876,12 @@ int ha_tokudb::info(uint flag) {
else { else {
goto cleanup; goto cleanup;
} }
error = share->file->get_fragmentation( error = share->file->get_fragmentation(share->file, &frag_info);
share->file,
&frag_info
);
if (error) { goto cleanup; } if (error) { goto cleanup; }
stats.delete_length = frag_info.unused_bytes; stats.delete_length = frag_info.unused_bytes;
error = share->file->stat64( DB_BTREE_STAT64 dict_stats;
share->file, error = share->file->stat64(share->file, txn, &dict_stats);
txn,
&dict_stats
);
if (error) { goto cleanup; } if (error) { goto cleanup; }
stats.create_time = dict_stats.bt_create_time_sec; stats.create_time = dict_stats.bt_create_time_sec;
...@@ -5915,6 +5917,7 @@ int ha_tokudb::info(uint flag) { ...@@ -5915,6 +5917,7 @@ int ha_tokudb::info(uint flag) {
// //
// this solution is much simpler than trying to maintain an // this solution is much simpler than trying to maintain an
// accurate number of valid keys at the handlerton layer. // accurate number of valid keys at the handlerton layer.
uint curr_num_DBs = table->s->keys + tokudb_test(hidden_primary_key);
for (uint i = 0; i < curr_num_DBs; i++) { for (uint i = 0; i < curr_num_DBs; i++) {
// skip the primary key, skip dropped indexes // skip the primary key, skip dropped indexes
if (i == primary_key || share->key_file[i] == NULL) { if (i == primary_key || share->key_file[i] == NULL) {
......
...@@ -113,6 +113,7 @@ PATENT RIGHTS GRANT: ...@@ -113,6 +113,7 @@ PATENT RIGHTS GRANT:
#endif #endif
#define TOKU_INCLUDE_OPTION_STRUCTS 1 #define TOKU_INCLUDE_OPTION_STRUCTS 1
#define TOKU_OPTIMIZE_WITH_RECREATE 1 #define TOKU_OPTIMIZE_WITH_RECREATE 1
#define TOKU_CLUSTERING_IS_COVERING 1
#elif 50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799 #elif 50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799
// mysql 5.7 with no patches // mysql 5.7 with no patches
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment