Commit 0ba2425c authored by andrey@lmy004's avatar andrey@lmy004

fix for bug#16407 (EVENTS: sql_mode)

post-review fixes
parent a1fdeb13
...@@ -18,8 +18,8 @@ end| ...@@ -18,8 +18,8 @@ end|
show processlist; show processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
# root localhost events_test Query # NULL show processlist # root localhost events_test Query # NULL show processlist
# event_scheduler NULL Connect # Sleeping NULL # event_scheduler localhost NULL Connect # Sleeping NULL
# root events_test Connect # User lock select get_lock('test_bug16407', 60) # root localhost events_test Connect # User lock select get_lock('test_bug16407', 60)
select release_lock('test_bug16407'); select release_lock('test_bug16407');
release_lock('test_bug16407') release_lock('test_bug16407')
1 1
...@@ -72,17 +72,17 @@ set global event_scheduler= 1; ...@@ -72,17 +72,17 @@ set global event_scheduler= 1;
show processlist; show processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
# root localhost events_test Query # NULL show processlist # root localhost events_test Query # NULL show processlist
# event_scheduler NULL Connect # Sleeping NULL # event_scheduler localhost NULL Connect # Sleeping NULL
# root events_test Connect # User lock select get_lock('ee_16407_2', 60) # root localhost events_test Connect # User lock select get_lock('ee_16407_2', 60)
# root events_test Connect # User lock select get_lock('ee_16407_2', 60) # root localhost events_test Connect # User lock select get_lock('ee_16407_2', 60)
# root events_test Connect # User lock select get_lock('ee_16407_2', 60) # root localhost events_test Connect # User lock select get_lock('ee_16407_2', 60)
select release_lock('ee_16407_2'); select release_lock('ee_16407_2');
release_lock('ee_16407_2') release_lock('ee_16407_2')
1 1
show processlist; show processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
# root localhost events_test Query # NULL show processlist # root localhost events_test Query # NULL show processlist
# event_scheduler NULL Connect # Sleeping NULL # event_scheduler localhost NULL Connect # Sleeping NULL
set global event_scheduler= 0; set global event_scheduler= 0;
select * from events_smode_test order by ev_name, a; select * from events_smode_test order by ev_name, a;
ev_name a ev_name a
...@@ -121,16 +121,16 @@ set global event_scheduler= 1; ...@@ -121,16 +121,16 @@ set global event_scheduler= 1;
show processlist; show processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
# root localhost events_test Query # NULL show processlist # root localhost events_test Query # NULL show processlist
# event_scheduler NULL Connect # Sleeping NULL # event_scheduler localhost NULL Connect # Sleeping NULL
# root events_test Connect # User lock select get_lock('ee_16407_5', 60) # root localhost events_test Connect # User lock select get_lock('ee_16407_5', 60)
# root events_test Connect # User lock select get_lock('ee_16407_5', 60) # root localhost events_test Connect # User lock select get_lock('ee_16407_5', 60)
select release_lock('ee_16407_5'); select release_lock('ee_16407_5');
release_lock('ee_16407_5') release_lock('ee_16407_5')
1 1
show processlist; show processlist;
Id User Host db Command Time State Info Id User Host db Command Time State Info
# root localhost events_test Query # NULL show processlist # root localhost events_test Query # NULL show processlist
# event_scheduler NULL Connect # Sleeping NULL # event_scheduler localhost NULL Connect # Sleeping NULL
select * from events_smode_test order by ev_name, a; select * from events_smode_test order by ev_name, a;
ev_name a ev_name a
ee_16407_6 2004-02-29 ee_16407_6 2004-02-29
......
...@@ -1384,7 +1384,7 @@ evex_show_create_event(THD *thd, sp_name *spn, LEX_STRING definer) ...@@ -1384,7 +1384,7 @@ evex_show_create_event(THD *thd, sp_name *spn, LEX_STRING definer)
char show_str_buf[768]; char show_str_buf[768];
String show_str(show_str_buf, sizeof(show_str_buf), system_charset_info); String show_str(show_str_buf, sizeof(show_str_buf), system_charset_info);
List<Item> field_list; List<Item> field_list;
const char *sql_mode_str; byte *sql_mode_str;
ulong sql_mode_len=0; ulong sql_mode_len=0;
show_str.length(0); show_str.length(0);
......
...@@ -268,7 +268,7 @@ init_event_thread(THD* thd) ...@@ -268,7 +268,7 @@ init_event_thread(THD* thd)
thd->client_capabilities= 0; thd->client_capabilities= 0;
thd->security_ctx->master_access= 0; thd->security_ctx->master_access= 0;
thd->security_ctx->db_access= 0; thd->security_ctx->db_access= 0;
thd->security_ctx->host= (char*)my_localhost; thd->security_ctx->host_or_ip= (char*)my_localhost;
my_net_init(&thd->net, 0); my_net_init(&thd->net, 0);
thd->net.read_timeout = slave_net_timeout; thd->net.read_timeout = slave_net_timeout;
thd->slave_thread= 0; thd->slave_thread= 0;
......
...@@ -111,17 +111,21 @@ void ...@@ -111,17 +111,21 @@ void
event_timed::init_body(THD *thd) event_timed::init_body(THD *thd)
{ {
DBUG_ENTER("event_timed::init_body"); DBUG_ENTER("event_timed::init_body");
MEM_ROOT *root= thd->mem_root; DBUG_PRINT("info", ("body=[%s] body_begin=0x%ld end=0x%ld", body_begin,
body_begin, thd->lex->ptr));
body.length= thd->lex->ptr - body_begin; body.length= thd->lex->ptr - body_begin;
// Trim nuls at the end // Trim nuls at the end
while (body.length && body_begin[body.length-1] == '\0') while (body.length && body_begin[body.length-1] == '\0')
body.length--; body.length--;
//the first is always space which I cannot skip in the parser /* the first is always whitespace which I cannot skip in the parser */
DBUG_ASSERT(my_isspace(thd->variables.character_set_client, *body_begin)); while (my_isspace(thd->variables.character_set_client, *body_begin))
body.length--; {
body.str= strmake_root(root, (char *)body_begin + 1, body.length); ++body_begin;
--body.length;
}
body.str= strmake_root(thd->mem_root, (char *)body_begin, body.length);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
......
...@@ -3956,7 +3956,7 @@ fill_events_copy_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table) ...@@ -3956,7 +3956,7 @@ fill_events_copy_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table)
// [9] is SQL_MODE // [9] is SQL_MODE
{ {
const char *sql_mode_str=""; byte *sql_mode_str;
ulong sql_mode_len=0; ulong sql_mode_len=0;
sql_mode_str= sql_mode_str=
sys_var_thd_sql_mode::symbolic_mode_representation(thd, et.sql_mode, sys_var_thd_sql_mode::symbolic_mode_representation(thd, et.sql_mode,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment