Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3(EOL)
Description
In Oracle, all these keywords can be used for SP variables (in declarations and as INTO targets):
- DO
- HANDLER
- REPAIR
- SHUTDOWN
- TRUNCATE
- CLOSE
- COMMIT
- OPEN
- ROLLBACK
- SAVEPOINT
- CONTAINS
- LANGUAGE
- NO
- CHARSET
- FOLLOWS
- PRECEDES
In MariaDB this script:
SET sql_mode=ORACLE; |
DELIMITER /
|
|
DECLARE
|
do INT; |
BEGIN
|
SELECT do INTO do FROM DUAL; |
END; |
/
|
|
DECLARE
|
handler INT; |
BEGIN
|
SELECT handler INTO handler FROM DUAL; |
END; |
/
|
|
DECLARE
|
repair INT; |
BEGIN
|
SELECT repair INTO repair FROM DUAL; |
END; |
/
|
|
DECLARE
|
shutdown INT; |
BEGIN
|
SELECT shutdown INTO shutdown FROM DUAL; |
END; |
/
|
|
DECLARE
|
truncate INT; |
BEGIN
|
SELECT truncate INTO truncate FROM DUAL; |
END; |
/
|
|
DECLARE
|
close INT; |
BEGIN
|
SELECT close INTO close FROM DUAL; |
END; |
/
|
|
DECLARE
|
commit INT; |
BEGIN
|
SELECT commit INTO commit FROM DUAL; |
END; |
/
|
|
DECLARE
|
open INT; |
BEGIN
|
SELECT open INTO open FROM DUAL; |
END; |
/
|
|
DECLARE
|
rollback INT; |
BEGIN
|
SELECT rollback INTO rollback FROM DUAL; |
END; |
/
|
|
DECLARE
|
savepoint INT; |
BEGIN
|
SELECT savepoint INTO savepoint FROM DUAL; |
END; |
/
|
|
DECLARE
|
contains INT; |
BEGIN
|
SELECT contains INTO contains FROM DUAL; |
END; |
/
|
|
DECLARE
|
language INT; |
BEGIN
|
SELECT language INTO language FROM DUAL; |
END; |
/
|
|
DECLARE
|
no INT; |
BEGIN
|
SELECT no INTO no FROM DUAL; |
END; |
/
|
|
DECLARE
|
charset INT; |
BEGIN
|
SELECT charset INTO charset FROM DUAL; |
END; |
/
|
DECLARE
|
follows INT; |
BEGIN
|
SELECT follows INTO follows FROM DUAL; |
END; |
/
|
|
DECLARE
|
precedes INT; |
BEGIN
|
SELECT precedes INTO precedes FROM DUAL; |
END; |
/
|
returns an error:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'do INT;
|
BEGIN
|
SELECT do INTO do FROM DUAL;
|
END' at line 2
|
In Oracle the same script (without SET sql_mode and DELIMITER commands) works without errors.
Attachments
Issue Links
- causes
-
MDEV-20101 Assertion failure on select @@global.'m2'.replicate_ignore_table;
- Closed
- relates to
-
MDEV-10485 "Unreserve" MariaDB reserved keywords that are not reserved in the other databases
- Open
-
MDEV-16258 sql_mode=ORACLE: Keywords from keyword_verb_clause do not work in assignments
- Open
-
MDEV-16259 sql_mode=ORACLE: Keywords from keyword_sp_head do not work in assignments
- Open