[MDEV-15830] Assorted notes on sql_mode=ORACLE documentation Created: 2018-04-09  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Documentation
Affects Version/s: 10.3
Fix Version/s: 10.4

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: None


 Description   

https://mariadb.com/kb/en/library/sql_modeoracle-from-mariadb-103/

If function has no parameters then parentheses must be omitted

In fact, it works just fine either way:

MariaDB [test]> delimiter $$
MariaDB [test]> set sql_mode=ORACLE $$
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> CREATE OR REPLACE FUNCTION f1() RETURN NUMBER IS BEGIN RETURN 1; END $$
Query OK, 0 rows affected (0.02 sec)
 
MariaDB [test]> delimiter ;


RETURN. Can also be used in stored procedures

Need an example, I can't make it work

MariaDB [test]> SET sql_mode=ORACLE $$
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> CREATE OR REPLACE PROCEDURE p1 RETURN NUMBER AS BEGIN NULL; END $$
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 'RETURN NUMBER AS BEGIN NULL; END' at line 1


CREATE PROCEDURE p1 AS rec IN (SELECT a, b FROM t1)

Apparently, it implies

CREATE PROCEDURE p1 AS BEGIN FOR rec IN (SELECT a, b FROM t1) LOOP SELECT 1; END LOOP; END

but it's hard to guess


https://mariadb.com/kb/en/library/sql-mode/

lists sql_modes which are set if one uses ORACLE. It doesn't mention SIMULTANEOUS_ASSIGNMENT, but it is also set



Generated at Thu Feb 08 08:24:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.