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
2ef1963c
Commit
2ef1963c
authored
Apr 17, 2005
by
sergefp@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for BUG#9348: when computing union of two intervals set lower bound to
minimum of lower bounds of two joined intervals.
parent
2b322f36
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
0 deletions
+41
-0
mysql-test/r/range.result
mysql-test/r/range.result
+19
-0
mysql-test/t/range.test
mysql-test/t/range.test
+21
-0
sql/opt_range.cc
sql/opt_range.cc
+1
-0
No files found.
mysql-test/r/range.result
View file @
2ef1963c
...
@@ -577,3 +577,22 @@ id select_type table type possible_keys key key_len ref rows Extra
...
@@ -577,3 +577,22 @@ id select_type table type possible_keys key key_len ref rows Extra
explain select * from t1 where a='aaa' collate latin1_german1_ci;
explain select * from t1 where a='aaa' collate latin1_german1_ci;
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL a NULL NULL NULL 9 Using where
1 SIMPLE t1 ALL a NULL NULL NULL 9 Using where
drop table t1;
CREATE TABLE t1 (
`CLIENT` char(3) character set latin1 collate latin1_bin NOT NULL default '000',
`ARG1` char(3) character set latin1 collate latin1_bin NOT NULL default '',
`ARG2` char(3) character set latin1 collate latin1_bin NOT NULL default '',
`FUNCTION` varchar(10) character set latin1 collate latin1_bin NOT NULL default '',
`FUNCTINT` int(11) NOT NULL default '0',
KEY `VERI_CLNT~2` (`ARG1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES ('000',' 0',' 0','Text 001',0), ('000',' 0',' 1','Text 002',0),
('000',' 1',' 2','Text 003',0), ('000',' 2',' 3','Text 004',0),
('001',' 3',' 0','Text 017',0);
SELECT count(*) FROM t1 WHERE CLIENT='000' AND (ARG1 != ' 1' OR ARG1 != ' 2');
count(*)
4
SELECT count(*) FROM t1 WHERE CLIENT='000' AND (ARG1 != ' 2' OR ARG1 != ' 1');
count(*)
4
drop table t1;
mysql-test/t/range.test
View file @
2ef1963c
...
@@ -445,3 +445,24 @@ explain select * from t1 where a=binary 'aaa';
...
@@ -445,3 +445,24 @@ explain select * from t1 where a=binary 'aaa';
explain
select
*
from
t1
where
a
=
'aaa'
collate
latin1_bin
;
explain
select
*
from
t1
where
a
=
'aaa'
collate
latin1_bin
;
# this one cannot:
# this one cannot:
explain
select
*
from
t1
where
a
=
'aaa'
collate
latin1_german1_ci
;
explain
select
*
from
t1
where
a
=
'aaa'
collate
latin1_german1_ci
;
drop
table
t1
;
# Test for BUG#9348 "result for WHERE A AND (B OR C) differs from WHERE a AND (C OR B)"
CREATE
TABLE
t1
(
`CLIENT`
char
(
3
)
character
set
latin1
collate
latin1_bin
NOT
NULL
default
'000'
,
`ARG1`
char
(
3
)
character
set
latin1
collate
latin1_bin
NOT
NULL
default
''
,
`ARG2`
char
(
3
)
character
set
latin1
collate
latin1_bin
NOT
NULL
default
''
,
`FUNCTION`
varchar
(
10
)
character
set
latin1
collate
latin1_bin
NOT
NULL
default
''
,
`FUNCTINT`
int
(
11
)
NOT
NULL
default
'0'
,
KEY
`VERI_CLNT~2`
(
`ARG1`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
latin1
;
INSERT
INTO
t1
VALUES
(
'000'
,
' 0'
,
' 0'
,
'Text 001'
,
0
),
(
'000'
,
' 0'
,
' 1'
,
'Text 002'
,
0
),
(
'000'
,
' 1'
,
' 2'
,
'Text 003'
,
0
),
(
'000'
,
' 2'
,
' 3'
,
'Text 004'
,
0
),
(
'001'
,
' 3'
,
' 0'
,
'Text 017'
,
0
);
SELECT
count
(
*
)
FROM
t1
WHERE
CLIENT
=
'000'
AND
(
ARG1
!=
' 1'
OR
ARG1
!=
' 2'
);
SELECT
count
(
*
)
FROM
t1
WHERE
CLIENT
=
'000'
AND
(
ARG1
!=
' 2'
OR
ARG1
!=
' 1'
);
drop
table
t1
;
sql/opt_range.cc
View file @
2ef1963c
...
@@ -1683,6 +1683,7 @@ key_or(SEL_ARG *key1,SEL_ARG *key2)
...
@@ -1683,6 +1683,7 @@ key_or(SEL_ARG *key1,SEL_ARG *key2)
last
=
last
->
next
;
last
=
last
->
next
;
key1
=
key1
->
tree_delete
(
save
);
key1
=
key1
->
tree_delete
(
save
);
}
}
last
->
copy_min
(
tmp
);
if
(
last
->
copy_min
(
key2
)
||
last
->
copy_max
(
key2
))
if
(
last
->
copy_min
(
key2
)
||
last
->
copy_max
(
key2
))
{
// Full range
{
// Full range
key1
->
free_tree
();
key1
->
free_tree
();
...
...
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