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
4cbadaea
Commit
4cbadaea
authored
Aug 07, 2018
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-16891 EVENTs created with SQL_MODE=ORACLE fail to execute
parent
cb1945dd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
3 deletions
+52
-3
mysql-test/suite/compat/oracle/r/events.result
mysql-test/suite/compat/oracle/r/events.result
+16
-0
mysql-test/suite/compat/oracle/t/events.test
mysql-test/suite/compat/oracle/t/events.test
+29
-0
sql/event_data_objects.cc
sql/event_data_objects.cc
+7
-3
No files found.
mysql-test/suite/compat/oracle/r/events.result
0 → 100644
View file @
4cbadaea
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;
mysql-test/suite/compat/oracle/t/events.test
0 → 100644
View file @
4cbadaea
--
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
;
sql/event_data_objects.cc
View file @
4cbadaea
...
...
@@ -1284,7 +1284,11 @@ Event_job_data::construct_sp_sql(THD *thd, String *sp_sql)
*/
sp_sql
->
append
(
STRING_WITH_LEN
(
"() SQL SECURITY INVOKER "
));
if
(
thd
->
variables
.
sql_mode
&
MODE_ORACLE
)
sp_sql
->
append
(
STRING_WITH_LEN
(
" AS BEGIN "
));
sp_sql
->
append
(
&
body
);
if
(
thd
->
variables
.
sql_mode
&
MODE_ORACLE
)
sp_sql
->
append
(
STRING_WITH_LEN
(
"; END"
));
DBUG_RETURN
(
thd
->
is_fatal_error
);
}
...
...
@@ -1387,9 +1391,6 @@ Event_job_data::execute(THD *thd, bool drop)
goto
end
;
}
if
(
construct_sp_sql
(
thd
,
&
sp_sql
))
goto
end
;
/*
Set up global thread attributes to reflect the properties of
this Event. We can simply reset these instead of usual
...
...
@@ -1401,6 +1402,9 @@ Event_job_data::execute(THD *thd, bool drop)
thd
->
variables
.
sql_mode
=
sql_mode
;
thd
->
variables
.
time_zone
=
time_zone
;
if
(
construct_sp_sql
(
thd
,
&
sp_sql
))
goto
end
;
thd
->
set_query
(
sp_sql
.
c_ptr_safe
(),
sp_sql
.
length
());
{
...
...
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