From 5c21619b3a07d1b7b8a76ea7542cb4401c097907 Mon Sep 17 00:00:00 2001 From: "tnurnberg@sin.intern.azundris.com" <> Date: Fri, 12 Oct 2007 11:23:45 +0200 Subject: [PATCH 1/3] Bug#30821: setting --tc_heuristic_recover tries to set myisam_stats_method Options to mysqld were not processed correctly because switch statement was missing some "break"s. CS adds them. No test case; would require .opt file and server restart. Manually tested. --- sql/mysqld.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index d8b87b69c4b..5ad73979e7b 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -7165,6 +7165,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), have_merge_db= SHOW_OPTION_YES; else have_merge_db= SHOW_OPTION_DISABLED; + break; #ifdef HAVE_BERKELEY_DB case OPT_BDB_NOSYNC: /* Deprecated option */ @@ -7304,6 +7305,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), fprintf(stderr, "Unknown option to tc-heuristic-recover: %s\n",argument); exit(1); } + break; } case OPT_MYISAM_STATS_METHOD: { From 57dc3812686a6af49b7652d0d75bc59a2c30350a Mon Sep 17 00:00:00 2001 From: "tnurnberg@sin.intern.azundris.com" <> Date: Fri, 12 Oct 2007 11:46:48 +0200 Subject: [PATCH 2/3] Bug#30951: makedate returns different results depending on version of mysql makedate() will fold years below 100 into the 1970-2069 range. CS removes code that also wrongly folded years between 100 and 200 into that range, which should be left unchanged. Backport from 5.1. --- mysql-test/r/func_sapdb.result | 3 +++ mysql-test/t/func_sapdb.test | 1 + sql-common/my_time.c | 5 ----- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result index dbae7e551e5..ba66ac3bc94 100644 --- a/mysql-test/r/func_sapdb.result +++ b/mysql-test/r/func_sapdb.result @@ -93,6 +93,9 @@ makedate(9999,365) select makedate(9999,366); makedate(9999,366) NULL +select makedate(100,1); +makedate(100,1) +0100-01-01 select addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002"); addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002") 1998-01-02 01:01:01.000001 diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test index bb65cbaa774..5db6db70e8f 100644 --- a/mysql-test/t/func_sapdb.test +++ b/mysql-test/t/func_sapdb.test @@ -47,6 +47,7 @@ select makedate(1997,1); select makedate(1997,0); select makedate(9999,365); select makedate(9999,366); +select makedate(100,1); #Time functions diff --git a/sql-common/my_time.c b/sql-common/my_time.c index f5d5828e024..3c08db6bf97 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -769,11 +769,6 @@ long calc_daynr(uint year,uint month,uint day) if (year == 0 && month == 0 && day == 0) DBUG_RETURN(0); /* Skip errors */ - if (year < 200) - { - if ((year=year+1900) < 1900+YY_PART_YEAR) - year+=100; - } delsum= (long) (365L * year+ 31*(month-1) +day); if (month <= 2) year--; From 56e85a8cb25d6d0f59b222088dda22765eb53085 Mon Sep 17 00:00:00 2001 From: "kaa@polly.(none)" <> Date: Fri, 12 Oct 2007 14:03:51 +0400 Subject: [PATCH 3/3] Fix for bug #31254: "Max_data_length" truncated / reported wrong (compiler issue ?) Problem: Improper compile-time flags on AIX prevented use of files > 2 GB. This resulted in Max_data_length being truncated to 2 GB by MyISAM code. Solution: Reverted large-file changes from the fix for bug10776. We need to define _LARGE_FILES on AIX to have support for files > 2 GB. Since _LARGE_FILE_API is incompatible with _LARGE_FILES and may be automatically defined by including standards.h, we also need a workaround to avoid this conflict. --- config/ac-macros/large_file.m4 | 11 +++++++++-- include/my_global.h | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/config/ac-macros/large_file.m4 b/config/ac-macros/large_file.m4 index 2639cec5fb7..279ce6d60f1 100644 --- a/config/ac-macros/large_file.m4 +++ b/config/ac-macros/large_file.m4 @@ -128,8 +128,15 @@ AC_DEFUN([MYSQL_SYS_LARGEFILE], ac_cv_sys_largefile_source=1 ;; esac]) - # AIX 4.2 and later -- do nothing, include standards.h instead. - # this goes for both GNU and IBM C and C++ compilers. + AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, + ac_cv_sys_large_files, + [Large files support on AIX-style hosts.], + [case "$host_os" in + # Large file support on AIX is available starting from version 4.2 + # Tested only on 5.2 and up + aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*) + ac_cv_sys_large_files=1 ;; + esac]) fi ]) diff --git a/include/my_global.h b/include/my_global.h index 4457b88c33e..dd3bc39413d 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -100,6 +100,11 @@ #define NETWARE_SET_SCREEN_MODE(A) #endif +/* Workaround for _LARGE_FILES and _LARGE_FILE_API incompatibility on AIX */ +#if defined(_AIX) && defined(_LARGE_FILE_API) +#undef _LARGE_FILE_API +#endif + /* The macros below are used to allow build of Universal/fat binaries of MySQL and MySQL applications under darwin.