summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2005-02-11 10:39:26 -0800
committerunknown <igor@rurik.mysql.com>2005-02-11 10:39:26 -0800
commitaa3727d7dc294e82b6e9ba81db0b86c56b804e5d (patch)
treec7c177764ec770b1d090107d99b102c9fd36b51e /sql/table.cc
parent20cbf9c2f69d84aff92562ac88d756d55aa88c4a (diff)
downloadmariadb-git-aa3727d7dc294e82b6e9ba81db0b86c56b804e5d.tar.gz
select.result:
After revision of the fix for bug #7520. table.cc: Revised the fix for bug #7520. Made it compliant with 5.0 code where the bug does not exist. sql/table.cc: Revised the fix for bug #7520. Made it compliant with 5.0 code where the bug does not exist. mysql-test/r/select.result: After revision of the fix for bug #7520.
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 244c7fa94f3..43ac122c7f3 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -143,7 +143,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
goto err_not_open; /* purecov: inspected */
bzero((char*) keyinfo,n_length);
outparam->key_info=keyinfo;
- outparam->max_key_length= outparam->total_key_length= 0;
key_part= my_reinterpret_cast(KEY_PART_INFO*) (keyinfo+keys);
strpos=disk_buff+6;
@@ -199,11 +198,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
}
key_part->store_length=key_part->length;
}
- set_if_bigger(outparam->max_key_length,keyinfo->key_length+
- keyinfo->key_parts);
- outparam->total_key_length+= keyinfo->key_length;
- if (keyinfo->flags & HA_NOSAME)
- set_if_bigger(outparam->max_unique_length,keyinfo->key_length);
}
keynames=(char*) key_part;
strpos+= (strmov(keynames, (char *) strpos) - keynames)+1;
@@ -486,7 +480,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
if (!(field->flags & BINARY_FLAG))
keyinfo->flags|= HA_END_SPACE_KEY;
}
- set_if_bigger(outparam->max_key_length, keyinfo->key_length);
if (i == 0 && key != primary_key)
field->flags |=
((keyinfo->flags & HA_NOSAME) &&
@@ -547,6 +540,12 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
}
}
keyinfo->usable_key_parts=usable_parts; // Filesort
+
+ set_if_bigger(outparam->max_key_length,keyinfo->key_length+
+ keyinfo->key_parts);
+ outparam->total_key_length+= keyinfo->key_length;
+ if (keyinfo->flags & HA_NOSAME)
+ set_if_bigger(outparam->max_unique_length,keyinfo->key_length);
}
if (primary_key < MAX_KEY &&
(outparam->keys_in_use & ((key_map) 1 << primary_key)))