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
af1231fa
Commit
af1231fa
authored
Dec 18, 2007
by
gkodinov/kgeorge@magare.gmz
Browse files
Options
Browse Files
Download
Plain Diff
Merge magare.gmz:/home/kgeorge/mysql/autopush/B19390-5.0-opt
into magare.gmz:/home/kgeorge/mysql/work/B19390-5.1-opt
parents
c25619f2
1a8b8eb9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
121 additions
and
9 deletions
+121
-9
mysql-test/r/union.result
mysql-test/r/union.result
+51
-0
mysql-test/suite/rpl/r/rpl_trigger.result
mysql-test/suite/rpl/r/rpl_trigger.result
+8
-4
mysql-test/suite/rpl/t/rpl_trigger.test
mysql-test/suite/rpl/t/rpl_trigger.test
+8
-4
mysql-test/t/union.test
mysql-test/t/union.test
+44
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+10
-1
No files found.
mysql-test/r/union.result
View file @
af1231fa
...
@@ -1445,4 +1445,55 @@ select @var;
...
@@ -1445,4 +1445,55 @@ select @var;
1
1
(select 2) union (select 1 into @var);
(select 2) union (select 1 into @var);
ERROR 42000: Result consisted of more than one row
ERROR 42000: Result consisted of more than one row
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (10), (20);
CREATE TABLE t2 (b int);
INSERT INTO t2 VALUES (10), (50), (50);
SELECT a,1 FROM t1
UNION
SELECT b, COUNT(*) FROM t2 GROUP BY b WITH ROLLUP
ORDER BY a;
a 1
NULL 3
10 1
20 1
50 2
SELECT a,1 FROM t1
UNION
SELECT b, COUNT(*) FROM t2 GROUP BY b WITH ROLLUP
ORDER BY a DESC;
a 1
50 2
20 1
10 1
NULL 3
SELECT a,1 FROM t1
UNION
SELECT b, COUNT(*) FROM t2 GROUP BY b WITH ROLLUP
ORDER BY a ASC LIMIT 3;
a 1
NULL 3
10 1
20 1
SELECT a,1 FROM t1
UNION ALL
SELECT b, COUNT(*) FROM t2 GROUP BY b WITH ROLLUP
ORDER BY a DESC;
a 1
50 2
20 1
10 1
10 1
NULL 3
SELECT a,1 FROM t1
UNION
(SELECT b, COUNT(*) FROM t2 GROUP BY b WITH ROLLUP ORDER BY a);
ERROR HY000: Incorrect usage of CUBE/ROLLUP and ORDER BY
SELECT a,1 FROM t1
UNION ALL
SELECT b, COUNT(*) FROM t2 GROUP BY b WITH ROLLUP ORDER BY a
UNION
SELECT 1,1;
ERROR HY000: Incorrect usage of UNION and ORDER BY
DROP TABLE t1,t2;
End of 5.0 tests
End of 5.0 tests
mysql-test/suite/rpl/r/rpl_trigger.result
View file @
af1231fa
...
@@ -91,21 +91,25 @@ select a=b && a=c from t1;
...
@@ -91,21 +91,25 @@ select a=b && a=c from t1;
a=b && a=c
a=b && a=c
1
1
SELECT routine_name, definer
SELECT routine_name, definer
FROM information_schema.routines;
FROM information_schema.routines
WHERE routine_name = 'bug12480';
routine_name definer
routine_name definer
bug12480 root@localhost
bug12480 root@localhost
SELECT trigger_name, definer
SELECT trigger_name, definer
FROM information_schema.triggers;
FROM information_schema.triggers
WHERE trigger_name = 't1_first';
trigger_name definer
trigger_name definer
t1_first root@localhost
t1_first root@localhost
--- On slave --
--- On slave --
SELECT routine_name, definer
SELECT routine_name, definer
FROM information_schema.routines;
FROM information_schema.routines
WHERE routine_name = 'bug12480';
routine_name definer
routine_name definer
bug12480 root@localhost
bug12480 root@localhost
SELECT trigger_name, definer
SELECT trigger_name, definer
FROM information_schema.triggers;
FROM information_schema.triggers
WHERE trigger_name = 't1_first';
trigger_name definer
trigger_name definer
t1_first root@localhost
t1_first root@localhost
select a=b && a=c from t1;
select a=b && a=c from t1;
...
...
mysql-test/suite/rpl/t/rpl_trigger.test
View file @
af1231fa
...
@@ -101,10 +101,12 @@ let $time=`select a from t1`;
...
@@ -101,10 +101,12 @@ let $time=`select a from t1`;
# - dump definers on the slave;
# - dump definers on the slave;
SELECT
routine_name
,
definer
SELECT
routine_name
,
definer
FROM
information_schema
.
routines
;
FROM
information_schema
.
routines
WHERE
routine_name
=
'bug12480'
;
SELECT
trigger_name
,
definer
SELECT
trigger_name
,
definer
FROM
information_schema
.
triggers
;
FROM
information_schema
.
triggers
WHERE
trigger_name
=
't1_first'
;
save_master_pos
;
save_master_pos
;
connection
slave
;
connection
slave
;
...
@@ -119,10 +121,12 @@ select "--- On slave --" as "";
...
@@ -119,10 +121,12 @@ select "--- On slave --" as "";
# item.
# item.
SELECT
routine_name
,
definer
SELECT
routine_name
,
definer
FROM
information_schema
.
routines
;
FROM
information_schema
.
routines
WHERE
routine_name
=
'bug12480'
;
SELECT
trigger_name
,
definer
SELECT
trigger_name
,
definer
FROM
information_schema
.
triggers
;
FROM
information_schema
.
triggers
WHERE
trigger_name
=
't1_first'
;
select
a
=
b
&&
a
=
c
from
t1
;
select
a
=
b
&&
a
=
c
from
t1
;
--
disable_query_log
--
disable_query_log
...
...
mysql-test/t/union.test
View file @
af1231fa
...
@@ -922,4 +922,48 @@ DROP TABLE t1;
...
@@ -922,4 +922,48 @@ DROP TABLE t1;
select
@
var
;
select
@
var
;
--
error
1172
--
error
1172
(
select
2
)
union
(
select
1
into
@
var
);
(
select
2
)
union
(
select
1
into
@
var
);
#
# Bug#27848: order-by of union clashes with rollup of select part
#
CREATE
TABLE
t1
(
a
int
);
INSERT
INTO
t1
VALUES
(
10
),
(
20
);
CREATE
TABLE
t2
(
b
int
);
INSERT
INTO
t2
VALUES
(
10
),
(
50
),
(
50
);
SELECT
a
,
1
FROM
t1
UNION
SELECT
b
,
COUNT
(
*
)
FROM
t2
GROUP
BY
b
WITH
ROLLUP
ORDER
BY
a
;
SELECT
a
,
1
FROM
t1
UNION
SELECT
b
,
COUNT
(
*
)
FROM
t2
GROUP
BY
b
WITH
ROLLUP
ORDER
BY
a
DESC
;
SELECT
a
,
1
FROM
t1
UNION
SELECT
b
,
COUNT
(
*
)
FROM
t2
GROUP
BY
b
WITH
ROLLUP
ORDER
BY
a
ASC
LIMIT
3
;
SELECT
a
,
1
FROM
t1
UNION
ALL
SELECT
b
,
COUNT
(
*
)
FROM
t2
GROUP
BY
b
WITH
ROLLUP
ORDER
BY
a
DESC
;
--
error
ER_WRONG_USAGE
SELECT
a
,
1
FROM
t1
UNION
(
SELECT
b
,
COUNT
(
*
)
FROM
t2
GROUP
BY
b
WITH
ROLLUP
ORDER
BY
a
);
--
error
ER_WRONG_USAGE
SELECT
a
,
1
FROM
t1
UNION
ALL
SELECT
b
,
COUNT
(
*
)
FROM
t2
GROUP
BY
b
WITH
ROLLUP
ORDER
BY
a
UNION
SELECT
1
,
1
;
DROP
TABLE
t1
,
t2
;
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
sql/sql_yacc.yy
View file @
af1231fa
...
@@ -6151,6 +6151,14 @@ select_paren:
...
@@ -6151,6 +6151,14 @@ select_paren:
my_parse_error(ER(ER_SYNTAX_ERROR));
my_parse_error(ER(ER_SYNTAX_ERROR));
MYSQL_YYABORT;
MYSQL_YYABORT;
}
}
if (sel->linkage == UNION_TYPE &&
sel->olap != UNSPECIFIED_OLAP_TYPE &&
sel->master_unit()->fake_select_lex)
{
my_error(ER_WRONG_USAGE, MYF(0),
"CUBE/ROLLUP", "ORDER BY");
MYSQL_YYABORT;
}
/* select in braces, can't contain global parameters */
/* select in braces, can't contain global parameters */
if (sel->master_unit()->fake_select_lex)
if (sel->master_unit()->fake_select_lex)
sel->master_unit()->global_parameters=
sel->master_unit()->global_parameters=
...
@@ -8039,7 +8047,8 @@ order_clause:
...
@@ -8039,7 +8047,8 @@ order_clause:
SELECT_LEX *sel= lex->current_select;
SELECT_LEX *sel= lex->current_select;
SELECT_LEX_UNIT *unit= sel-> master_unit();
SELECT_LEX_UNIT *unit= sel-> master_unit();
if (sel->linkage != GLOBAL_OPTIONS_TYPE &&
if (sel->linkage != GLOBAL_OPTIONS_TYPE &&
sel->olap != UNSPECIFIED_OLAP_TYPE)
sel->olap != UNSPECIFIED_OLAP_TYPE &&
(sel->linkage != UNION_TYPE || sel->braces))
{
{
my_error(ER_WRONG_USAGE, MYF(0),
my_error(ER_WRONG_USAGE, MYF(0),
"CUBE/ROLLUP", "ORDER BY");
"CUBE/ROLLUP", "ORDER BY");
...
...
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