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
2fb040e0
Commit
2fb040e0
authored
Nov 05, 2010
by
Luis Soares
Browse files
Options
Browse Files
Download
Plain Diff
BUG 57899: merged bzr bundle #1 from bug report into latest
mysql-5.5-bugteam.
parents
f0ce6787
1602ffb8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
327 additions
and
1 deletion
+327
-1
mysql-test/r/keywords.result
mysql-test/r/keywords.result
+224
-0
mysql-test/t/keywords.test
mysql-test/t/keywords.test
+99
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+4
-0
No files found.
mysql-test/r/keywords.result
View file @
2fb040e0
...
...
@@ -45,3 +45,227 @@ p1
max=1
drop procedure p1;
drop table t1;
CREATE TABLE slow (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
INSERT INTO slow(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
INSERT INTO slow(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
INSERT INTO slow(slow, general) VALUES (1,2), (5,6);
INSERT INTO slow(slow) VALUES (1), (5);
SELECT slow, general, master_heartbeat_period, slow FROM slow ORDER BY slow;
slow general master_heartbeat_period slow
1 2 3 1
1 2 3 1
1 2 NULL 1
1 NULL NULL 1
5 6 7 5
5 6 7 5
5 6 NULL 5
5 NULL NULL 5
SELECT slow, general, master_heartbeat_period FROM slow ORDER BY slow;
slow general master_heartbeat_period
1 2 3
1 2 3
1 2 NULL
1 NULL NULL
5 6 7
5 6 7
5 6 NULL
5 NULL NULL
SELECT slow, master_heartbeat_period FROM slow ORDER BY slow;
slow master_heartbeat_period
1 3
1 3
1 NULL
1 NULL
5 7
5 7
5 NULL
5 NULL
SELECT slow FROM slow ORDER BY slow;
slow
1
1
1
1
5
5
5
5
DROP TABLE slow;
CREATE TABLE general (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
INSERT INTO general(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
INSERT INTO general(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
INSERT INTO general(slow, general) VALUES (1,2), (5,6);
INSERT INTO general(slow) VALUES (1), (5);
SELECT slow, general, master_heartbeat_period, slow FROM general ORDER BY slow;
slow general master_heartbeat_period slow
1 2 3 1
1 2 3 1
1 2 NULL 1
1 NULL NULL 1
5 6 7 5
5 6 7 5
5 6 NULL 5
5 NULL NULL 5
SELECT slow, general, master_heartbeat_period FROM general ORDER BY slow;
slow general master_heartbeat_period
1 2 3
1 2 3
1 2 NULL
1 NULL NULL
5 6 7
5 6 7
5 6 NULL
5 NULL NULL
SELECT slow, master_heartbeat_period FROM general ORDER BY slow;
slow master_heartbeat_period
1 3
1 3
1 NULL
1 NULL
5 7
5 7
5 NULL
5 NULL
SELECT slow FROM general ORDER BY slow;
slow
1
1
1
1
5
5
5
5
DROP TABLE general;
CREATE TABLE master_heartbeat_period (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
INSERT INTO master_heartbeat_period(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
INSERT INTO master_heartbeat_period(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
INSERT INTO master_heartbeat_period(slow, general) VALUES (1,2), (5,6);
INSERT INTO master_heartbeat_period(slow) VALUES (1), (5);
SELECT slow, general, master_heartbeat_period, slow FROM master_heartbeat_period ORDER BY slow;
slow general master_heartbeat_period slow
1 2 3 1
1 2 3 1
1 2 NULL 1
1 NULL NULL 1
5 6 7 5
5 6 7 5
5 6 NULL 5
5 NULL NULL 5
SELECT slow, general, master_heartbeat_period FROM master_heartbeat_period ORDER BY slow;
slow general master_heartbeat_period
1 2 3
1 2 3
1 2 NULL
1 NULL NULL
5 6 7
5 6 7
5 6 NULL
5 NULL NULL
SELECT slow, master_heartbeat_period FROM master_heartbeat_period ORDER BY slow;
slow master_heartbeat_period
1 3
1 3
1 NULL
1 NULL
5 7
5 7
5 NULL
5 NULL
SELECT slow FROM master_heartbeat_period ORDER BY slow;
slow
1
1
1
1
5
5
5
5
DROP TABLE master_heartbeat_period;
CREATE TABLE ignore_server_ids (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
INSERT INTO ignore_server_ids(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
INSERT INTO ignore_server_ids(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
INSERT INTO ignore_server_ids(slow, general) VALUES (1,2), (5,6);
INSERT INTO ignore_server_ids(slow) VALUES (1), (5);
SELECT slow, general, master_heartbeat_period, slow FROM ignore_server_ids ORDER BY slow;
slow general master_heartbeat_period slow
1 2 3 1
1 2 3 1
1 2 NULL 1
1 NULL NULL 1
5 6 7 5
5 6 7 5
5 6 NULL 5
5 NULL NULL 5
SELECT slow, general, master_heartbeat_period FROM ignore_server_ids ORDER BY slow;
slow general master_heartbeat_period
1 2 3
1 2 3
1 2 NULL
1 NULL NULL
5 6 7
5 6 7
5 6 NULL
5 NULL NULL
SELECT slow, master_heartbeat_period FROM ignore_server_ids ORDER BY slow;
slow master_heartbeat_period
1 3
1 3
1 NULL
1 NULL
5 7
5 7
5 NULL
5 NULL
SELECT slow FROM ignore_server_ids ORDER BY slow;
slow
1
1
1
1
5
5
5
5
DROP TABLE ignore_server_ids;
CREATE TABLE t1 (slow INT, general INT, ignore_server_ids INT, master_heartbeat_period INT);
INSERT INTO t1 VALUES (1,2,3,4);
CREATE PROCEDURE p1()
BEGIN
DECLARE slow INT;
DECLARE general INT;
DECLARE ignore_server_ids INT;
DECLARE master_heartbeat_period INT;
SELECT max(t1.slow) INTO slow FROM t1;
SELECT max(t1.general) INTO general FROM t1;
SELECT max(t1.ignore_server_ids) INTO ignore_server_ids FROM t1;
SELECT max(t1.master_heartbeat_period) INTO master_heartbeat_period FROM t1;
SELECT slow, general, ignore_server_ids, master_heartbeat_period;
END|
CREATE PROCEDURE p2()
BEGIN
DECLARE n INT DEFAULT 2;
general: WHILE n > 0 DO
SET n = n -1;
END WHILE general;
SET n = 2;
slow: WHILE n > 0 DO
SET n = n -1;
END WHILE slow;
SET n = 2;
ignore_server_ids: WHILE n > 0 DO
SET n = n -1;
END WHILE ignore_server_ids;
SET n = 2;
master_heartbeat_period: WHILE n > 0 DO
SET n = n -1;
END WHILE master_heartbeat_period;
END|
CALL p1();
slow general ignore_server_ids master_heartbeat_period
1 2 3 4
call p2();
DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP TABLE t1;
mysql-test/t/keywords.test
View file @
2fb040e0
...
...
@@ -62,5 +62,103 @@ call p1();
drop
procedure
p1
;
drop
table
t1
;
# End of 5.0 tests
#
# BUG#57899: Certain reserved words should not be reserved
#
#
# We are looking for SYNTAX ERRORS here, so no need to
# log the queries
#
CREATE
TABLE
slow
(
slow
INT
,
general
INT
,
master_heartbeat_period
INT
,
ignore_server_ids
INT
);
INSERT
INTO
slow
(
slow
,
general
,
master_heartbeat_period
,
ignore_server_ids
)
VALUES
(
1
,
2
,
3
,
4
),
(
5
,
6
,
7
,
8
);
INSERT
INTO
slow
(
slow
,
general
,
master_heartbeat_period
)
VALUES
(
1
,
2
,
3
),
(
5
,
6
,
7
);
INSERT
INTO
slow
(
slow
,
general
)
VALUES
(
1
,
2
),
(
5
,
6
);
INSERT
INTO
slow
(
slow
)
VALUES
(
1
),
(
5
);
SELECT
slow
,
general
,
master_heartbeat_period
,
slow
FROM
slow
ORDER
BY
slow
;
SELECT
slow
,
general
,
master_heartbeat_period
FROM
slow
ORDER
BY
slow
;
SELECT
slow
,
master_heartbeat_period
FROM
slow
ORDER
BY
slow
;
SELECT
slow
FROM
slow
ORDER
BY
slow
;
DROP
TABLE
slow
;
CREATE
TABLE
general
(
slow
INT
,
general
INT
,
master_heartbeat_period
INT
,
ignore_server_ids
INT
);
INSERT
INTO
general
(
slow
,
general
,
master_heartbeat_period
,
ignore_server_ids
)
VALUES
(
1
,
2
,
3
,
4
),
(
5
,
6
,
7
,
8
);
INSERT
INTO
general
(
slow
,
general
,
master_heartbeat_period
)
VALUES
(
1
,
2
,
3
),
(
5
,
6
,
7
);
INSERT
INTO
general
(
slow
,
general
)
VALUES
(
1
,
2
),
(
5
,
6
);
INSERT
INTO
general
(
slow
)
VALUES
(
1
),
(
5
);
SELECT
slow
,
general
,
master_heartbeat_period
,
slow
FROM
general
ORDER
BY
slow
;
SELECT
slow
,
general
,
master_heartbeat_period
FROM
general
ORDER
BY
slow
;
SELECT
slow
,
master_heartbeat_period
FROM
general
ORDER
BY
slow
;
SELECT
slow
FROM
general
ORDER
BY
slow
;
DROP
TABLE
general
;
CREATE
TABLE
master_heartbeat_period
(
slow
INT
,
general
INT
,
master_heartbeat_period
INT
,
ignore_server_ids
INT
);
INSERT
INTO
master_heartbeat_period
(
slow
,
general
,
master_heartbeat_period
,
ignore_server_ids
)
VALUES
(
1
,
2
,
3
,
4
),
(
5
,
6
,
7
,
8
);
INSERT
INTO
master_heartbeat_period
(
slow
,
general
,
master_heartbeat_period
)
VALUES
(
1
,
2
,
3
),
(
5
,
6
,
7
);
INSERT
INTO
master_heartbeat_period
(
slow
,
general
)
VALUES
(
1
,
2
),
(
5
,
6
);
INSERT
INTO
master_heartbeat_period
(
slow
)
VALUES
(
1
),
(
5
);
SELECT
slow
,
general
,
master_heartbeat_period
,
slow
FROM
master_heartbeat_period
ORDER
BY
slow
;
SELECT
slow
,
general
,
master_heartbeat_period
FROM
master_heartbeat_period
ORDER
BY
slow
;
SELECT
slow
,
master_heartbeat_period
FROM
master_heartbeat_period
ORDER
BY
slow
;
SELECT
slow
FROM
master_heartbeat_period
ORDER
BY
slow
;
DROP
TABLE
master_heartbeat_period
;
CREATE
TABLE
ignore_server_ids
(
slow
INT
,
general
INT
,
master_heartbeat_period
INT
,
ignore_server_ids
INT
);
INSERT
INTO
ignore_server_ids
(
slow
,
general
,
master_heartbeat_period
,
ignore_server_ids
)
VALUES
(
1
,
2
,
3
,
4
),
(
5
,
6
,
7
,
8
);
INSERT
INTO
ignore_server_ids
(
slow
,
general
,
master_heartbeat_period
)
VALUES
(
1
,
2
,
3
),
(
5
,
6
,
7
);
INSERT
INTO
ignore_server_ids
(
slow
,
general
)
VALUES
(
1
,
2
),
(
5
,
6
);
INSERT
INTO
ignore_server_ids
(
slow
)
VALUES
(
1
),
(
5
);
SELECT
slow
,
general
,
master_heartbeat_period
,
slow
FROM
ignore_server_ids
ORDER
BY
slow
;
SELECT
slow
,
general
,
master_heartbeat_period
FROM
ignore_server_ids
ORDER
BY
slow
;
SELECT
slow
,
master_heartbeat_period
FROM
ignore_server_ids
ORDER
BY
slow
;
SELECT
slow
FROM
ignore_server_ids
ORDER
BY
slow
;
DROP
TABLE
ignore_server_ids
;
CREATE
TABLE
t1
(
slow
INT
,
general
INT
,
ignore_server_ids
INT
,
master_heartbeat_period
INT
);
INSERT
INTO
t1
VALUES
(
1
,
2
,
3
,
4
);
DELIMITER
|
;
CREATE
PROCEDURE
p1
()
BEGIN
DECLARE
slow
INT
;
DECLARE
general
INT
;
DECLARE
ignore_server_ids
INT
;
DECLARE
master_heartbeat_period
INT
;
SELECT
max
(
t1
.
slow
)
INTO
slow
FROM
t1
;
SELECT
max
(
t1
.
general
)
INTO
general
FROM
t1
;
SELECT
max
(
t1
.
ignore_server_ids
)
INTO
ignore_server_ids
FROM
t1
;
SELECT
max
(
t1
.
master_heartbeat_period
)
INTO
master_heartbeat_period
FROM
t1
;
SELECT
slow
,
general
,
ignore_server_ids
,
master_heartbeat_period
;
END
|
CREATE
PROCEDURE
p2
()
BEGIN
DECLARE
n
INT
DEFAULT
2
;
general
:
WHILE
n
>
0
DO
SET
n
=
n
-
1
;
END
WHILE
general
;
SET
n
=
2
;
slow
:
WHILE
n
>
0
DO
SET
n
=
n
-
1
;
END
WHILE
slow
;
SET
n
=
2
;
ignore_server_ids
:
WHILE
n
>
0
DO
SET
n
=
n
-
1
;
END
WHILE
ignore_server_ids
;
SET
n
=
2
;
master_heartbeat_period
:
WHILE
n
>
0
DO
SET
n
=
n
-
1
;
END
WHILE
master_heartbeat_period
;
END
|
DELIMITER
;
|
CALL
p1
();
call
p2
();
DROP
PROCEDURE
p1
;
DROP
PROCEDURE
p2
;
DROP
TABLE
t1
;
sql/sql_yacc.yy
View file @
2fb040e0
...
...
@@ -12497,6 +12497,7 @@ keyword_sp:
| FILE_SYM {}
| FIRST_SYM {}
| FIXED_SYM {}
| GENERAL {}
| GEOMETRY_SYM {}
| GEOMETRYCOLLECTION {}
| GET_FORMAT {}
...
...
@@ -12506,6 +12507,7 @@ keyword_sp:
| HOSTS_SYM {}
| HOUR_SYM {}
| IDENTIFIED_SYM {}
| IGNORE_SERVER_IDS_SYM {}
| INVOKER_SYM {}
| IMPORT {}
| INDEXES {}
...
...
@@ -12528,6 +12530,7 @@ keyword_sp:
| LOGS_SYM {}
| MAX_ROWS {}
| MASTER_SYM {}
| MASTER_HEARTBEAT_PERIOD_SYM {}
| MASTER_HOST_SYM {}
| MASTER_PORT_SYM {}
| MASTER_LOG_FILE_SYM {}
...
...
@@ -12633,6 +12636,7 @@ keyword_sp:
| SIMPLE_SYM {}
| SHARE_SYM {}
| SHUTDOWN {}
| SLOW {}
| SNAPSHOT_SYM {}
| SOUNDS_SYM {}
| SOURCE_SYM {}
...
...
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