Below is the list of changes that have just been committed into a local
5.1 repository of andrey. When andrey does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2002 05/12/14 12:15:48 andrey@lmy004. +9 -0
Merge ahristov@stripped:/home/bk/mysql-5.1-wl1034
into lmy004.:/work/mysql-5.1-tt-copy-works
sql/table.cc
1.193 05/12/14 12:15:43 andrey@lmy004. +0 -0
Auto merged
sql/sql_show.cc
1.286 05/12/14 12:15:43 andrey@lmy004. +0 -0
Auto merged
sql/sql_parse.cc
1.491 05/12/14 12:15:42 andrey@lmy004. +0 -0
Auto merged
sql/sql_acl.cc
1.165 05/12/14 12:15:42 andrey@lmy004. +0 -0
Auto merged
sql/sp_head.cc
1.201 05/12/14 12:15:42 andrey@lmy004. +0 -0
Auto merged
sql/set_var.cc
1.150 05/12/14 12:15:42 andrey@lmy004. +0 -0
Auto merged
sql/mysqld.cc
1.496 05/12/14 12:15:41 andrey@lmy004. +0 -0
Auto merged
sql/Makefile.am
1.124 05/12/14 12:15:41 andrey@lmy004. +0 -0
Auto merged
libmysqld/Makefile.am
1.73 05/12/14 12:15:41 andrey@lmy004. +0 -0
Auto merged
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: andrey
# Host: lmy004.
# Root: /work/mysql-5.1-tt-copy-works/RESYNC
--- 1.123/sql/Makefile.am 2005-11-26 05:26:19 +01:00
+++ 1.124/sql/Makefile.am 2005-12-14 12:15:41 +01:00
@@ -61,7 +61,7 @@
tztime.h my_decimal.h\
sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \
parse_file.h sql_view.h sql_trigger.h \
- sql_array.h sql_cursor.h \
+ sql_array.h sql_cursor.h event.h event_priv.h \
sql_plugin.h authors.h
mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
item.cc item_sum.cc item_buff.cc item_func.cc \
@@ -95,6 +95,7 @@
tztime.cc my_time.c my_decimal.cc\
sp_head.cc sp_pcontext.cc sp_rcontext.cc sp.cc \
sp_cache.cc parse_file.cc sql_trigger.cc \
+ event_executor.cc event.cc event_timed.cc \
sql_plugin.cc\
handlerton.cc
EXTRA_mysqld_SOURCES = ha_innodb.cc ha_berkeley.cc ha_archive.cc \
--- 1.495/sql/mysqld.cc 2005-11-30 22:43:49 +01:00
+++ 1.496/sql/mysqld.cc 2005-12-14 12:15:41 +01:00
@@ -24,6 +24,7 @@
#include "stacktrace.h"
#include "mysqld_suffix.h"
#include "mysys_err.h"
+#include "event.h"
#include "ha_myisam.h"
@@ -3505,6 +3506,8 @@
}
}
+ init_events();
+
create_shutdown_thread();
create_maintenance_thread();
@@ -3568,6 +3571,7 @@
clean_up(1);
wait_for_signal_thread_to_end();
clean_up_mutexes();
+ shutdown_events();
my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
exit(0);
@@ -4529,7 +4533,7 @@
OPT_MAX_BINLOG_DUMP_EVENTS, OPT_SPORADIC_BINLOG_DUMP_FAIL,
OPT_SAFE_USER_CREATE, OPT_SQL_MODE,
OPT_HAVE_NAMED_PIPE,
- OPT_DO_PSTACK, OPT_REPORT_HOST,
+ OPT_DO_PSTACK, OPT_EVENT_EXECUTOR, OPT_REPORT_HOST,
OPT_REPORT_USER, OPT_REPORT_PASSWORD, OPT_REPORT_PORT,
OPT_SHOW_SLAVE_AUTH_INFO,
OPT_SLAVE_LOAD_TMPDIR, OPT_NO_MIX_TYPE,
@@ -4807,6 +4811,9 @@
(gptr*) &global_system_variables.engine_condition_pushdown,
(gptr*) &global_system_variables.engine_condition_pushdown,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"event-scheduler", OPT_EVENT_EXECUTOR, "Enable/disable the event scheduler.",
+ (gptr*) &opt_event_executor, (gptr*) &opt_event_executor, 0, GET_BOOL, NO_ARG,
+ 0/*default*/, 0/*min-value*/, 1/*max-value*/, 0, 0, 0},
{"exit-info", 'T', "Used for debugging; Use at your own risk!", 0, 0, 0,
GET_LONG, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"external-locking", OPT_USE_LOCKING, "Use system (external) locking. With this option enabled you can run myisamchk to test (not repair) tables while the MySQL server is running.",
@@ -6031,6 +6038,7 @@
{"Bytes_sent", (char*) offsetof(STATUS_VAR, bytes_sent), SHOW_LONG_STATUS},
{"Com_admin_commands", (char*) offsetof(STATUS_VAR, com_other), SHOW_LONG_STATUS},
{"Com_alter_db", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ALTER_DB]), SHOW_LONG_STATUS},
+ {"Com_alter_event", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ALTER_EVENT]), SHOW_LONG_STATUS},
{"Com_alter_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ALTER_TABLE]), SHOW_LONG_STATUS},
{"Com_analyze", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ANALYZE]), SHOW_LONG_STATUS},
{"Com_backup_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_BACKUP_TABLE]), SHOW_LONG_STATUS},
@@ -6041,6 +6049,7 @@
{"Com_checksum", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CHECKSUM]), SHOW_LONG_STATUS},
{"Com_commit", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_COMMIT]), SHOW_LONG_STATUS},
{"Com_create_db", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CREATE_DB]), SHOW_LONG_STATUS},
+ {"Com_create_event", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CREATE_EVENT]), SHOW_LONG_STATUS},
{"Com_create_function", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CREATE_FUNCTION]), SHOW_LONG_STATUS},
{"Com_create_index", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CREATE_INDEX]), SHOW_LONG_STATUS},
{"Com_create_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CREATE_TABLE]), SHOW_LONG_STATUS},
@@ -6049,6 +6058,7 @@
{"Com_delete_multi", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_DELETE_MULTI]), SHOW_LONG_STATUS},
{"Com_do", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_DO]), SHOW_LONG_STATUS},
{"Com_drop_db", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_DROP_DB]), SHOW_LONG_STATUS},
+ {"Com_drop_event", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_DROP_EVENT]), SHOW_LONG_STATUS},
{"Com_drop_function", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_DROP_FUNCTION]), SHOW_LONG_STATUS},
{"Com_drop_index", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_DROP_INDEX]), SHOW_LONG_STATUS},
{"Com_drop_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_DROP_TABLE]), SHOW_LONG_STATUS},
@@ -6090,6 +6100,7 @@
{"Com_show_collations", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_COLLATIONS]), SHOW_LONG_STATUS},
{"Com_show_column_types", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_COLUMN_TYPES]), SHOW_LONG_STATUS},
{"Com_show_create_db", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CREATE_DB]), SHOW_LONG_STATUS},
+ {"Com_show_create_event", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CREATE_EVENT]), SHOW_LONG_STATUS},
{"Com_show_create_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CREATE]), SHOW_LONG_STATUS},
{"Com_show_databases", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_DATABASES]), SHOW_LONG_STATUS},
{"Com_show_engine_logs", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_ENGINE_LOGS]), SHOW_LONG_STATUS},
--- 1.164/sql/sql_acl.cc 2005-11-28 20:07:12 +01:00
+++ 1.165/sql/sql_acl.cc 2005-12-14 12:15:42 +01:00
@@ -352,6 +352,14 @@
if (table->s->fields <= 36 && (user.access & GRANT_ACL))
user.access|= CREATE_USER_ACL;
+
+ /*
+ if it is pre 5.1.4 privilege table then map CREATE privilege on
+ CREATE|ALTER|DROP|EXECUTE EVENT
+ */
+ if (table->s->fields <= 37 && (user.access & CREATE_ACL))
+ user.access|= EVENT_ACL;
+
user.sort= get_sort(2,user.host.hostname,user.user);
user.hostname_length= (user.host.hostname ?
(uint) strlen(user.host.hostname) : 0);
@@ -3971,13 +3979,13 @@
"ALTER", "SHOW DATABASES", "SUPER", "CREATE TEMPORARY TABLES",
"LOCK TABLES", "EXECUTE", "REPLICATION SLAVE", "REPLICATION CLIENT",
"CREATE VIEW", "SHOW VIEW", "CREATE ROUTINE", "ALTER ROUTINE",
- "CREATE USER"
+ "CREATE USER", "EVENT"
};
static uint command_lengths[]=
{
6, 6, 6, 6, 6, 4, 6, 8, 7, 4, 5, 10, 5, 5, 14, 5, 23, 11, 7, 17, 18, 11, 9,
- 14, 13, 11
+ 14, 13, 11, 5
};
--- 1.490/sql/sql_parse.cc 2005-12-01 10:02:45 +01:00
+++ 1.491/sql/sql_parse.cc 2005-12-14 12:15:42 +01:00
@@ -25,6 +25,7 @@
#include "sp_head.h"
#include "sp.h"
#include "sp_cache.h"
+#include "event.h"
#ifdef HAVE_OPENSSL
/*
@@ -642,6 +643,9 @@
uc_update_queries[SQLCOM_DROP_INDEX]=1;
uc_update_queries[SQLCOM_CREATE_VIEW]=1;
uc_update_queries[SQLCOM_DROP_VIEW]=1;
+ uc_update_queries[SQLCOM_CREATE_EVENT]=1;
+ uc_update_queries[SQLCOM_ALTER_EVENT]=1;
+ uc_update_queries[SQLCOM_DROP_EVENT]=1;
}
bool is_update_query(enum enum_sql_command command)
@@ -3667,6 +3671,60 @@
res=mysqld_show_create_db(thd,lex->name,&lex->create_info);
break;
}
+ case SQLCOM_CREATE_EVENT:
+ case SQLCOM_ALTER_EVENT:
+ case SQLCOM_DROP_EVENT:
+ {
+ DBUG_ASSERT(lex->et);
+ do {
+ if (! lex->et->dbname.str)
+ {
+ my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
+ res= true;
+ break;
+ }
+
+ if (check_access(thd, EVENT_ACL, lex->et->dbname.str, 0, 0, 0,
+ is_schema_db(lex->et->dbname.str)))
+ break;
+
+ switch (lex->sql_command) {
+ case SQLCOM_CREATE_EVENT:
+ res= evex_create_event(thd, lex->et, (uint) lex->create_info.options);
+ break;
+ case SQLCOM_ALTER_EVENT:
+ res= evex_update_event(thd, lex->et, lex->spname);
+ break;
+ case SQLCOM_DROP_EVENT:
+ evex_drop_event(thd, lex->et, lex->drop_if_exists);
+ default:;
+ }
+ if (!res)
+ send_ok(thd, 1);
+
+ /* lex->unit.cleanup() is called outside, no need to call it here */
+ } while (0);
+ delete lex->et;
+ delete lex->sphead;
+ lex->et= 0;
+ lex->sphead= 0;
+ break;
+ }
+ case SQLCOM_SHOW_CREATE_EVENT:
+ {
+ if (check_access(thd, EVENT_ACL, lex->spname->m_db.str, 0, 0, 0,
+ is_schema_db(lex->spname->m_db.str)))
+ break;
+
+ if (lex->spname->m_name.length > NAME_LEN)
+ {
+ my_error(ER_TOO_LONG_IDENT, MYF(0), lex->spname->m_name.str);
+ goto error;
+ }
+ /* TODO : Implement it */
+ send_ok(thd, 1);
+ break;
+ }
case SQLCOM_CREATE_FUNCTION: // UDF function
{
if (check_access(thd,INSERT_ACL,"mysql",0,1,0,0))
@@ -5598,6 +5656,11 @@
delete thd->lex->sphead;
thd->lex->sphead= NULL;
}
+ if (thd->lex->et)
+ {
+ delete thd->lex->et;
+ thd->lex->et= NULL;
+ }
}
else
{
@@ -5632,6 +5695,11 @@
/* Clean up after failed stored procedure/function */
delete thd->lex->sphead;
thd->lex->sphead= NULL;
+ }
+ if (thd->lex->et)
+ {
+ delete thd->lex->et;
+ thd->lex->et= NULL;
}
}
thd->proc_info="freeing items";
--- 1.285/sql/sql_show.cc 2005-12-01 10:02:45 +01:00
+++ 1.286/sql/sql_show.cc 2005-12-14 12:15:43 +01:00
@@ -147,6 +147,7 @@
{"Create user", "Server Admin", "To create new users"},
{"Delete", "Tables", "To delete existing rows"},
{"Drop", "Databases,Tables", "To drop databases, tables, and views"},
+ {"Event","Server Admin","Creation, alteration, deletion and execution of events."},
{"Execute", "Functions,Procedures", "To execute stored routines"},
{"File", "File access on server", "To read and write files on the server"},
{"Grant option", "Databases,Tables,Functions,Procedures", "To give to other users those privileges you possess"},
--- 1.192/sql/table.cc 2005-11-30 22:43:49 +01:00
+++ 1.193/sql/table.cc 2005-12-14 12:15:43 +01:00
@@ -282,7 +282,8 @@
*/
if (share->db.length == 5 &&
!my_strcasecmp(system_charset_info, share->db.str, "mysql") &&
- !my_strcasecmp(system_charset_info, share->table_name.str, "proc"))
+ (!my_strcasecmp(system_charset_info, share->table_name.str, "proc") ||
+ !my_strcasecmp(system_charset_info, share->table_name.str, "event")))
share->system_table= 1;
error_given= 1;
}
--- 1.149/sql/set_var.cc 2005-11-26 05:20:46 +01:00
+++ 1.150/sql/set_var.cc 2005-12-14 12:15:42 +01:00
@@ -104,6 +104,7 @@
+extern my_bool event_executor_running_global_var;
static HASH system_variable_hash;
const char *bool_type_names[]= { "OFF", "ON", NullS };
@@ -208,6 +209,8 @@
&delayed_insert_timeout);
sys_var_long_ptr sys_delayed_queue_size("delayed_queue_size",
&delayed_queue_size);
+sys_var_event_executor sys_event_executor("event_scheduler",
+ &event_executor_running_global_var);
sys_var_long_ptr sys_expire_logs_days("expire_logs_days",
&expire_logs_days);
sys_var_bool_ptr sys_flush("flush", &myisam_flush);
@@ -666,6 +669,7 @@
{sys_div_precincrement.name,(char*) &sys_div_precincrement,SHOW_SYS},
{sys_engine_condition_pushdown.name,
(char*) &sys_engine_condition_pushdown, SHOW_SYS},
+ {sys_event_executor.name, (char*) &sys_event_executor, SHOW_SYS},
{sys_expire_logs_days.name, (char*) &sys_expire_logs_days, SHOW_SYS},
{sys_flush.name, (char*) &sys_flush, SHOW_SYS},
{sys_flush_time.name, (char*) &sys_flush_time, SHOW_SYS},
@@ -3361,6 +3365,7 @@
warn_deprecated(thd);
return sys_var_bool_ptr::update(thd, var);
}
+
/****************************************************************************
Used templates
--- 1.72/libmysqld/Makefile.am 2005-11-28 20:14:03 +01:00
+++ 1.73/libmysqld/Makefile.am 2005-12-14 12:15:41 +01:00
@@ -62,8 +62,8 @@
unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \
spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
- parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
- rpl_filter.cc sql_partition.cc handlerton.cc sql_plugin.cc
+ parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc event.cc \
+ rpl_filter.cc sql_partition.cc handlerton.cc sql_plugin.cc
libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources)
EXTRA_libmysqld_a_SOURCES = ha_innodb.cc ha_berkeley.cc ha_archive.cc \
| Thread |
|---|
| • bk commit into 5.1 tree (andrey:1.2002) | ahristov | 14 Dec |