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
281f8a42
Commit
281f8a42
authored
Mar 29, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-12089 sql_mode=ORACLE: Understand optional routine name after the END keyword
parent
891c1e2d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
237 additions
and
5 deletions
+237
-5
mysql-test/suite/compat/oracle/r/sp.result
mysql-test/suite/compat/oracle/r/sp.result
+75
-0
mysql-test/suite/compat/oracle/t/sp.test
mysql-test/suite/compat/oracle/t/sp.test
+113
-0
sql/share/errmsg-utf8.txt
sql/share/errmsg-utf8.txt
+2
-0
sql/sql_class.h
sql/sql_class.h
+15
-0
sql/sql_yacc_ora.yy
sql/sql_yacc_ora.yy
+32
-5
No files found.
mysql-test/suite/compat/oracle/r/sp.result
View file @
281f8a42
...
...
@@ -2152,6 +2152,81 @@ END' at line 1
# End of MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations
#
#
# MDEV-12089 sql_mode=ORACLE: Understand optional routine name after the END keyword
#
CREATE FUNCTION f1 RETURN INT AS
BEGIN
RETURN 10;
END f1;
$$
DROP FUNCTION f1;
CREATE FUNCTION test.f1 RETURN INT AS
BEGIN
RETURN 10;
END test.f1;
$$
DROP FUNCTION f1;
CREATE FUNCTION test.f1 RETURN INT AS
BEGIN
RETURN 10;
END test2.f1;
$$
ERROR HY000: END identifier 'test2.f1' does not match 'test.f1'
CREATE FUNCTION test.f1 RETURN INT AS
BEGIN
RETURN 10;
END test.f2;
$$
ERROR HY000: END identifier 'test.f2' does not match 'test.f1'
CREATE FUNCTION f1 RETURN INT AS
BEGIN
RETURN 10;
END test.f2;
$$
ERROR HY000: END identifier 'test.f2' does not match 'test.f1'
CREATE FUNCTION f1 RETURN INT AS
BEGIN
RETURN 10;
END test2.f1;
$$
ERROR HY000: END identifier 'test2.f1' does not match 'test.f1'
CREATE PROCEDURE p1 AS
BEGIN
NULL;
END p1;
$$
DROP PROCEDURE p1;
CREATE PROCEDURE test.p1 AS
BEGIN
NULL;
END test.p1;
$$
DROP PROCEDURE p1;
CREATE PROCEDURE test.p1 AS
BEGIN
NULL;
END test2.p1;
$$
ERROR HY000: END identifier 'test2.p1' does not match 'test.p1'
CREATE PROCEDURE test.p1 AS
BEGIN
NULL;
END test.p2;
$$
ERROR HY000: END identifier 'test.p2' does not match 'test.p1'
CREATE PROCEDURE p1 AS
BEGIN
NULL;
END test.p2;
$$
ERROR HY000: END identifier 'test.p2' does not match 'test.p1'
CREATE PROCEDURE p1 AS
BEGIN
NULL;
END test2.p1;
$$
ERROR HY000: END identifier 'test2.p1' does not match 'test.p1'
#
# MDEV-12107 sql_mode=ORACLE: Inside routines the CALL keywoard is optional
#
CREATE OR REPLACE PROCEDURE p1(a INT) AS
...
...
mysql-test/suite/compat/oracle/t/sp.test
View file @
281f8a42
...
...
@@ -1973,6 +1973,119 @@ DELIMITER ;$$
--
echo
#
--
echo
#
--
echo
# MDEV-12089 sql_mode=ORACLE: Understand optional routine name after the END keyword
--
echo
#
DELIMITER
$$
;
CREATE
FUNCTION
f1
RETURN
INT
AS
BEGIN
RETURN
10
;
END
f1
;
$$
DELIMITER
;
$$
DROP
FUNCTION
f1
;
DELIMITER
$$
;
CREATE
FUNCTION
test
.
f1
RETURN
INT
AS
BEGIN
RETURN
10
;
END
test
.
f1
;
$$
DELIMITER
;
$$
DROP
FUNCTION
f1
;
DELIMITER
$$
;
--
error
ER_END_IDENTIFIER_DOES_NOT_MATCH
CREATE
FUNCTION
test
.
f1
RETURN
INT
AS
BEGIN
RETURN
10
;
END
test2
.
f1
;
$$
DELIMITER
;
$$
DELIMITER
$$
;
--
error
ER_END_IDENTIFIER_DOES_NOT_MATCH
CREATE
FUNCTION
test
.
f1
RETURN
INT
AS
BEGIN
RETURN
10
;
END
test
.
f2
;
$$
DELIMITER
;
$$
DELIMITER
$$
;
--
error
ER_END_IDENTIFIER_DOES_NOT_MATCH
CREATE
FUNCTION
f1
RETURN
INT
AS
BEGIN
RETURN
10
;
END
test
.
f2
;
$$
DELIMITER
;
$$
DELIMITER
$$
;
--
error
ER_END_IDENTIFIER_DOES_NOT_MATCH
CREATE
FUNCTION
f1
RETURN
INT
AS
BEGIN
RETURN
10
;
END
test2
.
f1
;
$$
DELIMITER
;
$$
DELIMITER
$$
;
CREATE
PROCEDURE
p1
AS
BEGIN
NULL
;
END
p1
;
$$
DELIMITER
;
$$
DROP
PROCEDURE
p1
;
DELIMITER
$$
;
CREATE
PROCEDURE
test
.
p1
AS
BEGIN
NULL
;
END
test
.
p1
;
$$
DELIMITER
;
$$
DROP
PROCEDURE
p1
;
DELIMITER
$$
;
--
error
ER_END_IDENTIFIER_DOES_NOT_MATCH
CREATE
PROCEDURE
test
.
p1
AS
BEGIN
NULL
;
END
test2
.
p1
;
$$
DELIMITER
;
$$
DELIMITER
$$
;
--
error
ER_END_IDENTIFIER_DOES_NOT_MATCH
CREATE
PROCEDURE
test
.
p1
AS
BEGIN
NULL
;
END
test
.
p2
;
$$
DELIMITER
;
$$
DELIMITER
$$
;
--
error
ER_END_IDENTIFIER_DOES_NOT_MATCH
CREATE
PROCEDURE
p1
AS
BEGIN
NULL
;
END
test
.
p2
;
$$
DELIMITER
;
$$
DELIMITER
$$
;
--
error
ER_END_IDENTIFIER_DOES_NOT_MATCH
CREATE
PROCEDURE
p1
AS
BEGIN
NULL
;
END
test2
.
p1
;
$$
DELIMITER
;
$$
--
echo
#
--
echo
# MDEV-12107 sql_mode=ORACLE: Inside routines the CALL keywoard is optional
--
echo
#
...
...
sql/share/errmsg-utf8.txt
View file @
281f8a42
...
...
@@ -7464,3 +7464,5 @@ ER_UNKNOWN_STRUCTURED_VARIABLE
eng "Unknown structured system variable or ROW routine variable '%-.*s'"
ER_ROW_VARIABLE_DOES_NOT_HAVE_FIELD
eng "Row variable '%-.192s' does not have a field '%-.192s'"
ER_END_IDENTIFIER_DOES_NOT_MATCH
eng "END identifier '%-.192s' does not match '%-.192s'"
sql/sql_class.h
View file @
281f8a42
...
...
@@ -5916,6 +5916,21 @@ class Database_qualified_name
m_name
.
length
=
name_length
;
}
bool
eq
(
const
Database_qualified_name
*
other
)
const
{
CHARSET_INFO
*
cs
=
lower_case_table_names
?
&
my_charset_utf8_general_ci
:
&
my_charset_utf8_bin
;
return
m_db
.
length
==
other
->
m_db
.
length
&&
m_name
.
length
==
other
->
m_name
.
length
&&
!
my_strnncoll
(
cs
,
(
const
uchar
*
)
m_db
.
str
,
m_db
.
length
,
(
const
uchar
*
)
other
->
m_db
.
str
,
other
->
m_db
.
length
)
&&
!
my_strnncoll
(
cs
,
(
const
uchar
*
)
m_name
.
str
,
m_name
.
length
,
(
const
uchar
*
)
other
->
m_name
.
str
,
other
->
m_name
.
length
);
}
// Export db and name as a qualified name string: 'db.name'
size_t
make_qname
(
char
*
dst
,
size_t
dstlen
)
const
{
...
...
sql/sql_yacc_ora.yy
View file @
281f8a42
...
...
@@ -1315,6 +1315,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
opt_serial_attribute opt_serial_attribute_list serial_attribute
explainable_command
set_assign
sf_tail_standalone
sp_tail_standalone
END_OF_INPUT
%type <NONE> call sp_proc_stmts sp_proc_stmts1 sp_proc_stmt
...
...
@@ -1342,7 +1344,7 @@ END_OF_INPUT
%type <sp_instr_addr> sp_instr_addr
%type <sp_cursor_name_and_offset> sp_cursor_name_and_offset
%type <num> opt_exception_clause exception_handlers
%type <spname> sp_name
%type <spname> sp_name
opt_sp_name
%type <spvar> sp_param_name sp_param_name_and_type
%type <for_loop> sp_for_loop_index_and_bounds
%type <for_loop_bounds> sp_for_loop_bounds
...
...
@@ -2219,6 +2221,11 @@ sp_name:
}
;
opt_sp_name:
/* Empty */ { $$= NULL; }
| sp_name { $$= $1; }
;
sp_a_chistics:
/* Empty */ {}
| sp_a_chistics sp_chistic {}
...
...
@@ -16352,16 +16359,16 @@ view_or_trigger_or_sp_or_event:
definer_tail:
view_tail
| trigger_tail
| sp_tail
| sf_tail
| sp_tail
_standalone
| sf_tail
_standalone
| event_tail
;
no_definer_tail:
view_tail
| trigger_tail
| sp_tail
| sf_tail
| sp_tail
_standalone
| sf_tail
_standalone
| udf_tail
| event_tail
;
...
...
@@ -16713,6 +16720,26 @@ sp_tail:
}
;
sf_tail_standalone:
sf_tail opt_sp_name
{
if ($2 && !$2->eq(Lex->sphead))
my_yyabort_error((ER_END_IDENTIFIER_DOES_NOT_MATCH, MYF(0),
ErrConvDQName($2).ptr(),
ErrConvDQName(Lex->sphead).ptr()));
}
;
sp_tail_standalone:
sp_tail opt_sp_name
{
if ($2 && !$2->eq(Lex->sphead))
my_yyabort_error((ER_END_IDENTIFIER_DOES_NOT_MATCH, MYF(0),
ErrConvDQName($2).ptr(),
ErrConvDQName(Lex->sphead).ptr()));
}
;
sp_tail_is:
IS
| AS
...
...
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