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
ab6ef39c
Commit
ab6ef39c
authored
Dec 19, 2007
by
davi@endora.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/Users/davi/mysql/bugs/28317-5.1
into mysql.com:/Users/davi/mysql/mysql-5.1-runtime
parents
b9a41928
cab36bdf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
24 deletions
+57
-24
mysql-test/r/parser.result
mysql-test/r/parser.result
+20
-0
mysql-test/t/parser.test
mysql-test/t/parser.test
+20
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+17
-24
No files found.
mysql-test/r/parser.result
View file @
ab6ef39c
...
...
@@ -527,3 +527,23 @@ SELECT * FROM t1 WHERE a = INTERVAL(3,2,1) + 1;
a b
3 1998-01-01 00:00:00
DROP TABLE t1;
DROP TABLE IF EXISTS t1,t2,t3;
CREATE TABLE t1 (a1 INT, a2 INT, a3 INT, a4 DATETIME);
CREATE TABLE t2 LIKE t1;
CREATE TABLE t3 LIKE t1;
SELECT t1.* FROM t1 AS t0, { OJ t2 INNER JOIN t1 ON (t1.a1=t2.a1) } WHERE t0.a3=2;
a1 a2 a3 a4
SELECT t1.*,t2.* FROM { OJ ((t1 INNER JOIN t2 ON (t1.a1=t2.a2)) LEFT OUTER JOIN t3 ON t3.a3=t2.a1)};
a1 a2 a3 a4 a1 a2 a3 a4
SELECT t1.*,t2.* FROM { OJ ((t1 LEFT OUTER JOIN t2 ON t1.a3=t2.a2) INNER JOIN t3 ON (t3.a1=t2.a2))};
a1 a2 a3 a4 a1 a2 a3 a4
SELECT t1.*,t2.* FROM { OJ (t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a2) CROSS JOIN t3 ON (t3.a2=t2.a3)};
a1 a2 a3 a4 a1 a2 a3 a4
SELECT * FROM {oj t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a3} WHERE t1.a2 > 10;
a1 a2 a3 a4 a1 a2 a3 a4
SELECT {fn CONCAT(a1,a2)} FROM t1;
{fn CONCAT(a1,a2)}
UPDATE t3 SET a4={d '1789-07-14'} WHERE a1=0;
SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')};
a1 a4
DROP TABLE t1, t2, t3;
mysql-test/t/parser.test
View file @
ab6ef39c
...
...
@@ -657,3 +657,23 @@ CREATE TABLE t1 (a INT, b DATETIME);
INSERT
INTO
t1
VALUES
(
INTERVAL
(
3
,
2
,
1
)
+
1
,
"1997-12-31 23:59:59"
+
INTERVAL
1
SECOND
);
SELECT
*
FROM
t1
WHERE
a
=
INTERVAL
(
3
,
2
,
1
)
+
1
;
DROP
TABLE
t1
;
#
# Bug#28317 Left Outer Join with {oj outer-join}
#
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
,
t2
,
t3
;
--
enable_warnings
CREATE
TABLE
t1
(
a1
INT
,
a2
INT
,
a3
INT
,
a4
DATETIME
);
CREATE
TABLE
t2
LIKE
t1
;
CREATE
TABLE
t3
LIKE
t1
;
SELECT
t1
.*
FROM
t1
AS
t0
,
{
OJ
t2
INNER
JOIN
t1
ON
(
t1
.
a1
=
t2
.
a1
)
}
WHERE
t0
.
a3
=
2
;
SELECT
t1
.*
,
t2
.*
FROM
{
OJ
((
t1
INNER
JOIN
t2
ON
(
t1
.
a1
=
t2
.
a2
))
LEFT
OUTER
JOIN
t3
ON
t3
.
a3
=
t2
.
a1
)};
SELECT
t1
.*
,
t2
.*
FROM
{
OJ
((
t1
LEFT
OUTER
JOIN
t2
ON
t1
.
a3
=
t2
.
a2
)
INNER
JOIN
t3
ON
(
t3
.
a1
=
t2
.
a2
))};
SELECT
t1
.*
,
t2
.*
FROM
{
OJ
(
t1
LEFT
OUTER
JOIN
t2
ON
t1
.
a1
=
t2
.
a2
)
CROSS
JOIN
t3
ON
(
t3
.
a2
=
t2
.
a3
)};
SELECT
*
FROM
{
oj
t1
LEFT
OUTER
JOIN
t2
ON
t1
.
a1
=
t2
.
a3
}
WHERE
t1
.
a2
>
10
;
SELECT
{
fn
CONCAT
(
a1
,
a2
)}
FROM
t1
;
UPDATE
t3
SET
a4
=
{
d
'1789-07-14'
}
WHERE
a1
=
0
;
SELECT
a1
,
a4
FROM
t2
WHERE
a4
LIKE
{
fn
UCASE
(
'1789-07-14'
)};
DROP
TABLE
t1
,
t2
,
t3
;
sql/sql_yacc.yy
View file @
ab6ef39c
...
...
@@ -508,10 +508,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%pure_parser /* We have threads */
/*
Currently there are 1
77
shift/reduce conflicts.
Currently there are 1
69
shift/reduce conflicts.
We should not introduce new conflicts any more.
*/
%expect 1
77
%expect 1
69
/*
Comments for TOKENS.
...
...
@@ -1193,7 +1193,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%type <table_list>
join_table_list join_table
table_factor table_ref
table_factor table_ref
esc_table_ref
select_derived derived_table_list
%type <date_time_type> date_time_type;
...
...
@@ -7444,10 +7444,22 @@ join_table_list:
derived_table_list { MYSQL_YYABORT_UNLESS($$=$1); }
;
/*
The ODBC escape syntax for Outer Join is: '{' OJ join_table '}'
The parser does not define OJ as a token, any ident is accepted
instead in $2 (ident). Also, all productions from table_ref can
be escaped, not only join_table. Both syntax extensions are safe
and are ignored.
*/
esc_table_ref:
table_ref { $$=$1; }
| '{' ident table_ref '}' { $$=$3; }
;
/* Warning - may return NULL in case of incomplete SELECT */
derived_table_list:
table_ref { $$=$1; }
| derived_table_list ',' table_ref
esc_
table_ref { $$=$1; }
| derived_table_list ','
esc_
table_ref
{
MYSQL_YYABORT_UNLESS($1 && ($$=$3));
}
...
...
@@ -7612,25 +7624,6 @@ table_factor:
MYSQL_YYABORT;
Select->add_joined_table($$);
}
| '{' ident table_ref LEFT OUTER JOIN_SYM table_ref
ON
{
/* Change the current name resolution context to a local context. */
if (push_new_name_resolution_context(YYTHD, $3, $7))
MYSQL_YYABORT;
}
expr '}'
{
LEX *lex= Lex;
MYSQL_YYABORT_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)))
MYSQL_YYABORT;
}
| select_derived_init get_select_lex select_derived2
{
LEX *lex= Lex;
...
...
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