#include <event_parse_data.h>
◆ enum_on_completion
Enumerator |
---|
ON_COMPLETION_DEFAULT | |
ON_COMPLETION_DROP | |
ON_COMPLETION_PRESERVE | |
◆ enum_status
Enumerator |
---|
ENABLED | |
DISABLED | |
REPLICA_SIDE_DISABLED | |
◆ Event_parse_data() [1/2]
Event_parse_data::Event_parse_data |
( |
| ) |
|
|
default |
◆ Event_parse_data() [2/2]
◆ check_dates()
Check time/dates in ALTER EVENT.
We check whether ALTER EVENT was given dates that are in the past. However to know how to react, we need the ON COMPLETION type. Hence, the check is deferred until we have the previous ON COMPLETION type from the event-db to fall back on if nothing was specified in the ALTER EVENT-statement.
- Parameters
-
thd | Thread |
previous_on_completion | ON COMPLETION value currently in event-db. Will be overridden by value in ALTER EVENT if given. |
- Returns
- true on error, false otherwise
◆ check_for_execute()
bool Event_parse_data::check_for_execute |
( |
THD * |
thd | ) |
|
Checks performed on every execute.
This includes checking and possibly initializing the definer, and checking the originator id.
- Parameters
-
- Returns
- true on error, false otherwise.
◆ check_if_in_the_past()
bool Event_parse_data::check_if_in_the_past |
( |
THD * |
thd, |
|
|
my_time_t |
ltime_utc |
|
) |
| |
|
private |
This function is called on CREATE EVENT or ALTER EVENT.
When either ENDS or AT is in the past, we are trying to create an event that will never be executed. If it has ON COMPLETION NOT PRESERVE (default), then it would normally be dropped already, so on CREATE EVENT we give a warning, and do not create anything. On ALTER EVENT we give a error, and do not change the event.
If the event has ON COMPLETION PRESERVE, then we see if the event is created or altered to the ENABLED (default) state. If so, then we give a warning, and change the state to DISABLED.
Otherwise it is a valid event in ON COMPLETION PRESERVE DISABLE state.
- Parameters
-
thd | THD |
ltime_utc | either ENDS or AT time for event |
- Returns
- true on error, false otherwise
◆ check_originator_id()
void Event_parse_data::check_originator_id |
( |
THD * |
thd | ) |
|
|
private |
Set the originator id of the event to the server_id if executing on the source or set to the server_id of the source if executing on the replica.
If executing on replica, also set status to REPLICA_SIDE_DISABLED.
- Parameters
-
◆ init_definer()
void Event_parse_data::init_definer |
( |
THD * |
thd | ) |
|
|
private |
Inits definer (definer_user and definer_host) during parsing.
- Parameters
-
◆ init_ends()
bool Event_parse_data::init_ends |
( |
THD * |
thd | ) |
|
|
private |
Sets ENDS (deactivation time).
- Note
- Note that activation time is not execution time. EVERY 5 MINUTE ENDS "2004-12-12 10:00:00" means that the event will be executed every 5 minutes but this will end at the date shown above. Expressions are possible : DATE_ADD(NOW(), INTERVAL 1 DAY) – end tomorrow at same time.
- Parameters
-
- Returns
- true on error, false otherwise
◆ init_execute_at()
bool Event_parse_data::init_execute_at |
( |
THD * |
thd | ) |
|
|
private |
Sets time for execution for one-time event.
- Parameters
-
- Returns
- true on error, false otherwise
◆ init_interval()
bool Event_parse_data::init_interval |
( |
THD * |
thd | ) |
|
|
private |
Sets time for execution of multi-time event.
- Parameters
-
- Returns
- true on error, false otherwise
◆ init_name()
void Event_parse_data::init_name |
( |
THD * |
thd, |
|
|
sp_name * |
spn |
|
) |
| |
|
private |
Set a name of the event.
- Parameters
-
thd | THD |
spn | the name extracted in the parser |
◆ init_starts()
bool Event_parse_data::init_starts |
( |
THD * |
thd | ) |
|
|
private |
Sets STARTS.
- Note
- Note that activation time is not execution time. EVERY 5 MINUTE STARTS "2004-12-12 10:00:00" means that the event will be executed every 5 minutes but this will start at the date shown above. Expressions are possible : DATE_ADD(NOW(), INTERVAL 1 DAY) – start tomorrow at same time.
- Parameters
-
- Returns
- true on error, false otherwise
◆ operator=()
◆ report_bad_value()
void Event_parse_data::report_bad_value |
( |
THD * |
thd, |
|
|
const char * |
item_name, |
|
|
Item * |
bad_item |
|
) |
| |
|
private |
Prints an error message about invalid value.
Internally used during input data verification
- Parameters
-
thd | THD object |
item_name | The name of the parameter |
bad_item | The parameter |
Don't proceed to val_str() if an error has already been raised.
◆ resolve()
bool Event_parse_data::resolve |
( |
THD * |
thd | ) |
|
Resolves the event parse data by checking the validity of the data gathered during the parsing phase.
- Parameters
-
- Returns
- true on error, false otherwise.
◆ body_changed
bool Event_parse_data::body_changed {false} |
◆ comment
◆ dbname
◆ definer
◆ do_not_create
bool Event_parse_data::do_not_create {false} |
◆ ends
◆ ends_null
bool Event_parse_data::ends_null {true} |
◆ event_body
◆ execute_at
◆ execute_at_null
bool Event_parse_data::execute_at_null {true} |
◆ expression
longlong Event_parse_data::expression {0} |
◆ identifier
◆ interval
◆ item_ends
◆ item_execute_at
◆ item_expression
◆ item_starts
◆ name
◆ on_completion
◆ originator
std::uint64_t Event_parse_data::originator {0} |
◆ starts
◆ starts_null
bool Event_parse_data::starts_null {true} |
◆ status
◆ status_changed
bool Event_parse_data::status_changed {false} |
The documentation for this class was generated from the following files: