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
7d8b9106
Commit
7d8b9106
authored
Mar 13, 2005
by
igor@rurik.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Manual merge
parents
f4631431
a90d2bd9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
6 deletions
+42
-6
mysql-test/r/join_outer.result
mysql-test/r/join_outer.result
+22
-0
mysql-test/t/join_outer.test
mysql-test/t/join_outer.test
+19
-6
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+1
-0
No files found.
mysql-test/r/join_outer.result
View file @
7d8b9106
...
...
@@ -889,3 +889,25 @@ a b a b
2 2 2 2
NULL NULL 3 3
DROP TABLE t0,t1,t2,t3;
CREATE TABLE t1 (a int PRIMARY KEY, b int);
CREATE TABLE t2 (a int PRIMARY KEY, b int);
INSERT INTO t1 VALUES (1,1), (2,1), (3,1), (4,2);
INSERT INTO t2 VALUES (1,2), (2,2);
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a;
a b a b
1 1 1 2
2 1 2 2
3 1 NULL NULL
4 2 NULL NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE t1.b=1;
a b a b
1 1 1 2
2 1 2 2
3 1 NULL NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
WHERE t1.b=1 XOR (NOT ISNULL(t2.a) AND t2.b=1);
a b a b
1 1 1 2
2 1 2 2
3 1 NULL NULL
DROP TABLE t1,t2;
mysql-test/t/join_outer.test
View file @
7d8b9106
...
...
@@ -588,12 +588,6 @@ INSERT INTO t2 VALUES("0", "SV", "0-SV");
INSERT
INTO
t2
VALUES
(
"10"
,
"EN"
,
"10-EN"
);
INSERT
INTO
t2
VALUES
(
"10"
,
"SV"
,
"10-SV"
);
SELECT
t1
.
id
,
t1
.
text_id
,
t2
.
text_data
FROM
t1
LEFT
JOIN
t2
ON
t1
.
text_id
=
t2
.
text_id
AND
t2
.
language_id
=
'SV'
WHERE
(
t1
.
id
LIKE
'%'
OR
t2
.
text_data
LIKE
'%'
);
DROP
TABLE
t1
,
t2
;
# Test for bug #5896
...
...
@@ -630,3 +624,22 @@ select * from t2 right join t1 on t2.a=t1.a;
select
straight_join
*
from
t2
right
join
t1
on
t2
.
a
=
t1
.
a
;
DROP
TABLE
t0
,
t1
,
t2
,
t3
;
#
# Test for bug #9017: left join mistakingly converted to inner join
#
CREATE
TABLE
t1
(
a
int
PRIMARY
KEY
,
b
int
);
CREATE
TABLE
t2
(
a
int
PRIMARY
KEY
,
b
int
);
INSERT
INTO
t1
VALUES
(
1
,
1
),
(
2
,
1
),
(
3
,
1
),
(
4
,
2
);
INSERT
INTO
t2
VALUES
(
1
,
2
),
(
2
,
2
);
SELECT
*
FROM
t1
LEFT
JOIN
t2
ON
t1
.
a
=
t2
.
a
;
SELECT
*
FROM
t1
LEFT
JOIN
t2
ON
t1
.
a
=
t2
.
a
WHERE
t1
.
b
=
1
;
SELECT
*
FROM
t1
LEFT
JOIN
t2
ON
t1
.
a
=
t2
.
a
WHERE
t1
.
b
=
1
XOR
(
NOT
ISNULL
(
t2
.
a
)
AND
t2
.
b
=
1
);
DROP
TABLE
t1
,
t2
;
sql/item_cmpfunc.h
View file @
7d8b9106
...
...
@@ -1234,6 +1234,7 @@ public:
enum
Type
type
()
const
{
return
FUNC_ITEM
;
}
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"xor"
;
}
table_map
not_null_tables
()
const
{
return
and_tables_cache
;
}
};
...
...
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