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
881e6e68
Commit
881e6e68
authored
Nov 25, 2005
by
igor@rurik.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug #15106.
A typo bug caused loss of a predicate of the form field=const in some cases.
parent
e5592190
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
1 deletion
+92
-1
mysql-test/r/select.result
mysql-test/r/select.result
+46
-0
mysql-test/t/select.test
mysql-test/t/select.test
+45
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+1
-1
No files found.
mysql-test/r/select.result
View file @
881e6e68
...
@@ -3291,3 +3291,49 @@ f1 f2 x1
...
@@ -3291,3 +3291,49 @@ f1 f2 x1
30 1 30
30 1 30
drop table t1;
drop table t1;
drop view v1, v2, v3;
drop view v1, v2, v3;
CREATE TABLE t1(key_a int4 NOT NULL, optimus varchar(32), PRIMARY KEY(key_a));
CREATE TABLE t2(key_a int4 NOT NULL, prime varchar(32), PRIMARY KEY(key_a));
CREATE table t3(key_a int4 NOT NULL, key_b int4 NOT NULL, foo varchar(32),
PRIMARY KEY(key_a,key_b));
INSERT INTO t1 VALUES (0,'');
INSERT INTO t1 VALUES (1,'i');
INSERT INTO t1 VALUES (2,'j');
INSERT INTO t1 VALUES (3,'k');
INSERT INTO t2 VALUES (1,'r');
INSERT INTO t2 VALUES (2,'s');
INSERT INTO t2 VALUES (3,'t');
INSERT INTO t3 VALUES (1,5,'x');
INSERT INTO t3 VALUES (1,6,'y');
INSERT INTO t3 VALUES (2,5,'xx');
INSERT INTO t3 VALUES (2,6,'yy');
INSERT INTO t3 VALUES (2,7,'zz');
INSERT INTO t3 VALUES (3,5,'xxx');
SELECT t2.key_a,foo
FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a
INNER JOIN t3 ON t1.key_a = t3.key_a
WHERE t2.key_a=2 and key_b=5;
key_a foo
2 xx
EXPLAIN SELECT t2.key_a,foo
FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a
INNER JOIN t3 ON t1.key_a = t3.key_a
WHERE t2.key_a=2 and key_b=5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 Using index
1 SIMPLE t3 const PRIMARY PRIMARY 8 const,const 1
SELECT t2.key_a,foo
FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a
INNER JOIN t3 ON t1.key_a = t3.key_a
WHERE t2.key_a=2 and key_b=5;
key_a foo
2 xx
EXPLAIN SELECT t2.key_a,foo
FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a
INNER JOIN t3 ON t1.key_a = t3.key_a
WHERE t2.key_a=2 and key_b=5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 Using index
1 SIMPLE t3 const PRIMARY PRIMARY 8 const,const 1
DROP TABLE t1,t2,t3;
mysql-test/t/select.test
View file @
881e6e68
...
@@ -2760,3 +2760,48 @@ select f1, f2, v2.f1 as x1 from v2 order by v2.f1;
...
@@ -2760,3 +2760,48 @@ select f1, f2, v2.f1 as x1 from v2 order by v2.f1;
select
f1
,
f2
,
v3
.
f1
as
x1
from
v3
order
by
v3
.
f1
;
select
f1
,
f2
,
v3
.
f1
as
x1
from
v3
order
by
v3
.
f1
;
drop
table
t1
;
drop
table
t1
;
drop
view
v1
,
v2
,
v3
;
drop
view
v1
,
v2
,
v3
;
#
# Bug #15106: lost equality predicate of the form field=const in a join query
#
CREATE
TABLE
t1
(
key_a
int4
NOT
NULL
,
optimus
varchar
(
32
),
PRIMARY
KEY
(
key_a
));
CREATE
TABLE
t2
(
key_a
int4
NOT
NULL
,
prime
varchar
(
32
),
PRIMARY
KEY
(
key_a
));
CREATE
table
t3
(
key_a
int4
NOT
NULL
,
key_b
int4
NOT
NULL
,
foo
varchar
(
32
),
PRIMARY
KEY
(
key_a
,
key_b
));
INSERT
INTO
t1
VALUES
(
0
,
''
);
INSERT
INTO
t1
VALUES
(
1
,
'i'
);
INSERT
INTO
t1
VALUES
(
2
,
'j'
);
INSERT
INTO
t1
VALUES
(
3
,
'k'
);
INSERT
INTO
t2
VALUES
(
1
,
'r'
);
INSERT
INTO
t2
VALUES
(
2
,
's'
);
INSERT
INTO
t2
VALUES
(
3
,
't'
);
INSERT
INTO
t3
VALUES
(
1
,
5
,
'x'
);
INSERT
INTO
t3
VALUES
(
1
,
6
,
'y'
);
INSERT
INTO
t3
VALUES
(
2
,
5
,
'xx'
);
INSERT
INTO
t3
VALUES
(
2
,
6
,
'yy'
);
INSERT
INTO
t3
VALUES
(
2
,
7
,
'zz'
);
INSERT
INTO
t3
VALUES
(
3
,
5
,
'xxx'
);
SELECT
t2
.
key_a
,
foo
FROM
t1
INNER
JOIN
t2
ON
t1
.
key_a
=
t2
.
key_a
INNER
JOIN
t3
ON
t1
.
key_a
=
t3
.
key_a
WHERE
t2
.
key_a
=
2
and
key_b
=
5
;
EXPLAIN
SELECT
t2
.
key_a
,
foo
FROM
t1
INNER
JOIN
t2
ON
t1
.
key_a
=
t2
.
key_a
INNER
JOIN
t3
ON
t1
.
key_a
=
t3
.
key_a
WHERE
t2
.
key_a
=
2
and
key_b
=
5
;
SELECT
t2
.
key_a
,
foo
FROM
t1
INNER
JOIN
t2
ON
t2
.
key_a
=
t1
.
key_a
INNER
JOIN
t3
ON
t1
.
key_a
=
t3
.
key_a
WHERE
t2
.
key_a
=
2
and
key_b
=
5
;
EXPLAIN
SELECT
t2
.
key_a
,
foo
FROM
t1
INNER
JOIN
t2
ON
t2
.
key_a
=
t1
.
key_a
INNER
JOIN
t3
ON
t1
.
key_a
=
t3
.
key_a
WHERE
t2
.
key_a
=
2
and
key_b
=
5
;
DROP
TABLE
t1
,
t2
,
t3
;
sql/item_cmpfunc.cc
View file @
881e6e68
...
@@ -3662,7 +3662,7 @@ void Item_equal::merge(Item_equal *item)
...
@@ -3662,7 +3662,7 @@ void Item_equal::merge(Item_equal *item)
the multiple equality already contains a constant and its
the multiple equality already contains a constant and its
value is not equal to the value of c.
value is not equal to the value of c.
*/
*/
add
(
c
onst_item
);
add
(
c
);
}
}
cond_false
|=
item
->
cond_false
;
cond_false
|=
item
->
cond_false
;
}
}
...
...
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