List:Commits« Previous MessageNext Message »
From:Georgi Kodinov Date:June 7 2010 9:51am
Subject:bzr push into mysql-5.0-bugteam branch (Georgi.Kodinov:2867 to 2868)
Bug#52315
View as plain text  
 2868 Georgi Kodinov	2010-06-07
      Addendum to the fix for bug #52315: need to set a proper shutdown type
      when an out-of-supported-range date is detected.

    modified:
      sql/sql_parse.cc
 2867 Georgi Kodinov	2010-06-04
      Bug #52315: utc_date() crashes when system time > year 2037
                  
      Some of the server implementations don't support dates later
      than 2038 due to the internal time type being 32 bit.
      Added checks so that the server will refuse dates that cannot
      be handled by either throwing an error when setting date at 
      runtime or by refusing to start or shutting down the server if 
      the system date cannot be stored in my_time_t.

    modified:
      mysql-test/r/variables.result
      mysql-test/t/variables.test
      sql/mysqld.cc
      sql/set_var.cc
      sql/set_var.h
      sql/sql_class.h
      sql/sql_parse.cc
=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2010-06-04 13:21:19 +0000
+++ b/sql/sql_parse.cc	2010-06-07 09:49:52 +0000
@@ -2243,8 +2243,12 @@ bool dispatch_command(enum enum_server_c
       SHUTDOWN_DEFAULT is 0. If client is >= 4.1.3, the shutdown level is in
       packet[0].
     */
-    enum mysql_enum_shutdown_level level=
-      (enum mysql_enum_shutdown_level) (uchar) packet[0];
+    enum mysql_enum_shutdown_level level;
+    if (!thd->is_valid_time())
+      level= SHUTDOWN_DEFAULT;
+    else
+      level= (enum mysql_enum_shutdown_level) (uchar) packet[0];
+
     DBUG_PRINT("quit",("Got shutdown command for level %u", level));
     if (level == SHUTDOWN_DEFAULT)
       level= SHUTDOWN_WAIT_ALL_BUFFERS; // soon default will be configurable


Attachment: [text/bzr-bundle] bzr/georgi.kodinov@oracle.com-20100607094952-3oy50pdrefv2fej6.bundle
Thread
bzr push into mysql-5.0-bugteam branch (Georgi.Kodinov:2867 to 2868)Bug#52315Georgi Kodinov7 Jun