Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
ae4b9459
Commit
ae4b9459
authored
20 years ago
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
an obvious bug in _mi_key_cmp fixed (BUG#2295 - range on blobs)
parent
3640f7e1
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
4 deletions
+26
-4
myisam/mi_search.c
myisam/mi_search.c
+6
-4
mysql-test/r/range.result
mysql-test/r/range.result
+8
-0
mysql-test/t/range.test
mysql-test/t/range.test
+12
-0
No files found.
myisam/mi_search.c
View file @
ae4b9459
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
mysql-test/r/range.result
View file @
ae4b9459
...
@@ -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;
This diff is collapsed.
Click to expand it.
mysql-test/t/range.test
View file @
ae4b9459
...
@@ -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
;
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment