summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/key.cc22
-rw-r--r--sql/sql_select.cc6
2 files changed, 5 insertions, 23 deletions
diff --git a/sql/key.cc b/sql/key.cc
index 780cc6733c1..fd5c129eee8 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -689,20 +689,12 @@ ulong key_hashnr(KEY *key_info, uint used_key_parts, const uchar *key)
pack_length= 0;
break;
case HA_KEYTYPE_VARTEXT1:
- cs= key_part->field->charset();
- length= (uint)(pos[0]);
- pack_length= 1;
- break;
- case HA_KEYTYPE_VARBINARY1:
- cs= &my_charset_bin;
- length= (uint)(pos[0]);
- pack_length= 1;
- break;
case HA_KEYTYPE_VARTEXT2:
cs= key_part->field->charset();
length= uint2korr(pos);
pack_length= 2;
break;
+ case HA_KEYTYPE_VARBINARY1:
case HA_KEYTYPE_VARBINARY2:
cs= &my_charset_bin;
length= uint2korr(pos);
@@ -806,23 +798,13 @@ bool key_buf_cmp(KEY *key_info, uint used_key_parts,
pack_length= 0;
break;
case HA_KEYTYPE_VARTEXT1:
- cs= key_part->field->charset();
- length1= (uint)(pos1[0]);
- length2= (uint)(pos2[0]);
- pack_length= 1;
- break;
- case HA_KEYTYPE_VARBINARY1:
- cs= &my_charset_bin;
- length1= (uint)(pos1[0]);
- length2= (uint)(pos2[0]);
- pack_length= 1;
- break;
case HA_KEYTYPE_VARTEXT2:
cs= key_part->field->charset();
length1= uint2korr(pos1);
length2= uint2korr(pos2);
pack_length= 2;
break;
+ case HA_KEYTYPE_VARBINARY1:
case HA_KEYTYPE_VARBINARY2:
cs= &my_charset_bin;
length1= uint2korr(pos1);
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 37930edb27f..de9c7f5c13a 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -7877,8 +7877,8 @@ uint check_join_cache_usage(JOIN_TAB *tab,
bool *icp_other_tables_ok,
bool *idx_cond_fact_out)
{
- uint flags;
COST_VECT cost;
+ uint flags= 0;
ha_rows rows= 0;
uint bufsz= 4096;
JOIN_CACHE *prev_cache=0;
@@ -7996,8 +7996,8 @@ uint check_join_cache_usage(JOIN_TAB *tab,
}
if ((cache_level <=4 && !no_hashed_cache) || no_bka_cache ||
- ((flags & HA_MRR_NO_ASSOCIATION) && cache_level <=6) ||
- tab->is_ref_for_hash_join())
+ tab->is_ref_for_hash_join() ||
+ ((flags & HA_MRR_NO_ASSOCIATION) && cache_level <=6))
{
if (!tab->hash_join_is_possible() ||
tab->make_scan_filter())