[MDEV-14393] CREATE OR REPLACE + DEFINER + PROCEDURE Does Not Work Created: 2017-11-14  Updated: 2017-11-23  Resolved: 2017-11-23

Status: Closed
Project: MariaDB Server
Component/s: Stored routines
Affects Version/s: 10.2.8
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Juan Telleria Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: need_feedback
Environment:

Windows



 Description   

When executing the following SQL statement, it does not work, and MariaDB throws an error (When it should work):

CREATE OR REPLACE DEFINER='root'@'localhost' PROCEDURE MyProcedureName() ...

But this works:

CREATE OR REPLACE PROCEDURE MyProcedureName() ...

And this also works:

CREATE DEFINER='root'@'localhost' PROCEDURE MyProcedureName() ...

So the first statement shall also work, and does not.

Thank you,
Juan



 Comments   
Comment by Alice Sherepa [ 2017-11-16 ]

please provide an example and what exact error is shown.

MariaDB [test]> create table t (i int);
Query OK, 0 rows affected (0.11 sec)
 
MariaDB [test]> insert into t values (1),(2),(3);
Query OK, 3 rows affected (0.03 sec)
Records: 3  Duplicates: 0  Warnings: 0
 
MariaDB [test]> DELIMITER //
MariaDB [test]> CREATE OR REPLACE  DEFINER='root'@'localhost' PROCEDURE simpleproc (OUT param1 INT)
    ->  BEGIN
    ->   SELECT COUNT(*) FROM t;
    ->  END;
    -> //
Query OK, 0 rows affected (0.03 sec)
 
MariaDB [test]> DELIMITER ;
 
MariaDB [test]> CALL simpleproc(@a);
+----------+
| COUNT(*) |
+----------+
|        3 |
+----------+
1 row in set (0.00 sec)
 
MariaDB [test]> select version();
+----------------+
| version()      |
+----------------+
| 10.2.8-MariaDB |
+----------------+
1 row in set (0.00 sec)

Comment by Juan Telleria [ 2017-11-22 ]

Mmmm... Seems to work, do not know why did not work previously for me

Comment by Alice Sherepa [ 2017-11-23 ]

So I will close the issue. If you find where the bug was, you are always welcome to write back, so we can reopen it.

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