Below is the list of changes that have just been committed into a local
5.0 repository of serg. When serg does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1833 05/03/23 19:31:29 serg@stripped +1 -0
removed unnecessary (and incorrect) space trimming/padding in generating ranges
(where e.g. col='aaa ' was converted to col>='aaa' AND col<='aaa ')
it was incorrect because ucs2 space is not ' ' (0x20)
it was unnecessary because storage engine pads values with spaces for comparison anyway
sql/opt_range.cc
1.149 05/03/23 19:31:12 serg@stripped +4 -30
removed unnecessary (and incorrect) space trimming/padding in generating ranges
(where e.g. col='aaa ' was converted to col>='aaa' AND col<='aaa ')
it was incorrect because ucs2 space is not ' ' (0x20)
it was unnecessary because storage engine pads values with spaces for comparison
anyway
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: serg
# Host: serg.mylan
# Root: /usr/home/serg/Abk/mysql-5.0
--- 1.148/sql/opt_range.cc Sat Mar 19 01:12:21 2005
+++ 1.149/sql/opt_range.cc Wed Mar 23 19:31:12 2005
@@ -3607,10 +3607,10 @@
get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part,
Item_func::Functype type,Item *value)
{
- uint maybe_null=(uint) field->real_maybe_null(), copies;
+ uint maybe_null=(uint) field->real_maybe_null();
bool optimize_range;
SEL_ARG *tree;
- char *str, *str2;
+ char *str;
DBUG_ENTER("get_mm_leaf");
if (!value) // IS NULL or IS NOT NULL
@@ -3745,39 +3745,13 @@
/* This happens when we try to insert a NULL field in a not null column */
DBUG_RETURN(&null_element); // cmp with NULL is never TRUE
}
- /* Get local copy of key */
- copies= 1;
- if (field->key_type() == HA_KEYTYPE_VARTEXT1 ||
- field->key_type() == HA_KEYTYPE_VARTEXT2)
- copies= 2;
- str= str2= (char*) alloc_root(param->mem_root,
- (key_part->store_length)*copies+1);
+ str= (char*) alloc_root(param->mem_root, key_part->store_length+1);
if (!str)
DBUG_RETURN(0);
if (maybe_null)
*str= (char) field->is_real_null(); // Set to 1 if null
field->get_key_image(str+maybe_null, key_part->length, key_part->image_type);
- if (copies == 2)
- {
- /*
- The key is stored as 2 byte length + key
- key doesn't match end space. In other words, a key 'X ' should match
- all rows between 'X' and 'X ...'
- */
- uint length= uint2korr(str+maybe_null);
- str2= str+ key_part->store_length;
- /* remove end space */
- while (length > 0 && str[length+HA_KEY_BLOB_LENGTH+maybe_null-1] == ' ')
- length--;
- int2store(str+maybe_null, length);
- /* Create key that is space filled */
- memcpy(str2, str, length + HA_KEY_BLOB_LENGTH + maybe_null);
- my_fill_8bit(field->charset(),
- str2+ length+ HA_KEY_BLOB_LENGTH +maybe_null,
- key_part->length-length, ' ');
- int2store(str2+maybe_null, key_part->length);
- }
- if (!(tree=new SEL_ARG(field,str,str2)))
+ if (!(tree=new SEL_ARG(field,str,str)))
DBUG_RETURN(0); // out of memory
switch (type) {
| Thread |
|---|
| • bk commit into 5.0 tree (serg:1.1833) | Sergei Golubchik | 23 Mar |