summaryrefslogtreecommitdiff
path: root/sql/sql_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_test.cc')
-rw-r--r--sql/sql_test.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index 5bf9cd1f77e..af89b3cd525 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -231,14 +231,18 @@ void print_keyuse(KEYUSE *keyuse)
char buff[256];
char buf2[64];
const char *fieldname;
+ JOIN_TAB *join_tab= keyuse->table->reginfo.join_tab;
+ KEY *key_info= join_tab->get_keyinfo_by_key_no(keyuse->key);
String str(buff,(uint32) sizeof(buff), system_charset_info);
str.length(0);
keyuse->val->print(&str, QT_ORDINARY);
str.append('\0');
- if (keyuse->keypart == FT_KEYPART)
+ if (keyuse->is_for_hash_join())
+ fieldname= keyuse->table->field[keyuse->keypart]->field_name;
+ else if (keyuse->keypart == FT_KEYPART)
fieldname= "FT_KEYPART";
else
- fieldname= keyuse->table->key_info[keyuse->key].key_part[keyuse->keypart].field->field_name;
+ fieldname= key_info->key_part[keyuse->keypart].field->field_name;
longlong2str(keyuse->used_tables, buf2, 16, 0);
DBUG_LOCK_FILE;
fprintf(DBUG_FILE, "KEYUSE: %s.%s=%s optimize: %u used_tables: %s "