summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <andrey@example.com>2006-08-28 10:27:42 +0200
committerunknown <andrey@example.com>2006-08-28 10:27:42 +0200
commitf18ec676a0b0be35068e2c464b39d92ac143ec5c (patch)
tree20f1308446168c71113bc7ef963c8dfb57bd5188 /sql
parentbd868fb60cb9aa47a3add210d11bb4b2d5b7eed7 (diff)
downloadmariadb-git-f18ec676a0b0be35068e2c464b39d92ac143ec5c.tar.gz
WL#3337 (Event scheduler new architecture)
Don't send affected rows after CREATE/ALTER/DROP EVENT as this is inconsistent with the rest of the server in terms of CREATE/ALTER/DROP DDLs sql/event_data_objects.cc: Events::drop_event() does not expect anymore a parameter named affected_rows sql/event_db_repository.cc: Remove rows_affected as the behavior exposed by Events is not coherent with the behavior of many other DDL, like CREATE PROCEDURE, etc. sql/event_db_repository.h: Remove rows_affected as the behavior exposed by Events is not coherent with the behavior of many other DDL, like CREATE PROCEDURE, etc. sql/events.cc: Remove rows_affected as the behavior exposed by Events is not coherent with the behavior of many other DDL, like CREATE PROCEDURE, etc. sql/events.h: Remove rows_affected as the behavior exposed by Events is not coherent with the behavior of many other DDL, like CREATE PROCEDURE, etc. sql/sql_parse.cc: Don't send affected rows, because this behavior is not consistent with the rest of the server for CREATE/ALTER/DROP DDLs
Diffstat (limited to 'sql')
-rw-r--r--sql/event_data_objects.cc3
-rw-r--r--sql/event_db_repository.cc8
-rw-r--r--sql/event_db_repository.h6
-rw-r--r--sql/events.cc17
-rw-r--r--sql/events.h8
-rw-r--r--sql/sql_parse.cc18
6 files changed, 21 insertions, 39 deletions
diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc
index b33ebfa7da9..6f865a2bcac 100644
--- a/sql/event_data_objects.cc
+++ b/sql/event_data_objects.cc
@@ -1437,11 +1437,10 @@ Event_queue_element::mark_last_executed(THD *thd)
int
Event_queue_element::drop(THD *thd)
{
- uint tmp= 0;
DBUG_ENTER("Event_queue_element::drop");
DBUG_RETURN(Events::get_instance()->
- drop_event(thd, dbname, name, FALSE, &tmp, TRUE));
+ drop_event(thd, dbname, name, FALSE, TRUE));
}
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc
index c6b84a1c84b..69f44b44be0 100644
--- a/sql/event_db_repository.cc
+++ b/sql/event_db_repository.cc
@@ -508,7 +508,6 @@ check_parse_params(THD *thd, Event_parse_data *parse_data)
thd [in] THD
parse_data [in] Object containing info about the event
create_if_not [in] Whether to generate anwarning in case event exists
- rows_affected [out] How many rows were affected
RETURN VALUE
0 OK
@@ -521,7 +520,7 @@ check_parse_params(THD *thd, Event_parse_data *parse_data)
bool
Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data,
- my_bool create_if_not, uint *rows_affected)
+ my_bool create_if_not)
{
int ret= 0;
CHARSET_INFO *scs= system_charset_info;
@@ -532,7 +531,6 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data,
DBUG_ENTER("Event_db_repository::create_event");
- *rows_affected= 0;
if (check_parse_params(thd, parse_data))
goto err;
@@ -621,7 +619,6 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data,
goto err;
}
- *rows_affected= 1;
ok:
if (dbchanged)
(void) mysql_change_db(thd, old_db.str, 1);
@@ -760,7 +757,6 @@ err:
name [in] Event's name
drop_if_exists [in] If set and the event not existing => warning
onto the stack
- rows_affected [out] Affected number of rows is returned heres
RETURN VALUE
FALSE OK
@@ -769,7 +765,7 @@ err:
bool
Event_db_repository::drop_event(THD *thd, LEX_STRING db, LEX_STRING name,
- bool drop_if_exists, uint *rows_affected)
+ bool drop_if_exists)
{
TABLE *table= NULL;
Open_tables_state backup;
diff --git a/sql/event_db_repository.h b/sql/event_db_repository.h
index 10f2fa8632c..ed74edd7e19 100644
--- a/sql/event_db_repository.h
+++ b/sql/event_db_repository.h
@@ -56,16 +56,14 @@ public:
Event_db_repository(){}
bool
- create_event(THD *thd, Event_parse_data *parse_data, my_bool create_if_not,
- uint *rows_affected);
+ create_event(THD *thd, Event_parse_data *parse_data, my_bool create_if_not);
bool
update_event(THD *thd, Event_parse_data *parse_data, LEX_STRING *new_dbname,
LEX_STRING *new_name);
bool
- drop_event(THD *thd, LEX_STRING db, LEX_STRING name, bool drop_if_exists,
- uint *rows_affected);
+ drop_event(THD *thd, LEX_STRING db, LEX_STRING name, bool drop_if_exists);
void
drop_schema_events(THD *thd, LEX_STRING schema);
diff --git a/sql/events.cc b/sql/events.cc
index deb96ba2e89..f4b9b05179d 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -304,7 +304,6 @@ Events::open_event_table(THD *thd, enum thr_lock_type lock_type,
thd [in] THD
parse_data [in] Event's data from parsing stage
if_not_exists [in] Whether IF NOT EXISTS was specified in the DDL
- rows_affected [out] How many rows were affected
RETURN VALUE
FALSE OK
@@ -316,8 +315,7 @@ Events::open_event_table(THD *thd, enum thr_lock_type lock_type,
*/
bool
-Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists,
- uint *rows_affected)
+Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists)
{
int ret;
DBUG_ENTER("Events::create_event");
@@ -329,8 +327,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists,
pthread_mutex_lock(&LOCK_event_metadata);
/* On error conditions my_error() is called so no need to handle here */
- if (!(ret= db_repository->create_event(thd, parse_data, if_not_exists,
- rows_affected)))
+ if (!(ret= db_repository->create_event(thd, parse_data, if_not_exists)))
{
if ((ret= event_queue->create_event(thd, parse_data->dbname,
parse_data->name)))
@@ -353,7 +350,6 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists,
thd [in] THD
parse_data [in] Event's data from parsing stage
rename_to [in] Set in case of RENAME TO.
- rows_affected [out] How many rows were affected.
RETURN VALUE
FALSE OK
@@ -366,8 +362,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists,
*/
bool
-Events::update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to,
- uint *rows_affected)
+Events::update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to)
{
int ret;
DBUG_ENTER("Events::update_event");
@@ -406,7 +401,6 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to,
name [in] Event's name
if_exists [in] When set and the event does not exist =>
warning onto the stack
- rows_affected [out] Affected number of rows is returned here
only_from_disk [in] Whether to remove the event from the queue too.
In case of Event_job_data::drop() it's needed to
do only disk drop because Event_queue will handle
@@ -419,7 +413,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to,
bool
Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists,
- uint *rows_affected, bool only_from_disk)
+ bool only_from_disk)
{
int ret;
DBUG_ENTER("Events::drop_event");
@@ -431,8 +425,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists,
pthread_mutex_lock(&LOCK_event_metadata);
/* On error conditions my_error() is called so no need to handle here */
- if (!(ret= db_repository->drop_event(thd, dbname, name, if_exists,
- rows_affected)))
+ if (!(ret= db_repository->drop_event(thd, dbname, name, if_exists)))
{
if (!only_from_disk)
event_queue->drop_event(thd, dbname, name);
diff --git a/sql/events.h b/sql/events.h
index 4ea91baf64c..737044ad298 100644
--- a/sql/events.h
+++ b/sql/events.h
@@ -77,16 +77,14 @@ public:
get_instance();
bool
- create_event(THD *thd, Event_parse_data *parse_data, bool if_exists,
- uint *rows_affected);
+ create_event(THD *thd, Event_parse_data *parse_data, bool if_exists);
bool
- update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to,
- uint *rows_affected);
+ update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to);
bool
drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists,
- uint *rows_affected, bool only_from_disk);
+ bool only_from_disk);
void
drop_schema_events(THD *thd, char *db);
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 38d8ac5d56e..4fa96525d72 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -3897,24 +3897,23 @@ end_with_restore_list:
case SQLCOM_CREATE_EVENT:
case SQLCOM_ALTER_EVENT:
{
- uint affected= 1;
DBUG_ASSERT(lex->event_parse_data);
switch (lex->sql_command) {
case SQLCOM_CREATE_EVENT:
res= Events::get_instance()->
create_event(thd, lex->event_parse_data,
- lex->create_info.options & HA_LEX_CREATE_IF_NOT_EXISTS,
- &affected);
+ lex->create_info.options & HA_LEX_CREATE_IF_NOT_EXISTS);
break;
case SQLCOM_ALTER_EVENT:
- res= Events::get_instance()->
- update_event(thd, lex->event_parse_data, lex->spname, &affected);
+ res= Events::get_instance()->update_event(thd, lex->event_parse_data,
+ lex->spname);
break;
- default:;
+ default:
+ DBUG_ASSERT(0);
}
- DBUG_PRINT("info",("DDL error code=%d affected=%d", res, affected));
+ DBUG_PRINT("info",("DDL error code=%d", res));
if (!res)
- send_ok(thd, affected);
+ send_ok(thd);
/* Don't do it, if we are inside a SP */
if (!thd->spcont)
@@ -3956,9 +3955,8 @@ end_with_restore_list:
lex->spname->m_db,
lex->spname->m_name,
lex->drop_if_exists,
- &affected,
FALSE)))
- send_ok(thd, affected);
+ send_ok(thd);
}
break;
}