Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
MDEV-16891 EVENTs created with SQL_MODE=ORACLE fail to execute
- Loading branch information
Showing
3 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| set sql_mode='ORACLE'; | ||
| # | ||
| # MDEV-16891 EVENTs created with SQL_MODE=ORACLE fail to execute | ||
| # | ||
| SET GLOBAL event_scheduler=off; | ||
| SET sql_mode='ORACLE'; | ||
| CREATE TABLE t1 (a TIMESTAMP); | ||
| CREATE EVENT e1 | ||
| ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 MICROSECOND | ||
| DO INSERT INTO t1 VALUES(NOW()); | ||
| SET GLOBAL event_scheduler=on; | ||
| SELECT COUNT(*) FROM t1; | ||
| COUNT(*) | ||
| 1 | ||
| DROP TABLE t1; | ||
| SET GLOBAL event_scheduler=off; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| -- source include/not_embedded.inc | ||
|
|
||
| set sql_mode='ORACLE'; | ||
|
|
||
| --echo # | ||
| --echo # MDEV-16891 EVENTs created with SQL_MODE=ORACLE fail to execute | ||
| --echo # | ||
|
|
||
| SET GLOBAL event_scheduler=off; | ||
|
|
||
| SET sql_mode='ORACLE'; | ||
| CREATE TABLE t1 (a TIMESTAMP); | ||
| CREATE EVENT e1 | ||
| ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 MICROSECOND | ||
| DO INSERT INTO t1 VALUES(NOW()); | ||
| SET GLOBAL event_scheduler=on; | ||
|
|
||
| let $wait_timeout = 10; | ||
| let $wait_condition = | ||
| SELECT COUNT(*) = 0 | ||
| FROM INFORMATION_SCHEMA.EVENTS | ||
| WHERE event_schema = 'test' AND event_name = 'e1'; | ||
| --source include/wait_condition.inc | ||
|
|
||
| SELECT COUNT(*) FROM t1; | ||
| DROP TABLE t1; | ||
|
|
||
|
|
||
| SET GLOBAL event_scheduler=off; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters