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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
8b10ae74
Commit
8b10ae74
authored
Apr 13, 2007
by
kostja@vajra.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rpl_events test failure in the runtime tree.
parent
eccd5ae2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
8 deletions
+51
-8
mysql-test/r/rpl_events.result
mysql-test/r/rpl_events.result
+0
-2
sql/event_data_objects.cc
sql/event_data_objects.cc
+43
-3
sql/event_data_objects.h
sql/event_data_objects.h
+2
-0
sql/events.cc
sql/events.cc
+6
-3
No files found.
mysql-test/r/rpl_events.result
View file @
8b10ae74
...
...
@@ -34,7 +34,6 @@ id c ts
affected rows: 2
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
db name status originator
test justonce SLAVESIDE_DISABLED 1
DROP EVENT IF EXISTS test.slave_once;
CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO
INSERT INTO t1(c) VALUES ('from slave_once');
...
...
@@ -111,7 +110,6 @@ id c ts
affected rows: 2
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
db name status originator
test justonce SLAVESIDE_DISABLED 1
DROP EVENT IF EXISTS test.slave_once;
CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO
INSERT INTO t1(c) VALUES ('from slave_once');
...
...
sql/event_data_objects.cc
View file @
8b10ae74
...
...
@@ -1792,6 +1792,33 @@ Event_job_data::construct_sp_sql(THD *thd, String *sp_sql)
}
/**
Get DROP EVENT statement to binlog the drop of ON COMPLETION NOT
PRESERVE event.
*/
bool
Event_job_data
::
construct_drop_event_sql
(
THD
*
thd
,
String
*
sp_sql
)
{
LEX_STRING
buffer
;
const
uint
STATIC_SQL_LENGTH
=
14
;
DBUG_ENTER
(
"Event_job_data::construct_drop_event_sql"
);
buffer
.
length
=
STATIC_SQL_LENGTH
+
name
.
length
*
2
+
dbname
.
length
*
2
;
if
(
!
(
buffer
.
str
=
(
char
*
)
thd
->
alloc
(
buffer
.
length
)))
DBUG_RETURN
(
TRUE
);
sp_sql
->
set
(
buffer
.
str
,
buffer
.
length
,
system_charset_info
);
sp_sql
->
length
(
0
);
sp_sql
->
append
(
C_STRING_WITH_LEN
(
"DROP EVENT "
));
append_identifier
(
thd
,
sp_sql
,
dbname
.
str
,
dbname
.
length
);
sp_sql
->
append
(
'.'
);
append_identifier
(
thd
,
sp_sql
,
name
.
str
,
name
.
length
);
DBUG_RETURN
(
thd
->
is_fatal_error
);
}
/**
Compiles and executes the event (the underlying sp_head object)
...
...
@@ -1804,7 +1831,9 @@ bool
Event_job_data
::
execute
(
THD
*
thd
,
bool
drop
)
{
String
sp_sql
;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
Security_context
event_sctx
,
*
save_sctx
=
NULL
;
#endif
CHARSET_INFO
*
charset_connection
;
List
<
Item
>
empty_item_list
;
bool
ret
=
TRUE
;
...
...
@@ -1916,15 +1945,26 @@ Event_job_data::execute(THD *thd, bool drop)
end:
if
(
drop
&&
!
thd
->
is_fatal_error
)
{
sql_print_information
(
"Event Scheduler: Dropping %s.%s"
,
(
const
char
*
)
dbname
.
str
,
(
const
char
*
)
name
.
str
);
/*
We must do it here since here we're under the right authentication
ID of the event definer.
*/
sql_print_information
(
"Event Scheduler: Dropping %s.%s"
,
(
const
char
*
)
dbname
.
str
,
(
const
char
*
)
name
.
str
);
/*
Construct a query for the binary log, to ensure the event is dropped
on the slave
*/
if
(
construct_drop_event_sql
(
thd
,
&
sp_sql
))
ret
=
1
;
else
{
thd
->
query
=
sp_sql
.
c_ptr_safe
();
thd
->
query_length
=
sp_sql
.
length
();
if
(
Events
::
drop_event
(
thd
,
dbname
,
name
,
FALSE
))
ret
=
1
;
}
}
if
(
thd
->
lex
->
sphead
)
/* NULL only if a parse error */
{
delete
thd
->
lex
->
sphead
;
...
...
sql/event_data_objects.h
View file @
8b10ae74
...
...
@@ -184,6 +184,8 @@ public:
private:
bool
construct_sp_sql
(
THD
*
thd
,
String
*
sp_sql
);
bool
construct_drop_event_sql
(
THD
*
thd
,
String
*
sp_sql
);
Event_job_data
(
const
Event_job_data
&
);
/* Prevent use of these */
void
operator
=
(
Event_job_data
&
);
...
...
sql/events.cc
View file @
8b10ae74
...
...
@@ -424,7 +424,8 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
if
(
event_queue
)
event_queue
->
create_event
(
thd
,
new_element
,
&
created
);
/* Binlog the create event. */
if
(
mysql_bin_log
.
is_open
()
&&
(
thd
->
query_length
>
0
))
DBUG_ASSERT
(
thd
->
query
&&
thd
->
query_length
);
if
(
mysql_bin_log
.
is_open
())
{
thd
->
clear_error
();
thd
->
binlog_query
(
THD
::
MYSQL_QUERY_TYPE
,
...
...
@@ -549,7 +550,8 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
event_queue
->
update_event
(
thd
,
parse_data
->
dbname
,
parse_data
->
name
,
new_element
);
/* Binlog the alter event. */
if
(
mysql_bin_log
.
is_open
()
&&
(
thd
->
query_length
>
0
))
DBUG_ASSERT
(
thd
->
query
&&
thd
->
query_length
);
if
(
mysql_bin_log
.
is_open
())
{
thd
->
clear_error
();
thd
->
binlog_query
(
THD
::
MYSQL_QUERY_TYPE
,
...
...
@@ -628,7 +630,8 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists)
if
(
event_queue
)
event_queue
->
drop_event
(
thd
,
dbname
,
name
);
/* Binlog the drop event. */
if
(
mysql_bin_log
.
is_open
()
&&
(
thd
->
query_length
>
0
))
DBUG_ASSERT
(
thd
->
query
&&
thd
->
query_length
);
if
(
mysql_bin_log
.
is_open
())
{
thd
->
clear_error
();
thd
->
binlog_query
(
THD
::
MYSQL_QUERY_TYPE
,
...
...
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