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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d1da520f
Commit
d1da520f
authored
Sep 29, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge rurik.mysql.com:/home/igor/mysql-5.0-opt
into rurik.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug22753
parents
04bf9cc7
af2ba777
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
1 deletion
+58
-1
mysql-test/r/select.result
mysql-test/r/select.result
+29
-0
mysql-test/t/select.test
mysql-test/t/select.test
+28
-1
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+1
-0
No files found.
mysql-test/r/select.result
View file @
d1da520f
...
...
@@ -3517,3 +3517,32 @@ id a b c d e
2 NULL NULL NULL 2 40
2 NULL NULL NULL 2 50
DROP TABLE t1,t2,t3;
CREATE TABLE t1 (pk varchar(10) PRIMARY KEY, fk varchar(16));
CREATE TABLE t2 (pk varchar(16) PRIMARY KEY, fk varchar(10));
INSERT INTO t1 VALUES
('d','dddd'), ('i','iii'), ('a','aa'), ('b','bb'), ('g','gg'),
('e','eee'), ('c','cccc'), ('h','hhh'), ('j','jjj'), ('f','fff');
INSERT INTO t2 VALUES
('jjj', 'j'), ('cc','c'), ('ccc','c'), ('aaa', 'a'), ('jjjj','j'),
('hhh','h'), ('gg','g'), ('fff','f'), ('ee','e'), ('ffff','f'),
('bbb','b'), ('ff','f'), ('cccc','c'), ('dddd','d'), ('jj','j'),
('aaaa','a'), ('bb','b'), ('eeee','e'), ('aa','a'), ('hh','h');
EXPLAIN SELECT t2.*
FROM t1 JOIN t2 ON t2.fk=t1.pk
WHERE t2.fk < 'c' AND t2.pk=t1.fk;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 12 NULL 3 Using where
1 SIMPLE t2 ref PRIMARY PRIMARY 18 test.t1.fk 1 Using where
EXPLAIN SELECT t2.*
FROM t1 JOIN t2 ON t2.fk=t1.pk
WHERE t2.fk BETWEEN 'a' AND 'b' AND t2.pk=t1.fk;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 12 NULL 2 Using where
1 SIMPLE t2 ref PRIMARY PRIMARY 18 test.t1.fk 1 Using where
EXPLAIN SELECT t2.*
FROM t1 JOIN t2 ON t2.fk=t1.pk
WHERE t2.fk IN ('a','b') AND t2.pk=t1.fk;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 12 NULL 2 Using where
1 SIMPLE t2 ref PRIMARY PRIMARY 18 test.t1.fk 1 Using where
DROP TABLE t1,t2;
mysql-test/t/select.test
View file @
d1da520f
...
...
@@ -2996,5 +2996,32 @@ SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id
SELECT
*
FROM
t1
LEFT
JOIN
t2
ON
t2
.
b
=
t1
.
a
INNER
JOIN
t3
ON
t3
.
d
=
t1
.
id
WHERE
t1
.
id
=
2
;
DROP
TABLE
t1
,
t2
,
t3
;
#
# Bug #22735: no equality propagation for BETWEEN and IN with STRING arguments
#
CREATE
TABLE
t1
(
pk
varchar
(
10
)
PRIMARY
KEY
,
fk
varchar
(
16
));
CREATE
TABLE
t2
(
pk
varchar
(
16
)
PRIMARY
KEY
,
fk
varchar
(
10
));
INSERT
INTO
t1
VALUES
(
'd'
,
'dddd'
),
(
'i'
,
'iii'
),
(
'a'
,
'aa'
),
(
'b'
,
'bb'
),
(
'g'
,
'gg'
),
(
'e'
,
'eee'
),
(
'c'
,
'cccc'
),
(
'h'
,
'hhh'
),
(
'j'
,
'jjj'
),
(
'f'
,
'fff'
);
INSERT
INTO
t2
VALUES
(
'jjj'
,
'j'
),
(
'cc'
,
'c'
),
(
'ccc'
,
'c'
),
(
'aaa'
,
'a'
),
(
'jjjj'
,
'j'
),
(
'hhh'
,
'h'
),
(
'gg'
,
'g'
),
(
'fff'
,
'f'
),
(
'ee'
,
'e'
),
(
'ffff'
,
'f'
),
(
'bbb'
,
'b'
),
(
'ff'
,
'f'
),
(
'cccc'
,
'c'
),
(
'dddd'
,
'd'
),
(
'jj'
,
'j'
),
(
'aaaa'
,
'a'
),
(
'bb'
,
'b'
),
(
'eeee'
,
'e'
),
(
'aa'
,
'a'
),
(
'hh'
,
'h'
);
EXPLAIN
SELECT
t2
.*
FROM
t1
JOIN
t2
ON
t2
.
fk
=
t1
.
pk
WHERE
t2
.
fk
<
'c'
AND
t2
.
pk
=
t1
.
fk
;
EXPLAIN
SELECT
t2
.*
FROM
t1
JOIN
t2
ON
t2
.
fk
=
t1
.
pk
WHERE
t2
.
fk
BETWEEN
'a'
AND
'b'
AND
t2
.
pk
=
t1
.
fk
;
EXPLAIN
SELECT
t2
.*
FROM
t1
JOIN
t2
ON
t2
.
fk
=
t1
.
pk
WHERE
t2
.
fk
IN
(
'a'
,
'b'
)
AND
t2
.
pk
=
t1
.
fk
;
DROP
TABLE
t1
,
t2
;
sql/item_cmpfunc.h
View file @
d1da520f
...
...
@@ -446,6 +446,7 @@ class Item_func_opt_neg :public Item_int_func
negated
=
!
negated
;
return
this
;
}
bool
subst_argument_checker
(
byte
**
arg
)
{
return
TRUE
;
}
};
...
...
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