[MDEV-16891] EVENTs created with SQL_MODE=ORACLE fail to execute Created: 2018-08-03  Updated: 2020-08-25  Resolved: 2018-08-07

Status: Closed
Project: MariaDB Server
Component/s: Events, Parser
Affects Version/s: 10.3.8
Fix Version/s: 10.3.9

Type: Bug Priority: Major
Reporter: Hartmut Holzgraefe Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: oracle


 Description   

How to reproduce:

Create the same event doing a simple "SELECT 1"
in default and 'ORACLE' sql_modes:

SET GLOBAL event_scheduler=1;
 
SET sql_mode='';
CREATE EVENT e1 ON SCHEDULE EVERY 1 MINUTE  DO SELECT 1;
 
SET sql_mode='ORACLE';
CREATE EVENT e2 ON SCHEDULE EVERY 1 MINUTE  DO SELECT 1;

Creating the events succeeds just fine without problems.

But when it is time to execute the events the one that was created while "ORACLE" mode was in effect fails with a syntax error:

2018-08-03 11:38:11 14 [ERROR] Event Scheduler: error during compilation of test.e2
2018-08-03 11:38:11 14 [ERROR] Event Scheduler: [root@localhost][test.e2] 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 'select 1' at line 1
2018-08-03 11:38:11 14 [Note] Event Scheduler: [root@localhost].[test.e2] event execution failed.



 Comments   
Comment by Elena Stepanova [ 2018-08-03 ]

Same way, if you have ORACLE mode by default (that is, if event scheduler itself starts with sql_mode=ORACLE), then the "normal" ev1 will cause the syntax error. It doesn't seem particularly surprising, but I'll leave it to bar to clarify whether it's expected behavior.

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