Commit f950b5ae authored by lenz@mysql.com's avatar lenz@mysql.com

Merge lgrimmer@build.mysql.com:/home/bk/mysql-4.0

into mysql.com:/space/my/mysql-4.0
parents 5693662f 52ad8214
...@@ -840,9 +840,11 @@ int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a, ...@@ -840,9 +840,11 @@ int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a,
break; break;
case HA_KEYTYPE_VARTEXT: case HA_KEYTYPE_VARTEXT:
{ {
int a_length,b_length,pack_length; int a_length,full_a_length,b_length,full_b_length,pack_length;
get_key_length(a_length,a); get_key_length(a_length,a);
get_key_pack_length(b_length,pack_length,b); get_key_pack_length(b_length,pack_length,b);
full_a_length=a_length;
full_b_length=b_length;
next_key_length=key_length-b_length-pack_length; next_key_length=key_length-b_length-pack_length;
if (!(nextflag & (SEARCH_PREFIX | SEARCH_UPDATE))) if (!(nextflag & (SEARCH_PREFIX | SEARCH_UPDATE)))
...@@ -857,8 +859,8 @@ int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a, ...@@ -857,8 +859,8 @@ int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a,
(my_bool) ((nextflag & SEARCH_PREFIX) && (my_bool) ((nextflag & SEARCH_PREFIX) &&
next_key_length <= 0)))) next_key_length <= 0))))
return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
a+=a_length; a+=full_a_length;
b+=b_length; b+=full_b_length;
break; break;
} }
break; break;
...@@ -963,7 +965,7 @@ int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a, ...@@ -963,7 +965,7 @@ int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a,
if (keyseg->flag & HA_REVERSE_SORT) if (keyseg->flag & HA_REVERSE_SORT)
{ {
swap(uchar*,a,b); swap(uchar*,a,b);
swap_flag=1; /* Remember swap of a & b */ swap_flag=1; /* Remember swap of a & b */
end= a+ (int) (end-b); end= a+ (int) (end-b);
} }
......
...@@ -300,3 +300,11 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1); ...@@ -300,3 +300,11 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1);
COUNT(*) COUNT(*)
6 6
DROP TABLE t1; DROP TABLE t1;
create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10)));
insert into t1 values('807780', '477', '165');
insert into t1 values('807780', '477', '162');
insert into t1 values('807780', '472', '162');
select * from t1 where a='807780' and b='477' and c='165';
a b c
807780 477 165
drop table t1;
...@@ -248,3 +248,15 @@ INSERT INTO t1 VALUES (0,1,0),(0,1,0),(0,1,0); ...@@ -248,3 +248,15 @@ INSERT INTO t1 VALUES (0,1,0),(0,1,0),(0,1,0);
SELECT COUNT(*) FROM t1 WHERE (c=0 and a=1) or (c=0 and b=1); SELECT COUNT(*) FROM t1 WHERE (c=0 and a=1) or (c=0 and b=1);
SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1); SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1);
DROP TABLE t1; DROP TABLE t1;
#
# BUG#2295 - range on blob
#
create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10)));
insert into t1 values('807780', '477', '165');
insert into t1 values('807780', '477', '162');
insert into t1 values('807780', '472', '162');
select * from t1 where a='807780' and b='477' and c='165';
drop table t1;
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