From b1f396227669531e81d443395822f7a395c789ca Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Fri, 24 Oct 2008 17:34:17 +0200 Subject: [PATCH 1/8] Fix a "configure" syntax error. It had been introduced with the patch for bug entry 37098 and affected runs "--without-server" only. configure.in: The conditional "BUILD_INNODB_TOOLS" is set depending on whether InnoDB is configured in the build, but that check is done only when building the server. For builds without the server it must also be set, or else "configure" reports an error. Set it to "false" in such builds, as this conditional only affects a tool that is useless in client installations. --- configure.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 85021ba8dde..f48f1544677 100644 --- a/configure.in +++ b/configure.in @@ -2728,8 +2728,10 @@ then AC_SUBST(THREAD_LOBJECTS) fi -if test "$with_server" != "no" +if test "$with_server" = "no" then + AM_CONDITIONAL([BUILD_INNODB_TOOLS], [false]) +else server_scripts="mysqld_safe mysql_install_db" sql_server_dirs="strings mysys dbug extra regex" From 1f09ede4e4adf8deccb2069e321b7157d1b224d2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Nov 2008 23:37:54 +0100 Subject: [PATCH 2/8] Merge from mysql-5.0.72-release From 4f75f58b7aa36184f853e7682c1f1acfbbe72b85 Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Mon, 1 Dec 2008 12:14:02 +0400 Subject: [PATCH 3/8] After-push commit for bug #33461 to make valgrind happy: TABLE_LIST doesn't free Strings in its string lists (TABLE_LIST::use_index and TABLE_liST::ignore_index), so calling c_ptr_safe() on that Strings leads to memleaks. OTOH "safe" c_ptr_safe() is not necessary there and we can replace it with c_ptr(). --- sql/sql_view.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 5bd3c09a289..41a638b2618 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -985,7 +985,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, if (index_list) { DBUG_ASSERT(index_list->head()); // should never fail - my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), index_list->head()->c_ptr_safe(), + my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), index_list->head()->c_ptr(), table->table_name); DBUG_RETURN(TRUE); } From a1e9b6ba1e7d02c527bd2bd8b0a811919553f09c Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Mon, 1 Dec 2008 13:34:53 +0200 Subject: [PATCH 4/8] Addendum to bug #37339 : make the test case portable to windows by using and taking out a full path. mysql-test/r/ctype_filesystem.result: Bug #37399: use MYSQL_TEST_DIR rooted test mysql-test/t/ctype_filesystem-master.opt: Bug #37399: use MYSQL_TEST_DIR rooted test mysql-test/t/ctype_filesystem.test: Bug #37399: use MYSQL_TEST_DIR rooted test --- mysql-test/r/ctype_filesystem.result | 2 +- mysql-test/t/ctype_filesystem-master.opt | 2 +- mysql-test/t/ctype_filesystem.test | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ctype_filesystem.result b/mysql-test/r/ctype_filesystem.result index 8a8f0f7f8cc..b461cf2a1a4 100644 --- a/mysql-test/r/ctype_filesystem.result +++ b/mysql-test/r/ctype_filesystem.result @@ -1,7 +1,7 @@ SET CHARACTER SET utf8; SHOW VARIABLES like 'character_sets_dir'; Variable_name Value -character_sets_dir /ß/ +character_sets_dir MYSQL_TEST_DIR/ß/ SHOW VARIABLES like 'character_set_filesystem'; Variable_name Value character_set_filesystem latin1 diff --git a/mysql-test/t/ctype_filesystem-master.opt b/mysql-test/t/ctype_filesystem-master.opt index cb3427571b5..44127f68664 100644 --- a/mysql-test/t/ctype_filesystem-master.opt +++ b/mysql-test/t/ctype_filesystem-master.opt @@ -1,2 +1,2 @@ ---character-sets-dir=/ß +--character-sets-dir=$MYSQL_TEST_DIR/ß --character-set-filesystem=latin1 diff --git a/mysql-test/t/ctype_filesystem.test b/mysql-test/t/ctype_filesystem.test index 30b1607008b..2b993c2b924 100644 --- a/mysql-test/t/ctype_filesystem.test +++ b/mysql-test/t/ctype_filesystem.test @@ -1,4 +1,5 @@ SET CHARACTER SET utf8; +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR SHOW VARIABLES like 'character_sets_dir'; SHOW VARIABLES like 'character_set_filesystem'; SHOW VARIABLES like 'character_set_client'; From f56e43ce521e4265f09682dd52ffa07ae1433afa Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Mon, 1 Dec 2008 16:18:35 +0200 Subject: [PATCH 5/8] Bug #39920: MySQL cannot deal with Leap Second expression in string literal. Updated MySQL time handling code to react correctly on UTC leap second additions. MySQL functions that return the OS current time, like e.g. CURDATE(), NOW() etc will return :59:59 instead of :59:60 or 59:61. As a result the reader will receive :59:59 for 2 or 3 consecutive seconds during the leap second. This fix will not affect the values returned by UNIX_TIMESTAMP() for leap seconds. But note that when converting the value returned by UNIX_TIMESTAMP() to broken down time the correction of leap seconds will still be applied. Note that this fix will make a difference *only* if the OS is specially configured to return leap seconds from the OS time calls or when using a MySQL time zone defintion that has leap seconds. Even after this change date/time literals (or other broken down time representations) with leap seconds (ending on :59:60 or 59:61) will still be considered illegal and discarded by the server with an error or a warning depending on the sql mode. Added a test case to demonstrate the effect of the fix. mysql-test/r/timezone3.result: Bug #39920: test case mysql-test/std_data/Moscow_leap: Bug #39920: updated the Moscow time zone to Dr. Olson's tzdata 2008i to accomodate for the 2008 leap second mysql-test/t/timezone3.test: Bug #39920: test case sql/tztime.cc: Bug #39920: adjust leap seconds (:60 or :61) to :59 sql/tztime.h: Bug #39920: adjust leap seconds (:60 or :61) to :59 --- mysql-test/r/timezone3.result | 8 ++++++++ mysql-test/std_data/Moscow_leap | Bin 991 -> 2674 bytes mysql-test/t/timezone3.test | 12 ++++++++++++ sql/tztime.cc | 22 ++++++++++++++++++++++ sql/tztime.h | 3 +++ 5 files changed, 45 insertions(+) diff --git a/mysql-test/r/timezone3.result b/mysql-test/r/timezone3.result index ec0b6045f93..ceac4a5aefb 100644 --- a/mysql-test/r/timezone3.result +++ b/mysql-test/r/timezone3.result @@ -17,6 +17,9 @@ insert into t1 values insert into t1 values (unix_timestamp('1981-07-01 03:59:59'),'1981-07-01 03:59:59'), (unix_timestamp('1981-07-01 04:00:00'),'1981-07-01 04:00:00'); +insert into t1 values +(unix_timestamp('2009-01-01 02:59:59'),'2009-01-01 02:59:59'), +(unix_timestamp('2009-01-01 03:00:00'),'2009-01-01 03:00:00'); select i, from_unixtime(i), c from t1; i from_unixtime(i) c 1072904422 2004-01-01 00:00:00 2004-01-01 00:00:00 @@ -31,6 +34,8 @@ i from_unixtime(i) c 1099180821 2004-10-31 02:59:59 2004-10-31 02:59:59 362793608 1981-07-01 03:59:59 1981-07-01 03:59:59 362793610 1981-07-01 04:00:00 1981-07-01 04:00:00 +1230768022 2009-01-01 02:59:59 2009-01-01 02:59:59 +1230768024 2009-01-01 03:00:00 2009-01-01 03:00:00 drop table t1; create table t1 (ts timestamp); insert into t1 values (19730101235900), (20040101235900); @@ -39,3 +44,6 @@ ts 1973-01-01 23:59:00 2004-01-01 23:59:00 drop table t1; +SELECT FROM_UNIXTIME(1230768022), FROM_UNIXTIME(1230768023), FROM_UNIXTIME(1230768024); +FROM_UNIXTIME(1230768022) FROM_UNIXTIME(1230768023) FROM_UNIXTIME(1230768024) +2009-01-01 02:59:59 2009-01-01 02:59:59 2009-01-01 03:00:00 diff --git a/mysql-test/std_data/Moscow_leap b/mysql-test/std_data/Moscow_leap index 4994c005595dc06bc6d288e9ecea38307ce11c82..3e73923cfb323ed1f7fe38d1b1929a0dc2bc8eeb 100644 GIT binary patch literal 2674 zcmb`|eN0t#7{Kv!x%b@r;{t*&2qYlB5QvDpq+o$)cvTb%1&IjKLM+FwX)oDuBkEGTv_NJtz6~GS{u32i#^|CXCrI<t`6l1$@YN2uK4ik7SC?>TtLSq)S-A^$vYh}3nG&aeKj=t@~kM;QyKMV__^q71A1b53X1MK z|H|cIAMU>udu02qxYwHl@mp5~hHqFDNLV&6FrsRDU}RBt->BT=zR{^MeTlK&zWYON z-cB-;8k2gXHzi+<+BT-)<85OuUMNX9{r1$c$1gXfc6`=6Zs$kMX)SMU9>043=JZ9| zH)m9zbY-sG<;u!ycRet7ojD<{$()#3Wljv#xO0Xz_;arK+>>rr`X4-*EWRCnn`!#AqMc{}tHwOiN5t=6?atk-pca=rA^YW?(;9R1AUe7)?e)J{Ug3{X&&^3tD;M8Xt1^PrYTp(0e8hKZP1+xN&97%v!+;*$aN)38d;O$d*Y%QG z-`%b^?C#VXk2dKS)@t3@R-=O)K~9I$beV3`<#CCeD!AY24N<16|BZV)8^)+)`44Gi z)Hz%-S1{){IFw)BO1dNF&i&%zGNZUuu4#Of&X#MM z;q#TrB{y8htbf>HcKqa!F9`DZhc}DP;M!8B=n9$XZxPL~u_0STcX(*NTl7Tyys}kP zgStEAiHzXL_OmaF-l$D|UNIzQVaCg1Xk6koUaznbUtg7HHU=c_+uJ6FCpCT^E=Hu3 z^llRere=C?k`7DB2a*sZBS=b+oFGX-vVx=q$qSMgBr`~AklY~2L9&CS2g#46 zBnZh6k|ImV5t1Y%OGuiKJRylfGKHiH$rX|;BwI+jkbEHtvy_Y>DYKNEAxT5BhNKP2 z8qy!yCGSY$k<25hM{&58SL$MhJ*&Y&Hgv;?aceh)5r#pw?a06vNnLsvH_&0vH_%) zvH_%tvH|2XHo=hI_rEV2AnwlnA~wMPZUMf_-UQ6{Hej|l0<*mpnC;ELY;Olo``MBx@*yvy~4gN=U6CPZiix9 z-ZFEx{0!!{f;LIE!axPKqSW7P#fD65C9ZebN(G*time_type= MYSQL_TIMESTAMP_DATETIME; + adjust_leap_second(tmp); } @@ -1157,6 +1158,7 @@ Time_zone_utc::gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const gmtime_r(&tmp_t, &tmp_tm); localtime_to_TIME(tmp, &tmp_tm); tmp->time_type= MYSQL_TIMESTAMP_DATETIME; + adjust_leap_second(tmp); } @@ -1260,6 +1262,7 @@ void Time_zone_db::gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const { ::gmt_sec_to_TIME(tmp, t, tz_info); + adjust_leap_second(tmp); } @@ -2373,6 +2376,25 @@ Time_zone *my_tz_find_with_opening_tz_tables(THD *thd, const String *name) DBUG_RETURN(tz); } + +/** + Convert leap seconds into non-leap + + This function will convert the leap seconds added by the OS to + non-leap seconds, e.g. 23:59:59, 23:59:60 -> 23:59:59, 00:00:01 ... + This check is not checking for years on purpose : although it's not a + complete check this way it doesn't require looking (and having installed) + the leap seconds table. + + @param[in,out] broken down time structure as filled in by the OS +*/ + +void Time_zone::adjust_leap_second(MYSQL_TIME *t) +{ + if (t->second == 60 || t->second == 61) + t->second= 59; +} + #endif /* !defined(TESTTIME) && !defined(TZINFO2SQL) */ diff --git a/sql/tztime.h b/sql/tztime.h index 32a942a26e1..750b8dacbe1 100644 --- a/sql/tztime.h +++ b/sql/tztime.h @@ -55,6 +55,9 @@ public: allocated on MEM_ROOT and should not require destruction. */ virtual ~Time_zone() {}; + +protected: + static inline void adjust_leap_second(MYSQL_TIME *t); }; extern Time_zone * my_tz_UTC; From 7f9e0b9bfb71bd3e47c48bb77f11df76feb1b7ad Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Mon, 1 Dec 2008 17:41:06 +0200 Subject: [PATCH 6/8] addendum to the fix for bug #39920 : post-merge test suite fixes --- mysql-test/r/timezone2.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result index bb1d764ac8c..e115ce16fa4 100644 --- a/mysql-test/r/timezone2.result +++ b/mysql-test/r/timezone2.result @@ -110,7 +110,7 @@ i ts 362793610 1981-07-01 04:00:00 select from_unixtime(362793609); from_unixtime(362793609) -1981-07-01 03:59:60 +1981-07-01 03:59:59 drop table t1; create table t1 (ts timestamp); set time_zone='UTC'; From bd53e304d7a75854dea2b732468fe4b18ef3aaf8 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Tue, 2 Dec 2008 13:15:28 +0200 Subject: [PATCH 7/8] Addendum to the fix for bug #39178: Server crash in YaSSL with non-RSA-requesting client if server uses RSA key matchSuite() may not find a match. It will return error in this case. Added a error checking code that will prevent using uninitialized memory in the code based on the assumption that matchSuite() has found a match. extra/yassl/src/yassl_imp.cpp: Bug #39178: Correct error checking added --- extra/yassl/src/yassl_imp.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/extra/yassl/src/yassl_imp.cpp b/extra/yassl/src/yassl_imp.cpp index 4430ef0213c..20dfe50f132 100644 --- a/extra/yassl/src/yassl_imp.cpp +++ b/extra/yassl/src/yassl_imp.cpp @@ -1560,6 +1560,7 @@ void ClientHello::Process(input_buffer&, SSL& ssl) return; } ssl.matchSuite(cipher_suites_, suite_len_); + if (ssl.GetError()) return; ssl.set_pending(ssl.getSecurity().get_parms().suite_[1]); if (compression_methods_ == zlib) From 014143e8588c4313ccf10e269aa34a997f5772b6 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Tue, 2 Dec 2008 13:21:05 +0200 Subject: [PATCH 8/8] Fixed a bad merge (5.0->5.1) of the fix for bug 37339. There was a missing initialization. sql/set_var.h: Added an initialization missing during the merge of 37339. --- sql/set_var.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/set_var.h b/sql/set_var.h index 2e58b2faa7d..b6c67d1ab4a 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -82,6 +82,7 @@ public: sys_var(const char *name_arg, sys_after_update_func func= NULL, Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) :name(name_arg), after_update(func), no_support_one_shot(1), + is_os_charset (FALSE), binlog_status(binlog_status_arg), m_allow_empty_value(TRUE) {}