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
a0df09ee
Commit
a0df09ee
authored
May 13, 2006
by
igor@rurik.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-2
parents
98b81c4f
058cba6b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
0 deletions
+52
-0
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
+26
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+4
-0
No files found.
mysql-test/r/join_outer.result
View file @
a0df09ee
...
...
@@ -1154,3 +1154,25 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index PRIMARY,name name 23 NULL 3 Using where; Using index
1 SIMPLE t2 ref fkey fkey 5 test.t1.id 1 Using where; Using index
DROP TABLE t1,t2;
DROP VIEW IF EXISTS v1,v2;
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (a int);
CREATE table t2 (b int);
INSERT INTO t1 VALUES (1), (2), (3), (4), (1), (1), (3);
INSERT INTO t2 VALUES (2), (3);
CREATE VIEW v1 AS SELECT a FROM t1 JOIN t2 ON t1.a=t2.b;
CREATE VIEW v2 AS SELECT b FROM t2 JOIN t1 ON t2.b=t1.a;
SELECT v1.a, v2. b
FROM v1 LEFT OUTER JOIN v2 ON (v1.a=v2.b) AND (v1.a >= 3)
GROUP BY v1.a;
a b
2 NULL
3 3
SELECT v1.a, v2. b
FROM { OJ v1 LEFT OUTER JOIN v2 ON (v1.a=v2.b) AND (v1.a >= 3) }
GROUP BY v1.a;
a b
2 NULL
3 3
DROP VIEW v1,v2;
DROP TABLE t1,t2;
mysql-test/t/join_outer.test
View file @
a0df09ee
...
...
@@ -779,3 +779,29 @@ SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
WHERE
t1
.
name
LIKE
'A%'
OR
FALSE
;
DROP
TABLE
t1
,
t2
;
#
# Bug 19396: LEFT OUTER JOIN over views in curly braces
#
--
disable_warnings
DROP
VIEW
IF
EXISTS
v1
,
v2
;
DROP
TABLE
IF
EXISTS
t1
,
t2
;
--
enable_warnings
CREATE
TABLE
t1
(
a
int
);
CREATE
table
t2
(
b
int
);
INSERT
INTO
t1
VALUES
(
1
),
(
2
),
(
3
),
(
4
),
(
1
),
(
1
),
(
3
);
INSERT
INTO
t2
VALUES
(
2
),
(
3
);
CREATE
VIEW
v1
AS
SELECT
a
FROM
t1
JOIN
t2
ON
t1
.
a
=
t2
.
b
;
CREATE
VIEW
v2
AS
SELECT
b
FROM
t2
JOIN
t1
ON
t2
.
b
=
t1
.
a
;
SELECT
v1
.
a
,
v2
.
b
FROM
v1
LEFT
OUTER
JOIN
v2
ON
(
v1
.
a
=
v2
.
b
)
AND
(
v1
.
a
>=
3
)
GROUP
BY
v1
.
a
;
SELECT
v1
.
a
,
v2
.
b
FROM
{
OJ
v1
LEFT
OUTER
JOIN
v2
ON
(
v1
.
a
=
v2
.
b
)
AND
(
v1
.
a
>=
3
)
}
GROUP
BY
v1
.
a
;
DROP
VIEW
v1
,
v2
;
DROP
TABLE
t1
,
t2
;
sql/sql_yacc.yy
View file @
a0df09ee
...
...
@@ -448,6 +448,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token NUMERIC_SYM
%token NVARCHAR_SYM
%token OFFSET_SYM
%token OJ_SYM
%token OLD_PASSWORD
%token ON
%token ONE_SHOT_SYM
...
...
@@ -5246,11 +5247,14 @@ table_factor:
}
expr '}'
{
LEX *lex= Lex;
YYERROR_UNLESS($3 && $7);
add_join_on($7,$10);
Lex->pop_context();
$7->outer_join|=JOIN_TYPE_LEFT;
$$=$7;
if (!($$= lex->current_select->nest_last_join(lex->thd)))
YYABORT;
}
| select_derived_init get_select_lex select_derived2
{
...
...
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