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
04b306da
Commit
04b306da
authored
Feb 22, 2008
by
andrey@whirlpool.hristov.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into whirlpool.hristov.com:/work/mysql-5.1-runtime
parents
1e6dbd94
b4fb43d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
3 deletions
+42
-3
sql/event_queue.cc
sql/event_queue.cc
+36
-2
sql/events.cc
sql/events.cc
+6
-1
No files found.
sql/event_queue.cc
View file @
04b306da
...
@@ -60,8 +60,16 @@ extern "C" int event_queue_element_compare_q(void *, uchar *, uchar *);
...
@@ -60,8 +60,16 @@ extern "C" int event_queue_element_compare_q(void *, uchar *, uchar *);
int
event_queue_element_compare_q
(
void
*
vptr
,
uchar
*
a
,
uchar
*
b
)
int
event_queue_element_compare_q
(
void
*
vptr
,
uchar
*
a
,
uchar
*
b
)
{
{
my_time_t
lhs
=
((
Event_queue_element
*
)
a
)
->
execute_at
;
Event_queue_element
*
left
=
(
Event_queue_element
*
)
a
;
my_time_t
rhs
=
((
Event_queue_element
*
)
b
)
->
execute_at
;
Event_queue_element
*
right
=
(
Event_queue_element
*
)
b
;
my_time_t
lhs
=
left
->
execute_at
;
my_time_t
rhs
=
right
->
execute_at
;
if
(
left
->
status
==
Event_queue_element
::
DISABLED
)
return
right
->
status
!=
Event_queue_element
::
DISABLED
;
if
(
right
->
status
==
Event_queue_element
::
DISABLED
)
return
1
;
return
(
lhs
<
rhs
?
-
1
:
(
lhs
>
rhs
?
1
:
0
));
return
(
lhs
<
rhs
?
-
1
:
(
lhs
>
rhs
?
1
:
0
));
}
}
...
@@ -434,8 +442,34 @@ Event_queue::recalculate_activation_times(THD *thd)
...
@@ -434,8 +442,34 @@ Event_queue::recalculate_activation_times(THD *thd)
((
Event_queue_element
*
)
queue_element
(
&
queue
,
i
))
->
update_timing_fields
(
thd
);
((
Event_queue_element
*
)
queue_element
(
&
queue
,
i
))
->
update_timing_fields
(
thd
);
}
}
queue_fix
(
&
queue
);
queue_fix
(
&
queue
);
/*
The disabled elements are moved to the end during the `fix`.
Start from the end and remove all of the elements which are
disabled. When we find the first non-disabled one we break, as we
have removed all. The queue has been ordered in a way the disabled
events are at the end.
*/
for
(
i
=
queue
.
elements
;
i
>
0
;
i
--
)
{
Event_queue_element
*
element
=
(
Event_queue_element
*
)
queue_element
(
&
queue
,
i
-
1
);
if
(
element
->
status
!=
Event_queue_element
::
DISABLED
)
break
;
/*
This won't cause queue re-order, because we remove
always the last element.
*/
queue_remove
(
&
queue
,
i
-
1
);
delete
element
;
}
UNLOCK_QUEUE_DATA
();
UNLOCK_QUEUE_DATA
();
/*
XXX: The events are dropped only from memory and not from disk
even if `drop_list[j]->dropped` is TRUE. There will be still on the
disk till next server restart.
Please add code here to do it.
*/
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
...
...
sql/events.cc
View file @
04b306da
...
@@ -1185,7 +1185,12 @@ Events::load_events_from_db(THD *thd)
...
@@ -1185,7 +1185,12 @@ Events::load_events_from_db(THD *thd)
{
{
/*
/*
If not created, a stale event - drop if immediately if
If not created, a stale event - drop if immediately if
ON COMPLETION NOT PRESERVE
ON COMPLETION NOT PRESERVE.
XXX: This won't be replicated, thus the drop won't appear in
in the slave. When the slave is restarted it will drop events.
However, as the slave will be "out of sync", it might happen that
an event created on the master, after master restart, won't be
replicated to the slave correctly, as the create will fail there.
*/
*/
int
rc
=
table
->
file
->
ha_delete_row
(
table
->
record
[
0
]);
int
rc
=
table
->
file
->
ha_delete_row
(
table
->
record
[
0
]);
if
(
rc
)
if
(
rc
)
...
...
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