List:Commits« Previous MessageNext Message »
From:ahristov Date:January 23 2006 5:53pm
Subject:bk commit into 5.1 tree (andrey:1.2067) BUG#16430
View as plain text  
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.2067 06/01/23 18:53:43 andrey@lmy004. +3 -0
  fix for bug #16430: Events: no storage of current_database value
  WL#1034 (Internal CRON)

  sql/event_timed.cc
    1.19 06/01/23 18:53:35 andrey@lmy004. +5 -0
    - save also the length and set the length of db, otherwise thd->strdup()
     in sp_head::reset_thd... will copy 0 bytes and set thd->db to "" which is not
     what we want!
    fix for bug #16430 (#16430: Events: no storage of current_database value)

  mysql-test/t/events.test
    1.8 06/01/23 18:53:35 andrey@lmy004. +13 -0
    add a test case 

  mysql-test/r/events.result
    1.7 06/01/23 18:53:35 andrey@lmy004. +15 -0
    update result file

# 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-bug16430

--- 1.6/mysql-test/r/events.result	2006-01-20 22:24:51 +01:00
+++ 1.7/mysql-test/r/events.result	2006-01-23 18:53:35 +01:00
@@ -1,5 +1,20 @@
 create database if not exists events_test;
 use events_test;
+set global event_scheduler = 0;
+create table tp3(a varchar(5));
+create event e43_p21 on schedule every 1 second do insert into tp3 values('ccc');
+use test;
+set global event_scheduler = 1;
+select sleep(2);
+sleep(2)
+0
+set global event_scheduler = 0;
+select IF(count(*), 'YES','NO') FROM events_test.tp3 where a='ccc';
+IF(count(*), 'YES','NO')
+YES
+use events_test;
+drop event e43_p21;
+drop table tp3;
 drop event if exists event1;
 Warnings:
 Note	1305	Event event1 does not exist

--- 1.7/mysql-test/t/events.test	2006-01-20 22:24:51 +01:00
+++ 1.8/mysql-test/t/events.test	2006-01-23 18:53:35 +01:00
@@ -1,5 +1,18 @@
 create database if not exists events_test;
 use events_test;
+
+set global event_scheduler = 0;
+create table tp3(a varchar(5));
+create event e43_p21 on schedule every 1 second do insert into tp3 values('ccc');
+use test;
+set global event_scheduler = 1;
+select sleep(2);
+set global event_scheduler = 0;
+select IF(count(*), 'YES','NO') FROM events_test.tp3 where a='ccc';
+use events_test;
+drop event e43_p21;
+drop table tp3;
+
 drop event if exists event1;
 create event event1 on schedule every 15 minute starts now() ends date_add(now(), interval 5 hour) DO begin end;
 alter event event1 rename to event2;

--- 1.18/sql/event_timed.cc	2006-01-20 22:24:51 +01:00
+++ 1.19/sql/event_timed.cc	2006-01-23 18:53:35 +01:00
@@ -909,6 +909,7 @@
   MEM_ROOT *tmp_mem_root= 0;
   LEX *old_lex= thd->lex, lex;
   char *old_db;
+  int old_db_length;
   event_timed *ett;
   sp_name *spn;
   char *old_query;
@@ -938,7 +939,10 @@
   old_query_len= thd->query_length;
   old_query= thd->query;
   old_db= thd->db;
+  old_db_length= thd->db_length;
   thd->db= dbname.str;
+  thd->db_length= dbname.length;
+
   thd->query= get_show_create_event(thd, &thd->query_length);
   DBUG_PRINT("event_timed::compile", ("query:%s",thd->query));
 
@@ -983,6 +987,7 @@
   thd->query= old_query;
   thd->query_length= old_query_len;
   thd->db= old_db;
+  thd->db_length= old_db_length;
 
   thd->variables.character_set_client= old_character_set_client;
   thd->variables.character_set_results= old_character_set_results;
Thread
bk commit into 5.1 tree (andrey:1.2067) BUG#16430ahristov23 Jan