From 65d6b24ed9d2aec30ae6584357ca5f916197399e Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Wed, 15 Nov 2006 20:27:02 +0100 Subject: [PATCH 01/13] support-files/mysql.spec.sh : Use "report features" in the first test run. --- support-files/mysql.spec.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 1daac2d0e95..1547a5b578d 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -317,7 +317,10 @@ then cp -fp config.log "$MYSQL_MAXCONFLOG_DEST" fi -make -i test-force || true +( cd mysql-test + perl ./mysql-test-run.pl --force --report-features + perl ./mysql-test-run.pl --force --ps-protocol + true ) # Save mysqld-max ./libtool --mode=execute cp sql/mysqld sql/mysqld-max @@ -380,7 +383,10 @@ then cp -fp config.log "$MYSQL_CONFLOG_DEST" fi -make -i test-force || true +( cd mysql-test + perl ./mysql-test-run.pl --force --report-features + perl ./mysql-test-run.pl --force --ps-protocol + true ) %install RBR=$RPM_BUILD_ROOT @@ -716,6 +722,11 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Wed Nov 15 2006 Joerg Bruehe + +- Switch from "make test*" to explicit calls of the test suite, + so that "report features" can be used. + * Tue Jun 27 2006 Joerg Bruehe - move "mysqldumpslow" from the client RPM to the server RPM (bug#20216) From 29dd8d2e588937545013fe42f46394cb19b5d533 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Thu, 16 Nov 2006 14:01:31 +0100 Subject: [PATCH 02/13] support-files/mysql.spec.sh : Add an "Obsoletes" note relative to SuSE RPMs (bug#22081). --- support-files/mysql.spec.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 1547a5b578d..b14ffd24894 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -170,6 +170,8 @@ necessary to develop MySQL client applications. %package shared Summary: MySQL - Shared libraries Group: Applications/Databases +Provides: mysql-shared +Obsoletes: mysql-shared %description shared This package contains the shared libraries (*.so*) which certain @@ -722,6 +724,12 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Thu Nov 16 2006 Joerg Bruehe + +- Explicitly note that the "MySQL-shared" RPMs (as built by MySQL AB) + replace "mysql-shared" (as distributed by SuSE) to allow easy upgrading + (bug#22081). + * Wed Nov 15 2006 Joerg Bruehe - Switch from "make test*" to explicit calls of the test suite, From 8809a5e27e4e2fa2e0fa0bf3359e750fae4128de Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Mon, 20 Nov 2006 13:02:49 +0100 Subject: [PATCH 03/13] mysql_client_test not found when running from binary dist Look in bin for myql_client_test executable --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 74ec2a02c12..a1dfed2c57c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1499,7 +1499,7 @@ sub executable_setup () { $exe_mysql_client_test= mtr_exe_maybe_exists(vs_config_dirs('tests', 'mysql_client_test'), "$glob_basedir/tests/mysql_client_test", - "$glob_basedir/bin"); + "$glob_basedir/bin/mysql_client_test"); } } From 8e6cf24d3b766440fc506b12a7de63ff54441f70 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 23 Nov 2006 09:56:50 +0100 Subject: [PATCH 04/13] Fix my_system_gmt_sec function declaration to be same as definition --- sql-common/my_time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 2dd40c112de..003442e9330 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -780,7 +780,7 @@ long calc_daynr(uint year,uint month,uint day) */ my_time_t my_system_gmt_sec(const MYSQL_TIME *t_src, long *my_timezone, - bool *in_dst_time_gap) + my_bool *in_dst_time_gap) { uint loop; time_t tmp= 0; From 2aa0d085e35b0a2594d22c57b3402a3b686370c7 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 23 Nov 2006 11:38:44 +0100 Subject: [PATCH 05/13] Build fixes for NetWare --- client/mysql_upgrade.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index e2b5931c2eb..520d87b5ed7 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -373,22 +373,24 @@ static int comp_names(struct fileinfo *a, struct fileinfo *b) } -static int -find_file(const char *name, const char *root, uint flags, char *result, size_t len, ...) +static int find_file(const char *name, const char *root, + uint flags, char *result, size_t len, ...) { - int ret; + int ret= 1; va_list va; - FILEINFO key= { (char*)name, NULL }; const char *subdir; char *cp; - + FILEINFO key; + + /* Init key with name of the file to look for */ + key.name= (char*)name; + DBUG_ASSERT(root != NULL); cp= strmake(result, root, len); if (cp[-1] != FN_LIBCHAR) *cp++= FN_LIBCHAR; - ret= 1; va_start(va, len); subdir= (!(flags & MY_SEARCH_SELF)) ? va_arg(va, char *) : ""; while (subdir) From 176313a6797f17b8021a3f6b21ac5d92ac03a3d6 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 23 Nov 2006 11:56:05 +0100 Subject: [PATCH 06/13] mysql_upgrade should look for .sql script also in share/ directory --- client/mysql_upgrade.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 37cbeb81e1d..0e228c257d1 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -597,7 +597,7 @@ fix_priv_tables: if (find_file(MYSQL_FIX_PRIV_TABLES_NAME, basedir, MYF(0), path, sizeof(path), - "support_files", "share/mysql", "scripts", + "support_files", "share", "share/mysql", "scripts", NullS) && find_file(MYSQL_FIX_PRIV_TABLES_NAME, "/usr/local/mysql", MYF(0), path, sizeof(path), From 7053ef84bf03002f864f5985f9915116de756fda Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 23 Nov 2006 17:23:29 +0100 Subject: [PATCH 07/13] Rework my_getpagesize function - Put 'my_getpagesize' in it's own .c file - Map the call 'my_getpagesize' directly to 'getpagesize' if it exists - Add default implementation for 'my_getpagesize' to be used if no platform specfic function exists --- include/my_sys.h | 14 +++++++------- mysys/CMakeLists.txt | 3 ++- mysys/Makefile.am | 2 +- mysys/my_getpagesize.c | 41 +++++++++++++++++++++++++++++++++++++++++ mysys/my_mmap.c | 7 ------- 5 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 mysys/my_getpagesize.c diff --git a/include/my_sys.h b/include/my_sys.h index ebb518314b2..d19091a85e8 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -842,12 +842,6 @@ my_bool my_gethwaddr(uchar *to); #endif #define my_mmap(a,b,c,d,e,f) mmap(a,b,c,d,e,f) -#ifdef HAVE_GETPAGESIZE -#define my_getpagesize() getpagesize() -#else -/* qnx ? */ -#define my_getpagesize() 8192 -#endif #define my_munmap(a,b) munmap((a),(b)) #else @@ -863,11 +857,17 @@ my_bool my_gethwaddr(uchar *to); #define HAVE_MMAP #endif -int my_getpagesize(void); void *my_mmap(void *, size_t, int, int, int, my_off_t); int my_munmap(void *, size_t); #endif +/* my_getpagesize */ +#ifdef HAVE_GETPAGESIZE +#define my_getpagesize() getpagesize() +#else +int my_getpagesize(void); +#endif + int my_msync(int, void *, size_t, int); /* character sets */ diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index 7926cb916c1..b1a3e7441fb 100755 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -26,4 +26,5 @@ ADD_LIBRARY(mysys array.c charset-def.c charset.c checksum.c default.c default_m my_static.c my_symlink.c my_symlink2.c my_sync.c my_thr_init.c my_wincond.c my_windac.c my_winsem.c my_winthread.c my_write.c ptr_cmp.c queues.c rijndael.c safemalloc.c sha1.c string.c thr_alarm.c thr_lock.c thr_mutex.c - thr_rwlock.c tree.c typelib.c base64.c my_memmem.c) + thr_rwlock.c tree.c typelib.c base64.c my_memmem.c + my_getpagesize.c) diff --git a/mysys/Makefile.am b/mysys/Makefile.am index 041130fdf5c..47480e8f363 100644 --- a/mysys/Makefile.am +++ b/mysys/Makefile.am @@ -29,7 +29,7 @@ noinst_HEADERS = mysys_priv.h my_static.h \ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \ mf_path.c mf_loadpath.c my_file.c \ my_open.c my_create.c my_dup.c my_seek.c my_read.c \ - my_pread.c my_write.c \ + my_pread.c my_write.c my_getpagesize.c \ mf_keycache.c mf_keycaches.c my_crc32.c \ mf_iocache.c mf_iocache2.c mf_cache.c mf_tempfile.c \ mf_tempdir.c my_lock.c mf_brkhant.c my_alarm.c \ diff --git a/mysys/my_getpagesize.c b/mysys/my_getpagesize.c new file mode 100644 index 00000000000..ac4bd775ba9 --- /dev/null +++ b/mysys/my_getpagesize.c @@ -0,0 +1,41 @@ +/* Copyright (C) 2000-2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" + +#ifndef HAVE_GETPAGESIZE + +#if defined __WIN__ + +int my_getpagesize(void) +{ + SYSTEM_INFO si; + GetSystemInfo(&si); + return si.dwPageSize; +} + +#else + +/* Default implementation */ +int my_getpagesize(void) +{ + return (int)8192; +} + +#endif + +#endif + diff --git a/mysys/my_mmap.c b/mysys/my_mmap.c index 21bfddae46c..eb74aaeaae4 100644 --- a/mysys/my_mmap.c +++ b/mysys/my_mmap.c @@ -33,13 +33,6 @@ int my_msync(int fd, void *addr, size_t len, int flags) static SECURITY_ATTRIBUTES mmap_security_attributes= {sizeof(SECURITY_ATTRIBUTES), 0, TRUE}; -int my_getpagesize(void) -{ - SYSTEM_INFO si; - GetSystemInfo(&si); - return si.dwPageSize; -} - void *my_mmap(void *addr, size_t len, int prot, int flags, int fd, my_off_t offset) { From 8f85eaf925cc8c8cf33704c955c543f0de156c43 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 23 Nov 2006 17:26:06 +0100 Subject: [PATCH 08/13] Remove duplicate "$report_features" --- mysql-test/mysql-test-run.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 3c855fb0499..e7d269e143b 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -223,9 +223,8 @@ our $opt_ndbcluster_port_slave; our $opt_ndbconnectstring_slave; our $opt_record; -our $opt_report_features; +my $opt_report_features; our $opt_check_testcases; -my $opt_report_features; our $opt_skip; our $opt_skip_rpl; From cdbc79b500af5e24eff8781e695a981b22956c19 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 23 Nov 2006 17:30:32 +0100 Subject: [PATCH 09/13] Make source_dist a "local" global variable And it's not an "opt" --- mysql-test/mysql-test-run.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 9b1dc1c9c0a..aa650d3bf02 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -238,8 +238,6 @@ our $opt_suite_timeout; my $default_testcase_timeout= 15; # 15 min max my $default_suite_timeout= 180; # 3 hours max -our $opt_source_dist; - our $opt_start_and_exit; our $opt_start_dirty; our $opt_start_from; @@ -299,6 +297,8 @@ our $glob_tot_real_time= 0; our %mysqld_variables; +my $source_dist= 0; + ###################################################################### # @@ -627,7 +627,7 @@ sub command_line_setup () { if ( -d "../sql" ) { - $opt_source_dist= 1; + $source_dist= 1; } $glob_hostname= mtr_short_hostname(); @@ -647,7 +647,7 @@ sub command_line_setup () { unless defined $glob_mysql_bench_dir; $path_my_basedir= - $opt_source_dist ? $glob_mysql_test_dir : $glob_basedir; + $source_dist ? $glob_mysql_test_dir : $glob_basedir; $glob_timers= mtr_init_timers(); @@ -901,7 +901,7 @@ sub command_line_setup () { # -------------------------------------------------------------------------- # Gcov flag # -------------------------------------------------------------------------- - if ( $opt_gcov and ! $opt_source_dist ) + if ( $opt_gcov and ! $source_dist ) { mtr_error("Coverage test needs the source - please use source dist"); } @@ -1526,7 +1526,7 @@ sub environment_setup () { # Setup LD_LIBRARY_PATH so the libraries from this distro/clone # are used in favor of the system installed ones # -------------------------------------------------------------------------- - if ( $opt_source_dist ) + if ( $source_dist ) { push(@ld_library_paths, "$glob_basedir/libmysql/.libs/", "$glob_basedir/libmysql_r/.libs/"); From c99678df03090bb2e9672c374934d44ca9304860 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 23 Nov 2006 20:07:53 +0100 Subject: [PATCH 10/13] Fix netware compile failure Remove other warnings about unused variables --- sql/udf_example.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sql/udf_example.c b/sql/udf_example.c index a4f7eddd302..bbab47e253d 100644 --- a/sql/udf_example.c +++ b/sql/udf_example.c @@ -1087,12 +1087,13 @@ my_bool is_const_init(UDF_INIT *initid, UDF_ARGS *args, char *message) strmov(message, "IS_CONST accepts only one argument"); return 1; } - initid->ptr= (args->args[0] != NULL) ? 1 : 0; + initid->ptr= (char*)((args->args[0] != NULL) ? 1 : 0); return 0; } -char * is_const(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long - *length, char *is_null, char *error) +char * is_const(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)), + char *result, unsigned long *length, + char *is_null, char *error __attribute__((unused))) { if (initid->ptr != 0) { sprintf(result, "const"); From 91c3698aba896e78a5377fbd9b274ab352347f92 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 23 Nov 2006 20:08:48 +0100 Subject: [PATCH 11/13] Convert one more opt_source_dist --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 47fc6dca2fd..df22143e08d 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -658,7 +658,7 @@ sub command_line_setup () { # directory. And we install "/usr/share/mysql-test". Moving up one # more directory relative to "mysql-test" gives us a usable base # directory for RPM installs. - if ( ! $opt_source_dist and ! -d "$glob_basedir/bin" ) + if ( ! $source_dist and ! -d "$glob_basedir/bin" ) { $glob_basedir= dirname($glob_basedir); } From c4af2f26a7ff976973de6b21c4bd22fe67306045 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 23 Nov 2006 21:07:41 +0100 Subject: [PATCH 12/13] Add mysys/my_getpagesize.c as source file for mysql_upgrade --- client/CMakeLists.txt | 2 +- client/Makefile.am | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 09a6a3f1e2a..d37d99ad479 100755 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -66,7 +66,7 @@ TARGET_LINK_LIBRARIES(mysqldump mysqlclient mysys dbug yassl taocrypt zlib wsock ADD_EXECUTABLE(mysqlimport mysqlimport.c) TARGET_LINK_LIBRARIES(mysqlimport mysqlclient mysys dbug yassl taocrypt zlib wsock32) -ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c) +ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c ../mysys/my_getpagesize.c) TARGET_LINK_LIBRARIES(mysql_upgrade mysqlclient mysys dbug yassl taocrypt zlib wsock32) ADD_EXECUTABLE(mysqlshow mysqlshow.c) diff --git a/client/Makefile.am b/client/Makefile.am index df6e38223d4..db578b05da4 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -49,7 +49,8 @@ mysqlshow_SOURCES= mysqlshow.c mysqldump_SOURCES= mysqldump.c my_user.c \ $(top_srcdir)/mysys/mf_getdate.c mysqlimport_SOURCES= mysqlimport.c -mysql_upgrade_SOURCES= mysql_upgrade.c +mysql_upgrade_SOURCES= mysql_upgrade.c \ + $(top_srcdir)/mysys/my_getpagesize.c sql_src=log_event.h mysql_priv.h log_event.cc my_decimal.h my_decimal.cc strings_src=decimal.c From d4d675a6e2b68d7a988f9c81b0333e42821ff11f Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 23 Nov 2006 21:12:50 +0100 Subject: [PATCH 13/13] mysql_fix_priviileg_tables.sql might be in share/ but not in $path_share since that is where the lang files etc are --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index df22143e08d..c9dcd75415c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1443,7 +1443,7 @@ sub executable_setup () { # Look for mysql_fix_privilege_tables.sql script $file_mysql_fix_privilege_tables= mtr_file_exists("$glob_basedir/scripts/mysql_fix_privilege_tables.sql", - "$path_share/mysql_fix_privilege_tables.sql"); + "$glob_basedir/share/mysql_fix_privilege_tables.sql"); if ( ! $opt_skip_ndbcluster and executable_setup_ndb()) {