MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:kpettersson Date:February 15 2007 5:49pm
Subject:bk commit into 4.1 tree (thek:1.2594) BUG#23240
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of thek. When thek 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@stripped, 2007-02-15 18:49:18+01:00, thek@stripped +5 -0
  Bug#23240 --init-file statements with NOW() reports '1970-01-01 11:00:00'as the date time
  
  - Starting time of a query sent by file bootstrapping wasn't initialized
    and starting time defaulted to 0. This later used value by the Now-
    item and is translated to 1970-01-01 11:00:00.
  - marking the time with thd->set_time() before the call to 
    mysql_parse resolves this issue.

  mysql-test/r/func_time_init.result@stripped, 2007-02-15 18:49:16+01:00, thek@stripped +7 -0
    Added test file

  mysql-test/r/func_time_init.result@stripped, 2007-02-15 18:49:16+01:00, thek@stripped +0 -0

  mysql-test/t/func_time_init-master.opt@stripped, 2007-02-15 18:49:16+01:00, thek@stripped +1 -0
    Added test case

  mysql-test/t/func_time_init-master.opt@stripped, 2007-02-15 18:49:16+01:00, thek@stripped +0 -0

  mysql-test/t/func_time_init.sql@stripped, 2007-02-15 18:49:16+01:00, thek@stripped +4 -0
    Added test case

  mysql-test/t/func_time_init.sql@stripped, 2007-02-15 18:49:16+01:00, thek@stripped +0 -0

  mysql-test/t/func_time_init.test@stripped, 2007-02-15 18:49:16+01:00, thek@stripped +5 -0
    Added test case

  mysql-test/t/func_time_init.test@stripped, 2007-02-15 18:49:16+01:00, thek@stripped +0 -0

  sql/sql_parse.cc@stripped, 2007-02-15 18:49:16+01:00, thek@stripped +2 -0
    Bug#23240 --init-file statements with NOW() reports '1970-01-01 11:00:00'as the date time
    
    - Starting time of a query sent by file bootstrapping wasn't initialized
      and starting time defaulted to 0. This later used value by the Now-
      item and is translated to 1970-01-01 11:00:00.
    - marking the time with thd->set_time() before the call to 
      mysql_parse resolves this issue.

# 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:	thek
# Host:	kpdesk.mysql.com
# Root:	/home/thek/dev/bug23240/my41-bug23240

--- 1.490/sql/sql_parse.cc	2007-02-15 18:49:22 +01:00
+++ 1.491/sql/sql_parse.cc	2007-02-15 18:49:22 +01:00
@@ -1175,7 +1175,9 @@ extern "C" pthread_handler_decl(handle_b
       free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC));
       break;
     }
+    thd->set_time();
     mysql_parse(thd,thd->query,length);
+    thd->end_time();
     close_thread_tables(thd);			// Free tables
     if (thd->is_fatal_error)
       break;
--- New file ---
+++ mysql-test/r/func_time_init.result	07/02/15 18:49:16
INSERT INTO init_file.startup VALUES ( NOW() );
SELECT * INTO @X FROM init_file.startup limit 0,1;
SELECT * INTO @Y FROM init_file.startup limit 1,1;
SELECT YEAR(@X)-YEAR(@Y);
YEAR(@X)-YEAR(@Y)
0
DROP DATABASE init_file;

--- New file ---
+++ mysql-test/t/func_time_init-master.opt	07/02/15 18:49:16
--init-file=$MYSQL_TEST_DIR/t/func_time_init.sql

--- New file ---
+++ mysql-test/t/func_time_init.sql	07/02/15 18:49:16
CREATE DATABASE IF NOT EXISTS init_file;
CREATE TABLE IF NOT EXISTS init_file.startup ( startdate DATETIME );
INSERT INTO init_file.startup VALUES ( NOW() );


--- New file ---
+++ mysql-test/t/func_time_init.test	07/02/15 18:49:16
INSERT INTO init_file.startup VALUES ( NOW() );
SELECT * INTO @X FROM init_file.startup limit 0,1;
SELECT * INTO @Y FROM init_file.startup limit 1,1;
SELECT YEAR(@X)-YEAR(@Y);
DROP DATABASE init_file;

Thread
bk commit into 4.1 tree (thek:1.2594) BUG#23240kpettersson15 Feb