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
0c9c4b84
Commit
0c9c4b84
authored
Aug 11, 2016
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-10411 Providing compatibility for basic PL/SQL constructs
Part 10: Default variable value: x INT := 10;
parent
8fdc1f01
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
0 deletions
+32
-0
mysql-test/suite/compat/oracle/r/sp.result
mysql-test/suite/compat/oracle/r/sp.result
+15
-0
mysql-test/suite/compat/oracle/t/sp.test
mysql-test/suite/compat/oracle/t/sp.test
+16
-0
sql/sql_yacc_ora.yy
sql/sql_yacc_ora.yy
+1
-0
No files found.
mysql-test/suite/compat/oracle/r/sp.result
View file @
0c9c4b84
SET sql_mode=ORACLE;
# Testing ":=" to set the default value of a variable
CREATE FUNCTION f1 () RETURNS NUMBER(10) AS
a NUMBER(10) := 10;
BEGIN
DECLARE
b NUMBER(10) DEFAULT 3;
BEGIN
RETURN a+b;
END;
END;
/
SELECT f1();
f1()
13
DROP FUNCTION f1;
# Testing labels
CREATE FUNCTION f1 (a INT) RETURNS CLOB AS
BEGIN
...
...
mysql-test/suite/compat/oracle/t/sp.test
View file @
0c9c4b84
SET
sql_mode
=
ORACLE
;
--
echo
# Testing ":=" to set the default value of a variable
DELIMITER
/
;
CREATE
FUNCTION
f1
()
RETURNS
NUMBER
(
10
)
AS
a
NUMBER
(
10
)
:=
10
;
BEGIN
DECLARE
b
NUMBER
(
10
)
DEFAULT
3
;
BEGIN
RETURN
a
+
b
;
END
;
END
;
/
DELIMITER
;
/
SELECT
f1
();
DROP
FUNCTION
f1
;
--
echo
# Testing labels
DELIMITER
/
;
...
...
sql/sql_yacc_ora.yy
View file @
0c9c4b84
...
...
@@ -2851,6 +2851,7 @@ sp_decl_idents:
sp_opt_default:
/* Empty */ { $$ = NULL; }
| DEFAULT expr { $$ = $2; }
| SET_VAR expr { $$ = $2; }
;
/*
...
...
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