diff options
79 files changed, 9515 insertions, 8645 deletions
diff --git a/000_index.txt b/000_index.txt new file mode 100644 index 0000000..68a5aba --- /dev/null +++ b/000_index.txt @@ -0,0 +1,288 @@ +@patch 010_all_mysql-4.0-my-print-defaults.patch +@ver 4.00.00.00 to 4.00.26.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ /etc => /etc/mysql + +@patch 010_all_default-dir-4.0.27.patch +@ver 4.00.27.00 to 4.00.27.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ /etc => /etc/mysql + +@patch 010_all_default-dir-4.0.28.patch +@ver 4.00.28.00 to 4.00.99.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ /etc => /etc/mysql + +@patch 010_all_default-dir-4.1.15.patch +@ver 4.01.15.00 to 4.01.99.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ Move config directory to the gentoo default + +@patch 010_all_default-dir-5.0.19.patch +@ver 5.00.19.00 to 5.00.19.99 +@ver 5.01.07.00 to 5.01.09.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ upstream http://lists.mysql.com/commits/3885?f=plain +@@ fix MySQL Bug#15069 +@@ does not fix gentoo Bug#126054 + +@patch 020_all_gentoo-nptl-4.0.18.patch +@ver 4.00.18.00 to 4.00.27.99 +@ver 4.01.00.00 to 4.01.11.99 +@ver 5.00.00.00 to 5.00.03.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ Add support for NPTL + +@patch 030_all_thrssl-4.0.patch +@ver 4.00.00.00 to 4.00.27.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ Link libmysqlclient_r against ssl +# attempt to get libmysqlclient_r linked against ssl if USE="ssl" enabled +# i would really prefer to fix this at the Makefile.am level, but can't +# get the software to autoreconf as distributed - too many missing files + +@patch 030_all_thrssl-4.0.28.patch +@ver 4.00.28.00 to 4.00.99.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ Link libmysqlclient_r against ssl +# attempt to get libmysqlclient_r linked against ssl if USE="ssl" enabled +# i would really prefer to fix this at the Makefile.am level, but can't +# get the software to autoreconf as distributed - too many missing files + +@patch 030_all_thrssl-4.1.21.patch +@ver 4.01.21.00 to 4.01.22.99 +@ver 5.00.00.00 to 5.00.04.00 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ Link libmysqlclient_r against ssl + +@patch 030_all_thrssl-4.1.23.patch +@ver 4.01.23.00 to 4.01.99.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ Link libmysqlclient_r against ssl + +@patch 035_x86_asm-pic-fixes-4.0.27.patch +@ver 4.00.25.00 to 4.00.99.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ remove page relocations +@@ _many_ thanks to pageexec@freemail.hu + +@patch 035_x86_asm-pic-fixes-4.1.12.patch +@ver 4.01.12.00 to 4.01.99.99 +@ver 5.00.12.00 to 5.00.99.99 +@ver 5.01.00.00 to 5.01.10.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ remove page relocations +@@ Most part of the original patch has already been accepted by MysQL, +@@ here is the remaining. +@@ _many_ thanks to pageexec@freemail.hu + +@patch 040_all_tcpd-vars-fix-4.0.14.patch +@ver 4.00.14.00 to 4.01.99.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted + +@patch 060_all_nisam_maykeylen-4.0.27.patch +@ver 4.00.00.00 to 4.00.99.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ Enlarge max key lenght + +@patch 080_all_slot_script-4.0.patch +@ver 4.00.26.00 to 4.00.99.99 +@pn mysql-slotted +@@ add slot MySQL support to scripts utilities + +@patch 080_all_slot_script-4.1.16.patch +@ver 4.01.16.00 to 4.01.22.99 +@pn mysql-slotted +@@ add slot MySQL support to scripts utilities + +@patch 080_all_slot_script-4.1.23.patch +@ver 4.01.23.00 to 4.01.99.99 +@pn mysql-slotted +@@ add slot MySQL support to scripts utilities + +@patch 080_all_slot_script-5.0.17.patch +@ver 5.01.00.00 to 5.01.08.99 +@ver 5.00.17.00 to 5.00.20.99 +@pn mysql-slotted +@@ add slot MySQL support to scripts utilities + +@patch 080_all_slot_script-5.0.21.patch +@ver 5.00.21.00 to 5.00.33.99 +@pn mysql-slotted +@@ add slot MySQL support to scripts utilities + +@patch 080_all_slot_script-5.0.34.patch +@ver 5.00.34.00 to 5.00.99.99 +@pn mysql-slotted +@@ add slot MySQL support to scripts utilities + +@patch 080_all_slot_script-5.1.10.patch +@ver 5.01.09.00 to 5.01.11.99 +@pn mysql-slotted +@@ add slot MySQL support to scripts utilities + +@patch 080_all_slot_script-5.1.12.patch +@ver 5.01.12.00 to 5.01.13.99 +@pn mysql-slotted +@@ add slot MySQL support to scripts utilities + +@patch 080_all_slot_script-5.1.14.patch +@ver 5.01.14.00 to 5.01.14.99 +@pn mysql-slotted +@@ add slot MySQL support to scripts utilities + +@patch 080_all_slot_script-5.1.15.patch +@ver 5.01.15.00 to 5.01.99.99 +@pn mysql-slotted +@@ add slot MySQL support to scripts utilities + +@patch 081_all_slot_manager-5.0.19.patch +@ver 5.00.19.00 to 5.00.99.99 +@pn mysql-slotted +@@ add slot support for mysqlmanager + +@patch 081_all_slot_manager-5.1.7.patch +@ver 5.01.07.00 to 5.01.08.99 +@pn mysql-slotted +@@ add slot support for mysqlmanager + +@patch 081_all_slot_manager-5.1.10.patch +@ver 5.01.09.00 to 5.01.99.99 +@pn mysql-slotted +@@ add slot support for mysqlmanager + +@patch 100_all_bug23427-abi-breakage-5.0.26.patch +@ver 5.00.26.00 to 5.00.26.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ Fix MySQL bug #23427 + +@patch 101_all_bootstrap_no_plugin.patch +@ver 5.01.13.00 to 5.01.99.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ prevent loading of modules from plugin table when in bootstrap mode +@@ Thanks solar, bug #158777 + +@patch 200_all_query-logging-bypass-4.1.19.patch +@ver 4.01.14.00 to 4.01.99.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ Fix bug #128713 +@@ dev-db/mysql: Query Logging Bypass Vulnerability (CVE-2006-0903) + +@patch 200_all_query-logging-bypass-5.0.21.patch +@ver 5.00.00.00 to 5.00.23.99 +@ver 5.01.00.00 to 5.01.10.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ Fix bug #128713 +@@ dev-db/mysql: Query Logging Bypass Vulnerability (CVE-2006-0903) + +@patch 400_all_mysqld-safe-sh-4.0.27.patch +@ver 4.00.00.00 to 4.00.99.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ Change paths detection in mysqld_safe + +@patch 401_all_install-db-sh-4.0.27.patch +@ver 4.00.00.00 to 4.00.99.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ Change an output comment in mysql_install_db + +@patch 700_all_mysqldump-missing-cfgfile-fix-4.1.21.patch +@ver 4.01.21.00 to 4.01.99.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ Add configuration section for mysqldump + +@patch 701_all_rpl000015-portsobst-fix-4.1.21.patch +@ver 4.01.21.00 to 4.01.22.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ normalize port 3306 in tests + +@patch 701_all_rpl000015-portsobst-fix-4.1.23.patch +@ver 4.01.23.00 to 4.01.99.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ normalize port 3306 in tests + +@patch 701_all_rpl000015-portsobst-fix-5.0.26.patch +@ver 5.00.26.00 to 5.00.31.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ normalize port 3306 in tests + +@patch 702_all_trigger-rename-fail-as-root-5.0.26.patch +@ver 5.00.26.00 to 5.00.99.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ portage normally ran as root, MySQL tests are designed to be used +@@ with lower priviledges + +@patch 703_all_test-rpl_rotate_logs-5.0.21.patch +@ver 5.00.26.00 to 5.00.99.99 +@ver 5.01.00.00 to 5.01.99.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted + +@patch 704_all_disable_mybug_9735_test.patch +@ver 5.00.26.00 to 5.00.99.99 +@ver 5.01.00.00 to 5.01.99.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ disable a test that fail on longtext field lenght, the expected value is +@@ three times the returned one, look like a multibyte character related +@@ failure. + +@patch 705_all_we-are-in-2007-now.patch +@ver 5.00.26.00 to 5.00.30.99 +@ver 5.01.14.00 to 5.01.14.99 +@pn mysql +@pn mysql-community +@pn mysql-slotted +@@ the view.test is year dependant + diff --git a/005_all_tmp-5.1.patch b/005_all_tmp-5.1.patch deleted file mode 100644 index 6694c55..0000000 --- a/005_all_tmp-5.1.patch +++ /dev/null @@ -1,11 +0,0 @@ -###MY_VER_RANGE [5.1.0_alpha,mysql-5.1.0_alpha20050606) ---- mysql-5.1.0-alpha-nightly-20050531/sql/Makefile.am 2005-05-31 08:39:53.000000000 +0200 -+++ mysql-5.1.0-bitvector/sql/Makefile.am 2005-06-02 13:15:49.000000000 +0200 -@@ -91,7 +91,6 @@ - sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \ - slave.cc sql_repl.cc rpl_filter.cc \ - sql_union.cc sql_derived.cc \ -- bitvector.cc \ - client.c sql_client.cc mini_client_errors.c pack.c\ - stacktrace.c repl_failsafe.h repl_failsafe.cc \ - sql_olap.cc sql_view.cc \ diff --git a/010_all_default-dir-4.0.27.patch b/010_all_default-dir-4.0.27.patch new file mode 100644 index 0000000..20cebce --- /dev/null +++ b/010_all_default-dir-4.0.27.patch @@ -0,0 +1,10 @@ +--- mysql.orig/mysys/default.c 2006-04-18 00:03:34.000000000 +0200 ++++ mysql.fixed/mysys/default.c 2006-04-18 00:03:50.000000000 +0200 +@@ -50,6 +50,7 @@ + #else + "/etc/", + #endif ++"/etc/mysql/", + #ifdef DATADIR + DATADIR, + #endif diff --git a/010_all_default-dir-4.0.28.patch b/010_all_default-dir-4.0.28.patch new file mode 100644 index 0000000..7733a9c --- /dev/null +++ b/010_all_default-dir-4.0.28.patch @@ -0,0 +1,11 @@ +--- mysql-4.0.18-bk-20070101/mysys/default.c 2007-01-01 21:19:15.000000000 +0100 ++++ mysql-4.0.18-bk-20070101.orig/mysys/default.c 2007-01-01 20:46:31.000000000 +0100 +@@ -48,7 +48,7 @@ + #elif defined(__NETWARE__) + "sys:/etc/", + #else +-"/etc/", ++"/etc/mysql/", + #endif + #ifdef DATADIR + DATADIR, diff --git a/010_all_default-dir-4.1.15.patch b/010_all_default-dir-4.1.15.patch new file mode 100644 index 0000000..7d8124f --- /dev/null +++ b/010_all_default-dir-4.1.15.patch @@ -0,0 +1,38 @@ +diff -Naur -Naur mysql-4.1.18.orig/libmysql/Makefile.shared mysql-4.1.18.new/libmysql/Makefile.shared +--- mysql-4.1.18.orig/libmysql/Makefile.shared 2006-01-27 16:26:16.000000000 +0000 ++++ mysql-4.1.18.new/libmysql/Makefile.shared 2006-04-10 17:36:35.000000000 +0000 +@@ -81,7 +81,8 @@ + $(target) + DEFS = -DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \ + -DDATADIR="\"$(MYSQLDATAdir)\"" \ +- -DSHAREDIR="\"$(MYSQLSHAREdir)\"" $(target_defs) ++ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \ ++ -DDEFAULT_SYSCONFDIR="\"$(sysconfdir)\"" $(target_defs) + + # The automatic dependencies miss this + #bmove_upp.lo: $(LTCHARSET_OBJS) +diff -Naur -Naur mysql-4.1.18.orig/mysys/default.c mysql-4.1.18.new/mysys/default.c +--- mysql-4.1.18.orig/mysys/default.c 2006-01-27 16:26:04.000000000 +0000 ++++ mysql-4.1.18.new/mysys/default.c 2006-04-10 18:51:43.000000000 +0000 +@@ -43,7 +43,9 @@ + /* Which directories are searched for options (and in which order) */ + + const char *default_directories[]= { +-#ifdef __WIN__ ++#ifdef DEFAULT_SYSCONFDIR ++DEFAULT_SYSCONFDIR, ++#elif defined(__WIN__) + "C:/", + #elif defined(__NETWARE__) + "sys:/etc/", +diff -Naur -Naur mysql-4.1.18.orig/mysys/Makefile.am mysql-4.1.18.new/mysys/Makefile.am +--- mysql-4.1.18.orig/mysys/Makefile.am 2006-01-27 16:26:26.000000000 +0000 ++++ mysql-4.1.18.new/mysys/Makefile.am 2006-04-10 17:35:42.000000000 +0000 +@@ -68,6 +68,7 @@ + -DDATADIR="\"$(MYSQLDATAdir)\"" \ + -DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \ + -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \ ++ -DDEFAULT_SYSCONFDIR="\"$(sysconfdir)\"" \ + @DEFS@ + + libmysys_a_DEPENDENCIES= @THREAD_LOBJECTS@ diff --git a/010_all_default-dir-5.0.19.patch b/010_all_default-dir-5.0.19.patch new file mode 100644 index 0000000..16fbcb7 --- /dev/null +++ b/010_all_default-dir-5.0.19.patch @@ -0,0 +1,111 @@ +From: msvensson at mysql dot com +Date: April 10 2006 3:11pm +Subject: bk commit into 5.0 tree (msvensson:1.2086) BUG#15069 + +Below is the list of changes that have just been committed into a local +5.0 repository of msvensson. When msvensson 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 + 1.2086 06/04/10 15:11:37 msvensson@shellback.(none) +3 -0 + Bug#15069 [patch] my_print_defaults does'nt care --sysconfdir + - Grab the path from "configure --sysconfdir=<path>" and set it as + the first place to look for my.cnf files + Do this both in Makefiles for libmysql and mysys + - Patch provided by Francesco Riosa. Thank you! + + mysys/default.c + 1.81 06/04/10 15:11:32 msvensson@shellback.(none) +9 -1 + Use DEFAULT_SYSCONFDIR as first place to look for my.cnf file if "--sysconfdir=<path>" been specified as argument to configure + + mysys/Makefile.am + 1.68 06/04/10 15:11:32 msvensson@shellback.(none) +1 -0 + Grab the path from "--sysconfdir=<path>" into the defined variable DEFAULT_SYSYCONFDIR + + libmysql/Makefile.shared + 1.67 06/04/10 15:11:32 msvensson@shellback.(none) +1 -0 + Grab the path from "--sysconfdir=<path>" into the defined variable DEFAULT_SYSYCONFDIR + +# 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: msvensson +# Host: shellback.(none) +# Root: /home/msvensson/mysql/bug15069/my50-bug15069 + +--- 1.67/mysys/Makefile.am 2005-10-14 01:13:55 +02:00 ++++ 1.68/mysys/Makefile.am 2006-04-10 15:11:32 +02:00 +@@ -70,6 +70,7 @@ + -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \ + -DDEFAULT_HOME_ENV=MYSQL_HOME \ + -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX \ ++ -DDEFAULT_SYSCONFDIR="\"$(sysconfdir)\"" \ + @DEFS@ + + libmysys_a_DEPENDENCIES= @THREAD_LOBJECTS@ + +--- 1.80/mysys/default.c 2005-09-30 12:25:36 +02:00 ++++ 1.81/mysys/default.c 2006-04-10 15:11:32 +02:00 +@@ -48,7 +48,7 @@ + + /* Which directories are searched for options (and in which order) */ + +-#define MAX_DEFAULT_DIRS 6 ++#define MAX_DEFAULT_DIRS 7 + const char *default_directories[MAX_DEFAULT_DIRS + 1]; + + #ifdef __WIN__ +@@ -959,11 +959,13 @@ + 4. getenv(DEFAULT_HOME_ENV) + 5. Directory above where the executable is located + 6. "" ++ 7. --sysconfdir=<path> + + On Novell NetWare, this is: + 1. sys:/etc/ + 2. getenv(DEFAULT_HOME_ENV) + 3. "" ++ 4. --sysconfdir=<path> + + On OS/2, this is: + 1. getenv(ETC) +@@ -971,12 +973,14 @@ + 3. getenv(DEFAULT_HOME_ENV) + 4. "" + 5. "~/" ++ 6. --sysconfdir=<path> + + Everywhere else, this is: + 1. /etc/ + 2. getenv(DEFAULT_HOME_ENV) + 3. "" + 4. "~/" ++ 5. --sysconfdir=<path> + + */ + +@@ -1040,6 +1044,10 @@ + } + *ptr++= (char *)&config_dir; + } ++#endif ++#ifdef DEFAULT_SYSCONFDIR ++ if (DEFAULT_SYSCONFDIR != "") ++ *ptr++= DEFAULT_SYSCONFDIR; + #endif + *ptr= 0; /* end marker */ + } + +--- 1.66/libmysql/Makefile.shared 2006-01-18 13:09:42 +01:00 ++++ 1.67/libmysql/Makefile.shared 2006-04-10 15:11:32 +02:00 +@@ -85,6 +85,7 @@ + -DDATADIR="\"$(MYSQLDATAdir)\"" \ + -DDEFAULT_HOME_ENV=MYSQL_HOME \ + -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX \ ++ -DDEFAULT_SYSCONFDIR="\"$(sysconfdir)\"" \ + -DSHAREDIR="\"$(MYSQLSHAREdir)\"" $(target_defs) + + # The automatic dependencies miss this diff --git a/010_all_my-print-defaults-r0.patch b/010_all_my-print-defaults-r0.patch deleted file mode 100644 index 890f3f8..0000000 --- a/010_all_my-print-defaults-r0.patch +++ /dev/null @@ -1,15 +0,0 @@ -###MY_VER_RANGE [4.0_alpha,5.0_alpha) [5.0_alpha,5.0.5_beta) - -# for correct hardcoded sysconf directory - ---- mysql-4.1.8/mysys/default.c 2004-12-14 13:40:36.000000000 +0100 -+++ bbb/mysys/default.c 2005-01-09 17:57:00.407231408 +0100 -@@ -48,7 +48,7 @@ - #elif defined(__NETWARE__) - "sys:/etc/", - #else --"/etc/", -+"/etc/mysql/", - #endif - #ifdef DATADIR - DATADIR, diff --git a/010_all_my-print-defaults-r1.patch b/010_all_my-print-defaults-r1.patch deleted file mode 100644 index 831e6c8..0000000 --- a/010_all_my-print-defaults-r1.patch +++ /dev/null @@ -1,29 +0,0 @@ -###MY_VER_RANGE [5.0.5_beta,5.0.6_beta) -+++ mysql/mysys/default.c 2005-05-09 14:29:29.783506560 +0200 -@@ -844,25 +844,8 @@ - { - const char *env, **ptr= default_directories; - --#ifdef __WIN__ -- *ptr++= "C:/"; -+ *ptr++= "/etc/mysql/"; - -- if (GetWindowsDirectory(system_dir,sizeof(system_dir))) -- *ptr++= &system_dir; -- /* Only add shared system directory if different from default. */ -- if (GetSystemWindowsDirectory(shared_system_dir,sizeof(shared_system_dir)) && -- strcmp(system_dir, shared_system_dir)) -- *ptr++= &shared_system_dir; -- --#elif defined(__NETWARE__) -- *ptr++= "sys:/etc/"; --#else --#if defined(__EMX__) || defined(OS2) -- if ((env= getenv("ETC"))) -- *ptr++= env; --#endif -- *ptr++= "/etc/"; --#endif - if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV)))) - *ptr++= env; - *ptr++= ""; /* Place for defaults_extra_file */ diff --git a/010_all_my-print-defaults-r2.patch b/010_all_my-print-defaults-r2.patch deleted file mode 100644 index 656930d..0000000 --- a/010_all_my-print-defaults-r2.patch +++ /dev/null @@ -1,42 +0,0 @@ -###MY_VER_RANGE [5.0.6_beta,) ---- mysql.old/mysys/default.c 2005-05-22 02:35:25.000000000 +0200 -+++ mysql/mysys/default.c 2005-05-22 02:36:17.000000000 +0200 -@@ -823,19 +823,19 @@ - 5. "" - - On Novell NetWare, this is: -- 1. sys:/etc/ -+ 1. sys:/etc/mysql/ - 2. getenv(DEFAULT_HOME_ENV) - 3. "" - - On OS/2, this is: - 1. getenv(ETC) -- 2. /etc/ -+ 2. /etc/mysql/ - 3. getenv(DEFAULT_HOME_ENV) - 4. "" - 5. "~/" - - Everywhere else, this is: -- 1. /etc/ -+ 1. /etc/mysql/ - 2. getenv(DEFAULT_HOME_ENV) - 3. "" - 4. "~/" -@@ -860,13 +860,13 @@ - #endif - - #elif defined(__NETWARE__) -- *ptr++= "sys:/etc/"; -+ *ptr++= "sys:/etc/mysql/"; - #else - #if defined(__EMX__) || defined(OS2) - if ((env= getenv("ETC"))) - *ptr++= env; - #endif -- *ptr++= "/etc/"; -+ *ptr++= "/etc/mysql/"; - #endif - if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV)))) - *ptr++= env; diff --git a/mysql-4.0-my-print-defaults.diff b/010_all_mysql-4.0-my-print-defaults.patch index b086563..b086563 100644 --- a/mysql-4.0-my-print-defaults.diff +++ b/010_all_mysql-4.0-my-print-defaults.patch diff --git a/020_all_gentoo-nptl.patch b/020_all_gentoo-nptl-4.0.18.patch index 5fb1759..80f1235 100644 --- a/020_all_gentoo-nptl.patch +++ b/020_all_gentoo-nptl-4.0.18.patch @@ -1,7 +1,3 @@ -###MY_VER_RANGE [3,4) [4.0.18,4.1.12) [5.0.0_alpha,5.0.4_beta) - -# NPTL support - --- mysql-4.1.8/configure.in 2004-12-14 13:40:38.000000000 +0100 +++ bbb/configure.in 2005-01-09 17:57:57.451559352 +0100 @@ -1269,7 +1269,10 @@ diff --git a/030_all_thrssl-4.0.28.patch b/030_all_thrssl-4.0.28.patch new file mode 100644 index 0000000..5d8ac12 --- /dev/null +++ b/030_all_thrssl-4.0.28.patch @@ -0,0 +1,11 @@ +--- mysql-4.0.18-bk-20070101/libmysql_r/Makefile.am 2007-01-01 20:46:25.000000000 +0100 ++++ mysql-4.0.18-bk-20070101.new/libmysql_r/Makefile.am 2007-01-02 10:16:18.000000000 +0100 +@@ -22,7 +22,7 @@ + + target = libmysqlclient_r.la + target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@ +-LIBS = @LIBS@ @openssl_libs@ ++LIBS = @CLIENT_LIBS@ @openssl_libs@ + + INCLUDES = @MT_INCLUDES@ -I$(srcdir)/../include -I../include \ + -I$(srcdir)/.. -I$(top_srcdir) -I.. $(openssl_includes) diff --git a/mysql-4.0.21-thrssl.patch b/030_all_thrssl-4.0.patch index e180572..e180572 100644 --- a/mysql-4.0.21-thrssl.patch +++ b/030_all_thrssl-4.0.patch diff --git a/030_all_thrssl-4.1.21.patch b/030_all_thrssl-4.1.21.patch new file mode 100644 index 0000000..c6924d1 --- /dev/null +++ b/030_all_thrssl-4.1.21.patch @@ -0,0 +1,22 @@ +--- mysql-4.1.10/libmysql_r/Makefile.am 2005-08-17 19:06:38.000000000 +0200 ++++ mysql-4.1.10/libmysql_r/Makefile.am 2006-04-17 20:36:35.000000000 +0200 +@@ -22,7 +22,7 @@ + + target = libmysqlclient_r.la + target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@ +-LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@ ++LIBS = @CLIENT_LIBS@ @ZLIB_LIBS@ @openssl_libs@ + + INCLUDES = @MT_INCLUDES@ \ + -I$(top_builddir)/include -I$(top_srcdir)/include \ +--- mysql-4.1.10/libmysql_r/Makefile.in 2005-08-17 19:07:19.000000000 +0200 ++++ mysql-4.1.10/libmysql_r/Makefile.in 2006-04-17 20:36:35.000000000 +0200 +@@ -244,7 +244,7 @@ + LIBDL = @LIBDL@ + LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@ + LIBOBJS = @LIBOBJS@ +-LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@ ++LIBS = @CLIENT_LIBS@ @ZLIB_LIBS@ @openssl_libs@ + LIBTOOL = @LIBTOOL@ + LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@ + LM_CFLAGS = @LM_CFLAGS@ diff --git a/030_all_thrssl-4.1.23.patch b/030_all_thrssl-4.1.23.patch new file mode 100644 index 0000000..2123a27 --- /dev/null +++ b/030_all_thrssl-4.1.23.patch @@ -0,0 +1,11 @@ +--- mysql/libmysql_r/Makefile.am 2007-01-01 20:44:03.000000000 +0100 ++++ mysql.new/libmysql_r/Makefile.am 2007-01-02 10:38:08.000000000 +0100 +@@ -22,7 +22,7 @@ + + target = libmysqlclient_r.la + target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@ +-LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@ ++LIBS = @CLIENT_LIBS@ @ZLIB_LIBS@ @openssl_libs@ + + INCLUDES = @MT_INCLUDES@ \ + -I$(top_builddir)/include -I$(top_srcdir)/include \ diff --git a/030_all_thrssl-r1.patch b/030_all_thrssl-4.1.patch index adbd84d..2e6c893 100644 --- a/030_all_thrssl-r1.patch +++ b/030_all_thrssl-4.1.patch @@ -1,18 +1,12 @@ -###MY_VER_RANGE [4.1.11_alpha20050215,5.0_alpha) [5.0.3_alpha,5.0.4_beta) - -# attempt to get libmysqlclient_r linked against ssl if USE="ssl" enabled -# i would really prefer to fix this at the Makefile.am level, but can't -# get the software to autoreconf as distributed - too many missing files - --- mysql-4.1.11_alpha20050216.orig/libmysql_r/Makefile.am 2005-02-19 15:58:34.000000000 +0100 +++ mysql-4.1.10/libmysql_r/Makefile.am 2005-02-19 15:59:02.000000000 +0100 @@ -22,7 +22,7 @@ - + target = libmysqlclient_r.la target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@ -LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@ +LIBS = @CLIENT_LIBS@ @ZLIB_LIBS@ @openssl_libs@ - + INCLUDES = @MT_INCLUDES@ \ -I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@ --- mysql-4.1.11_alpha20050216.orig/libmysql_r/Makefile.in 2005-02-19 15:58:34.000000000 +0100 diff --git a/030_all_thrssl-r0.patch b/030_all_thrssl-r0.patch deleted file mode 100644 index a4db917..0000000 --- a/030_all_thrssl-r0.patch +++ /dev/null @@ -1,17 +0,0 @@ -###MY_VER_RANGE [4.0.21,4.1.11_alpha20050215) [5.0_alpha,5.0.3_alpha) - -# attempt to get libmysqlclient_r linked against ssl if USE="ssl" enabled -# i would really prefer to fix this at the Makefile.am level, but can't -# get the software to autoreconf as distributed - too many missing files - ---- mysql-4.1.8/libmysql_r/Makefile.in 2004-12-14 13:41:13.000000000 +0100 -+++ bbb/libmysql_r/Makefile.in 2005-01-09 17:57:27.156164952 +0100 -@@ -242,7 +242,7 @@ - LIBDL = @LIBDL@ - LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@ - LIBOBJS = @LIBOBJS@ --LIBS = @LIBS@ @openssl_libs@ -+LIBS = @CLIENT_LIBS@ @openssl_libs@ - LIBTOOL = @LIBTOOL@ - LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@ - LM_CFLAGS = @LM_CFLAGS@ diff --git a/mysql-4.0.25-r2-asm-pic-fixes.patch b/035_x86_asm-pic-fixes-4.0.27.patch index 48e5517..48e5517 100644 --- a/mysql-4.0.25-r2-asm-pic-fixes.patch +++ b/035_x86_asm-pic-fixes-4.0.27.patch diff --git a/035_x86_asm-pic-fixes-r7.patch b/035_x86_asm-pic-fixes-4.1.12.patch index d7d2b58..a6de190 100644 --- a/035_x86_asm-pic-fixes-r7.patch +++ b/035_x86_asm-pic-fixes-4.1.12.patch @@ -1,10 +1,8 @@ -###MY_VER_RANGE [5.0.12_beta,5.0.12_beta] - diff -Naur mysql.old/strings/longlong2str-x86.s mysql.new/strings/longlong2str-x86.s --- mysql.old/strings/longlong2str-x86.s 2005-08-27 22:33:11.000000000 +0200 +++ mysql.new/strings/longlong2str-x86.s 2005-09-05 18:46:04.000000000 +0200 @@ -222,3 +222,6 @@ - + .L10end: .size longlong10_to_str,.L10end-longlong10_to_str + diff --git a/035_x86_asm-pic-fixes-r0.patch b/035_x86_asm-pic-fixes-r0.patch deleted file mode 100644 index 300756f..0000000 --- a/035_x86_asm-pic-fixes-r0.patch +++ /dev/null @@ -1,99 +0,0 @@ -###MY_VER_RANGE [4.0.24,4.1_alpha) ---- mysql-4.0.24/strings/longlong2str-x86.s 2005-03-05 00:38:14.000000000 +0000 -+++ mysql-4.0.24-fixed/strings/longlong2str-x86.s 2005-05-17 01:37:52.000000000 +0100 -@@ -19,6 +19,13 @@ - .file "longlong2str.s" - .version "1.01" - -+ .section .rodata -+ .align 32 -+ .type _dig_vec, @object -+ .size _dig_vec, 37 -+_dig_vec: -+ .string "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" -+ - .text - .align 4 - -@@ -31,11 +38,14 @@ longlong2str: - pushl %esi - pushl %edi - pushl %ebx -+ -+ call __i686.get_pc_thunk.bx -+ addl $_GLOBAL_OFFSET_TABLE_,%ebx -+ - movl 100(%esp),%esi # Lower part of val - movl 104(%esp),%ebp # Higher part of val - movl 108(%esp),%edi # get dst -- movl 112(%esp),%ebx # Radix -- movl %ebx,%eax -+ movl 112(%esp),%eax # Radix - testl %eax,%eax - jge .L144 - -@@ -50,7 +60,7 @@ longlong2str: - adcl $0,%ebp - negl %ebp - .L146: -- negl %ebx # Change radix to positive -+ negl 112(%esp) # Change radix to positive - jmp .L148 - .align 4 - .L144: -@@ -77,12 +87,12 @@ longlong2str: - - movl %ebp,%eax # High part of value - xorl %edx,%edx -- divl %ebx -+ divl 112(%esp) - movl %eax,%ebp - movl %esi,%eax -- divl %ebx -+ divl 112(%esp) - movl %eax,%esi # quotent in ebp:esi -- movb _dig_vec(%edx),%al # al is faster than dl -+ movb _dig_vec@GOTOFF(%ebx,%edx),%al # al is faster than dl - decl %ecx - movb %al,(%ecx) # store value in buff - .align 4 -@@ -93,14 +103,13 @@ longlong2str: - jl .L153 - je .L160 # Ready - movl %esi,%eax -- movl $_dig_vec,%ebp - .align 4 - - .L154: # Do rest with integer precision - cltd -- divl %ebx -+ divl 112(%esp) - decl %ecx -- movb (%edx,%ebp),%dl # bh is always zero as ebx=radix < 36 -+ movb _dig_vec@GOTOFF(%ebx,%edx),%dl - testl %eax,%eax - movb %dl,(%ecx) - jne .L154 -@@ -138,3 +147,13 @@ longlong10_to_str: - - .L10end: - .size longlong10_to_str,.L10end-longlong10_to_str -+ -+ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits -+.globl __i686.get_pc_thunk.bx -+ .hidden __i686.get_pc_thunk.bx -+ .type __i686.get_pc_thunk.bx, @function -+__i686.get_pc_thunk.bx: -+ movl (%esp), %ebx -+ ret -+ -+ .section .note.GNU-stack,"",@progbits -diff -Nurp mysql-4.0.24/strings/strings-x86.s mysql-4.0.24-fixed/strings/strings-x86.s ---- mysql-4.0.24/strings/strings-x86.s 2005-03-05 00:38:15.000000000 +0000 -+++ mysql-4.0.24-fixed/strings/strings-x86.s 2005-05-17 01:37:47.000000000 +0100 -@@ -403,3 +403,5 @@ next_str: - ret - .strxmov_end: - .size strxmov,.strxmov_end-strxmov -+ -+ .section .note.GNU-stack,"",@progbits diff --git a/035_x86_asm-pic-fixes-r1.patch b/035_x86_asm-pic-fixes-r1.patch deleted file mode 100644 index 6d6293d..0000000 --- a/035_x86_asm-pic-fixes-r1.patch +++ /dev/null @@ -1,159 +0,0 @@ -###MY_VER_RANGE [4.1,4.1.13-r1) -diff -Nurp mysql/strings/longlong2str-x86.s mysql-fixed/strings/longlong2str-x86.s ---- mysql/strings/longlong2str-x86.s 2005-05-13 12:32:11.000000000 +0100 -+++ mysql-fixed/strings/longlong2str-x86.s 2005-05-25 01:19:32.000000000 +0100 -@@ -19,6 +19,13 @@ - .file "longlong2str.s" - .version "1.01" - -+ .section .rodata -+ .align 32 -+ .type _dig_vec_upper, @object -+ .size _dig_vec_upper, 37 -+_dig_vec_upper: -+ .string "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" -+ - .text - .align 4 - -@@ -31,11 +38,14 @@ longlong2str: - pushl %esi - pushl %edi - pushl %ebx -+ -+ call __i686.get_pc_thunk.bx -+ addl $_GLOBAL_OFFSET_TABLE_,%ebx -+ - movl 100(%esp),%esi # Lower part of val - movl 104(%esp),%ebp # Higher part of val - movl 108(%esp),%edi # get dst -- movl 112(%esp),%ebx # Radix -- movl %ebx,%eax -+ movl 112(%esp),%eax # Radix - testl %eax,%eax - jge .L144 - -@@ -50,7 +60,7 @@ longlong2str: - adcl $0,%ebp - negl %ebp - .L146: -- negl %ebx # Change radix to positive -+ negl 112(%esp) # Change radix to positive - jmp .L148 - .align 4 - .L144: -@@ -77,13 +87,13 @@ longlong2str: - - movl %ebp,%eax # High part of value - xorl %edx,%edx -- divl %ebx -+ divl 112(%esp) - movl %eax,%ebp - movl %esi,%eax -- divl %ebx -+ divl 112(%esp) - decl %ecx - movl %eax,%esi # quotent in ebp:esi -- movb _dig_vec_upper(%edx),%al # al is faster than dl -+ movb _dig_vec_upper@GOTOFF(%ebx,%edx),%al # al is faster than dl - movb %al,(%ecx) # store value in buff - .align 4 - .L155: -@@ -93,14 +103,13 @@ longlong2str: - jl .L153 - je .L10_mov # Ready - movl %esi,%eax -- movl $_dig_vec_upper,%ebp - .align 4 - - .L154: # Do rest with integer precision - cltd -- divl %ebx -+ divl 112(%esp) - decl %ecx -- movb (%edx,%ebp),%dl # bh is always zero as ebx=radix < 36 -+ movb _dig_vec_upper@GOTOFF(%ebx,%edx),%dl - testl %eax,%eax - movb %dl,(%ecx) - jne .L154 -@@ -137,9 +146,6 @@ longlong2str: - # - - .align 4 --.Ltmp: -- .long 0xcccccccd -- .align 4 - - .globl longlong10_to_str - .type longlong10_to_str,@function -@@ -202,7 +208,7 @@ longlong10_to_str: - - # The following code uses some tricks to change division by 10 to - # multiplication and shifts -- movl .Ltmp,%esi # set %esi to 0xcccccccd -+ movl $0xcccccccd,%esi # set %esi to 0xcccccccd - - .L10_40: - movl %ebx,%eax -@@ -221,3 +227,13 @@ longlong10_to_str: - - .L10end: - .size longlong10_to_str,.L10end-longlong10_to_str -+ -+ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits -+.globl __i686.get_pc_thunk.bx -+ .hidden __i686.get_pc_thunk.bx -+ .type __i686.get_pc_thunk.bx, @function -+__i686.get_pc_thunk.bx: -+ movl (%esp), %ebx -+ ret -+ -+ .section .note.GNU-stack,"",@progbits -diff -Nurp mysql/strings/my_strtoll10-x86.s mysql-fixed/strings/my_strtoll10-x86.s ---- mysql/strings/my_strtoll10-x86.s 2005-05-13 12:32:22.000000000 +0100 -+++ mysql-fixed/strings/my_strtoll10-x86.s 2005-05-25 01:13:23.000000000 +0100 -@@ -18,7 +18,7 @@ - - .file "my_strtoll10-x86.s" - .version "01.01" --.data -+.section .rodata - .align 32 - .type lfactor,@object - .size lfactor,36 -@@ -315,7 +315,11 @@ my_strtoll10: - .Lend_i_and_j: - movl %esi,%ecx - subl -12(%ebp),%ecx # ecx= number of digits in second part -- movl lfactor(,%ecx,4),%eax -+ -+ call __i686.get_pc_thunk.bx -+ addl $_GLOBAL_OFFSET_TABLE_,%ebx -+ -+ movl lfactor@GOTOFF(%ebx,%ecx,4),%eax - jmp .L523 - - # Return -8(%ebp) * $1000000000 + edi -@@ -400,3 +404,13 @@ my_strtoll10: - .comm end_ptr,120,32 - .comm error,120,32 - .ident "Monty" -+ -+ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits -+.globl __i686.get_pc_thunk.bx -+ .hidden __i686.get_pc_thunk.bx -+ .type __i686.get_pc_thunk.bx, @function -+__i686.get_pc_thunk.bx: -+ movl (%esp), %ebx -+ ret -+ -+ .section .note.GNU-stack,"",@progbits -diff -Nurp mysql/strings/strings-x86.s mysql-fixed/strings/strings-x86.s ---- mysql/strings/strings-x86.s 2005-05-13 12:32:40.000000000 +0100 -+++ mysql-fixed/strings/strings-x86.s 2005-05-23 23:19:13.000000000 +0100 -@@ -415,3 +415,5 @@ next_str: - ret - .strxmov_end: - .size strxmov,.strxmov_end-strxmov -+ -+ .section .note.GNU-stack,"",@progbits diff --git a/035_x86_asm-pic-fixes-r2.patch b/035_x86_asm-pic-fixes-r2.patch deleted file mode 100644 index 4a089a3..0000000 --- a/035_x86_asm-pic-fixes-r2.patch +++ /dev/null @@ -1,343 +0,0 @@ -###MY_VER_RANGE [4.1.13-r1,4.1.13-r1] [5.0.9_beta-r2,5.0.9_beta-r2] -diff -aur mysql.orig/strings/longlong2str-x86.s mysql.notextrel/strings/longlong2str-x86.s ---- mysql.orig/strings/longlong2str-x86.s 2005-07-26 17:52:18.000000000 +0200 -+++ mysql.notextrel/strings/longlong2str-x86.s 2005-07-26 19:29:23.000000000 +0200 -@@ -13,8 +13,9 @@ - # along with this program; if not, write to the Free Software - # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - --# Optimized longlong2str function for Intel 80x86 (gcc/gas syntax) --# Some set sequences are optimized for pentuimpro II -+# longlong2str function for Intel 80x86 (gcc/gas syntax) -+ -+# See longlong2str(dst,radix,val) description in longlong2str.c. - - .file "longlong2str.s" - .version "1.01" -@@ -24,99 +25,88 @@ - - .globl longlong2str - .type longlong2str,@function -- -+ - longlong2str: -- subl $80,%esp -+ subl $80,%esp # Temporary buffer for up to 64 radix-2 digits - pushl %ebp - pushl %esi - pushl %edi - pushl %ebx -- movl 100(%esp),%esi # Lower part of val -- movl 104(%esp),%ebp # Higher part of val -- movl 108(%esp),%edi # get dst -- movl 112(%esp),%ebx # Radix -- movl %ebx,%eax -- testl %eax,%eax -- jge .L144 -- -- addl $36,%eax -- cmpl $34,%eax -- ja .Lerror # Wrong radix -+ -+ movl 100(%esp),%esi # esi = Lower part of val -+ movl 112(%esp),%ebx # ebx = Radix -+ movl 104(%esp),%ebp # ebp = Higher part of val -+ movl 108(%esp),%edi # edi -> dst -+ -+ testl %ebx,%ebx -+ jge .L144 # (Radix >= 0) -+ - testl %ebp,%ebp -- jge .L146 -- movb $45,(%edi) # Add sign -- incl %edi # Change sign of val -- negl %esi -- adcl $0,%ebp -- negl %ebp -+ jge .L146 # (Higher part of val >= 0) -+ movb $45,(%edi) # Add '-' sign -+ incl %edi -+ negl %esi # Change val to positive -+ adcl $0,%ebp -+ negl %ebp - .L146: -- negl %ebx # Change radix to positive -- jmp .L148 -- .align 4 -+ negl %ebx # Change radix to positive - .L144: -- addl $-2,%eax -- cmpl $34,%eax -- ja .Lerror # Radix in range -+ cmpl $36,%ebx # Radix must be between 2 and 36 -+ ja .Lerror # (Radix not in range) -+ cmpl $2,%ebx -+ jb .Lerror # (Radix not in range) -+ -+ movl %esi,%eax # eax = lower part of val ... -+ orl %ebp,%eax # and it stays thus if ebp=0 -+ je Lzero # (Treat zero as special case) - --.L148: -- movl %esi,%eax # Test if zero (for easy loop) -- orl %ebp,%eax -- jne .L150 -- movb $48,(%edi) -- incl %edi -- jmp .L10_end -- .align 4 -- --.L150: -- leal 92(%esp),%ecx # End of buffer -- jmp .L155 -- .align 4 -- --.L153: -- # val is stored in in ebp:esi -- -- movl %ebp,%eax # High part of value -- xorl %edx,%edx -- divl %ebx -- movl %eax,%ebp -- movl %esi,%eax -- divl %ebx -- decl %ecx -- movl %eax,%esi # quotent in ebp:esi -- movb _dig_vec_upper(%edx),%al # al is faster than dl -- movb %al,(%ecx) # store value in buff -- .align 4 --.L155: -+ leal 92(%esp),%ecx # ecx -> End of temporary buffer -+ - testl %ebp,%ebp -- ja .L153 -- testl %esi,%esi # rest value -- jl .L153 -- je .L10_mov # Ready -- movl %esi,%eax -- movl $_dig_vec_upper,%ebp -- .align 4 -- --.L154: # Do rest with integer precision -- cltd -- divl %ebx -- decl %ecx -- movb (%edx,%ebp),%dl # bh is always zero as ebx=radix < 36 -- testl %eax,%eax -- movb %dl,(%ecx) -- jne .L154 -- --.L10_mov: -- movl %ecx,%esi -- leal 92(%esp),%ecx # End of buffer -- subl %esi,%ecx -- rep -- movsb -- --.L10_end: -- movl %edi,%eax # Pointer to end null -- movb $0,(%edi) # Store the end null -- --.L165: -+ je Llow # (Higher part of val = 0) -+ -+Lhigh: -+ #val in ebp:esi. div the high part by the radix, -+ #then div remainder + low part by the radix. -+ movl %ebp,%eax # edx=0,eax=high(from ebp) -+ xorl %edx,%edx -+ decl %ecx -+ divl %ebx -+ movl %eax,%ebp # edx=result of last, eax=low(from esi) -+ movl %esi,%eax -+ divl %ebx -+ movl %eax,%esi # ebp:esi = quotient -+ movb %dl,(%ecx) # store byte in temporary buffer -+ testl %ebp,%ebp -+ jne Lhigh # (Higher part of val still > 0) -+ -+Llow: -+ #val in 0:eax. div 0 + low part by the radix. -+ xorl %edx,%edx -+ decl %ecx -+ divl %ebx -+ movb %dl,(%ecx) # store byte in temporary buffer -+ testl %eax,%eax -+ jne Llow # (Lower part of val still <> 0) -+ -+ leal 92(%esp),%esi # esi -> End of temporary buffer -+ -+Lmov: -+ movb (%ecx),%dl # dl = byte from temporary buffer -+ movb $-1,%bl -+ cmpb $10,%dl # add 7 if dl > '9' -+ adcb $0,%bl -+ addb $48,%dl # add '0' -+ andb $7,%bl -+ addb %bl,%dl -+ incl %ecx -+ movb %dl,(%edi) # put dl in dst -+ incl %edi -+ cmpl %ecx,%esi -+ ja Lmov # (more bytes exist in temporary buffer) -+ movb $0,(%edi) # trailing '\0' in dst -+ movl %edi,%eax # eax = return value = pointer to '\0' -+.Lret: - popl %ebx - popl %edi - popl %esi -@@ -126,20 +116,28 @@ - - .Lerror: - xorl %eax,%eax # Wrong radix -- jmp .L165 -+ jmp .Lret - --.Lfe3: -- .size longlong2str,.Lfe3-longlong2str -+Lzero: -+ # Treat 0 as a special case. Unnecessary but we -+ # expect 0 will be frequent. -+ movl 108(%esp),%eax # eax = dst -+ popl %ebx -+ movb $48,(%eax) # '0' -+ popl %edi -+ incl %eax -+ popl %esi -+ popl %ebp -+ addl $80,%esp -+ movb $0,(%eax) # '\0' -+ ret - - # - # This is almost equal to the above, except that we can do the final - # loop much more efficient --# -+# - - .align 4 --.Ltmp: -- .long 0xcccccccd -- .align 4 - - .globl longlong10_to_str - .type longlong10_to_str,@function -@@ -202,7 +200,7 @@ - - # The following code uses some tricks to change division by 10 to - # multiplication and shifts -- movl .Ltmp,%esi # set %esi to 0xcccccccd -+ movl $0xcccccccd,%esi # set %esi to 0xcccccccd - - .L10_40: - movl %ebx,%eax -@@ -217,7 +215,30 @@ - movl %edx,%ebx - testl %ebx,%ebx - jne .L10_40 -- jmp .L10_mov # Shared end with longlong10_to_str -+# jmp .L10_mov # Shared end with longlong10_to_str -+ - -+.L10_mov: -+ movl %ecx,%esi -+ leal 92(%esp),%ecx # End of buffer -+ subl %esi,%ecx -+ rep -+ movsb -+ -+.L10_end: -+ movl %edi,%eax # Pointer to end null -+ movb $0,(%edi) # Store the end null -+ -+.L165: -+ popl %ebx -+ popl %edi -+ popl %esi -+ popl %ebp -+ addl $80,%esp -+ ret -+ - .L10end: - .size longlong10_to_str,.L10end-longlong10_to_str -+ -+ .section .note.GNU-stack,"",@progbits -+ -diff -aur mysql.orig/strings/my_strtoll10-x86.s mysql.notextrel/strings/my_strtoll10-x86.s ---- mysql.orig/strings/my_strtoll10-x86.s 2005-07-26 17:52:18.000000000 +0200 -+++ mysql.notextrel/strings/my_strtoll10-x86.s 2005-07-26 19:29:33.000000000 +0200 -@@ -18,20 +18,7 @@ - - .file "my_strtoll10-x86.s" - .version "01.01" --.data -- .align 32 -- .type lfactor,@object -- .size lfactor,36 --lfactor: -- .long 1 -- .long 10 -- .long 100 -- .long 1000 -- .long 10000 -- .long 100000 -- .long 1000000 -- .long 10000000 -- .long 100000000 -+ - .text - .align 4 - -@@ -315,9 +302,32 @@ - .Lend_i_and_j: - movl %esi,%ecx - subl -12(%ebp),%ecx # ecx= number of digits in second part -- movl lfactor(,%ecx,4),%eax -- jmp .L523 -- -+ movl $1,%eax -+ cmpb $0,%cl -+ je .L523 # 0 so 1 -+ movl $10,%eax -+ cmpb $1,%cl -+ je .L523 # 1 so 10 -+ movl $100,%eax -+ cmpb $2,%cl -+ je .L523 # 2 so 100 -+ movl $1000,%eax -+ cmpb $3,%cl -+ je .L523 # 3 so 1000 -+ movl $10000,%eax -+ cmpb $4,%cl -+ je .L523 # 4 so 10000 -+ movl $100000,%eax -+ cmpb $5,%cl -+ je .L523 # 5 so 100000 -+ movl $1000000,%eax -+ cmpb $6,%cl -+ je .L523 # 6 so 1000000 -+ movl $10000000,%eax -+ cmpb $7,%cl -+ je .L523 # 7 so 10000000 -+ movl $100000000,%eax -+ jmp .L523 # 8 so 100000000 - # Return -8(%ebp) * $1000000000 + edi - .p2align 4,,7 - .Lend3: -@@ -400,3 +410,6 @@ - .comm end_ptr,120,32 - .comm error,120,32 - .ident "Monty" -+ -+ .section .note.GNU-stack,"",@progbits -+ -diff -aur mysql.orig/strings/strings-x86.s mysql.notextrel/strings/strings-x86.s ---- mysql.orig/strings/strings-x86.s 2005-07-26 17:52:18.000000000 +0200 -+++ mysql.notextrel/strings/strings-x86.s 2005-07-26 19:29:42.000000000 +0200 -@@ -415,3 +415,6 @@ - ret - .strxmov_end: - .size strxmov,.strxmov_end-strxmov -+ -+ .section .note.GNU-stack,"",@progbits -+ diff --git a/035_x86_asm-pic-fixes-r3.patch b/035_x86_asm-pic-fixes-r3.patch deleted file mode 100644 index a6836d0..0000000 --- a/035_x86_asm-pic-fixes-r3.patch +++ /dev/null @@ -1,365 +0,0 @@ -###MY_VER_RANGE [4.1.13-r2,4.1.14_alpha20050816) - -FOLLOWING THE ORIGINAL PATCH COMMIT COMMENTS: - -ChangeSet - 1.2356 05/08/08 13:18:18 monty@mishka.local +6 -0 - Fix for BUG #11642: [Patch]es x86 Assembler and text relocations - Changed assembler functions to not access global variables or variables in text segement - Added wrapper function in C to longlong2str() to pass _dig_vec_upper as an argument - - strings/longlong2str_asm.c - 1.1 05/08/08 13:18:12 monty@mishka.local +33 -0 - New BitKeeper file ``strings/longlong2str_asm.c'' - - strings/my_strtoll10-x86.s - 1.4 05/08/08 13:18:12 monty@mishka.local +39 -23 - Removd array lfactor by calculating the value in code - (this is to to make the code position independent) - - strings/longlong2str_asm.c - 1.0 05/08/08 13:18:12 monty@mishka.local +0 -0 - BitKeeper file /home/my/mysql-4.1/strings/longlong2str_asm.c - - strings/longlong2str-x86.s - 1.11 05/08/08 13:18:12 monty@mishka.local +18 -17 - Changed functions to not access variables in text segment - Fixed this by adding global variable '_dig_vec_upper' as an argument to longlong2str_with_dig_vector() - - strings/Makefile.am - 1.43 05/08/08 13:18:12 monty@mishka.local +2 -2 - Added longlong2str_asm.c - - mysql-test/t/bigint.test - 1.24 05/08/08 13:18:11 monty@mishka.local +3 -0 - More tests for parsing of bigint's - More tests for different values to conv() - - mysql-test/r/bigint.result - 1.25 05/08/08 13:18:11 monty@mishka.local +9 -0 - More tests for parsing of bigint's - More tests for different values to conv() - -REAPPLIED PATCH FROM HERE: -PLUS ".section .note.GNU-stack,"",@progbits" - -diff -Naur mysql.orig/mysql-test/r/bigint.result mysql.new/mysql-test/r/bigint.result ---- mysql.orig/mysql-test/r/bigint.result 2005-07-15 12:50:20.000000000 +0200 -+++ mysql.new/mysql-test/r/bigint.result 2005-08-08 22:21:46.000000000 +0200 -@@ -17,6 +17,15 @@ - select -(0-3),round(-(0-3)), round(9999999999999999999); - -(0-3) round(-(0-3)) round(9999999999999999999) - 3 3 10000000000000000000 -+select 1,11,101,1001,10001,100001,1000001,10000001,100000001,1000000001,10000000001,100000000001,1000000000001,10000000000001,100000000000001,1000000000000001,10000000000000001,100000000000000001,1000000000000000001,10000000000000000001; -+1 11 101 1001 10001 100001 1000001 10000001 100000001 1000000001 10000000001 100000000001 1000000000001 10000000000001 100000000000001 1000000000000001 10000000000000001 100000000000000001 1000000000000000001 10000000000000000001 -+1 11 101 1001 10001 100001 1000001 10000001 100000001 1000000001 10000000001 100000000001 1000000000001 10000000000001 100000000000001 1000000000000001 10000000000000001 100000000000000001 1000000000000000001 10000000000000000001 -+select -1,-11,-101,-1001,-10001,-100001,-1000001,-10000001,-100000001,-1000000001,-10000000001,-100000000001,-1000000000001,-10000000000001,-100000000000001,-1000000000000001,-10000000000000001,-100000000000000001,-1000000000000000001,-10000000000000000001; -+-1 -11 -101 -1001 -10001 -100001 -1000001 -10000001 -100000001 -1000000001 -10000000001 -100000000001 -1000000000001 -10000000000001 -100000000000001 -1000000000000001 -10000000000000001 -100000000000000001 -1000000000000000001 -10000000000000000001 -+-1 -11 -101 -1001 -10001 -100001 -1000001 -10000001 -100000001 -1000000001 -10000000001 -100000000001 -1000000000001 -10000000000001 -100000000000001 -1000000000000001 -10000000000000001 -100000000000000001 -1000000000000000001 -10000000000000000000 -+select conv(1,10,16),conv((1<<2)-1,10,16),conv((1<<10)-2,10,16),conv((1<<16)-3,10,16),conv((1<<25)-4,10,16),conv((1<<31)-5,10,16),conv((1<<36)-6,10,16),conv((1<<47)-7,10,16),conv((1<<48)-8,10,16),conv((1<<55)-9,10,16),conv((1<<56)-10,10,16),conv((1<<63)-11,10,16); -+conv(1,10,16) conv((1<<2)-1,10,16) conv((1<<10)-2,10,16) conv((1<<16)-3,10,16) conv((1<<25)-4,10,16) conv((1<<31)-5,10,16) conv((1<<36)-6,10,16) conv((1<<47)-7,10,16) conv((1<<48)-8,10,16) conv((1<<55)-9,10,16) conv((1<<56)-10,10,16) conv((1<<63)-11,10,16) -+1 3 3FE FFFD 1FFFFFC 7FFFFFFB FFFFFFFFA 7FFFFFFFFFF9 FFFFFFFFFFF8 7FFFFFFFFFFFF7 FFFFFFFFFFFFF6 7FFFFFFFFFFFFFF5 - create table t1 (a bigint unsigned not null, primary key(a)); - insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); - select * from t1; -diff -Naur mysql.orig/mysql-test/t/bigint.test mysql.new/mysql-test/t/bigint.test ---- mysql.orig/mysql-test/t/bigint.test 2005-07-15 12:50:20.000000000 +0200 -+++ mysql.new/mysql-test/t/bigint.test 2005-08-08 22:21:46.000000000 +0200 -@@ -14,6 +14,9 @@ - select cast(9223372036854775808 as unsigned)+1; - select 9223372036854775808+1; - select -(0-3),round(-(0-3)), round(9999999999999999999); -+select 1,11,101,1001,10001,100001,1000001,10000001,100000001,1000000001,10000000001,100000000001,1000000000001,10000000000001,100000000000001,1000000000000001,10000000000000001,100000000000000001,1000000000000000001,10000000000000000001; -+select -1,-11,-101,-1001,-10001,-100001,-1000001,-10000001,-100000001,-1000000001,-10000000001,-100000000001,-1000000000001,-10000000000001,-100000000000001,-1000000000000001,-10000000000000001,-100000000000000001,-1000000000000000001,-10000000000000000001; -+select conv(1,10,16),conv((1<<2)-1,10,16),conv((1<<10)-2,10,16),conv((1<<16)-3,10,16),conv((1<<25)-4,10,16),conv((1<<31)-5,10,16),conv((1<<36)-6,10,16),conv((1<<47)-7,10,16),conv((1<<48)-8,10,16),conv((1<<55)-9,10,16),conv((1<<56)-10,10,16),conv((1<<63)-11,10,16); - - # - # In 3.23 we have to disable the test of column to bigint as -diff -Naur mysql.orig/strings/Makefile.am mysql.new/strings/Makefile.am ---- mysql.orig/strings/Makefile.am 2005-07-15 12:39:35.000000000 +0200 -+++ mysql.new/strings/Makefile.am 2005-08-08 22:21:46.000000000 +0200 -@@ -23,7 +23,7 @@ - # Exact one of ASSEMBLER_X - if ASSEMBLER_x86 - ASRCS = strings-x86.s longlong2str-x86.s my_strtoll10-x86.s --CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c -+CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c longlong2str_asm.c - else - if ASSEMBLER_sparc32 - # These file MUST all be on the same line!! Otherwise automake -@@ -46,7 +46,7 @@ - ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-utf8.c \ - ctype-ucs2.c ctype-uca.c ctype-tis620.c ctype-ujis.c \ - xml.c strto.c strings-x86.s \ -- longlong2str.c longlong2str-x86.s \ -+ longlong2str.c longlong2str-x86.s longlong2str_asm.c \ - my_strtoll10.c my_strtoll10-x86.s \ - strxmov.c bmove_upp.c strappend.c strcont.c strend.c \ - strfill.c strcend.c is_prefix.c strstr.c strinstr.c \ -diff -Naur mysql.orig/strings/longlong2str-x86.s mysql.new/strings/longlong2str-x86.s ---- mysql.orig/strings/longlong2str-x86.s 2005-07-15 12:39:33.000000000 +0200 -+++ mysql.new/strings/longlong2str-x86.s 2005-08-08 22:52:38.000000000 +0200 -@@ -16,26 +16,26 @@ - # Optimized longlong2str function for Intel 80x86 (gcc/gas syntax) - # Some set sequences are optimized for pentuimpro II - -- .file "longlong2str.s" -- .version "1.01" -+ .file "longlong2str-x86.s" -+ .version "1.02" - - .text - .align 4 - --.globl longlong2str -- .type longlong2str,@function -+.globl longlong2str_with_dig_vector -+ .type longlong2str_with_dig_vector,@function - --longlong2str: -+longlong2str_with_dig_vector: - subl $80,%esp - pushl %ebp - pushl %esi - pushl %edi - pushl %ebx - movl 100(%esp),%esi # Lower part of val -- movl 104(%esp),%ebp # Higher part of val -- movl 108(%esp),%edi # get dst - movl 112(%esp),%ebx # Radix -+ movl 104(%esp),%ebp # Higher part of val - movl %ebx,%eax -+ movl 108(%esp),%edi # get dst - testl %eax,%eax - jge .L144 - -@@ -69,6 +69,8 @@ - - .L150: - leal 92(%esp),%ecx # End of buffer -+ movl %edi, 108(%esp) # Store possible modified dest -+ movl 116(%esp), %edi # dig_vec_upper - jmp .L155 - .align 4 - -@@ -83,7 +85,7 @@ - divl %ebx - decl %ecx - movl %eax,%esi # quotent in ebp:esi -- movb _dig_vec_upper(%edx),%al # al is faster than dl -+ movb (%edx,%edi),%al # al is faster than dl - movb %al,(%ecx) # store value in buff - .align 4 - .L155: -@@ -91,20 +93,22 @@ - ja .L153 - testl %esi,%esi # rest value - jl .L153 -- je .L10_mov # Ready -+ je .L160 # Ready - movl %esi,%eax -- movl $_dig_vec_upper,%ebp - .align 4 - - .L154: # Do rest with integer precision - cltd - divl %ebx - decl %ecx -- movb (%edx,%ebp),%dl # bh is always zero as ebx=radix < 36 -+ movb (%edx,%edi),%dl # bh is always zero as ebx=radix < 36 - testl %eax,%eax - movb %dl,(%ecx) - jne .L154 - -+.L160: -+ movl 108(%esp),%edi # get dst -+ - .L10_mov: - movl %ecx,%esi - leal 92(%esp),%ecx # End of buffer -@@ -129,7 +133,7 @@ - jmp .L165 - - .Lfe3: -- .size longlong2str,.Lfe3-longlong2str -+ .size longlong2str_with_dig_vector,.Lfe3-longlong2str_with_dig_vector - - # - # This is almost equal to the above, except that we can do the final -@@ -137,9 +141,6 @@ - # - - .align 4 --.Ltmp: -- .long 0xcccccccd -- .align 4 - - .globl longlong10_to_str - .type longlong10_to_str,@function -@@ -202,8 +203,8 @@ - - # The following code uses some tricks to change division by 10 to - # multiplication and shifts -- movl .Ltmp,%esi # set %esi to 0xcccccccd -- -+ movl $0xcccccccd,%esi -+ - .L10_40: - movl %ebx,%eax - mull %esi -@@ -221,3 +222,6 @@ - - .L10end: - .size longlong10_to_str,.L10end-longlong10_to_str -+ -+ .section .note.GNU-stack,"",@progbits -+ -diff -Naur mysql.orig/strings/longlong2str_asm.c mysql.new/strings/longlong2str_asm.c ---- mysql.orig/strings/longlong2str_asm.c 1970-01-01 01:00:00.000000000 +0100 -+++ mysql.new/strings/longlong2str_asm.c 2005-08-08 22:23:33.000000000 +0200 -@@ -0,0 +1,34 @@ -+/* Copyright (C) 2000 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 */ -+ -+/* -+ * Wrapper for longlong2str.s -+ * -+ * We need this because the assembler code can't access the local variable -+ * _dig_vector in a portable manner. -+ */ -+ -+#include <my_global.h> -+#include "m_string.h" -+ -+extern char *longlong2str_with_dig_vector(longlong val,char *dst,int radix, -+ const char *dig_vector); -+ -+char *longlong2str(longlong val,char *dst,int radix) -+{ -+ return longlong2str_with_dig_vector(val, dst, radix, _dig_vec_upper); -+} -+ -diff -Naur mysql.orig/strings/my_strtoll10-x86.s mysql.new/strings/my_strtoll10-x86.s ---- mysql.orig/strings/my_strtoll10-x86.s 2005-07-15 12:39:34.000000000 +0200 -+++ mysql.new/strings/my_strtoll10-x86.s 2005-08-08 22:52:51.000000000 +0200 -@@ -17,21 +17,8 @@ - # For documentation, check my_strtoll.c - - .file "my_strtoll10-x86.s" -- .version "01.01" --.data -- .align 32 -- .type lfactor,@object -- .size lfactor,36 --lfactor: -- .long 1 -- .long 10 -- .long 100 -- .long 1000 -- .long 10000 -- .long 100000 -- .long 1000000 -- .long 10000000 -- .long 100000000 -+ .version "01.02" -+ - .text - .align 4 - -@@ -209,14 +196,16 @@ - jne .L500 - cmpl -36(%ebp),%esi # Test if string is less than 18 digits - jne .Lend_i_and_j -- jmp .Lend3 # 18 digit string -+.L499: -+ movl $1000000000,%eax -+ jmp .Lgot_factor # 18 digit string - - # Handle the possible next to last digit and store in ecx - .L500: - movb (%esi),%al - addb $-48,%al - cmpb $9,%al -- ja .Lend3 -+ ja .L499 # 18 digit string - - incl %esi - movzbl %al,%ecx -@@ -315,14 +304,41 @@ - .Lend_i_and_j: - movl %esi,%ecx - subl -12(%ebp),%ecx # ecx= number of digits in second part -- movl lfactor(,%ecx,4),%eax -- jmp .L523 - -- # Return -8(%ebp) * $1000000000 + edi -+ # Calculate %eax= 10 ** %cl, where %cl <= 8 -+ # With an array one could do this with: -+ # movl 10_factor_table(,%ecx,4),%eax -+ # We calculate the table here to avoid problems in -+ # position independent code (gcc -pic) -+ -+ cmpb $3,%cl -+ ja .L4_to_8 -+ movl $1000, %eax -+ je .Lgot_factor # %cl=3, eax= 1000 -+ movl $10, %eax -+ cmpb $1,%cl # %cl is here 0 - 2 -+ je .Lgot_factor # %cl=1, eax= 10 -+ movl $100, %eax -+ ja .Lgot_factor # %cl=2, eax=100 -+ movl $1, %eax -+ jmp .Lgot_factor # %cl=0, eax=1 -+ -+.L4_to_8: # %cl is here 4-8 -+ cmpb $5,%cl -+ movl $100000, %eax -+ je .Lgot_factor # %cl=5, eax=100000 -+ movl $10000, %eax -+ jbe .Lgot_factor # %cl=4, eax=10000 -+ movl $10000000, %eax -+ cmpb $7,%cl -+ je .Lgot_factor # %cl=7, eax=10000000 -+ movl $100000000, %eax -+ ja .Lgot_factor # %cl=8, eax=100000000 -+ movl $1000000, %eax # %cl=6, eax=1000000 -+ -+ # Return -8(%ebp) * %eax + edi - .p2align 4,,7 --.Lend3: -- movl $1000000000,%eax --.L523: -+.Lgot_factor: - mull -8(%ebp) - addl %edi,%eax - adcl $0,%edx -@@ -400,3 +416,6 @@ - .comm end_ptr,120,32 - .comm error,120,32 - .ident "Monty" -+ -+ .section .note.GNU-stack,"",@progbits -+ -diff -Naur mysql.orig/strings/strings-x86.s mysql.new/strings/strings-x86.s ---- mysql.orig/strings/strings-x86.s 2005-07-15 12:39:36.000000000 +0200 -+++ mysql.new/strings/strings-x86.s 2005-08-08 22:53:00.000000000 +0200 -@@ -415,3 +415,6 @@ - ret - .strxmov_end: - .size strxmov,.strxmov_end-strxmov -+ -+ .section .note.GNU-stack,"",@progbits -+ diff --git a/035_x86_asm-pic-fixes-r4.patch b/035_x86_asm-pic-fixes-r4.patch deleted file mode 100644 index 308b6e5..0000000 --- a/035_x86_asm-pic-fixes-r4.patch +++ /dev/null @@ -1,365 +0,0 @@ -###MY_VER_RANGE [5.0.10_beta-r1,5.0.10_beta-r1] - -FOLLOWING THE ORIGINAL PATCH COMMIT COMMENTS: - -ChangeSet - 1.2356 05/08/08 13:18:18 monty@mishka.local +6 -0 - Fix for BUG #11642: [Patch]es x86 Assembler and text relocations - Changed assembler functions to not access global variables or variables in text segement - Added wrapper function in C to longlong2str() to pass _dig_vec_upper as an argument - - strings/longlong2str_asm.c - 1.1 05/08/08 13:18:12 monty@mishka.local +33 -0 - New BitKeeper file ``strings/longlong2str_asm.c'' - - strings/my_strtoll10-x86.s - 1.4 05/08/08 13:18:12 monty@mishka.local +39 -23 - Removd array lfactor by calculating the value in code - (this is to to make the code position independent) - - strings/longlong2str_asm.c - 1.0 05/08/08 13:18:12 monty@mishka.local +0 -0 - BitKeeper file /home/my/mysql-4.1/strings/longlong2str_asm.c - - strings/longlong2str-x86.s - 1.11 05/08/08 13:18:12 monty@mishka.local +18 -17 - Changed functions to not access variables in text segment - Fixed this by adding global variable '_dig_vec_upper' as an argument to longlong2str_with_dig_vector() - - strings/Makefile.am - 1.43 05/08/08 13:18:12 monty@mishka.local +2 -2 - Added longlong2str_asm.c - - mysql-test/t/bigint.test - 1.24 05/08/08 13:18:11 monty@mishka.local +3 -0 - More tests for parsing of bigint's - More tests for different values to conv() - - mysql-test/r/bigint.result - 1.25 05/08/08 13:18:11 monty@mishka.local +9 -0 - More tests for parsing of bigint's - More tests for different values to conv() - -REAPPLIED PATCH FROM HERE: -PLUS ".section .note.GNU-stack,"",@progbits" - - -diff -Naur mysql.orig/mysql-test/t/bigint.test mysql.new/mysql-test/t/bigint.test ---- mysql.orig/mysql-test/t/bigint.test 2005-08-08 22:39:10.000000000 +0200 -+++ mysql.new/mysql-test/t/bigint.test 2005-08-08 22:41:29.000000000 +0200 -@@ -14,6 +14,9 @@ - select cast(9223372036854775808 as unsigned)+1; - select 9223372036854775808+1; - select -(0-3),round(-(0-3)), round(9999999999999999999); -+select 1,11,101,1001,10001,100001,1000001,10000001,100000001,1000000001,10000000001,100000000001,1000000000001,10000000000001,100000000000001,1000000000000001,10000000000000001,100000000000000001,1000000000000000001,10000000000000000001; -+select -1,-11,-101,-1001,-10001,-100001,-1000001,-10000001,-100000001,-1000000001,-10000000001,-100000000001,-1000000000001,-10000000000001,-100000000000001,-1000000000000001,-10000000000000001,-100000000000000001,-1000000000000000001,-10000000000000000000; -+select conv(1,10,16),conv((1<<2)-1,10,16),conv((1<<10)-2,10,16),conv((1<<16)-3,10,16),conv((1<<25)-4,10,16),conv((1<<31)-5,10,16),conv((1<<36)-6,10,16),conv((1<<47)-7,10,16),conv((1<<48)-8,10,16),conv((1<<55)-9,10,16),conv((1<<56)-10,10,16),conv((1<<63)-11,10,16); - - # - # In 3.23 we have to disable the test of column to bigint as -diff -Naur mysql.orig/strings/Makefile.am mysql.new/strings/Makefile.am ---- mysql.orig/strings/Makefile.am 2005-08-08 22:39:10.000000000 +0200 -+++ mysql.new/strings/Makefile.am 2005-08-08 22:41:29.000000000 +0200 -@@ -22,7 +22,7 @@ - # Exact one of ASSEMBLER_X - if ASSEMBLER_x86 - ASRCS = strings-x86.s longlong2str-x86.s my_strtoll10-x86.s --CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c -+CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c longlong2str_asm.c - else - if ASSEMBLER_sparc32 - # These file MUST all be on the same line!! Otherwise automake -@@ -45,7 +45,7 @@ - ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-utf8.c \ - ctype-ucs2.c ctype-uca.c ctype-tis620.c ctype-ujis.c \ - xml.c decimal.c strto.c strings-x86.s \ -- longlong2str.c longlong2str-x86.s \ -+ longlong2str.c longlong2str-x86.s longlong2str_asm.c \ - my_strtoll10.c my_strtoll10-x86.s \ - strxmov.c bmove_upp.c strappend.c strcont.c strend.c \ - strfill.c strcend.c is_prefix.c strstr.c strinstr.c \ -diff -Naur mysql.orig/strings/longlong2str-x86.s mysql.new/strings/longlong2str-x86.s ---- mysql.orig/strings/longlong2str-x86.s 2005-08-08 22:39:10.000000000 +0200 -+++ mysql.new/strings/longlong2str-x86.s 2005-08-08 22:44:14.000000000 +0200 -@@ -16,26 +16,26 @@ - # Optimized longlong2str function for Intel 80x86 (gcc/gas syntax) - # Some set sequences are optimized for pentuimpro II - -- .file "longlong2str.s" -- .version "1.01" -+ .file "longlong2str-x86.s" -+ .version "1.02" - - .text - .align 4 - --.globl longlong2str -- .type longlong2str,@function -+.globl longlong2str_with_dig_vector -+ .type longlong2str_with_dig_vector,@function - --longlong2str: -+longlong2str_with_dig_vector: - subl $80,%esp - pushl %ebp - pushl %esi - pushl %edi - pushl %ebx - movl 100(%esp),%esi # Lower part of val -- movl 104(%esp),%ebp # Higher part of val -- movl 108(%esp),%edi # get dst - movl 112(%esp),%ebx # Radix -+ movl 104(%esp),%ebp # Higher part of val - movl %ebx,%eax -+ movl 108(%esp),%edi # get dst - testl %eax,%eax - jge .L144 - -@@ -69,6 +69,8 @@ - - .L150: - leal 92(%esp),%ecx # End of buffer -+ movl %edi, 108(%esp) # Store possible modified dest -+ movl 116(%esp), %edi # dig_vec_upper - jmp .L155 - .align 4 - -@@ -83,7 +85,7 @@ - divl %ebx - decl %ecx - movl %eax,%esi # quotent in ebp:esi -- movb _dig_vec_upper(%edx),%al # al is faster than dl -+ movb (%edx,%edi),%al # al is faster than dl - movb %al,(%ecx) # store value in buff - .align 4 - .L155: -@@ -91,20 +93,22 @@ - ja .L153 - testl %esi,%esi # rest value - jl .L153 -- je .L10_mov # Ready -+ je .L160 # Ready - movl %esi,%eax -- movl $_dig_vec_upper,%ebp - .align 4 - - .L154: # Do rest with integer precision - cltd - divl %ebx - decl %ecx -- movb (%edx,%ebp),%dl # bh is always zero as ebx=radix < 36 -+ movb (%edx,%edi),%dl # bh is always zero as ebx=radix < 36 - testl %eax,%eax - movb %dl,(%ecx) - jne .L154 - -+.L160: -+ movl 108(%esp),%edi # get dst -+ - .L10_mov: - movl %ecx,%esi - leal 92(%esp),%ecx # End of buffer -@@ -129,7 +133,7 @@ - jmp .L165 - - .Lfe3: -- .size longlong2str,.Lfe3-longlong2str -+ .size longlong2str_with_dig_vector,.Lfe3-longlong2str_with_dig_vector - - # - # This is almost equal to the above, except that we can do the final -@@ -137,9 +141,6 @@ - # - - .align 4 --.Ltmp: -- .long 0xcccccccd -- .align 4 - - .globl longlong10_to_str - .type longlong10_to_str,@function -@@ -202,8 +203,8 @@ - - # The following code uses some tricks to change division by 10 to - # multiplication and shifts -- movl .Ltmp,%esi # set %esi to 0xcccccccd -- -+ movl $0xcccccccd,%esi -+ - .L10_40: - movl %ebx,%eax - mull %esi -@@ -221,3 +222,6 @@ - - .L10end: - .size longlong10_to_str,.L10end-longlong10_to_str -+ -+ .section .note.GNU-stack,"",@progbits -+ -diff -Naur mysql.orig/strings/longlong2str_asm.c mysql.new/strings/longlong2str_asm.c ---- mysql.orig/strings/longlong2str_asm.c 1970-01-01 01:00:00.000000000 +0100 -+++ mysql.new/strings/longlong2str_asm.c 2005-08-08 22:39:10.000000000 +0200 -@@ -0,0 +1,34 @@ -+/* Copyright (C) 2000 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 */ -+ -+/* -+ * Wrapper for longlong2str.s -+ * -+ * We need this because the assembler code can't access the local variable -+ * _dig_vector in a portable manner. -+ */ -+ -+#include <my_global.h> -+#include "m_string.h" -+ -+extern char *longlong2str_with_dig_vector(longlong val,char *dst,int radix, -+ const char *dig_vector); -+ -+char *longlong2str(longlong val,char *dst,int radix) -+{ -+ return longlong2str_with_dig_vector(val, dst, radix, _dig_vec_upper); -+} -+ -diff -Naur mysql.orig/strings/my_strtoll10-x86.s mysql.new/strings/my_strtoll10-x86.s ---- mysql.orig/strings/my_strtoll10-x86.s 2005-08-08 22:39:10.000000000 +0200 -+++ mysql.new/strings/my_strtoll10-x86.s 2005-08-08 22:44:23.000000000 +0200 -@@ -17,21 +17,8 @@ - # For documentation, check my_strtoll.c - - .file "my_strtoll10-x86.s" -- .version "01.01" --.data -- .align 32 -- .type lfactor,@object -- .size lfactor,36 --lfactor: -- .long 1 -- .long 10 -- .long 100 -- .long 1000 -- .long 10000 -- .long 100000 -- .long 1000000 -- .long 10000000 -- .long 100000000 -+ .version "01.02" -+ - .text - .align 4 - -@@ -209,14 +196,16 @@ - jne .L500 - cmpl -36(%ebp),%esi # Test if string is less than 18 digits - jne .Lend_i_and_j -- jmp .Lend3 # 18 digit string -+.L499: -+ movl $1000000000,%eax -+ jmp .Lgot_factor # 18 digit string - - # Handle the possible next to last digit and store in ecx - .L500: - movb (%esi),%al - addb $-48,%al - cmpb $9,%al -- ja .Lend3 -+ ja .L499 # 18 digit string - - incl %esi - movzbl %al,%ecx -@@ -315,14 +304,41 @@ - .Lend_i_and_j: - movl %esi,%ecx - subl -12(%ebp),%ecx # ecx= number of digits in second part -- movl lfactor(,%ecx,4),%eax -- jmp .L523 - -- # Return -8(%ebp) * $1000000000 + edi -+ # Calculate %eax= 10 ** %cl, where %cl <= 8 -+ # With an array one could do this with: -+ # movl 10_factor_table(,%ecx,4),%eax -+ # We calculate the table here to avoid problems in -+ # position independent code (gcc -pic) -+ -+ cmpb $3,%cl -+ ja .L4_to_8 -+ movl $1000, %eax -+ je .Lgot_factor # %cl=3, eax= 1000 -+ movl $10, %eax -+ cmpb $1,%cl # %cl is here 0 - 2 -+ je .Lgot_factor # %cl=1, eax= 10 -+ movl $100, %eax -+ ja .Lgot_factor # %cl=2, eax=100 -+ movl $1, %eax -+ jmp .Lgot_factor # %cl=0, eax=1 -+ -+.L4_to_8: # %cl is here 4-8 -+ cmpb $5,%cl -+ movl $100000, %eax -+ je .Lgot_factor # %cl=5, eax=100000 -+ movl $10000, %eax -+ jbe .Lgot_factor # %cl=4, eax=10000 -+ movl $10000000, %eax -+ cmpb $7,%cl -+ je .Lgot_factor # %cl=7, eax=10000000 -+ movl $100000000, %eax -+ ja .Lgot_factor # %cl=8, eax=100000000 -+ movl $1000000, %eax # %cl=6, eax=1000000 -+ -+ # Return -8(%ebp) * %eax + edi - .p2align 4,,7 --.Lend3: -- movl $1000000000,%eax --.L523: -+.Lgot_factor: - mull -8(%ebp) - addl %edi,%eax - adcl $0,%edx -@@ -400,3 +416,6 @@ - .comm end_ptr,120,32 - .comm error,120,32 - .ident "Monty" -+ -+ .section .note.GNU-stack,"",@progbits -+ -diff -Naur mysql.orig/strings/strings-x86.s mysql.new/strings/strings-x86.s ---- mysql.orig/strings/strings-x86.s 2005-08-08 22:39:10.000000000 +0200 -+++ mysql.new/strings/strings-x86.s 2005-08-08 22:44:29.000000000 +0200 -@@ -415,3 +415,6 @@ - ret - .strxmov_end: - .size strxmov,.strxmov_end-strxmov -+ -+ .section .note.GNU-stack,"",@progbits -+ ---- mysql.orig/mysql-test/r/bigint.result 2005-08-10 23:28:13.000000000 +0200 -+++ mysql.new/mysql-test/r/bigint.result 2005-08-10 23:27:41.000000000 +0200 -@@ -17,6 +17,15 @@ - select -(0-3),round(-(0-3)), round(9999999999999999999); - -(0-3) round(-(0-3)) round(9999999999999999999) - 3 3 9999999999999999999 -+select 1,11,101,1001,10001,100001,1000001,10000001,100000001,1000000001,10000000001,100000000001,1000000000001,10000000000001,100000000000001,1000000000000001,10000000000000001,100000000000000001,1000000000000000001,10000000000000000001; -+1 11 101 1001 10001 100001 1000001 10000001 100000001 1000000001 10000000001 100000000001 1000000000001 10000000000001 100000000000001 1000000000000001 10000000000000001 100000000000000001 1000000000000000001 10000000000000000001 -+1 11 101 1001 10001 100001 1000001 10000001 100000001 1000000001 10000000001 100000000001 1000000000001 10000000000001 100000000000001 1000000000000001 10000000000000001 100000000000000001 1000000000000000001 10000000000000000001 -+select -1,-11,-101,-1001,-10001,-100001,-1000001,-10000001,-100000001,-1000000001,-10000000001,-100000000001,-1000000000001,-10000000000001,-100000000000001,-1000000000000001,-10000000000000001,-100000000000000001,-1000000000000000001,-10000000000000000000; -+-1 -11 -101 -1001 -10001 -100001 -1000001 -10000001 -100000001 -1000000001 -10000000001 -100000000001 -1000000000001 -10000000000001 -100000000000001 -1000000000000001 -10000000000000001 -100000000000000001 -1000000000000000001 -10000000000000000000 -+-1 -11 -101 -1001 -10001 -100001 -1000001 -10000001 -100000001 -1000000001 -10000000001 -100000000001 -1000000000001 -10000000000001 -100000000000001 -1000000000000001 -10000000000000001 -100000000000000001 -1000000000000000001 -10000000000000000000 -+select conv(1,10,16),conv((1<<2)-1,10,16),conv((1<<10)-2,10,16),conv((1<<16)-3,10,16),conv((1<<25)-4,10,16),conv((1<<31)-5,10,16),conv((1<<36)-6,10,16),conv((1<<47)-7,10,16),conv((1<<48)-8,10,16),conv((1<<55)-9,10,16),conv((1<<56)-10,10,16),conv((1<<63)-11,10,16); -+conv(1,10,16) conv((1<<2)-1,10,16) conv((1<<10)-2,10,16) conv((1<<16)-3,10,16) conv((1<<25)-4,10,16) conv((1<<31)-5,10,16) conv((1<<36)-6,10,16) conv((1<<47)-7,10,16) conv((1<<48)-8,10,16) conv((1<<55)-9,10,16) conv((1<<56)-10,10,16) conv((1<<63)-11,10,16) -+1 3 3FE FFFD 1FFFFFC 7FFFFFFB FFFFFFFFA 7FFFFFFFFFF9 FFFFFFFFFFF8 7FFFFFFFFFFFF7 FFFFFFFFFFFFF6 7FFFFFFFFFFFFFF5 - create table t1 (a bigint unsigned not null, primary key(a)); - insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); - select * from t1; diff --git a/035_x86_asm-pic-fixes-r6.patch b/035_x86_asm-pic-fixes-r6.patch deleted file mode 100644 index 5430bc6..0000000 --- a/035_x86_asm-pic-fixes-r6.patch +++ /dev/null @@ -1,333 +0,0 @@ -###MY_VER_RANGE [5.0.11_beta,5.0.12_alpha) [5.1,5.1.2_alpha) - -FOLLOWING THE ORIGINAL PATCH COMMIT COMMENTS: - -ChangeSet - 1.2356 05/08/08 13:18:18 monty@mishka.local +6 -0 - Fix for BUG #11642: [Patch]es x86 Assembler and text relocations - Changed assembler functions to not access global variables or variables in text segement - Added wrapper function in C to longlong2str() to pass _dig_vec_upper as an argument - - strings/longlong2str_asm.c - 1.1 05/08/08 13:18:12 monty@mishka.local +33 -0 - New BitKeeper file ``strings/longlong2str_asm.c'' - - strings/my_strtoll10-x86.s - 1.4 05/08/08 13:18:12 monty@mishka.local +39 -23 - Removd array lfactor by calculating the value in code - (this is to to make the code position independent) - - strings/longlong2str_asm.c - 1.0 05/08/08 13:18:12 monty@mishka.local +0 -0 - BitKeeper file /home/my/mysql-4.1/strings/longlong2str_asm.c - - strings/longlong2str-x86.s - 1.11 05/08/08 13:18:12 monty@mishka.local +18 -17 - Changed functions to not access variables in text segment - Fixed this by adding global variable '_dig_vec_upper' as an argument to longlong2str_with_dig_vector() - - strings/Makefile.am - 1.43 05/08/08 13:18:12 monty@mishka.local +2 -2 - Added longlong2str_asm.c - -# mysql-test/t/bigint.test -# 1.24 05/08/08 13:18:11 monty@mishka.local +3 -0 -# More tests for parsing of bigint's -# More tests for different values to conv() -# -# mysql-test/r/bigint.result -# 1.25 05/08/08 13:18:11 monty@mishka.local +9 -0 -# More tests for parsing of bigint's -# More tests for different values to conv() - -REAPPLIED PATCH FROM HERE: -PLUS ".section .note.GNU-stack,"",@progbits" - -diff -Naur mysql.orig/strings/Makefile.am mysql.new/strings/Makefile.am ---- mysql.orig/strings/Makefile.am 2005-08-08 22:57:13.000000000 +0200 -+++ mysql.new/strings/Makefile.am 2005-08-08 22:57:45.000000000 +0200 -@@ -22,7 +22,7 @@ - # Exact one of ASSEMBLER_X - if ASSEMBLER_x86 - ASRCS = strings-x86.s longlong2str-x86.s my_strtoll10-x86.s --CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c str_alloc.c -+CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c str_alloc.c longlong2str_asm.c - else - if ASSEMBLER_sparc32 - # These file MUST all be on the same line!! Otherwise automake -@@ -45,7 +45,7 @@ - ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-utf8.c \ - ctype-ucs2.c ctype-uca.c ctype-tis620.c ctype-ujis.c \ - xml.c decimal.c strto.c strings-x86.s \ -- longlong2str.c longlong2str-x86.s \ -+ longlong2str.c longlong2str-x86.s longlong2str_asm.c \ - my_strtoll10.c my_strtoll10-x86.s \ - strxmov.c bmove_upp.c strappend.c strcont.c strend.c \ - strfill.c strcend.c is_prefix.c strstr.c strinstr.c \ -diff -Naur mysql.orig/strings/longlong2str-x86.s mysql.new/strings/longlong2str-x86.s ---- mysql.orig/strings/longlong2str-x86.s 2005-08-08 22:57:13.000000000 +0200 -+++ mysql.new/strings/longlong2str-x86.s 2005-08-08 22:58:23.000000000 +0200 -@@ -16,26 +16,26 @@ - # Optimized longlong2str function for Intel 80x86 (gcc/gas syntax) - # Some set sequences are optimized for pentuimpro II - -- .file "longlong2str.s" -- .version "1.01" -+ .file "longlong2str-x86.s" -+ .version "1.02" - - .text - .align 4 - --.globl longlong2str -- .type longlong2str,@function -+.globl longlong2str_with_dig_vector -+ .type longlong2str_with_dig_vector,@function - --longlong2str: -+longlong2str_with_dig_vector: - subl $80,%esp - pushl %ebp - pushl %esi - pushl %edi - pushl %ebx - movl 100(%esp),%esi # Lower part of val -- movl 104(%esp),%ebp # Higher part of val -- movl 108(%esp),%edi # get dst - movl 112(%esp),%ebx # Radix -+ movl 104(%esp),%ebp # Higher part of val - movl %ebx,%eax -+ movl 108(%esp),%edi # get dst - testl %eax,%eax - jge .L144 - -@@ -69,6 +69,8 @@ - - .L150: - leal 92(%esp),%ecx # End of buffer -+ movl %edi, 108(%esp) # Store possible modified dest -+ movl 116(%esp), %edi # dig_vec_upper - jmp .L155 - .align 4 - -@@ -83,7 +85,7 @@ - divl %ebx - decl %ecx - movl %eax,%esi # quotent in ebp:esi -- movb _dig_vec_upper(%edx),%al # al is faster than dl -+ movb (%edx,%edi),%al # al is faster than dl - movb %al,(%ecx) # store value in buff - .align 4 - .L155: -@@ -91,20 +93,22 @@ - ja .L153 - testl %esi,%esi # rest value - jl .L153 -- je .L10_mov # Ready -+ je .L160 # Ready - movl %esi,%eax -- movl $_dig_vec_upper,%ebp - .align 4 - - .L154: # Do rest with integer precision - cltd - divl %ebx - decl %ecx -- movb (%edx,%ebp),%dl # bh is always zero as ebx=radix < 36 -+ movb (%edx,%edi),%dl # bh is always zero as ebx=radix < 36 - testl %eax,%eax - movb %dl,(%ecx) - jne .L154 - -+.L160: -+ movl 108(%esp),%edi # get dst -+ - .L10_mov: - movl %ecx,%esi - leal 92(%esp),%ecx # End of buffer -@@ -129,7 +133,7 @@ - jmp .L165 - - .Lfe3: -- .size longlong2str,.Lfe3-longlong2str -+ .size longlong2str_with_dig_vector,.Lfe3-longlong2str_with_dig_vector - - # - # This is almost equal to the above, except that we can do the final -@@ -137,9 +141,6 @@ - # - - .align 4 --.Ltmp: -- .long 0xcccccccd -- .align 4 - - .globl longlong10_to_str - .type longlong10_to_str,@function -@@ -202,8 +203,8 @@ - - # The following code uses some tricks to change division by 10 to - # multiplication and shifts -- movl .Ltmp,%esi # set %esi to 0xcccccccd -- -+ movl $0xcccccccd,%esi -+ - .L10_40: - movl %ebx,%eax - mull %esi -@@ -221,3 +222,6 @@ - - .L10end: - .size longlong10_to_str,.L10end-longlong10_to_str -+ -+ .section .note.GNU-stack,"",@progbits -+ -diff -Naur mysql.orig/strings/longlong2str_asm.c mysql.new/strings/longlong2str_asm.c ---- mysql.orig/strings/longlong2str_asm.c 1970-01-01 01:00:00.000000000 +0100 -+++ mysql.new/strings/longlong2str_asm.c 2005-08-08 22:57:17.000000000 +0200 -@@ -0,0 +1,34 @@ -+/* Copyright (C) 2000 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 */ -+ -+/* -+ * Wrapper for longlong2str.s -+ * -+ * We need this because the assembler code can't access the local variable -+ * _dig_vector in a portable manner. -+ */ -+ -+#include <my_global.h> -+#include "m_string.h" -+ -+extern char *longlong2str_with_dig_vector(longlong val,char *dst,int radix, -+ const char *dig_vector); -+ -+char *longlong2str(longlong val,char *dst,int radix) -+{ -+ return longlong2str_with_dig_vector(val, dst, radix, _dig_vec_upper); -+} -+ -diff -Naur mysql.orig/strings/my_strtoll10-x86.s mysql.new/strings/my_strtoll10-x86.s ---- mysql.orig/strings/my_strtoll10-x86.s 2005-08-08 22:57:13.000000000 +0200 -+++ mysql.new/strings/my_strtoll10-x86.s 2005-08-08 22:58:30.000000000 +0200 -@@ -17,21 +17,8 @@ - # For documentation, check my_strtoll.c - - .file "my_strtoll10-x86.s" -- .version "01.01" --.data -- .align 32 -- .type lfactor,@object -- .size lfactor,36 --lfactor: -- .long 1 -- .long 10 -- .long 100 -- .long 1000 -- .long 10000 -- .long 100000 -- .long 1000000 -- .long 10000000 -- .long 100000000 -+ .version "01.02" -+ - .text - .align 4 - -@@ -209,14 +196,16 @@ - jne .L500 - cmpl -36(%ebp),%esi # Test if string is less than 18 digits - jne .Lend_i_and_j -- jmp .Lend3 # 18 digit string -+.L499: -+ movl $1000000000,%eax -+ jmp .Lgot_factor # 18 digit string - - # Handle the possible next to last digit and store in ecx - .L500: - movb (%esi),%al - addb $-48,%al - cmpb $9,%al -- ja .Lend3 -+ ja .L499 # 18 digit string - - incl %esi - movzbl %al,%ecx -@@ -315,14 +304,41 @@ - .Lend_i_and_j: - movl %esi,%ecx - subl -12(%ebp),%ecx # ecx= number of digits in second part -- movl lfactor(,%ecx,4),%eax -- jmp .L523 - -- # Return -8(%ebp) * $1000000000 + edi -+ # Calculate %eax= 10 ** %cl, where %cl <= 8 -+ # With an array one could do this with: -+ # movl 10_factor_table(,%ecx,4),%eax -+ # We calculate the table here to avoid problems in -+ # position independent code (gcc -pic) -+ -+ cmpb $3,%cl -+ ja .L4_to_8 -+ movl $1000, %eax -+ je .Lgot_factor # %cl=3, eax= 1000 -+ movl $10, %eax -+ cmpb $1,%cl # %cl is here 0 - 2 -+ je .Lgot_factor # %cl=1, eax= 10 -+ movl $100, %eax -+ ja .Lgot_factor # %cl=2, eax=100 -+ movl $1, %eax -+ jmp .Lgot_factor # %cl=0, eax=1 -+ -+.L4_to_8: # %cl is here 4-8 -+ cmpb $5,%cl -+ movl $100000, %eax -+ je .Lgot_factor # %cl=5, eax=100000 -+ movl $10000, %eax -+ jbe .Lgot_factor # %cl=4, eax=10000 -+ movl $10000000, %eax -+ cmpb $7,%cl -+ je .Lgot_factor # %cl=7, eax=10000000 -+ movl $100000000, %eax -+ ja .Lgot_factor # %cl=8, eax=100000000 -+ movl $1000000, %eax # %cl=6, eax=1000000 -+ -+ # Return -8(%ebp) * %eax + edi - .p2align 4,,7 --.Lend3: -- movl $1000000000,%eax --.L523: -+.Lgot_factor: - mull -8(%ebp) - addl %edi,%eax - adcl $0,%edx -@@ -400,3 +416,6 @@ - .comm end_ptr,120,32 - .comm error,120,32 - .ident "Monty" -+ -+ .section .note.GNU-stack,"",@progbits -+ -diff -Naur mysql.orig/strings/strings-x86.s mysql.new/strings/strings-x86.s ---- mysql.orig/strings/strings-x86.s 2005-08-08 22:57:13.000000000 +0200 -+++ mysql.new/strings/strings-x86.s 2005-08-08 22:58:40.000000000 +0200 -@@ -415,3 +415,6 @@ - ret - .strxmov_end: - .size strxmov,.strxmov_end-strxmov -+ -+ .section .note.GNU-stack,"",@progbits -+ diff --git a/040_all_tcpd-vars-fix.patch b/040_all_tcpd-vars-fix-4.0.14.patch index 156e368..6150a79 100644 --- a/040_all_tcpd-vars-fix.patch +++ b/040_all_tcpd-vars-fix-4.0.14.patch @@ -1,4 +1,3 @@ -###MY_VER_RANGE [4.0.14-r1,5.0_alpha] --- mysql-4.1.8/sql/mysqld.cc 2004-12-14 13:40:36.000000000 +0100 +++ bbb/sql/mysqld.cc 2005-01-09 17:57:47.829022200 +0100 @@ -133,8 +133,8 @@ @@ -9,6 +8,6 @@ -int deny_severity = LOG_WARNING; +//int allow_severity = LOG_INFO; +//int deny_severity = LOG_WARNING; - + #ifdef __STDC__ #define my_fromhost(A) fromhost(A) diff --git a/040_all_tcpd-vars-fix-r1.patch b/040_all_tcpd-vars-fix-r1.patch deleted file mode 100644 index 20a3798..0000000 --- a/040_all_tcpd-vars-fix-r1.patch +++ /dev/null @@ -1,14 +0,0 @@ -###MY_VER_RANGE [5.0.11_beta,) ---- mysql-old/sql/mysqld.cc 2005-08-06 03:39:41.000000000 +0200 -+++ mysql-new/sql/mysqld.cc 2005-08-30 23:40:44.000000000 +0200 -@@ -126,8 +126,8 @@ - #ifdef NEED_SYS_SYSLOG_H - #include <sys/syslog.h> - #endif /* NEED_SYS_SYSLOG_H */ --int allow_severity = LOG_INFO; --int deny_severity = LOG_WARNING; -+//int allow_severity = LOG_INFO; -+//int deny_severity = LOG_WARNING; - - #endif /* HAVE_LIBWRAP */ - diff --git a/050_all_mysql-create_system_tables.patch b/050_all_mysql-create_system_tables.patch deleted file mode 100644 index 9440c77..0000000 --- a/050_all_mysql-create_system_tables.patch +++ /dev/null @@ -1,12 +0,0 @@ -###MY_VER_RANGE [5.0_alpha,5.0.10_beta) ---- mysql.old/scripts/mysql_create_system_tables.sh 2005-04-19 12:08:40.000000000 +0200 -+++ mysql-5.0.4-beta/scripts/mysql_create_system_tables.sh 2005-04-19 12:09:18.000000000 +0200 -@@ -714,7 +714,7 @@ - c_p="$c_p 'TRADITIONAL'," - c_p="$c_p 'NO_AUTO_CREATE_USER'," - c_p="$c_p 'HIGH_NOT_PRECEDENCE'" -- c_p="$c_p ) DEFAULT 0 NOT NULL," -+ c_p="$c_p ) DEFAULT '' NOT NULL," - c_p="$c_p comment char(64) binary DEFAULT '' NOT NULL," - c_p="$c_p PRIMARY KEY (db,name,type)" - c_p="$c_p ) comment='Stored Procedures';" diff --git a/060_all_myxml_by_Alexander_Barkov.patch b/060_all_myxml_by_Alexander_Barkov.patch deleted file mode 100644 index 3dffe00..0000000 --- a/060_all_myxml_by_Alexander_Barkov.patch +++ /dev/null @@ -1,6170 +0,0 @@ -###MY_VER_RANGE [5.0.6_beta,) -###MY_USE_FLAG barkov-xml -diff -Naur mysql.orig/include/my_xml.h mysql.xml/include/my_xml.h ---- mysql.orig/include/my_xml.h 2005-05-15 06:16:51.000000000 +0200 -+++ mysql.xml/include/my_xml.h 2005-05-20 15:19:29.000000000 +0200 -@@ -26,8 +26,31 @@ - #define MY_XML_OK 0 - #define MY_XML_ERROR 1 - -+/* -+ A flag whether to use absolute tag names in call-back functions, -+ like "a", "a.b" and "a.b.c" (used in character set file parser), -+ or relative names like "a", "b" and "c". -+*/ -+#define MY_XML_FLAG_RELATIVE_NAMES 1 -+ -+/* -+ A flag whether to skip normilization of text values before calling -+ call-back functions: i.e. skip leading/trailing spaces, -+ \r, \n, \t characters. -+*/ -+#define MY_XML_FLAG_SKIP_TEXT_NORMALIZATION 2 -+ -+enum my_xml_node_type -+{ -+ MY_XML_NODE_TAG, /* can have TAG, ATTR and TEXT children */ -+ MY_XML_NODE_ATTR, /* can have TEXT children */ -+ MY_XML_NODE_TEXT /* cannot have children */ -+}; -+ - typedef struct xml_stack_st - { -+ int flags; -+ enum my_xml_node_type current_node_type; - char errstr[128]; - char attr[128]; - char *attrend; -diff -Naur mysql.orig/mysql-test/r/xml.result mysql.xml/mysql-test/r/xml.result ---- mysql.orig/mysql-test/r/xml.result 1970-01-01 01:00:00.000000000 +0100 -+++ mysql.xml/mysql-test/r/xml.result 2005-04-13 09:17:23.000000000 +0200 -@@ -0,0 +1,522 @@ -+SET @xml='<a aa1="aa1" aa2="aa2">a1<b ba1="ba1">b1<c>c1</c>b2</b>a2</a>'; -+SELECT extractValue(@xml,'/a'); -+extractValue(@xml,'/a') -+a1 a2 -+SELECT extractValue(@xml,'/a/b'); -+extractValue(@xml,'/a/b') -+b1 b2 -+SELECT extractValue(@xml,'/a/b/c'); -+extractValue(@xml,'/a/b/c') -+c1 -+SELECT extractValue(@xml,'/a/@aa1'); -+extractValue(@xml,'/a/@aa1') -+aa1 -+SELECT extractValue(@xml,'/a/@aa2'); -+extractValue(@xml,'/a/@aa2') -+aa2 -+SELECT extractValue(@xml,'/a/@*'); -+extractValue(@xml,'/a/@*') -+aa1 aa2 -+SELECT extractValue(@xml,'//@ba1'); -+extractValue(@xml,'//@ba1') -+ba1 -+SELECT extractValue(@xml,'//a'); -+extractValue(@xml,'//a') -+a1 a2 -+SELECT extractValue(@xml,'//b'); -+extractValue(@xml,'//b') -+b1 b2 -+SELECT extractValue(@xml,'//c'); -+extractValue(@xml,'//c') -+c1 -+SELECT extractValue(@xml,'/a//b'); -+extractValue(@xml,'/a//b') -+b1 b2 -+SELECT extractValue(@xml,'/a//c'); -+extractValue(@xml,'/a//c') -+c1 -+SELECT extractValue(@xml,'//*'); -+extractValue(@xml,'//*') -+a1 b1 c1 b2 a2 -+SELECT extractValue(@xml,'/a//*'); -+extractValue(@xml,'/a//*') -+b1 c1 b2 -+SELECT extractValue(@xml,'/./a'); -+extractValue(@xml,'/./a') -+a1 a2 -+SELECT extractValue(@xml,'/a/b/.'); -+extractValue(@xml,'/a/b/.') -+b1 b2 -+SELECT extractValue(@xml,'/a/b/..'); -+extractValue(@xml,'/a/b/..') -+a1 a2 -+SELECT extractValue(@xml,'/a/b/../@aa1'); -+extractValue(@xml,'/a/b/../@aa1') -+aa1 -+SELECT extractValue(@xml,'/*'); -+extractValue(@xml,'/*') -+a1 a2 -+SELECT extractValue(@xml,'/*/*'); -+extractValue(@xml,'/*/*') -+b1 b2 -+SELECT extractValue(@xml,'/*/*/*'); -+extractValue(@xml,'/*/*/*') -+c1 -+SELECT extractValue(@xml,'/a/child::*'); -+extractValue(@xml,'/a/child::*') -+b1 b2 -+SELECT extractValue(@xml,'/a/descendant::*'); -+extractValue(@xml,'/a/descendant::*') -+b1 c1 b2 -+SELECT extractValue(@xml,'/a/descendant-or-self::*'); -+extractValue(@xml,'/a/descendant-or-self::*') -+a1 b1 c1 b2 a2 -+SELECT extractValue(@xml,'/a/attribute::*'); -+extractValue(@xml,'/a/attribute::*') -+aa1 aa2 -+SELECT extractValue(@xml,'/a/b/c/parent::*'); -+extractValue(@xml,'/a/b/c/parent::*') -+b1 b2 -+SELECT extractValue(@xml,'/a/b/c/ancestor::*'); -+extractValue(@xml,'/a/b/c/ancestor::*') -+a1 b1 b2 a2 -+SELECT extractValue(@xml,'/a/b/c/ancestor-or-self::*'); -+extractValue(@xml,'/a/b/c/ancestor-or-self::*') -+a1 b1 c1 b2 a2 -+SELECT extractValue(@xml,'/descendant-or-self::*'); -+extractValue(@xml,'/descendant-or-self::*') -+a1 b1 c1 b2 a2 -+SET @xml='<a>a11<b ba="ba11" ba="ba12">b11</b><b ba="ba21" ba="ba22">b21<c>c1</c>b22</b>a12</a>'; -+SELECT extractValue(@xml,'/a/b/c/ancestor-or-self::*'); -+extractValue(@xml,'/a/b/c/ancestor-or-self::*') -+a11 b21 c1 b22 a12 -+SELECT extractValue(@xml,'//@ba'); -+extractValue(@xml,'//@ba') -+ba11 ba12 ba21 ba22 -+SET @xml='<a><b>b</b><c>c</c></a>'; -+SELECT extractValue(@xml,'/a/b'); -+extractValue(@xml,'/a/b') -+b -+SELECT extractValue(@xml,'/a/c'); -+extractValue(@xml,'/a/c') -+c -+SELECT extractValue(@xml,'/a/child::b'); -+extractValue(@xml,'/a/child::b') -+b -+SELECT extractValue(@xml,'/a/child::c'); -+extractValue(@xml,'/a/child::c') -+c -+SET @xml='<a><b>b1</b><c>c1</c><b>b2</b><c>c2</c></a>'; -+SELECT extractValue(@xml,'/a/b[1]'); -+extractValue(@xml,'/a/b[1]') -+b1 -+SELECT extractValue(@xml,'/a/b[2]'); -+extractValue(@xml,'/a/b[2]') -+b2 -+SELECT extractValue(@xml,'/a/c[1]'); -+extractValue(@xml,'/a/c[1]') -+c1 -+SELECT extractValue(@xml,'/a/c[2]'); -+extractValue(@xml,'/a/c[2]') -+c2 -+SET @xml='<a><b x="xb1" x="xb2"/><c x="xc1" x="xc2"/></a>'; -+SELECT extractValue(@xml,'/a//@x'); -+extractValue(@xml,'/a//@x') -+xb1 xb2 xc1 xc2 -+SELECT extractValue(@xml,'/a//@x[1]'); -+extractValue(@xml,'/a//@x[1]') -+xb1 xc1 -+SELECT extractValue(@xml,'/a//@x[2]'); -+extractValue(@xml,'/a//@x[2]') -+xb2 xc2 -+SET @xml='<a><b>b1</b><b>b2</b><c><b>c1b1</b><b>c1b2</b></c><c><b>c2b1</c></b>/a>'; -+SELECT extractValue(@xml,'//b[1]'); -+extractValue(@xml,'//b[1]') -+b1 c1b1 c2b1 -+SELECT extractValue(@xml,'/descendant::b[1]'); -+extractValue(@xml,'/descendant::b[1]') -+b1 -+SET @xml='<a><b>b1</b><b>b2</b></a>'; -+SELECT extractValue(@xml,'/a/b[1+0]'); -+extractValue(@xml,'/a/b[1+0]') -+b1 -+SELECT extractValue(@xml,'/a/b[1*1]'); -+extractValue(@xml,'/a/b[1*1]') -+b1 -+SELECT extractValue(@xml,'/a/b[--1]'); -+extractValue(@xml,'/a/b[--1]') -+b1 -+SELECT extractValue(@xml,'/a/b[2*1-1]'); -+extractValue(@xml,'/a/b[2*1-1]') -+b1 -+SELECT extractValue(@xml,'/a/b[1+1]'); -+extractValue(@xml,'/a/b[1+1]') -+b2 -+SELECT extractValue(@xml,'/a/b[1*2]'); -+extractValue(@xml,'/a/b[1*2]') -+b2 -+SELECT extractValue(@xml,'/a/b[--2]'); -+extractValue(@xml,'/a/b[--2]') -+b2 -+SELECT extractValue(@xml,'/a/b[1*(3-1)]'); -+extractValue(@xml,'/a/b[1*(3-1)]') -+b2 -+SELECT extractValue(@xml,'//*[1=1]'); -+extractValue(@xml,'//*[1=1]') -+b1 b2 -+SELECT extractValue(@xml,'//*[1!=1]'); -+extractValue(@xml,'//*[1!=1]') -+ -+SELECT extractValue(@xml,'//*[1>1]'); -+extractValue(@xml,'//*[1>1]') -+ -+SELECT extractValue(@xml,'//*[2>1]'); -+extractValue(@xml,'//*[2>1]') -+b1 b2 -+SELECT extractValue(@xml,'//*[1>2]'); -+extractValue(@xml,'//*[1>2]') -+ -+SELECT extractValue(@xml,'//*[1>=1]'); -+extractValue(@xml,'//*[1>=1]') -+b1 b2 -+SELECT extractValue(@xml,'//*[2>=1]'); -+extractValue(@xml,'//*[2>=1]') -+b1 b2 -+SELECT extractValue(@xml,'//*[1>=2]'); -+extractValue(@xml,'//*[1>=2]') -+ -+SELECT extractValue(@xml,'//*[1<1]'); -+extractValue(@xml,'//*[1<1]') -+ -+SELECT extractValue(@xml,'//*[2<1]'); -+extractValue(@xml,'//*[2<1]') -+ -+SELECT extractValue(@xml,'//*[1<2]'); -+extractValue(@xml,'//*[1<2]') -+b1 b2 -+SELECT extractValue(@xml,'//*[1<=1]'); -+extractValue(@xml,'//*[1<=1]') -+b1 b2 -+SELECT extractValue(@xml,'//*[2<=1]'); -+extractValue(@xml,'//*[2<=1]') -+ -+SELECT extractValue(@xml,'//*[1<=2]'); -+extractValue(@xml,'//*[1<=2]') -+b1 b2 -+SET @xml='<a><b>b11<c>c11</c></b><b>b21<c>c21</c></b></a>'; -+SELECT extractValue(@xml,'/a/b[c="c11"]'); -+extractValue(@xml,'/a/b[c="c11"]') -+b11 -+SELECT extractValue(@xml,'/a/b[c="c21"]'); -+extractValue(@xml,'/a/b[c="c21"]') -+b21 -+SET @xml='<a><b c="c11">b11</b><b c="c21">b21</b></a>'; -+SELECT extractValue(@xml,'/a/b[@c="c11"]'); -+extractValue(@xml,'/a/b[@c="c11"]') -+b11 -+SELECT extractValue(@xml,'/a/b[@c="c21"]'); -+extractValue(@xml,'/a/b[@c="c21"]') -+b21 -+SET @xml='<a>a1<b c="c11">b11<d>d11</d></b><b c="c21">b21<d>d21</d></b></a>'; -+SELECT extractValue(@xml, '/a/b[@c="c11"]/d'); -+extractValue(@xml, '/a/b[@c="c11"]/d') -+d11 -+SELECT extractValue(@xml, '/a/b[@c="c21"]/d'); -+extractValue(@xml, '/a/b[@c="c21"]/d') -+d21 -+SELECT extractValue(@xml, '/a/b[d="d11"]/@c'); -+extractValue(@xml, '/a/b[d="d11"]/@c') -+c11 -+SELECT extractValue(@xml, '/a/b[d="d21"]/@c'); -+extractValue(@xml, '/a/b[d="d21"]/@c') -+c21 -+SELECT extractValue(@xml, '/a[b="b11"]'); -+extractValue(@xml, '/a[b="b11"]') -+a1 -+SELECT extractValue(@xml, '/a[b/@c="c11"]'); -+extractValue(@xml, '/a[b/@c="c11"]') -+a1 -+SELECT extractValue(@xml, '/a[b/d="d11"]'); -+extractValue(@xml, '/a[b/d="d11"]') -+a1 -+SELECT extractValue(@xml, '/a[/a/b="b11"]'); -+extractValue(@xml, '/a[/a/b="b11"]') -+a1 -+SELECT extractValue(@xml, '/a[/a/b/@c="c11"]'); -+extractValue(@xml, '/a[/a/b/@c="c11"]') -+a1 -+SELECT extractValue(@xml, '/a[/a/b/d="d11"]'); -+extractValue(@xml, '/a[/a/b/d="d11"]') -+a1 -+SELECT extractValue('<a>a</a>', '/a[false()]'); -+extractValue('<a>a</a>', '/a[false()]') -+ -+SELECT extractValue('<a>a</a>', '/a[true()]'); -+extractValue('<a>a</a>', '/a[true()]') -+a -+SELECT extractValue('<a>a</a>', '/a[not(false())]'); -+extractValue('<a>a</a>', '/a[not(false())]') -+a -+SELECT extractValue('<a>a</a>', '/a[not(true())]'); -+extractValue('<a>a</a>', '/a[not(true())]') -+ -+SELECT extractValue('<a>a</a>', '/a[true() and true()]'); -+extractValue('<a>a</a>', '/a[true() and true()]') -+a -+SELECT extractValue('<a>a</a>', '/a[true() and false()]'); -+extractValue('<a>a</a>', '/a[true() and false()]') -+ -+SELECT extractValue('<a>a</a>', '/a[false()and false()]'); -+extractValue('<a>a</a>', '/a[false()and false()]') -+ -+SELECT extractValue('<a>a</a>', '/a[false()and true()]'); -+extractValue('<a>a</a>', '/a[false()and true()]') -+ -+SELECT extractValue('<a>a</a>', '/a[true() or true()]'); -+extractValue('<a>a</a>', '/a[true() or true()]') -+a -+SELECT extractValue('<a>a</a>', '/a[true() or false()]'); -+extractValue('<a>a</a>', '/a[true() or false()]') -+a -+SELECT extractValue('<a>a</a>', '/a[false()or false()]'); -+extractValue('<a>a</a>', '/a[false()or false()]') -+ -+SELECT extractValue('<a>a</a>', '/a[false()or true()]'); -+extractValue('<a>a</a>', '/a[false()or true()]') -+a -+SET @xml='<a>ab<b c="c" c="e">b1</b><b c="d">b2</b><b c="f" c="e">b3</b></a>'; -+select extractValue(@xml,'/a/b[@c="c"]'); -+extractValue(@xml,'/a/b[@c="c"]') -+b1 -+select extractValue(@xml,'/a/b[@c="d"]'); -+extractValue(@xml,'/a/b[@c="d"]') -+b2 -+select extractValue(@xml,'/a/b[@c="e"]'); -+extractValue(@xml,'/a/b[@c="e"]') -+b1 b3 -+select extractValue(@xml,'/a/b[not(@c="e")]'); -+extractValue(@xml,'/a/b[not(@c="e")]') -+b2 -+select extractValue(@xml,'/a/b[@c!="e"]'); -+extractValue(@xml,'/a/b[@c!="e"]') -+b1 b2 b3 -+select extractValue(@xml,'/a/b[@c="c" or @c="d"]'); -+extractValue(@xml,'/a/b[@c="c" or @c="d"]') -+b1 b2 -+select extractValue(@xml,'/a/b[@c="c" and @c="e"]'); -+extractValue(@xml,'/a/b[@c="c" and @c="e"]') -+b1 -+SET @xml='<a><b c="c" d="d">b1</b><b d="d" e="e">b2</b></a>'; -+select extractValue(@xml,'/a/b[@c]'); -+extractValue(@xml,'/a/b[@c]') -+b1 -+select extractValue(@xml,'/a/b[@d]'); -+extractValue(@xml,'/a/b[@d]') -+b1 b2 -+select extractValue(@xml,'/a/b[@e]'); -+extractValue(@xml,'/a/b[@e]') -+b2 -+select extractValue(@xml,'/a/b[not(@c)]'); -+extractValue(@xml,'/a/b[not(@c)]') -+b2 -+select extractValue(@xml,'/a/b[not(@d)]'); -+extractValue(@xml,'/a/b[not(@d)]') -+ -+select extractValue(@xml,'/a/b[not(@e)]'); -+extractValue(@xml,'/a/b[not(@e)]') -+b1 -+select extractValue(@xml, '/a/b[boolean(@c) or boolean(@d)]'); -+extractValue(@xml, '/a/b[boolean(@c) or boolean(@d)]') -+b1 b2 -+select extractValue(@xml, '/a/b[boolean(@c) or boolean(@e)]'); -+extractValue(@xml, '/a/b[boolean(@c) or boolean(@e)]') -+b1 b2 -+select extractValue(@xml, '/a/b[boolean(@d) or boolean(@e)]'); -+extractValue(@xml, '/a/b[boolean(@d) or boolean(@e)]') -+b1 b2 -+select extractValue(@xml, '/a/b[boolean(@c) and boolean(@d)]'); -+extractValue(@xml, '/a/b[boolean(@c) and boolean(@d)]') -+b1 -+select extractValue(@xml, '/a/b[boolean(@c) and boolean(@e)]'); -+extractValue(@xml, '/a/b[boolean(@c) and boolean(@e)]') -+ -+select extractValue(@xml, '/a/b[boolean(@d) and boolean(@e)]'); -+extractValue(@xml, '/a/b[boolean(@d) and boolean(@e)]') -+b2 -+select extractValue(@xml, '/a/b[@c or @d]'); -+extractValue(@xml, '/a/b[@c or @d]') -+b1 b2 -+select extractValue(@xml, '/a/b[@c or @e]'); -+extractValue(@xml, '/a/b[@c or @e]') -+b1 b2 -+select extractValue(@xml, '/a/b[@d or @e]'); -+extractValue(@xml, '/a/b[@d or @e]') -+b1 b2 -+select extractValue(@xml, '/a/b[@c and @d]'); -+extractValue(@xml, '/a/b[@c and @d]') -+b1 -+select extractValue(@xml, '/a/b[@c and @e]'); -+extractValue(@xml, '/a/b[@c and @e]') -+ -+select extractValue(@xml, '/a/b[@d and @e]'); -+extractValue(@xml, '/a/b[@d and @e]') -+b2 -+SET @xml='<a><b c="c">b1</b><b>b2</b></a>'; -+SELECT extractValue(@xml,'/a/b[@*]'); -+extractValue(@xml,'/a/b[@*]') -+b1 -+SELECT extractValue(@xml,'/a/b[not(@*)]'); -+extractValue(@xml,'/a/b[not(@*)]') -+b2 -+SELECT extractValue('<a>a</a>', '/a[ceiling(3.1)=4]'); -+extractValue('<a>a</a>', '/a[ceiling(3.1)=4]') -+a -+SELECT extractValue('<a>a</a>', '/a[floor(3.1)=3]'); -+extractValue('<a>a</a>', '/a[floor(3.1)=3]') -+a -+SELECT extractValue('<a>a</a>', '/a[round(3.1)=3]'); -+extractValue('<a>a</a>', '/a[round(3.1)=3]') -+a -+SELECT extractValue('<a>a</a>', '/a[round(3.8)=4]'); -+extractValue('<a>a</a>', '/a[round(3.8)=4]') -+a -+SELECT extractValue('<a><b>b</b><c>c</c></a>', '/a/b | /a/c'); -+extractValue('<a><b>b</b><c>c</c></a>', '/a/b | /a/c') -+b c -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[position()=1]'); -+extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[position()=1]') -+b1 -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[position()=2]'); -+extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[position()=2]') -+b2 -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[position()=3]'); -+extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[position()=3]') -+b3 -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[1=position()]'); -+extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[1=position()]') -+b1 -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[2=position()]'); -+extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[2=position()]') -+b2 -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[3=position()]'); -+extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[3=position()]') -+b3 -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[2>=position()]'); -+extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[2>=position()]') -+b1 b2 -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[2<=position()]'); -+extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[2<=position()]') -+b2 b3 -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[position()=3 or position()=2]'); -+extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[position()=3 or position()=2]') -+b2 b3 -+SELECT extractValue('<a>a<b>a1<c>c1</c></b><b>a2</b></a>','/a/b[count(c)=0]'); -+extractValue('<a>a<b>a1<c>c1</c></b><b>a2</b></a>','/a/b[count(c)=0]') -+a2 -+SELECT extractValue('<a>a<b>a1<c>c1</c></b><b>a2</b></a>','/a/b[count(c)=1]'); -+extractValue('<a>a<b>a1<c>c1</c></b><b>a2</b></a>','/a/b[count(c)=1]') -+a1 -+select extractValue('<a>a1<b ba="1" ba="2">b1</b><b>b2</b>4</a>','/a/b[sum(@ba)=3]'); -+extractValue('<a>a1<b ba="1" ba="2">b1</b><b>b2</b>4</a>','/a/b[sum(@ba)=3]') -+b1 -+select extractValue('<a><b>b1</b><b>b2</b></a>','/a/b[1]'); -+extractValue('<a><b>b1</b><b>b2</b></a>','/a/b[1]') -+b1 -+select extractValue('<a><b>b1</b><b>b2</b></a>','/a/b[boolean(1)]'); -+extractValue('<a><b>b1</b><b>b2</b></a>','/a/b[boolean(1)]') -+b1 b2 -+select extractValue('<a><b>b1</b><b>b2</b></a>','/a/b[true()]'); -+extractValue('<a><b>b1</b><b>b2</b></a>','/a/b[true()]') -+b1 b2 -+select extractValue('<a><b>b1</b><b>b2</b></a>','/a/b[number(true())]'); -+extractValue('<a><b>b1</b><b>b2</b></a>','/a/b[number(true())]') -+b1 -+select extractValue('<a>ab</a>','/a[contains("abc","b")]'); -+extractValue('<a>ab</a>','/a[contains("abc","b")]') -+ab -+select extractValue('<a>ab</a>','/a[contains(.,"a")]'); -+extractValue('<a>ab</a>','/a[contains(.,"a")]') -+ab -+select extractValue('<a>ab</a>','/a[contains(.,"b")]'); -+extractValue('<a>ab</a>','/a[contains(.,"b")]') -+ab -+select extractValue('<a>ab</a>','/a[contains(.,"c")]'); -+extractValue('<a>ab</a>','/a[contains(.,"c")]') -+ -+select extractValue('<a b="1">ab</a>','/a[concat(@b,"2")="12"]'); -+extractValue('<a b="1">ab</a>','/a[concat(@b,"2")="12"]') -+ab -+SET @xml='<a b="11" b="12" b="21" b="22">ab</a>'; -+select extractValue(@xml, '/a/@b[substring(.,2)="1"]'); -+extractValue(@xml, '/a/@b[substring(.,2)="1"]') -+11 21 -+select extractValue(@xml, '/a/@b[substring(.,2)="2"]'); -+extractValue(@xml, '/a/@b[substring(.,2)="2"]') -+12 22 -+select extractValue(@xml, '/a/@b[substring(.,1,1)="1"]'); -+extractValue(@xml, '/a/@b[substring(.,1,1)="1"]') -+11 12 -+select extractValue(@xml, '/a/@b[substring(.,1,1)="2"]'); -+extractValue(@xml, '/a/@b[substring(.,1,1)="2"]') -+21 22 -+select extractValue(@xml, '/a/@b[substring(.,2,1)="1"]'); -+extractValue(@xml, '/a/@b[substring(.,2,1)="1"]') -+11 21 -+select extractValue(@xml, '/a/@b[substring(.,2,1)="2"]'); -+extractValue(@xml, '/a/@b[substring(.,2,1)="2"]') -+12 22 -+SET @xml='<a b="b11" b="b12" b="b21" b="22"/>'; -+select extractValue(@xml,'/a/@b'); -+extractValue(@xml,'/a/@b') -+b11 b12 b21 22 -+select extractValue(@xml,'/a/@b[contains(.,"1")]'); -+extractValue(@xml,'/a/@b[contains(.,"1")]') -+b11 b12 b21 -+select extractValue(@xml,'/a/@b[contains(.,"1")][contains(.,"2")]'); -+extractValue(@xml,'/a/@b[contains(.,"1")][contains(.,"2")]') -+b12 b21 -+select extractValue(@xml,'/a/@b[contains(.,"1")][contains(.,"2")][2]'); -+extractValue(@xml,'/a/@b[contains(.,"1")][contains(.,"2")][2]') -+b21 -+SET @xml='<a>a1<b>b1<c>c1</c>b2</b>a2</a>'; -+select UpdateXML('<a>a1<b>b1<c>c1</c>b2</b>a2</a>','/a/b/c','+++++++++'); -+UpdateXML('<a>a1<b>b1<c>c1</c>b2</b>a2</a>','/a/b/c','+++++++++') -+<a>a1<b>b1+++++++++b2</b>a2</a> -+select UpdateXML('<a>a1<b>b1<c>c1</c>b2</b>a2</a>','/a/b/c','<c1>+++++++++</c1>'); -+UpdateXML('<a>a1<b>b1<c>c1</c>b2</b>a2</a>','/a/b/c','<c1>+++++++++</c1>') -+<a>a1<b>b1<c1>+++++++++</c1>b2</b>a2</a> -+select UpdateXML('<a>a1<b>b1<c>c1</c>b2</b>a2</a>','/a/b/c','<c1/>'); -+UpdateXML('<a>a1<b>b1<c>c1</c>b2</b>a2</a>','/a/b/c','<c1/>') -+<a>a1<b>b1<c1/>b2</b>a2</a> -+SET @xml='<a><b>bb</b></a>'; -+select UpdateXML(@xml, '/a/b', '<b>ccc</b>'); -+UpdateXML(@xml, '/a/b', '<b>ccc</b>') -+<a><b>ccc</b></a> -+SET @xml='<a aa1="aa1" aa2="aa2"><b bb1="bb1" bb2="bb2">bb</b></a>'; -+select UpdateXML(@xml, '/a/b', '<b>ccc</b>'); -+UpdateXML(@xml, '/a/b', '<b>ccc</b>') -+<a aa1="aa1" aa2="aa2"><b>ccc</b></a> -+select UpdateXML(@xml, '/a/@aa1', ''); -+UpdateXML(@xml, '/a/@aa1', '') -+<a aa2="aa2"><b bb1="bb1" bb2="bb2">bb</b></a> -+select UpdateXML(@xml, '/a/@aa1', 'aa3="aa3"'); -+UpdateXML(@xml, '/a/@aa1', 'aa3="aa3"') -+<a aa3="aa3" aa2="aa2"><b bb1="bb1" bb2="bb2">bb</b></a> -+select UpdateXML(@xml, '/a/@aa2', ''); -+UpdateXML(@xml, '/a/@aa2', '') -+<a aa1="aa1" ><b bb1="bb1" bb2="bb2">bb</b></a> -+select UpdateXML(@xml, '/a/@aa2', 'aa3="aa3"'); -+UpdateXML(@xml, '/a/@aa2', 'aa3="aa3"') -+<a aa1="aa1" aa3="aa3"><b bb1="bb1" bb2="bb2">bb</b></a> -+select UpdateXML(@xml, '/a/b/@bb1', ''); -+UpdateXML(@xml, '/a/b/@bb1', '') -+<a aa1="aa1" aa2="aa2"><b bb2="bb2">bb</b></a> -+select UpdateXML(@xml, '/a/b/@bb1', 'bb3="bb3"'); -+UpdateXML(@xml, '/a/b/@bb1', 'bb3="bb3"') -+<a aa1="aa1" aa2="aa2"><b bb3="bb3" bb2="bb2">bb</b></a> -+select UpdateXML(@xml, '/a/b/@bb2', ''); -+UpdateXML(@xml, '/a/b/@bb2', '') -+<a aa1="aa1" aa2="aa2"><b bb1="bb1" >bb</b></a> -+select UpdateXML(@xml, '/a/b/@bb2', 'bb3="bb3"'); -+UpdateXML(@xml, '/a/b/@bb2', 'bb3="bb3"') -+<a aa1="aa1" aa2="aa2"><b bb1="bb1" bb3="bb3">bb</b></a> -diff -Naur mysql.orig/mysql-test/t/xml.test mysql.xml/mysql-test/t/xml.test ---- mysql.orig/mysql-test/t/xml.test 1970-01-01 01:00:00.000000000 +0100 -+++ mysql.xml/mysql-test/t/xml.test 2005-04-13 09:15:03.000000000 +0200 -@@ -0,0 +1,217 @@ -+SET @xml='<a aa1="aa1" aa2="aa2">a1<b ba1="ba1">b1<c>c1</c>b2</b>a2</a>'; -+SELECT extractValue(@xml,'/a'); -+SELECT extractValue(@xml,'/a/b'); -+SELECT extractValue(@xml,'/a/b/c'); -+SELECT extractValue(@xml,'/a/@aa1'); -+SELECT extractValue(@xml,'/a/@aa2'); -+SELECT extractValue(@xml,'/a/@*'); -+SELECT extractValue(@xml,'//@ba1'); -+ -+SELECT extractValue(@xml,'//a'); -+SELECT extractValue(@xml,'//b'); -+SELECT extractValue(@xml,'//c'); -+SELECT extractValue(@xml,'/a//b'); -+SELECT extractValue(@xml,'/a//c'); -+SELECT extractValue(@xml,'//*'); -+SELECT extractValue(@xml,'/a//*'); -+SELECT extractValue(@xml,'/./a'); -+SELECT extractValue(@xml,'/a/b/.'); -+SELECT extractValue(@xml,'/a/b/..'); -+SELECT extractValue(@xml,'/a/b/../@aa1'); -+SELECT extractValue(@xml,'/*'); -+SELECT extractValue(@xml,'/*/*'); -+SELECT extractValue(@xml,'/*/*/*'); -+ -+SELECT extractValue(@xml,'/a/child::*'); -+SELECT extractValue(@xml,'/a/descendant::*'); -+SELECT extractValue(@xml,'/a/descendant-or-self::*'); -+SELECT extractValue(@xml,'/a/attribute::*'); -+SELECT extractValue(@xml,'/a/b/c/parent::*'); -+SELECT extractValue(@xml,'/a/b/c/ancestor::*'); -+SELECT extractValue(@xml,'/a/b/c/ancestor-or-self::*'); -+SELECT extractValue(@xml,'/descendant-or-self::*'); -+ -+SET @xml='<a>a11<b ba="ba11" ba="ba12">b11</b><b ba="ba21" ba="ba22">b21<c>c1</c>b22</b>a12</a>'; -+SELECT extractValue(@xml,'/a/b/c/ancestor-or-self::*'); -+SELECT extractValue(@xml,'//@ba'); -+ -+SET @xml='<a><b>b</b><c>c</c></a>'; -+SELECT extractValue(@xml,'/a/b'); -+SELECT extractValue(@xml,'/a/c'); -+SELECT extractValue(@xml,'/a/child::b'); -+SELECT extractValue(@xml,'/a/child::c'); -+ -+SET @xml='<a><b>b1</b><c>c1</c><b>b2</b><c>c2</c></a>'; -+SELECT extractValue(@xml,'/a/b[1]'); -+SELECT extractValue(@xml,'/a/b[2]'); -+SELECT extractValue(@xml,'/a/c[1]'); -+SELECT extractValue(@xml,'/a/c[2]'); -+ -+SET @xml='<a><b x="xb1" x="xb2"/><c x="xc1" x="xc2"/></a>'; -+SELECT extractValue(@xml,'/a//@x'); -+SELECT extractValue(@xml,'/a//@x[1]'); -+SELECT extractValue(@xml,'/a//@x[2]'); -+ -+SET @xml='<a><b>b1</b><b>b2</b><c><b>c1b1</b><b>c1b2</b></c><c><b>c2b1</c></b>/a>'; -+SELECT extractValue(@xml,'//b[1]'); -+SELECT extractValue(@xml,'/descendant::b[1]'); -+ -+SET @xml='<a><b>b1</b><b>b2</b></a>'; -+SELECT extractValue(@xml,'/a/b[1+0]'); -+SELECT extractValue(@xml,'/a/b[1*1]'); -+SELECT extractValue(@xml,'/a/b[--1]'); -+SELECT extractValue(@xml,'/a/b[2*1-1]'); -+ -+SELECT extractValue(@xml,'/a/b[1+1]'); -+SELECT extractValue(@xml,'/a/b[1*2]'); -+SELECT extractValue(@xml,'/a/b[--2]'); -+SELECT extractValue(@xml,'/a/b[1*(3-1)]'); -+ -+SELECT extractValue(@xml,'//*[1=1]'); -+SELECT extractValue(@xml,'//*[1!=1]'); -+SELECT extractValue(@xml,'//*[1>1]'); -+SELECT extractValue(@xml,'//*[2>1]'); -+SELECT extractValue(@xml,'//*[1>2]'); -+SELECT extractValue(@xml,'//*[1>=1]'); -+SELECT extractValue(@xml,'//*[2>=1]'); -+SELECT extractValue(@xml,'//*[1>=2]'); -+SELECT extractValue(@xml,'//*[1<1]'); -+SELECT extractValue(@xml,'//*[2<1]'); -+SELECT extractValue(@xml,'//*[1<2]'); -+SELECT extractValue(@xml,'//*[1<=1]'); -+SELECT extractValue(@xml,'//*[2<=1]'); -+SELECT extractValue(@xml,'//*[1<=2]'); -+ -+SET @xml='<a><b>b11<c>c11</c></b><b>b21<c>c21</c></b></a>'; -+SELECT extractValue(@xml,'/a/b[c="c11"]'); -+SELECT extractValue(@xml,'/a/b[c="c21"]'); -+ -+SET @xml='<a><b c="c11">b11</b><b c="c21">b21</b></a>'; -+SELECT extractValue(@xml,'/a/b[@c="c11"]'); -+SELECT extractValue(@xml,'/a/b[@c="c21"]'); -+ -+SET @xml='<a>a1<b c="c11">b11<d>d11</d></b><b c="c21">b21<d>d21</d></b></a>'; -+SELECT extractValue(@xml, '/a/b[@c="c11"]/d'); -+SELECT extractValue(@xml, '/a/b[@c="c21"]/d'); -+SELECT extractValue(@xml, '/a/b[d="d11"]/@c'); -+SELECT extractValue(@xml, '/a/b[d="d21"]/@c'); -+SELECT extractValue(@xml, '/a[b="b11"]'); -+SELECT extractValue(@xml, '/a[b/@c="c11"]'); -+SELECT extractValue(@xml, '/a[b/d="d11"]'); -+SELECT extractValue(@xml, '/a[/a/b="b11"]'); -+SELECT extractValue(@xml, '/a[/a/b/@c="c11"]'); -+SELECT extractValue(@xml, '/a[/a/b/d="d11"]'); -+ -+SELECT extractValue('<a>a</a>', '/a[false()]'); -+SELECT extractValue('<a>a</a>', '/a[true()]'); -+SELECT extractValue('<a>a</a>', '/a[not(false())]'); -+SELECT extractValue('<a>a</a>', '/a[not(true())]'); -+SELECT extractValue('<a>a</a>', '/a[true() and true()]'); -+SELECT extractValue('<a>a</a>', '/a[true() and false()]'); -+SELECT extractValue('<a>a</a>', '/a[false()and false()]'); -+SELECT extractValue('<a>a</a>', '/a[false()and true()]'); -+SELECT extractValue('<a>a</a>', '/a[true() or true()]'); -+SELECT extractValue('<a>a</a>', '/a[true() or false()]'); -+SELECT extractValue('<a>a</a>', '/a[false()or false()]'); -+SELECT extractValue('<a>a</a>', '/a[false()or true()]'); -+ -+SET @xml='<a>ab<b c="c" c="e">b1</b><b c="d">b2</b><b c="f" c="e">b3</b></a>'; -+select extractValue(@xml,'/a/b[@c="c"]'); -+select extractValue(@xml,'/a/b[@c="d"]'); -+select extractValue(@xml,'/a/b[@c="e"]'); -+select extractValue(@xml,'/a/b[not(@c="e")]'); -+select extractValue(@xml,'/a/b[@c!="e"]'); -+select extractValue(@xml,'/a/b[@c="c" or @c="d"]'); -+select extractValue(@xml,'/a/b[@c="c" and @c="e"]'); -+ -+SET @xml='<a><b c="c" d="d">b1</b><b d="d" e="e">b2</b></a>'; -+select extractValue(@xml,'/a/b[@c]'); -+select extractValue(@xml,'/a/b[@d]'); -+select extractValue(@xml,'/a/b[@e]'); -+select extractValue(@xml,'/a/b[not(@c)]'); -+select extractValue(@xml,'/a/b[not(@d)]'); -+select extractValue(@xml,'/a/b[not(@e)]'); -+ -+select extractValue(@xml, '/a/b[boolean(@c) or boolean(@d)]'); -+select extractValue(@xml, '/a/b[boolean(@c) or boolean(@e)]'); -+select extractValue(@xml, '/a/b[boolean(@d) or boolean(@e)]'); -+select extractValue(@xml, '/a/b[boolean(@c) and boolean(@d)]'); -+select extractValue(@xml, '/a/b[boolean(@c) and boolean(@e)]'); -+select extractValue(@xml, '/a/b[boolean(@d) and boolean(@e)]'); -+ -+select extractValue(@xml, '/a/b[@c or @d]'); -+select extractValue(@xml, '/a/b[@c or @e]'); -+select extractValue(@xml, '/a/b[@d or @e]'); -+select extractValue(@xml, '/a/b[@c and @d]'); -+select extractValue(@xml, '/a/b[@c and @e]'); -+select extractValue(@xml, '/a/b[@d and @e]'); -+ -+SET @xml='<a><b c="c">b1</b><b>b2</b></a>'; -+SELECT extractValue(@xml,'/a/b[@*]'); -+SELECT extractValue(@xml,'/a/b[not(@*)]'); -+ -+SELECT extractValue('<a>a</a>', '/a[ceiling(3.1)=4]'); -+SELECT extractValue('<a>a</a>', '/a[floor(3.1)=3]'); -+SELECT extractValue('<a>a</a>', '/a[round(3.1)=3]'); -+SELECT extractValue('<a>a</a>', '/a[round(3.8)=4]'); -+ -+SELECT extractValue('<a><b>b</b><c>c</c></a>', '/a/b | /a/c'); -+ -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[position()=1]'); -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[position()=2]'); -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[position()=3]'); -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[1=position()]'); -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[2=position()]'); -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[3=position()]'); -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[2>=position()]'); -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[2<=position()]'); -+select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[position()=3 or position()=2]'); -+ -+SELECT extractValue('<a>a<b>a1<c>c1</c></b><b>a2</b></a>','/a/b[count(c)=0]'); -+SELECT extractValue('<a>a<b>a1<c>c1</c></b><b>a2</b></a>','/a/b[count(c)=1]'); -+select extractValue('<a>a1<b ba="1" ba="2">b1</b><b>b2</b>4</a>','/a/b[sum(@ba)=3]'); -+ -+select extractValue('<a><b>b1</b><b>b2</b></a>','/a/b[1]'); -+select extractValue('<a><b>b1</b><b>b2</b></a>','/a/b[boolean(1)]'); -+select extractValue('<a><b>b1</b><b>b2</b></a>','/a/b[true()]'); -+select extractValue('<a><b>b1</b><b>b2</b></a>','/a/b[number(true())]'); -+ -+select extractValue('<a>ab</a>','/a[contains("abc","b")]'); -+select extractValue('<a>ab</a>','/a[contains(.,"a")]'); -+select extractValue('<a>ab</a>','/a[contains(.,"b")]'); -+select extractValue('<a>ab</a>','/a[contains(.,"c")]'); -+ -+select extractValue('<a b="1">ab</a>','/a[concat(@b,"2")="12"]'); -+ -+SET @xml='<a b="11" b="12" b="21" b="22">ab</a>'; -+select extractValue(@xml, '/a/@b[substring(.,2)="1"]'); -+select extractValue(@xml, '/a/@b[substring(.,2)="2"]'); -+select extractValue(@xml, '/a/@b[substring(.,1,1)="1"]'); -+select extractValue(@xml, '/a/@b[substring(.,1,1)="2"]'); -+select extractValue(@xml, '/a/@b[substring(.,2,1)="1"]'); -+select extractValue(@xml, '/a/@b[substring(.,2,1)="2"]'); -+ -+SET @xml='<a b="b11" b="b12" b="b21" b="22"/>'; -+select extractValue(@xml,'/a/@b'); -+select extractValue(@xml,'/a/@b[contains(.,"1")]'); -+select extractValue(@xml,'/a/@b[contains(.,"1")][contains(.,"2")]'); -+select extractValue(@xml,'/a/@b[contains(.,"1")][contains(.,"2")][2]'); -+ -+SET @xml='<a>a1<b>b1<c>c1</c>b2</b>a2</a>'; -+select UpdateXML('<a>a1<b>b1<c>c1</c>b2</b>a2</a>','/a/b/c','+++++++++'); -+select UpdateXML('<a>a1<b>b1<c>c1</c>b2</b>a2</a>','/a/b/c','<c1>+++++++++</c1>'); -+select UpdateXML('<a>a1<b>b1<c>c1</c>b2</b>a2</a>','/a/b/c','<c1/>'); -+ -+SET @xml='<a><b>bb</b></a>'; -+select UpdateXML(@xml, '/a/b', '<b>ccc</b>'); -+ -+SET @xml='<a aa1="aa1" aa2="aa2"><b bb1="bb1" bb2="bb2">bb</b></a>'; -+select UpdateXML(@xml, '/a/b', '<b>ccc</b>'); -+select UpdateXML(@xml, '/a/@aa1', ''); -+select UpdateXML(@xml, '/a/@aa1', 'aa3="aa3"'); -+select UpdateXML(@xml, '/a/@aa2', ''); -+select UpdateXML(@xml, '/a/@aa2', 'aa3="aa3"'); -+select UpdateXML(@xml, '/a/b/@bb1', ''); -+select UpdateXML(@xml, '/a/b/@bb1', 'bb3="bb3"'); -+select UpdateXML(@xml, '/a/b/@bb2', ''); -+select UpdateXML(@xml, '/a/b/@bb2', 'bb3="bb3"'); -diff -Naur mysql.orig/sql/Makefile.am mysql.xml/sql/Makefile.am ---- mysql.orig/sql/Makefile.am 2005-05-15 06:16:51.000000000 +0200 -+++ mysql.xml/sql/Makefile.am 2005-05-20 15:19:29.000000000 +0200 -@@ -45,6 +45,7 @@ - $(LDADD) $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ @openssl_libs@ - noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ - item_strfunc.h item_timefunc.h item_uniq.h \ -+ item_xmlfunc.h \ - item_create.h item_subselect.h item_row.h \ - mysql_priv.h item_geofunc.h sql_bitmap.h \ - procedure.h sql_class.h sql_lex.h sql_list.h \ -@@ -68,7 +69,7 @@ - item.cc item_sum.cc item_buff.cc item_func.cc \ - item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \ - thr_malloc.cc item_create.cc item_subselect.cc \ -- item_row.cc item_geofunc.cc \ -+ item_row.cc item_geofunc.cc item_xmlfunc.cc \ - field.cc strfunc.cc key.cc sql_class.cc sql_list.cc \ - net_serv.cc protocol.cc sql_state.c \ - lock.cc my_lock.c \ -diff -Naur mysql.orig/sql/item.h mysql.xml/sql/item.h ---- mysql.orig/sql/item.h 2005-05-15 06:16:50.000000000 +0200 -+++ mysql.xml/sql/item.h 2005-05-20 15:19:29.000000000 +0200 -@@ -241,7 +241,8 @@ - PROC_ITEM,COND_ITEM, REF_ITEM, FIELD_STD_ITEM, - FIELD_VARIANCE_ITEM, INSERT_VALUE_ITEM, - SUBSELECT_ITEM, ROW_ITEM, CACHE_ITEM, TYPE_HOLDER, -- PARAM_ITEM, TRIGGER_FIELD_ITEM, DECIMAL_ITEM}; -+ PARAM_ITEM, TRIGGER_FIELD_ITEM, DECIMAL_ITEM, -+ XPATH_NODESET, XPATH_NODESET_CMP }; - - enum cond_result { COND_UNDEF,COND_OK,COND_TRUE,COND_FALSE }; - -@@ -391,6 +392,7 @@ - TRUE value is true (not equal to 0) - */ - virtual bool val_bool(); -+ virtual String *val_nodeset(String*) { return 0; } - /* Helper functions, see item_sum.cc */ - String *val_string_from_real(String *str); - String *val_string_from_int(String *str); -@@ -1429,6 +1431,7 @@ - #include "item_timefunc.h" - #include "item_uniq.h" - #include "item_subselect.h" -+#include "item_xmlfunc.h" - - class Item_copy_string :public Item - { -diff -Naur mysql.orig/sql/item.h.orig mysql.xml/sql/item.h.orig ---- mysql.orig/sql/item.h.orig 1970-01-01 01:00:00.000000000 +0100 -+++ mysql.xml/sql/item.h.orig 2005-05-15 06:16:50.000000000 +0200 -@@ -0,0 +1,1850 @@ -+/* Copyright (C) 2000-2003 MySQL AB & MySQL Finland AB & TCX DataKonsult 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 */ -+ -+ -+#ifdef USE_PRAGMA_INTERFACE -+#pragma interface /* gcc class implementation */ -+#endif -+ -+class Protocol; -+struct st_table_list; -+void item_init(void); /* Init item functions */ -+class Item_field; -+ -+ -+/* -+ "Declared Type Collation" -+ A combination of collation and its derivation. -+*/ -+ -+enum Derivation -+{ -+ DERIVATION_IGNORABLE= 5, -+ DERIVATION_COERCIBLE= 4, -+ DERIVATION_SYSCONST= 3, -+ DERIVATION_IMPLICIT= 2, -+ DERIVATION_NONE= 1, -+ DERIVATION_EXPLICIT= 0 -+}; -+ -+/* -+ Flags for collation aggregation modes: -+ MY_COLL_ALLOW_SUPERSET_CONV - allow conversion to a superset -+ MY_COLL_ALLOW_COERCIBLE_CONV - allow conversion of a coercible value -+ (i.e. constant). -+ MY_COLL_ALLOW_CONV - allow any kind of conversion -+ (combination of the above two) -+ MY_COLL_DISALLOW_NONE - don't allow return DERIVATION_NONE -+ (e.g. when aggregating for comparison) -+ MY_COLL_CMP_CONV - combination of MY_COLL_ALLOW_CONV -+ and MY_COLL_DISALLOW_NONE -+*/ -+ -+#define MY_COLL_ALLOW_SUPERSET_CONV 1 -+#define MY_COLL_ALLOW_COERCIBLE_CONV 2 -+#define MY_COLL_ALLOW_CONV 3 -+#define MY_COLL_DISALLOW_NONE 4 -+#define MY_COLL_CMP_CONV 7 -+ -+class DTCollation { -+public: -+ CHARSET_INFO *collation; -+ enum Derivation derivation; -+ -+ DTCollation() -+ { -+ collation= &my_charset_bin; -+ derivation= DERIVATION_NONE; -+ } -+ DTCollation(CHARSET_INFO *collation_arg, Derivation derivation_arg) -+ { -+ collation= collation_arg; -+ derivation= derivation_arg; -+ } -+ void set(DTCollation &dt) -+ { -+ collation= dt.collation; -+ derivation= dt.derivation; -+ } -+ void set(CHARSET_INFO *collation_arg, Derivation derivation_arg) -+ { -+ collation= collation_arg; -+ derivation= derivation_arg; -+ } -+ void set(CHARSET_INFO *collation_arg) -+ { collation= collation_arg; } -+ void set(Derivation derivation_arg) -+ { derivation= derivation_arg; } -+ bool aggregate(DTCollation &dt, uint flags= 0); -+ bool set(DTCollation &dt1, DTCollation &dt2, uint flags= 0) -+ { set(dt1); return aggregate(dt2, flags); } -+ const char *derivation_name() const -+ { -+ switch(derivation) -+ { -+ case DERIVATION_IGNORABLE: return "IGNORABLE"; -+ case DERIVATION_COERCIBLE: return "COERCIBLE"; -+ case DERIVATION_IMPLICIT: return "IMPLICIT"; -+ case DERIVATION_SYSCONST: return "SYSCONST"; -+ case DERIVATION_EXPLICIT: return "EXPLICIT"; -+ case DERIVATION_NONE: return "NONE"; -+ default: return "UNKNOWN"; -+ } -+ } -+}; -+ -+ -+/*************************************************************************/ -+/* -+ A framework to easily handle different return types for hybrid items -+ (hybrid item is an item whose operand can be of any type, e.g. integer, -+ real, decimal). -+*/ -+ -+struct Hybrid_type_traits; -+ -+struct Hybrid_type -+{ -+ longlong integer; -+ -+ double real; -+ /* -+ Use two decimal buffers interchangeably to speed up += operation -+ which has no native support in decimal library. -+ Hybrid_type+= arg is implemented as dec_buf[1]= dec_buf[0] + arg. -+ The third decimal is used as a handy temporary storage. -+ */ -+ my_decimal dec_buf[3]; -+ int used_dec_buf_no; -+ -+ /* -+ Traits moved to a separate class to -+ a) be able to easily change object traits in runtime -+ b) they work as a differentiator for the union above -+ */ -+ const Hybrid_type_traits *traits; -+ -+ Hybrid_type() {} -+ /* XXX: add traits->copy() when needed */ -+ Hybrid_type(const Hybrid_type &rhs) :traits(rhs.traits) {} -+}; -+ -+ -+/* Hybryd_type_traits interface + default implementation for REAL_RESULT */ -+ -+struct Hybrid_type_traits -+{ -+ virtual Item_result type() const { return REAL_RESULT; } -+ -+ virtual void -+ fix_length_and_dec(Item *item, Item *arg) const; -+ -+ /* Hybrid_type operations. */ -+ virtual void set_zero(Hybrid_type *val) const { val->real= 0.0; } -+ virtual void add(Hybrid_type *val, Field *f) const -+ { val->real+= f->val_real(); } -+ virtual void div(Hybrid_type *val, ulonglong u) const -+ { val->real/= ulonglong2double(u); } -+ -+ virtual longlong val_int(Hybrid_type *val, bool unsigned_flag) const -+ { return (longlong) val->real; } -+ virtual double val_real(Hybrid_type *val) const { return val->real; } -+ virtual my_decimal *val_decimal(Hybrid_type *val, my_decimal *buf) const; -+ virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const; -+ static const Hybrid_type_traits *instance(); -+}; -+ -+ -+struct Hybrid_type_traits_decimal: public Hybrid_type_traits -+{ -+ virtual Item_result type() const { return DECIMAL_RESULT; } -+ -+ virtual void -+ fix_length_and_dec(Item *arg, Item *item) const; -+ -+ /* Hybrid_type operations. */ -+ virtual void set_zero(Hybrid_type *val) const; -+ virtual void add(Hybrid_type *val, Field *f) const; -+ virtual void div(Hybrid_type *val, ulonglong u) const; -+ -+ virtual longlong val_int(Hybrid_type *val, bool unsigned_flag) const; -+ virtual double val_real(Hybrid_type *val) const; -+ virtual my_decimal *val_decimal(Hybrid_type *val, my_decimal *buf) const -+ { return &val->dec_buf[val->used_dec_buf_no]; } -+ virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const; -+ static const Hybrid_type_traits_decimal *instance(); -+}; -+ -+ -+struct Hybrid_type_traits_integer: public Hybrid_type_traits -+{ -+ virtual Item_result type() const { return INT_RESULT; } -+ -+ virtual void -+ fix_length_and_dec(Item *arg, Item *item) const; -+ -+ /* Hybrid_type operations. */ -+ virtual void set_zero(Hybrid_type *val) const -+ { val->integer= 0; } -+ virtual void add(Hybrid_type *val, Field *f) const -+ { val->integer+= f->val_int(); } -+ virtual void div(Hybrid_type *val, ulonglong u) const -+ { val->integer/= (longlong) u; } -+ -+ virtual longlong val_int(Hybrid_type *val, bool unsigned_flag) const -+ { return val->integer; } -+ virtual double val_real(Hybrid_type *val) const -+ { return (double) val->integer; } -+ virtual my_decimal *val_decimal(Hybrid_type *val, my_decimal *buf) const -+ { -+ int2my_decimal(E_DEC_FATAL_ERROR, val->integer, 0, &val->dec_buf[2]); -+ return &val->dec_buf[2]; -+ } -+ virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const -+ { buf->set(val->integer, &my_charset_bin); return buf;} -+ static const Hybrid_type_traits_integer *instance(); -+}; -+ -+/*************************************************************************/ -+ -+typedef bool (Item::*Item_processor)(byte *arg); -+typedef Item* (Item::*Item_transformer) (byte *arg); -+ -+typedef void (*Cond_traverser) (const Item *item, void *arg); -+ -+class Item { -+ Item(const Item &); /* Prevent use of these */ -+ void operator=(Item &); -+public: -+ static void *operator new(size_t size) {return (void*) sql_alloc((uint) size); } -+ static void *operator new(size_t size, MEM_ROOT *mem_root) -+ { return (void*) alloc_root(mem_root, (uint) size); } -+ static void operator delete(void *ptr,size_t size) { TRASH(ptr, size); } -+ static void operator delete(void *ptr, MEM_ROOT *mem_root) {} -+ -+ enum Type {FIELD_ITEM= 0, FUNC_ITEM, SUM_FUNC_ITEM, STRING_ITEM, -+ INT_ITEM, REAL_ITEM, NULL_ITEM, VARBIN_ITEM, -+ COPY_STR_ITEM, FIELD_AVG_ITEM, DEFAULT_VALUE_ITEM, -+ PROC_ITEM,COND_ITEM, REF_ITEM, FIELD_STD_ITEM, -+ FIELD_VARIANCE_ITEM, INSERT_VALUE_ITEM, -+ SUBSELECT_ITEM, ROW_ITEM, CACHE_ITEM, TYPE_HOLDER, -+ PARAM_ITEM, TRIGGER_FIELD_ITEM, DECIMAL_ITEM}; -+ -+ enum cond_result { COND_UNDEF,COND_OK,COND_TRUE,COND_FALSE }; -+ -+ enum traverse_order { POSTFIX, PREFIX }; -+ -+ /* -+ str_values's main purpose is to be used to cache the value in -+ save_in_field -+ */ -+ String str_value; -+ my_string name; /* Name from select */ -+ /* Original item name (if it was renamed)*/ -+ my_string orig_name; -+ Item *next; -+ uint32 max_length; -+ uint name_length; /* Length of name */ -+ uint8 marker, decimals; -+ my_bool maybe_null; /* If item may be null */ -+ my_bool null_value; /* if item is null */ -+ my_bool unsigned_flag; -+ my_bool with_sum_func; -+ my_bool fixed; /* If item fixed with fix_fields */ -+ DTCollation collation; -+ -+ // alloc & destruct is done as start of select using sql_alloc -+ Item(); -+ /* -+ Constructor used by Item_field, Item_ref & aggregate (sum) functions. -+ Used for duplicating lists in processing queries with temporary -+ tables -+ Also it used for Item_cond_and/Item_cond_or for creating -+ top AND/OR structure of WHERE clause to protect it of -+ optimisation changes in prepared statements -+ */ -+ Item(THD *thd, Item *item); -+ virtual ~Item() -+ { -+ name=0; -+ } /*lint -e1509 */ -+ void set_name(const char *str,uint length, CHARSET_INFO *cs); -+ void rename(char *new_name); -+ void init_make_field(Send_field *tmp_field,enum enum_field_types type); -+ virtual void cleanup(); -+ virtual void make_field(Send_field *field); -+ Field *make_string_field(TABLE *table); -+ virtual bool fix_fields(THD *, struct st_table_list *, Item **); -+ /* -+ should be used in case where we are sure that we do not need -+ complete fix_fields() procedure. -+ */ -+ inline void quick_fix_field() { fixed= 1; } -+ /* Function returns 1 on overflow and -1 on fatal errors */ -+ int save_in_field_no_warnings(Field *field, bool no_conversions); -+ virtual int save_in_field(Field *field, bool no_conversions); -+ virtual void save_org_in_field(Field *field) -+ { (void) save_in_field(field, 1); } -+ virtual int save_safe_in_field(Field *field) -+ { return save_in_field(field, 1); } -+ virtual bool send(Protocol *protocol, String *str); -+ virtual bool eq(const Item *, bool binary_cmp) const; -+ virtual Item_result result_type() const { return REAL_RESULT; } -+ virtual Item_result cast_to_int_type() const { return result_type(); } -+ virtual enum_field_types field_type() const; -+ virtual enum Type type() const =0; -+ /* valXXX methods must return NULL or 0 or 0.0 if null_value is set. */ -+ /* -+ Return double precision floating point representation of item. -+ -+ SYNOPSIS -+ val_real() -+ -+ RETURN -+ In case of NULL value return 0.0 and set null_value flag to TRUE. -+ If value is not null null_value flag will be reset to FALSE. -+ */ -+ virtual double val_real()=0; -+ /* -+ Return integer representation of item. -+ -+ SYNOPSIS -+ val_int() -+ -+ RETURN -+ In case of NULL value return 0 and set null_value flag to TRUE. -+ If value is not null null_value flag will be reset to FALSE. -+ */ -+ virtual longlong val_int()=0; -+ /* -+ Return string representation of this item object. -+ -+ SYNOPSIS -+ val_str() -+ str an allocated buffer this or any nested Item object can use to -+ store return value of this method. -+ -+ NOTE -+ Buffer passed via argument should only be used if the item itself -+ doesn't have an own String buffer. In case when the item maintains -+ it's own string buffer, it's preferable to return it instead to -+ minimize number of mallocs/memcpys. -+ The caller of this method can modify returned string, but only in case -+ when it was allocated on heap, (is_alloced() is true). This allows -+ the caller to efficiently use a buffer allocated by a child without -+ having to allocate a buffer of it's own. The buffer, given to -+ val_str() as argument, belongs to the caller and is later used by the -+ caller at it's own choosing. -+ A few implications from the above: -+ - unless you return a string object which only points to your buffer -+ but doesn't manages it you should be ready that it will be -+ modified. -+ - even for not allocated strings (is_alloced() == false) the caller -+ can change charset (see Item_func_{typecast/binary}. XXX: is this -+ a bug? -+ - still you should try to minimize data copying and return internal -+ object whenever possible. -+ -+ RETURN -+ In case of NULL value return 0 (NULL pointer) and set null_value flag -+ to TRUE. -+ If value is not null null_value flag will be reset to FALSE. -+ */ -+ virtual String *val_str(String *str)=0; -+ /* -+ Return decimal representation of item with fixed point. -+ -+ SYNOPSIS -+ val_decimal() -+ decimal_buffer buffer which can be used by Item for returning value -+ (but can be not) -+ -+ NOTE -+ Returned value should not be changed if it is not the same which was -+ passed via argument. -+ -+ RETURN -+ Return pointer on my_decimal (it can be other then passed via argument) -+ if value is not NULL (null_value flag will be reset to FALSE). -+ In case of NULL value it return 0 pointer and set null_value flag -+ to TRUE. -+ */ -+ virtual my_decimal *val_decimal(my_decimal *decimal_buffer)= 0; -+ /* -+ Return boolean value of item. -+ -+ RETURN -+ FALSE value is false or NULL -+ TRUE value is true (not equal to 0) -+ */ -+ virtual bool val_bool(); -+ /* Helper functions, see item_sum.cc */ -+ String *val_string_from_real(String *str); -+ String *val_string_from_int(String *str); -+ String *val_string_from_decimal(String *str); -+ my_decimal *val_decimal_from_real(my_decimal *decimal_value); -+ my_decimal *val_decimal_from_int(my_decimal *decimal_value); -+ my_decimal *val_decimal_from_string(my_decimal *decimal_value); -+ longlong val_int_from_decimal(); -+ double val_real_from_decimal(); -+ -+ virtual Field *get_tmp_table_field() { return 0; } -+ virtual Field *tmp_table_field(TABLE *t_arg) { return 0; } -+ virtual const char *full_name() const { return name ? name : "???"; } -+ -+ /* -+ *result* family of methods is analog of *val* family (see above) but -+ return value of result_field of item if it is present. If Item have not -+ result field, it return val(). This methods set null_value flag in same -+ way as *val* methods do it. -+ */ -+ virtual double val_result() { return val_real(); } -+ virtual longlong val_int_result() { return val_int(); } -+ virtual String *str_result(String* tmp) { return val_str(tmp); } -+ virtual my_decimal *val_decimal_result(my_decimal *val) -+ { return val_decimal(val); } -+ virtual bool val_bool_result() { return val_bool(); } -+ -+ /* bit map of tables used by item */ -+ virtual table_map used_tables() const { return (table_map) 0L; } -+ /* -+ Return table map of tables that can't be NULL tables (tables that are -+ used in a context where if they would contain a NULL row generated -+ by a LEFT or RIGHT join, the item would not be true). -+ This expression is used on WHERE item to determinate if a LEFT JOIN can be -+ converted to a normal join. -+ Generally this function should return used_tables() if the function -+ would return null if any of the arguments are null -+ As this is only used in the beginning of optimization, the value don't -+ have to be updated in update_used_tables() -+ */ -+ virtual table_map not_null_tables() const { return used_tables(); } -+ /* -+ Returns true if this is a simple constant item like an integer, not -+ a constant expression. Used in the optimizer to propagate basic constants. -+ */ -+ virtual bool basic_const_item() const { return 0; } -+ /* cloning of constant items (0 if it is not const) */ -+ virtual Item *new_item() { return 0; } -+ virtual cond_result eq_cmp_result() const { return COND_OK; } -+ inline uint float_length(uint decimals_par) const -+ { return decimals != NOT_FIXED_DEC ? (DBL_DIG+2+decimals_par) : DBL_DIG+8;} -+ virtual uint decimal_precision() const; -+ inline int decimal_int_part() const -+ { return my_decimal_int_part(decimal_precision(), decimals); } -+ /* -+ Returns true if this is constant (during query execution, i.e. its value -+ will not change until next fix_fields) and its value is known. -+ */ -+ virtual bool const_item() const { return used_tables() == 0; } -+ /* -+ Returns true if this is constant but its value may be not known yet. -+ (Can be used for parameters of prep. stmts or of stored procedures.) -+ */ -+ virtual bool const_during_execution() const -+ { return (used_tables() & ~PARAM_TABLE_BIT) == 0; } -+ virtual void print(String *str_arg) { str_arg->append(full_name()); } -+ void print_item_w_name(String *); -+ virtual void update_used_tables() {} -+ virtual void split_sum_func(THD *thd, Item **ref_pointer_array, -+ List<Item> &fields) {} -+ /* Called for items that really have to be split */ -+ void split_sum_func2(THD *thd, Item **ref_pointer_array, List<Item> &fields, -+ Item **ref); -+ virtual bool get_date(TIME *ltime,uint fuzzydate); -+ virtual bool get_time(TIME *ltime); -+ virtual bool get_date_result(TIME *ltime,uint fuzzydate) -+ { return get_date(ltime,fuzzydate); } -+ /* -+ This function is used only in Item_func_isnull/Item_func_isnotnull -+ (implementations of IS NULL/IS NOT NULL clauses). Item_func_is{not}null -+ calls this method instead of one of val/result*() methods, which -+ normally will set null_value. This allows to determine nullness of -+ a complex expression without fully evaluating it. -+ Any new item which can be NULL must implement this call. -+ */ -+ virtual bool is_null() { return 0; } -+ /* -+ it is "top level" item of WHERE clause and we do not need correct NULL -+ handling -+ */ -+ virtual void top_level_item() {} -+ /* -+ set field of temporary table for Item which can be switched on temporary -+ table during query processing (grouping and so on) -+ */ -+ virtual void set_result_field(Field *field) {} -+ virtual bool is_result_field() { return 0; } -+ virtual bool is_bool_func() { return 0; } -+ virtual void save_in_result_field(bool no_conversions) {} -+ /* -+ set value of aggregate function in case of no rows for grouping were found -+ */ -+ virtual void no_rows_in_result() {} -+ virtual Item *copy_or_same(THD *thd) { return this; } -+ virtual Item *copy_andor_structure(THD *thd) { return this; } -+ virtual Item *real_item() { return this; } -+ virtual Item *get_tmp_table_item(THD *thd) { return copy_or_same(thd); } -+ -+ static CHARSET_INFO *default_charset(); -+ virtual CHARSET_INFO *compare_collation() { return NULL; } -+ -+ virtual bool walk(Item_processor processor, byte *arg) -+ { -+ return (this->*processor)(arg); -+ } -+ -+ virtual Item* transform(Item_transformer transformer, byte *arg) -+ { -+ return (this->*transformer)(arg); -+ } -+ -+ virtual void traverse_cond(Cond_traverser traverser, -+ void *arg, traverse_order order) -+ { -+ (*traverser)(this, arg); -+ } -+ -+ virtual bool remove_dependence_processor(byte * arg) { return 0; } -+ virtual bool remove_fixed(byte * arg) { fixed= 0; return 0; } -+ virtual bool cleanup_processor(byte *arg); -+ virtual bool collect_item_field_processor(byte * arg) { return 0; } -+ virtual Item *equal_fields_propagator(byte * arg) { return this; } -+ virtual Item *set_no_const_sub(byte *arg) { return this; } -+ virtual Item *replace_equal_field(byte * arg) { return this; } -+ -+ /* -+ For SP local variable returns pointer to Item representing its -+ current value and pointer to current Item otherwise. -+ */ -+ virtual Item *this_item() { return this; } -+ /* -+ For SP local variable returns address of pointer to Item representing its -+ current value and pointer passed via parameter otherwise. -+ */ -+ virtual Item **this_item_addr(THD *thd, Item **addr) { return addr; } -+ virtual Item *this_const_item() const { return const_cast<Item*>(this); } /* For SPs mostly. */ -+ -+ // Row emulation -+ virtual uint cols() { return 1; } -+ virtual Item* el(uint i) { return this; } -+ virtual Item** addr(uint i) { return 0; } -+ virtual bool check_cols(uint c); -+ // It is not row => null inside is impossible -+ virtual bool null_inside() { return 0; } -+ // used in row subselects to get value of elements -+ virtual void bring_value() {} -+ -+ Field *tmp_table_field_from_field_type(TABLE *table); -+ virtual Item_field *filed_for_view_update() { return 0; } -+ -+ virtual Item *neg_transformer(THD *thd) { return NULL; } -+ virtual Item *safe_charset_converter(CHARSET_INFO *tocs); -+ void delete_self() -+ { -+ cleanup(); -+ delete this; -+ } -+ -+ virtual bool is_splocal() { return 0; } /* Needed for error checking */ -+}; -+ -+ -+// A local SP variable (incl. parameters), used in runtime -+class Item_splocal : public Item -+{ -+private: -+ -+ uint m_offset; -+ LEX_STRING m_name; -+ -+public: -+ -+ Item_splocal(LEX_STRING name, uint offset) -+ : m_offset(offset), m_name(name) -+ { -+ Item::maybe_null= TRUE; -+ } -+ -+ bool is_splocal() { return 1; } /* Needed for error checking */ -+ -+ Item *this_item(); -+ Item **this_item_addr(THD *thd, Item **); -+ Item *this_const_item() const; -+ -+ bool fix_fields(THD *, struct st_table_list *, Item **); -+ void cleanup(); -+ -+ inline uint get_offset() -+ { -+ return m_offset; -+ } -+ -+ // Abstract methods inherited from Item. Just defer the call to -+ // the item in the frame -+ enum Type type() const; -+ -+ double val_real(); -+ longlong val_int(); -+ String *val_str(String *sp); -+ my_decimal *val_decimal(my_decimal *); -+ bool is_null(); -+ void print(String *str); -+ -+ inline void make_field(Send_field *field) -+ { -+ Item *it= this_item(); -+ -+ if (name) -+ it->set_name(name, strlen(name), system_charset_info); -+ else -+ it->set_name(m_name.str, m_name.length, system_charset_info); -+ it->make_field(field); -+ } -+ -+ inline Item_result result_type() const -+ { -+ return this_const_item()->result_type(); -+ } -+ -+ inline bool const_item() const -+ { -+ return TRUE; -+ } -+ -+ inline int save_in_field(Field *field, bool no_conversions) -+ { -+ return this_item()->save_in_field(field, no_conversions); -+ } -+ -+ inline bool send(Protocol *protocol, String *str) -+ { -+ return this_item()->send(protocol, str); -+ } -+}; -+ -+ -+class Item_num: public Item -+{ -+public: -+ virtual Item_num *neg()= 0; -+}; -+ -+#define NO_CACHED_FIELD_INDEX ((uint)(-1)) -+ -+class st_select_lex; -+class Item_ident :public Item -+{ -+protected: -+ /* -+ We have to store initial values of db_name, table_name and field_name -+ to be able to restore them during cleanup() because they can be -+ updated during fix_fields() to values from Field object and life-time -+ of those is shorter than life-time of Item_field. -+ */ -+ const char *orig_db_name; -+ const char *orig_table_name; -+ const char *orig_field_name; -+public: -+ const char *db_name; -+ const char *table_name; -+ const char *field_name; -+ bool alias_name_used; /* true if item was resolved against alias */ -+ /* -+ Cached value of index for this field in table->field array, used by prep. -+ stmts for speeding up their re-execution. Holds NO_CACHED_FIELD_INDEX -+ if index value is not known. -+ */ -+ uint cached_field_index; -+ /* -+ Cached pointer to table which contains this field, used for the same reason -+ by prep. stmt. too in case then we have not-fully qualified field. -+ 0 - means no cached value. -+ */ -+ TABLE_LIST *cached_table; -+ st_select_lex *depended_from; -+ Item_ident(const char *db_name_par,const char *table_name_par, -+ const char *field_name_par); -+ Item_ident(THD *thd, Item_ident *item); -+ const char *full_name() const; -+ void cleanup(); -+ bool remove_dependence_processor(byte * arg); -+ void print(String *str); -+ -+ friend bool insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name, -+ const char *table_name, List_iterator<Item> *it, -+ bool any_privileges, bool allocate_view_names); -+}; -+ -+class Item_equal; -+class COND_EQUAL; -+ -+class Item_field :public Item_ident -+{ -+protected: -+ void set_field(Field *field); -+public: -+ Field *field,*result_field; -+ Item_equal *item_equal; -+ bool no_const_subst; -+ /* -+ if any_privileges set to TRUE then here real effective privileges will -+ be stored -+ */ -+ uint have_privileges; -+ /* field need any privileges (for VIEW creation) */ -+ bool any_privileges; -+ -+ Item_field(const char *db_par,const char *table_name_par, -+ const char *field_name_par) -+ :Item_ident(db_par,table_name_par,field_name_par), -+ field(0), result_field(0), item_equal(0), no_const_subst(0), -+ have_privileges(0), any_privileges(0) -+ { collation.set(DERIVATION_IMPLICIT); } -+ /* -+ Constructor needed to process subselect with temporary tables (see Item) -+ */ -+ Item_field(THD *thd, Item_field *item); -+ /* -+ Constructor used inside setup_wild(), ensures that field, table, -+ and database names will live as long as Item_field (this is important -+ in prepared statements). -+ */ -+ Item_field(THD *thd, Field *field); -+ /* -+ If this constructor is used, fix_fields() won't work, because -+ db_name, table_name and column_name are unknown. It's necessary to call -+ reset_field() before fix_fields() for all fields created this way. -+ */ -+ Item_field(Field *field); -+ enum Type type() const { return FIELD_ITEM; } -+ bool eq(const Item *item, bool binary_cmp) const; -+ double val_real(); -+ longlong val_int(); -+ my_decimal *val_decimal(my_decimal *); -+ String *val_str(String*); -+ double val_result(); -+ longlong val_int_result(); -+ String *str_result(String* tmp); -+ my_decimal *val_decimal_result(my_decimal *); -+ bool val_bool_result(); -+ bool send(Protocol *protocol, String *str_arg); -+ void reset_field(Field *f); -+ bool fix_fields(THD *, struct st_table_list *, Item **); -+ void make_field(Send_field *tmp_field); -+ int save_in_field(Field *field,bool no_conversions); -+ void save_org_in_field(Field *field); -+ table_map used_tables() const; -+ enum Item_result result_type () const -+ { -+ return field->result_type(); -+ } -+ Item_result cast_to_int_type() const -+ { -+ return field->cast_to_int_type(); -+ } -+ enum_field_types field_type() const -+ { -+ return field->type(); -+ } -+ Field *get_tmp_table_field() { return result_field; } -+ Field *tmp_table_field(TABLE *t_arg) { return result_field; } -+ bool get_date(TIME *ltime,uint fuzzydate); -+ bool get_date_result(TIME *ltime,uint fuzzydate); -+ bool get_time(TIME *ltime); -+ bool is_null() { return field->is_null(); } -+ Item *get_tmp_table_item(THD *thd); -+ bool collect_item_field_processor(byte * arg); -+ void cleanup(); -+ Item_equal *find_item_equal(COND_EQUAL *cond_equal); -+ Item *equal_fields_propagator(byte *arg); -+ Item *set_no_const_sub(byte *arg); -+ Item *replace_equal_field(byte *arg); -+ inline uint32 max_disp_length() { return field->max_length(); } -+ Item_field *filed_for_view_update() { return this; } -+ Item *safe_charset_converter(CHARSET_INFO *tocs); -+ friend class Item_default_value; -+ friend class Item_insert_value; -+ friend class st_select_lex_unit; -+}; -+ -+class Item_null :public Item -+{ -+public: -+ Item_null(char *name_par=0) -+ { -+ maybe_null= null_value= TRUE; -+ max_length= 0; -+ name= name_par ? name_par : (char*) "NULL"; -+ fixed= 1; -+ collation.set(&my_charset_bin, DERIVATION_IGNORABLE); -+ } -+ enum Type type() const { return NULL_ITEM; } -+ bool eq(const Item *item, bool binary_cmp) const; -+ double val_real(); -+ longlong val_int(); -+ String *val_str(String *str); -+ my_decimal *val_decimal(my_decimal *); -+ int save_in_field(Field *field, bool no_conversions); -+ int save_safe_in_field(Field *field); -+ bool send(Protocol *protocol, String *str); -+ enum Item_result result_type () const { return STRING_RESULT; } -+ enum_field_types field_type() const { return MYSQL_TYPE_NULL; } -+ /* to prevent drop fixed flag (no need parent cleanup call) */ -+ void cleanup() {} -+ bool basic_const_item() const { return 1; } -+ Item *new_item() { return new Item_null(name); } -+ bool is_null() { return 1; } -+ void print(String *str) { str->append("NULL", 4); } -+ Item *safe_charset_converter(CHARSET_INFO *tocs); -+}; -+ -+class Item_null_result :public Item_null -+{ -+public: -+ Field *result_field; -+ Item_null_result() : Item_null(), result_field(0) {} -+ bool is_result_field() { return result_field != 0; } -+ void save_in_result_field(bool no_conversions) -+ { -+ save_in_field(result_field, no_conversions); -+ } -+}; -+ -+/* Item represents one placeholder ('?') of prepared statement */ -+ -+class Item_param :public Item -+{ -+public: -+ enum enum_item_param_state -+ { -+ NO_VALUE, NULL_VALUE, INT_VALUE, REAL_VALUE, -+ STRING_VALUE, TIME_VALUE, LONG_DATA_VALUE, -+ DECIMAL_VALUE -+ } state; -+ -+ /* -+ A buffer for string and long data values. Historically all allocated -+ values returned from val_str() were treated as eligible to -+ modification. I. e. in some cases Item_func_concat can append it's -+ second argument to return value of the first one. Because of that we -+ can't return the original buffer holding string data from val_str(), -+ and have to have one buffer for data and another just pointing to -+ the data. This is the latter one and it's returned from val_str(). -+ Can not be declared inside the union as it's not a POD type. -+ */ -+ String str_value_ptr; -+ my_decimal decimal_value; -+ union -+ { -+ longlong integer; -+ double real; -+ /* -+ Character sets conversion info for string values. -+ Character sets of client and connection defined at bind time are used -+ for all conversions, even if one of them is later changed (i.e. -+ between subsequent calls to mysql_stmt_execute). -+ */ -+ struct CONVERSION_INFO -+ { -+ CHARSET_INFO *character_set_client; -+ /* -+ This points at character set of connection if conversion -+ to it is required (i. e. if placeholder typecode is not BLOB). -+ Otherwise it's equal to character_set_client (to simplify -+ check in convert_str_value()). -+ */ -+ CHARSET_INFO *final_character_set_of_str_value; -+ } cs_info; -+ TIME time; -+ } value; -+ -+ /* Cached values for virtual methods to save us one switch. */ -+ enum Item_result item_result_type; -+ enum Type item_type; -+ -+ /* -+ Used when this item is used in a temporary table. -+ This is NOT placeholder metadata sent to client, as this value -+ is assigned after sending metadata (in setup_one_conversion_function). -+ For example in case of 'SELECT ?' you'll get MYSQL_TYPE_STRING both -+ in result set and placeholders metadata, no matter what type you will -+ supply for this placeholder in mysql_stmt_execute. -+ */ -+ enum enum_field_types param_type; -+ /* -+ Offset of placeholder inside statement text. Used to create -+ no-placeholders version of this statement for the binary log. -+ */ -+ uint pos_in_query; -+ -+ Item_param(uint pos_in_query_arg); -+ -+ enum Item_result result_type () const { return item_result_type; } -+ enum Type type() const { return item_type; } -+ enum_field_types field_type() const { return param_type; } -+ -+ double val_real(); -+ longlong val_int(); -+ my_decimal *val_decimal(my_decimal*); -+ String *val_str(String*); -+ bool get_time(TIME *tm); -+ bool get_date(TIME *tm, uint fuzzydate); -+ int save_in_field(Field *field, bool no_conversions); -+ bool fix_fields(THD *, struct st_table_list *, Item **); -+ -+ void set_null(); -+ void set_int(longlong i, uint32 max_length_arg); -+ void set_double(double i); -+ void set_decimal(const char *str, ulong length); -+ bool set_str(const char *str, ulong length); -+ bool set_longdata(const char *str, ulong length); -+ void set_time(TIME *tm, timestamp_type type, uint32 max_length_arg); -+ bool set_from_user_var(THD *thd, const user_var_entry *entry); -+ void reset(); -+ /* -+ Assign placeholder value from bind data. -+ Note, that 'len' has different semantics in embedded library (as we -+ don't need to check that packet is not broken there). See -+ sql_prepare.cc for details. -+ */ -+ void (*set_param_func)(Item_param *param, uchar **pos, ulong len); -+ -+ const String *query_val_str(String *str) const; -+ -+ bool convert_str_value(THD *thd); -+ -+ /* -+ If value for parameter was not set we treat it as non-const -+ so noone will use parameters value in fix_fields still -+ parameter is constant during execution. -+ */ -+ virtual table_map used_tables() const -+ { return state != NO_VALUE ? (table_map)0 : PARAM_TABLE_BIT; } -+ void print(String *str); -+ bool is_null() -+ { DBUG_ASSERT(state != NO_VALUE); return state == NULL_VALUE; } -+ bool basic_const_item() const; -+ /* -+ This method is used to make a copy of a basic constant item when -+ propagating constants in the optimizer. The reason to create a new -+ item and not use the existing one is not precisely known (2005/04/16). -+ Probably we are trying to preserve tree structure of items, in other -+ words, avoid pointing at one item from two different nodes of the tree. -+ Return a new basic constant item if parameter value is a basic -+ constant, assert otherwise. This method is called only if -+ basic_const_item returned TRUE. -+ */ -+ Item *new_item(); -+ /* -+ Implement by-value equality evaluation if parameter value -+ is set and is a basic constant (integer, real or string). -+ Otherwise return FALSE. -+ */ -+ bool eq(const Item *item, bool binary_cmp) const; -+}; -+ -+ -+class Item_int :public Item_num -+{ -+public: -+ longlong value; -+ Item_int(int32 i,uint length=11) :value((longlong) i) -+ { max_length=length; fixed= 1; } -+#ifdef HAVE_LONG_LONG -+ Item_int(longlong i,uint length=21) :value(i) -+ { max_length=length; fixed= 1; } -+#endif -+ Item_int(const char *str_arg,longlong i,uint length) :value(i) -+ { max_length=length; name=(char*) str_arg; fixed= 1; } -+ Item_int(const char *str_arg, uint length=64); -+ enum Type type() const { return INT_ITEM; } -+ enum Item_result result_type () const { return INT_RESULT; } -+ enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; } -+ longlong val_int() { DBUG_ASSERT(fixed == 1); return value; } -+ double val_real() { DBUG_ASSERT(fixed == 1); return (double) value; } -+ my_decimal *val_decimal(my_decimal *); -+ String *val_str(String*); -+ int save_in_field(Field *field, bool no_conversions); -+ bool basic_const_item() const { return 1; } -+ Item *new_item() { return new Item_int(name,value,max_length); } -+ // to prevent drop fixed flag (no need parent cleanup call) -+ void cleanup() {} -+ void print(String *str); -+ Item_num *neg() { value= -value; return this; } -+ uint decimal_precision() const { return (uint)(max_length - test(value < 0)); } -+ bool eq(const Item *, bool binary_cmp) const; -+}; -+ -+ -+class Item_static_int_func :public Item_int -+{ -+ const char *func_name; -+public: -+ Item_static_int_func(const char *str_arg, longlong i, uint length) -+ :Item_int(NullS, i, length), func_name(str_arg) -+ {} -+ void print(String *str) { str->append(func_name); } -+}; -+ -+ -+class Item_uint :public Item_int -+{ -+public: -+ Item_uint(const char *str_arg, uint length); -+ Item_uint(const char *str_arg, longlong i, uint length); -+ Item_uint(uint32 i) :Item_int((longlong) i, 10) -+ { unsigned_flag= 1; } -+ double val_real() -+ { DBUG_ASSERT(fixed == 1); return ulonglong2double((ulonglong)value); } -+ String *val_str(String*); -+ Item *new_item() { return new Item_uint(name,max_length); } -+ int save_in_field(Field *field, bool no_conversions); -+ void print(String *str); -+ Item_num *neg (); -+ uint decimal_precision() const { return max_length; } -+}; -+ -+ -+/* decimal (fixed point) constant */ -+class Item_decimal :public Item_num -+{ -+protected: -+ my_decimal decimal_value; -+public: -+ Item_decimal(const char *str_arg, uint length, CHARSET_INFO *charset); -+ Item_decimal(const char *str, const my_decimal *val_arg, -+ uint decimal_par, uint length); -+ Item_decimal(my_decimal *value_par); -+ Item_decimal(longlong val, bool unsig); -+ Item_decimal(double val, int precision, int scale); -+ Item_decimal(const char *bin, int precision, int scale); -+ -+ enum Type type() const { return DECIMAL_ITEM; } -+ enum Item_result result_type () const { return DECIMAL_RESULT; } -+ enum_field_types field_type() const { return MYSQL_TYPE_NEWDECIMAL; } -+ longlong val_int(); -+ double val_real(); -+ String *val_str(String*); -+ my_decimal *val_decimal(my_decimal *val) { return &decimal_value; } -+ int save_in_field(Field *field, bool no_conversions); -+ bool basic_const_item() const { return 1; } -+ Item *new_item() -+ { -+ return new Item_decimal(name, &decimal_value, decimals, max_length); -+ } -+ // to prevent drop fixed flag (no need parent cleanup call) -+ void cleanup() {} -+ void print(String *str); -+ Item_num *neg() -+ { -+ my_decimal_neg(&decimal_value); -+ unsigned_flag= !decimal_value.sign(); -+ return this; -+ } -+ uint decimal_precision() const { return decimal_value.precision(); } -+ bool eq(const Item *, bool binary_cmp) const; -+}; -+ -+ -+class Item_float :public Item_num -+{ -+ char *presentation; -+public: -+ double value; -+ // Item_real() :value(0) {} -+ Item_float(const char *str_arg, uint length); -+ Item_float(const char *str,double val_arg,uint decimal_par,uint length) -+ :value(val_arg) -+ { -+ presentation= name=(char*) str; -+ decimals=(uint8) decimal_par; -+ max_length=length; -+ fixed= 1; -+ } -+ Item_float(double value_par) :presentation(0), value(value_par) { fixed= 1; } -+ -+ int save_in_field(Field *field, bool no_conversions); -+ enum Type type() const { return REAL_ITEM; } -+ enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; } -+ double val_real() { DBUG_ASSERT(fixed == 1); return value; } -+ longlong val_int() -+ { -+ DBUG_ASSERT(fixed == 1); -+ return (longlong) (value+(value > 0 ? 0.5 : -0.5)); -+ } -+ String *val_str(String*); -+ my_decimal *val_decimal(my_decimal *); -+ bool basic_const_item() const { return 1; } -+ // to prevent drop fixed flag (no need parent cleanup call) -+ void cleanup() {} -+ Item *new_item() -+ { return new Item_float(name, value, decimals, max_length); } -+ Item_num *neg() { value= -value; return this; } -+ void print(String *str); -+ bool eq(const Item *, bool binary_cmp) const; -+}; -+ -+ -+class Item_static_float_func :public Item_float -+{ -+ const char *func_name; -+public: -+ Item_static_float_func(const char *str, double val_arg, uint decimal_par, -+ uint length) -+ :Item_float(NullS, val_arg, decimal_par, length), func_name(str) -+ {} -+ void print(String *str) { str->append(func_name); } -+}; -+ -+ -+class Item_string :public Item -+{ -+public: -+ Item_string(const char *str,uint length, -+ CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE) -+ { -+ collation.set(cs, dv); -+ str_value.set_or_copy_aligned(str,length,cs); -+ /* -+ We have to have a different max_length than 'length' here to -+ ensure that we get the right length if we do use the item -+ to create a new table. In this case max_length must be the maximum -+ number of chars for a string of this type because we in create_field:: -+ divide the max_length with mbmaxlen). -+ */ -+ max_length= str_value.numchars()*cs->mbmaxlen; -+ set_name(str, length, cs); -+ decimals=NOT_FIXED_DEC; -+ // it is constant => can be used without fix_fields (and frequently used) -+ fixed= 1; -+ } -+ Item_string(const char *name_par, const char *str, uint length, -+ CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE) -+ { -+ collation.set(cs, dv); -+ str_value.set_or_copy_aligned(str,length,cs); -+ max_length= str_value.numchars()*cs->mbmaxlen; -+ set_name(name_par,0,cs); -+ decimals=NOT_FIXED_DEC; -+ // it is constant => can be used without fix_fields (and frequently used) -+ fixed= 1; -+ } -+ enum Type type() const { return STRING_ITEM; } -+ double val_real(); -+ longlong val_int(); -+ String *val_str(String*) -+ { -+ DBUG_ASSERT(fixed == 1); -+ return (String*) &str_value; -+ } -+ my_decimal *val_decimal(my_decimal *); -+ int save_in_field(Field *field, bool no_conversions); -+ enum Item_result result_type () const { return STRING_RESULT; } -+ enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; } -+ bool basic_const_item() const { return 1; } -+ bool eq(const Item *item, bool binary_cmp) const; -+ Item *new_item() -+ { -+ return new Item_string(name, str_value.ptr(), -+ str_value.length(), collation.collation); -+ } -+ Item *safe_charset_converter(CHARSET_INFO *tocs); -+ String *const_string() { return &str_value; } -+ inline void append(char *str, uint length) { str_value.append(str, length); } -+ void print(String *str); -+ // to prevent drop fixed flag (no need parent cleanup call) -+ void cleanup() {} -+}; -+ -+ -+class Item_static_string_func :public Item_string -+{ -+ const char *func_name; -+public: -+ Item_static_string_func(const char *name_par, const char *str, uint length, -+ CHARSET_INFO *cs, -+ Derivation dv= DERIVATION_COERCIBLE) -+ :Item_string(NullS, str, length, cs, dv), func_name(name_par) -+ {} -+ void print(String *str) { str->append(func_name); } -+}; -+ -+ -+/* for show tables */ -+ -+class Item_datetime :public Item_string -+{ -+public: -+ Item_datetime(const char *item_name): Item_string(item_name,"",0, -+ &my_charset_bin) -+ { max_length=19;} -+ enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; } -+}; -+ -+class Item_empty_string :public Item_string -+{ -+public: -+ Item_empty_string(const char *header,uint length, CHARSET_INFO *cs= NULL) : -+ Item_string("",0, cs ? cs : &my_charset_bin) -+ { name=(char*) header; max_length= cs ? length * cs->mbmaxlen : length; } -+ void make_field(Send_field *field); -+}; -+ -+class Item_return_int :public Item_int -+{ -+ enum_field_types int_field_type; -+public: -+ Item_return_int(const char *name, uint length, -+ enum_field_types field_type_arg) -+ :Item_int(name, 0, length), int_field_type(field_type_arg) -+ { -+ unsigned_flag=1; -+ } -+ enum_field_types field_type() const { return int_field_type; } -+}; -+ -+ -+class Item_hex_string: public Item -+{ -+public: -+ Item_hex_string(): Item() {} -+ Item_hex_string(const char *str,uint str_length); -+ enum Type type() const { return VARBIN_ITEM; } -+ double val_real() -+ { DBUG_ASSERT(fixed == 1); return (double) Item_hex_string::val_int(); } -+ longlong val_int(); -+ bool basic_const_item() const { return 1; } -+ String *val_str(String*) { DBUG_ASSERT(fixed == 1); return &str_value; } -+ my_decimal *val_decimal(my_decimal *); -+ int save_in_field(Field *field, bool no_conversions); -+ enum Item_result result_type () const { return STRING_RESULT; } -+ enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; } -+ // to prevent drop fixed flag (no need parent cleanup call) -+ void cleanup() {} -+ bool eq(const Item *item, bool binary_cmp) const; -+}; -+ -+ -+class Item_bin_string: public Item_hex_string -+{ -+public: -+ Item_bin_string(const char *str,uint str_length); -+}; -+ -+class Item_result_field :public Item /* Item with result field */ -+{ -+public: -+ Field *result_field; /* Save result here */ -+ Item_result_field() :result_field(0) {} -+ // Constructor used for Item_sum/Item_cond_and/or (see Item comment) -+ Item_result_field(THD *thd, Item_result_field *item): -+ Item(thd, item), result_field(item->result_field) -+ {} -+ ~Item_result_field() {} /* Required with gcc 2.95 */ -+ Field *get_tmp_table_field() { return result_field; } -+ Field *tmp_table_field(TABLE *t_arg) { return result_field; } -+ table_map used_tables() const { return 1; } -+ virtual void fix_length_and_dec()=0; -+ void set_result_field(Field *field) { result_field= field; } -+ bool is_result_field() { return 1; } -+ void save_in_result_field(bool no_conversions) -+ { -+ save_in_field(result_field, no_conversions); -+ } -+ void cleanup(); -+}; -+ -+ -+class Item_ref :public Item_ident -+{ -+protected: -+ void set_properties(); -+public: -+ Field *result_field; /* Save result here */ -+ Item **ref; -+ Item_ref(const char *db_par, const char *table_name_par, -+ const char *field_name_par) -+ :Item_ident(db_par, table_name_par, field_name_par), result_field(0), ref(0) {} -+ /* -+ This constructor is used in two scenarios: -+ A) *item = NULL -+ No initialization is performed, fix_fields() call will be necessary. -+ -+ B) *item points to an Item this Item_ref will refer to. This is -+ used for GROUP BY. fix_fields() will not be called in this case, -+ so we call set_properties to make this item "fixed". set_properties -+ performs a subset of action Item_ref::fix_fields does, and this subset -+ is enough for Item_ref's used in GROUP BY. -+ -+ TODO we probably fix a superset of problems like in BUG#6658. Check this -+ with Bar, and if we have a more broader set of problems like this. -+ */ -+ Item_ref(Item **item, const char *table_name_par, const char *field_name_par); -+ -+ /* Constructor need to process subselect with temporary tables (see Item) */ -+ Item_ref(THD *thd, Item_ref *item) :Item_ident(thd, item), result_field(item->result_field), ref(item->ref) {} -+ enum Type type() const { return REF_ITEM; } -+ bool eq(const Item *item, bool binary_cmp) const -+ { return ref && (*ref)->eq(item, binary_cmp); } -+ double val_real(); -+ longlong val_int(); -+ my_decimal *val_decimal(my_decimal *); -+ bool val_bool(); -+ String *val_str(String* tmp); -+ bool is_null(); -+ bool get_date(TIME *ltime,uint fuzzydate); -+ double val_result(); -+ longlong val_int_result(); -+ String *str_result(String* tmp); -+ my_decimal *val_decimal_result(my_decimal *); -+ bool val_bool_result(); -+ bool send(Protocol *prot, String *tmp); -+ void make_field(Send_field *field) { (*ref)->make_field(field); } -+ bool fix_fields(THD *, struct st_table_list *, Item **); -+ int save_in_field(Field *field, bool no_conversions) -+ { return (*ref)->save_in_field(field, no_conversions); } -+ void save_org_in_field(Field *field) { (*ref)->save_org_in_field(field); } -+ enum Item_result result_type () const { return (*ref)->result_type(); } -+ enum_field_types field_type() const { return (*ref)->field_type(); } -+ Field *get_tmp_table_field() { return result_field; } -+ table_map used_tables() const -+ { -+ return depended_from ? OUTER_REF_TABLE_BIT : (*ref)->used_tables(); -+ } -+ void set_result_field(Field *field) { result_field= field; } -+ bool is_result_field() { return 1; } -+ void save_in_result_field(bool no_conversions) -+ { -+ (*ref)->save_in_field(result_field, no_conversions); -+ } -+ Item *real_item() { return *ref; } -+ bool walk(Item_processor processor, byte *arg) -+ { return (*ref)->walk(processor, arg); } -+ void print(String *str); -+ void cleanup(); -+}; -+ -+ -+/* -+ The same as Item_ref, but get value from val_* family of method to get -+ value of item on which it referred instead of result* family. -+*/ -+class Item_direct_ref :public Item_ref -+{ -+public: -+ Item_direct_ref(Item **item, const char *table_name_par, -+ const char *field_name_par) -+ :Item_ref(item, table_name_par, field_name_par) {} -+ /* Constructor need to process subselect with temporary tables (see Item) */ -+ Item_direct_ref(THD *thd, Item_direct_ref *item) : Item_ref(thd, item) {} -+ -+ double val_real(); -+ longlong val_int(); -+ String *val_str(String* tmp); -+ my_decimal *val_decimal(my_decimal *); -+ bool val_bool(); -+ bool is_null(); -+ bool get_date(TIME *ltime,uint fuzzydate); -+}; -+ -+ -+class Item_in_subselect; -+ -+class Item_ref_null_helper: public Item_ref -+{ -+protected: -+ Item_in_subselect* owner; -+public: -+ Item_ref_null_helper(Item_in_subselect* master, Item **item, -+ const char *table_name_par, const char *field_name_par): -+ Item_ref(item, table_name_par, field_name_par), owner(master) {} -+ double val_real(); -+ longlong val_int(); -+ String* val_str(String* s); -+ my_decimal *val_decimal(my_decimal *); -+ bool val_bool(); -+ bool get_date(TIME *ltime, uint fuzzydate); -+ void print(String *str); -+}; -+ -+class Item_null_helper :public Item_ref_null_helper -+{ -+ Item *store; -+public: -+ Item_null_helper(Item_in_subselect* master, Item *item, -+ const char *table_name_par, const char *field_name_par) -+ :Item_ref_null_helper(master, (store= 0, &store), table_name_par, -+ field_name_par), -+ store(item) -+ { ref= &store; } -+ void print(String *str); -+}; -+ -+/* -+ The following class is used to optimize comparing of date and bigint columns -+ We need to save the original item, to be able to set the field to the -+ original value in 'opt_range'. -+ An instance of Item_int_with_ref may refer to a signed or an unsigned -+ integer. -+*/ -+ -+class Item_int_with_ref :public Item_int -+{ -+ Item *ref; -+public: -+ Item_int_with_ref(longlong i, Item *ref_arg) :Item_int(i), ref(ref_arg) -+ { -+ unsigned_flag= ref_arg->unsigned_flag; -+ } -+ int save_in_field(Field *field, bool no_conversions) -+ { -+ return ref->save_in_field(field, no_conversions); -+ } -+ Item *new_item(); -+}; -+ -+ -+#include "gstream.h" -+#include "spatial.h" -+#include "item_sum.h" -+#include "item_func.h" -+#include "item_row.h" -+#include "item_cmpfunc.h" -+#include "item_strfunc.h" -+#include "item_geofunc.h" -+#include "item_timefunc.h" -+#include "item_uniq.h" -+#include "item_subselect.h" -+ -+class Item_copy_string :public Item -+{ -+ enum enum_field_types cached_field_type; -+public: -+ Item *item; -+ Item_copy_string(Item *i) :item(i) -+ { -+ null_value=maybe_null=item->maybe_null; -+ decimals=item->decimals; -+ max_length=item->max_length; -+ name=item->name; -+ cached_field_type= item->field_type(); -+ } -+ enum Type type() const { return COPY_STR_ITEM; } -+ enum Item_result result_type () const { return STRING_RESULT; } -+ enum_field_types field_type() const { return cached_field_type; } -+ double val_real() -+ { -+ int err_not_used; -+ char *end_not_used; -+ return (null_value ? 0.0 : -+ my_strntod(str_value.charset(), (char*) str_value.ptr(), -+ str_value.length(), &end_not_used, &err_not_used)); -+ } -+ longlong val_int() -+ { -+ int err; -+ return null_value ? LL(0) : my_strntoll(str_value.charset(),str_value.ptr(),str_value.length(),10, (char**) 0,&err); -+ } -+ String *val_str(String*); -+ my_decimal *val_decimal(my_decimal *); -+ void make_field(Send_field *field) { item->make_field(field); } -+ void copy(); -+ int save_in_field(Field *field, bool no_conversions); -+ table_map used_tables() const { return (table_map) 1L; } -+ bool const_item() const { return 0; } -+ bool is_null() { return null_value; } -+}; -+ -+ -+class Item_buff :public Sql_alloc -+{ -+public: -+ my_bool null_value; -+ Item_buff() :null_value(0) {} -+ virtual bool cmp(void)=0; -+ virtual ~Item_buff(); /*line -e1509 */ -+}; -+ -+class Item_str_buff :public Item_buff -+{ -+ Item *item; -+ String value,tmp_value; -+public: -+ Item_str_buff(Item *arg) :item(arg),value(arg->max_length) {} -+ bool cmp(void); -+ ~Item_str_buff(); // Deallocate String:s -+}; -+ -+ -+class Item_real_buff :public Item_buff -+{ -+ Item *item; -+ double value; -+public: -+ Item_real_buff(Item *item_par) :item(item_par),value(0.0) {} -+ bool cmp(void); -+}; -+ -+class Item_int_buff :public Item_buff -+{ -+ Item *item; -+ longlong value; -+public: -+ Item_int_buff(Item *item_par) :item(item_par),value(0) {} -+ bool cmp(void); -+}; -+ -+ -+class Item_decimal_buff :public Item_buff -+{ -+ Item *item; -+ my_decimal value; -+public: -+ Item_decimal_buff(Item *item_par); -+ bool cmp(void); -+}; -+ -+class Item_field_buff :public Item_buff -+{ -+ char *buff; -+ Field *field; -+ uint length; -+ -+public: -+ Item_field_buff(Item_field *item) -+ { -+ field=item->field; -+ buff= (char*) sql_calloc(length=field->pack_length()); -+ } -+ bool cmp(void); -+}; -+ -+class Item_default_value : public Item_field -+{ -+public: -+ Item *arg; -+ Item_default_value() : -+ Item_field((const char *)NULL, (const char *)NULL, (const char *)NULL), arg(NULL) {} -+ Item_default_value(Item *a) : -+ Item_field((const char *)NULL, (const char *)NULL, (const char *)NULL), arg(a) {} -+ enum Type type() const { return DEFAULT_VALUE_ITEM; } -+ bool eq(const Item *item, bool binary_cmp) const; -+ bool fix_fields(THD *, struct st_table_list *, Item **); -+ void print(String *str); -+ int save_in_field(Field *field_arg, bool no_conversions); -+ table_map used_tables() const { return (table_map)0L; } -+ -+ bool walk(Item_processor processor, byte *args) -+ { -+ return arg->walk(processor, args) || -+ (this->*processor)(args); -+ } -+ -+ /* -+ This method like the walk method traverses the item tree, but -+ at the same time it can replace some nodes in the tree -+ */ -+ Item *transform(Item_transformer transformer, byte *args) -+ { -+ Item *new_item= arg->transform(transformer, args); -+ if (!new_item) -+ return 0; -+ arg= new_item; -+ return (this->*transformer)(args); -+ } -+}; -+ -+class Item_insert_value : public Item_field -+{ -+public: -+ Item *arg; -+ Item_insert_value(Item *a) : -+ Item_field((const char *)NULL, (const char *)NULL, (const char *)NULL), arg(a) {} -+ bool eq(const Item *item, bool binary_cmp) const; -+ bool fix_fields(THD *, struct st_table_list *, Item **); -+ void print(String *str); -+ int save_in_field(Field *field_arg, bool no_conversions) -+ { -+ return Item_field::save_in_field(field_arg, no_conversions); -+ } -+ table_map used_tables() const { return (table_map)0L; } -+ -+ bool walk(Item_processor processor, byte *args) -+ { -+ return arg->walk(processor, args) || -+ (this->*processor)(args); -+ } -+}; -+ -+ -+/* -+ We need this two enums here instead of sql_lex.h because -+ at least one of them is used by Item_trigger_field interface. -+ -+ Time when trigger is invoked (i.e. before or after row actually -+ inserted/updated/deleted). -+*/ -+enum trg_action_time_type -+{ -+ TRG_ACTION_BEFORE= 0, TRG_ACTION_AFTER= 1 -+}; -+ -+/* -+ Event on which trigger is invoked. -+*/ -+enum trg_event_type -+{ -+ TRG_EVENT_INSERT= 0 , TRG_EVENT_UPDATE= 1, TRG_EVENT_DELETE= 2 -+}; -+ -+/* -+ Represents NEW/OLD version of field of row which is -+ changed/read in trigger. -+ -+ Note: For this item actual binding to Field object happens not during -+ fix_fields() (like for Item_field) but during parsing of trigger -+ definition, when table is opened, with special setup_field() call. -+*/ -+class Item_trigger_field : public Item_field -+{ -+public: -+ /* Is this item represents row from NEW or OLD row ? */ -+ enum row_version_type {OLD_ROW, NEW_ROW}; -+ row_version_type row_version; -+ /* Next in list of all Item_trigger_field's in trigger */ -+ Item_trigger_field *next_trg_field; -+ -+ Item_trigger_field(row_version_type row_ver_par, -+ const char *field_name_par): -+ Item_field((const char *)NULL, (const char *)NULL, field_name_par), -+ row_version(row_ver_par) -+ {} -+ void setup_field(THD *thd, TABLE *table, enum trg_event_type event); -+ enum Type type() const { return TRIGGER_FIELD_ITEM; } -+ bool eq(const Item *item, bool binary_cmp) const; -+ bool fix_fields(THD *, struct st_table_list *, Item **); -+ void print(String *str); -+ table_map used_tables() const { return (table_map)0L; } -+ void cleanup(); -+}; -+ -+ -+class Item_cache: public Item -+{ -+protected: -+ Item *example; -+ table_map used_table_map; -+public: -+ Item_cache(): example(0), used_table_map(0) {fixed= 1; null_value= 1;} -+ -+ void set_used_tables(table_map map) { used_table_map= map; } -+ -+ virtual bool allocate(uint i) { return 0; } -+ virtual bool setup(Item *item) -+ { -+ example= item; -+ max_length= item->max_length; -+ decimals= item->decimals; -+ collation.set(item->collation); -+ return 0; -+ }; -+ virtual void store(Item *)= 0; -+ enum Type type() const { return CACHE_ITEM; } -+ static Item_cache* get_cache(Item_result type); -+ table_map used_tables() const { return used_table_map; } -+ virtual void keep_array() {} -+ // to prevent drop fixed flag (no need parent cleanup call) -+ void cleanup() {} -+ void print(String *str); -+}; -+ -+ -+class Item_cache_int: public Item_cache -+{ -+protected: -+ longlong value; -+public: -+ Item_cache_int(): Item_cache(), value(0) {} -+ -+ void store(Item *item); -+ double val_real() { DBUG_ASSERT(fixed == 1); return (double) value; } -+ longlong val_int() { DBUG_ASSERT(fixed == 1); return value; } -+ String* val_str(String *str); -+ my_decimal *val_decimal(my_decimal *); -+ enum Item_result result_type() const { return INT_RESULT; } -+}; -+ -+ -+class Item_cache_real: public Item_cache -+{ -+ double value; -+public: -+ Item_cache_real(): Item_cache(), value(0) {} -+ -+ void store(Item *item); -+ double val_real() { DBUG_ASSERT(fixed == 1); return value; } -+ longlong val_int(); -+ String* val_str(String *str); -+ my_decimal *val_decimal(my_decimal *); -+ enum Item_result result_type() const { return REAL_RESULT; } -+}; -+ -+ -+class Item_cache_decimal: public Item_cache -+{ -+protected: -+ my_decimal decimal_value; -+public: -+ Item_cache_decimal(): Item_cache() {} -+ -+ void store(Item *item); -+ double val_real(); -+ longlong val_int(); -+ String* val_str(String *str); -+ my_decimal *val_decimal(my_decimal *); -+ enum Item_result result_type() const { return DECIMAL_RESULT; } -+}; -+ -+ -+class Item_cache_str: public Item_cache -+{ -+ char buffer[STRING_BUFFER_USUAL_SIZE]; -+ String *value, value_buff; -+public: -+ Item_cache_str(): Item_cache(), value(0) { } -+ -+ void store(Item *item); -+ double val_real(); -+ longlong val_int(); -+ String* val_str(String *) { DBUG_ASSERT(fixed == 1); return value; } -+ my_decimal *val_decimal(my_decimal *); -+ enum Item_result result_type() const { return STRING_RESULT; } -+ CHARSET_INFO *charset() const { return value->charset(); }; -+}; -+ -+class Item_cache_row: public Item_cache -+{ -+ Item_cache **values; -+ uint item_count; -+ bool save_array; -+public: -+ Item_cache_row() -+ :Item_cache(), values(0), item_count(2), save_array(0) {} -+ -+ /* -+ 'allocate' used only in row transformer, to preallocate space for row -+ cache. -+ */ -+ bool allocate(uint num); -+ /* -+ 'setup' is needed only by row => it not called by simple row subselect -+ (only by IN subselect (in subselect optimizer)) -+ */ -+ bool setup(Item *item); -+ void store(Item *item); -+ void illegal_method_call(const char *); -+ void make_field(Send_field *) -+ { -+ illegal_method_call((const char*)"make_field"); -+ }; -+ double val_real() -+ { -+ illegal_method_call((const char*)"val"); -+ return 0; -+ }; -+ longlong val_int() -+ { -+ illegal_method_call((const char*)"val_int"); -+ return 0; -+ }; -+ String *val_str(String *) -+ { -+ illegal_method_call((const char*)"val_str"); -+ return 0; -+ }; -+ my_decimal *val_decimal(my_decimal *val) -+ { -+ illegal_method_call((const char*)"val_decimal"); -+ return 0; -+ }; -+ -+ enum Item_result result_type() const { return ROW_RESULT; } -+ -+ uint cols() { return item_count; } -+ Item* el(uint i) { return values[i]; } -+ Item** addr(uint i) { return (Item **) (values + i); } -+ bool check_cols(uint c); -+ bool null_inside(); -+ void bring_value(); -+ void keep_array() { save_array= 1; } -+ void cleanup() -+ { -+ DBUG_ENTER("Item_cache_row::cleanup"); -+ Item_cache::cleanup(); -+ if (save_array) -+ bzero(values, item_count*sizeof(Item**)); -+ else -+ values= 0; -+ DBUG_VOID_RETURN; -+ } -+}; -+ -+ -+/* -+ Item_type_holder used to store type. name, length of Item for UNIONS & -+ derived tables. -+ -+ Item_type_holder do not need cleanup() because its time of live limited by -+ single SP/PS execution. -+*/ -+class Item_type_holder: public Item -+{ -+protected: -+ TYPELIB *enum_set_typelib; -+ enum_field_types fld_type; -+ -+ void get_full_info(Item *item); -+ -+ /* It is used to count decimal precision in join_types */ -+ int prev_decimal_int_part; -+public: -+ Item_type_holder(THD*, Item*); -+ -+ Item_result result_type() const; -+ virtual enum_field_types field_type() const { return fld_type; }; -+ enum Type type() const { return TYPE_HOLDER; } -+ double val_real(); -+ longlong val_int(); -+ my_decimal *val_decimal(my_decimal *); -+ String *val_str(String*); -+ bool join_types(THD *thd, Item *); -+ Field *make_field_by_type(TABLE *table); -+ static uint32 display_length(Item *item); -+ static enum_field_types get_real_type(Item *); -+}; -+ -+class st_select_lex; -+void mark_select_range_as_dependent(THD *thd, -+ st_select_lex *last_select, -+ st_select_lex *current_sel, -+ Field *found_field, Item *found_item, -+ Item_ident *resolved_item); -+ -+extern Item_buff *new_Item_buff(Item *item); -+extern Item_result item_cmp_type(Item_result a,Item_result b); -+extern void resolve_const_item(THD *thd, Item **ref, Item *cmp_item); -+extern bool field_is_equal_to_item(Field *field,Item *item); -diff -Naur mysql.orig/sql/item_create.cc mysql.xml/sql/item_create.cc ---- mysql.orig/sql/item_create.cc 2005-05-15 06:16:52.000000000 +0200 -+++ mysql.xml/sql/item_create.cc 2005-05-20 15:19:29.000000000 +0200 -@@ -496,6 +496,16 @@ - return new Item_func_quote(a); - } - -+Item *create_func_xml_extractvalue(Item *a, Item *b) -+{ -+ return new Item_func_xml_extractvalue(a, b); -+} -+ -+Item *create_func_xml_update(Item *a, Item *b, Item *c) -+{ -+ return new Item_func_xml_update(a, b, c); -+} -+ - #ifdef HAVE_SPATIAL - Item *create_func_as_wkt(Item *a) - { -diff -Naur mysql.orig/sql/item_create.cc.orig mysql.xml/sql/item_create.cc.orig ---- mysql.orig/sql/item_create.cc.orig 1970-01-01 01:00:00.000000000 +0100 -+++ mysql.xml/sql/item_create.cc.orig 2005-05-15 06:16:52.000000000 +0200 -@@ -0,0 +1,725 @@ -+/* 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 */ -+ -+/* Functions to create an item. Used by lex.h */ -+ -+#include "mysql_priv.h" -+ -+Item *create_func_abs(Item* a) -+{ -+ return new Item_func_abs(a); -+} -+ -+Item *create_func_acos(Item* a) -+{ -+ return new Item_func_acos(a); -+} -+ -+Item *create_func_aes_encrypt(Item* a, Item* b) -+{ -+ return new Item_func_aes_encrypt(a, b); -+} -+ -+Item *create_func_aes_decrypt(Item* a, Item* b) -+{ -+ return new Item_func_aes_decrypt(a, b); -+} -+ -+Item *create_func_ascii(Item* a) -+{ -+ return new Item_func_ascii(a); -+} -+ -+Item *create_func_ord(Item* a) -+{ -+ return new Item_func_ord(a); -+} -+ -+Item *create_func_asin(Item* a) -+{ -+ return new Item_func_asin(a); -+} -+ -+Item *create_func_bin(Item* a) -+{ -+ return new Item_func_conv(a,new Item_int((int32) 10,2), -+ new Item_int((int32) 2,1)); -+} -+ -+Item *create_func_bit_count(Item* a) -+{ -+ return new Item_func_bit_count(a); -+} -+ -+Item *create_func_ceiling(Item* a) -+{ -+ return new Item_func_ceiling(a); -+} -+ -+Item *create_func_connection_id(void) -+{ -+ THD *thd=current_thd; -+ thd->lex->safe_to_cache_query= 0; -+ return new Item_static_int_func("connection_id()", -+ (longlong) -+ ((thd->slave_thread) ? -+ thd->variables.pseudo_thread_id : -+ thd->thread_id), -+ 10); -+} -+ -+Item *create_func_conv(Item* a, Item *b, Item *c) -+{ -+ return new Item_func_conv(a,b,c); -+} -+ -+Item *create_func_cos(Item* a) -+{ -+ return new Item_func_cos(a); -+} -+ -+Item *create_func_cot(Item* a) -+{ -+ return new Item_func_div(new Item_int((char*) "1",1,1), -+ new Item_func_tan(a)); -+} -+ -+Item *create_func_date_format(Item* a,Item *b) -+{ -+ return new Item_func_date_format(a,b,0); -+} -+ -+Item *create_func_dayofmonth(Item* a) -+{ -+ return new Item_func_dayofmonth(a); -+} -+ -+Item *create_func_dayofweek(Item* a) -+{ -+ return new Item_func_weekday(new Item_func_to_days(a),1); -+} -+ -+Item *create_func_dayofyear(Item* a) -+{ -+ return new Item_func_dayofyear(a); -+} -+ -+Item *create_func_dayname(Item* a) -+{ -+ return new Item_func_dayname(new Item_func_to_days(a)); -+} -+ -+Item *create_func_degrees(Item *a) -+{ -+ return new Item_func_units((char*) "degrees",a,180/M_PI,0.0); -+} -+ -+Item *create_func_exp(Item* a) -+{ -+ return new Item_func_exp(a); -+} -+ -+Item *create_func_find_in_set(Item* a, Item *b) -+{ -+ return new Item_func_find_in_set(a, b); -+} -+ -+Item *create_func_floor(Item* a) -+{ -+ return new Item_func_floor(a); -+} -+ -+Item *create_func_found_rows(void) -+{ -+ THD *thd=current_thd; -+ thd->lex->safe_to_cache_query= 0; -+ return new Item_func_found_rows(); -+} -+ -+Item *create_func_from_days(Item* a) -+{ -+ return new Item_func_from_days(a); -+} -+ -+Item *create_func_get_lock(Item* a, Item *b) -+{ -+ current_thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT); -+ return new Item_func_get_lock(a, b); -+} -+ -+Item *create_func_hex(Item *a) -+{ -+ return new Item_func_hex(a); -+} -+ -+Item *create_func_inet_ntoa(Item* a) -+{ -+ return new Item_func_inet_ntoa(a); -+} -+ -+Item *create_func_inet_aton(Item* a) -+{ -+ return new Item_func_inet_aton(a); -+} -+ -+ -+Item *create_func_ifnull(Item* a, Item *b) -+{ -+ return new Item_func_ifnull(a,b); -+} -+ -+Item *create_func_nullif(Item* a, Item *b) -+{ -+ return new Item_func_nullif(a,b); -+} -+ -+Item *create_func_locate(Item* a, Item *b) -+{ -+ return new Item_func_locate(b,a); -+} -+ -+Item *create_func_instr(Item* a, Item *b) -+{ -+ return new Item_func_locate(a,b); -+} -+ -+Item *create_func_isnull(Item* a) -+{ -+ return new Item_func_isnull(a); -+} -+ -+Item *create_func_lcase(Item* a) -+{ -+ return new Item_func_lcase(a); -+} -+ -+Item *create_func_length(Item* a) -+{ -+ return new Item_func_length(a); -+} -+ -+Item *create_func_bit_length(Item* a) -+{ -+ return new Item_func_bit_length(a); -+} -+ -+Item *create_func_coercibility(Item* a) -+{ -+ return new Item_func_coercibility(a); -+} -+ -+Item *create_func_char_length(Item* a) -+{ -+ return new Item_func_char_length(a); -+} -+ -+Item *create_func_ln(Item* a) -+{ -+ return new Item_func_ln(a); -+} -+ -+Item *create_func_log2(Item* a) -+{ -+ return new Item_func_log2(a); -+} -+ -+Item *create_func_log10(Item* a) -+{ -+ return new Item_func_log10(a); -+} -+ -+Item *create_func_lpad(Item* a, Item *b, Item *c) -+{ -+ return new Item_func_lpad(a,b,c); -+} -+ -+Item *create_func_ltrim(Item* a) -+{ -+ return new Item_func_ltrim(a); -+} -+ -+Item *create_func_md5(Item* a) -+{ -+ return new Item_func_md5(a); -+} -+ -+Item *create_func_mod(Item* a, Item *b) -+{ -+ return new Item_func_mod(a,b); -+} -+ -+Item *create_func_monthname(Item* a) -+{ -+ return new Item_func_monthname(a); -+} -+ -+Item *create_func_month(Item* a) -+{ -+ return new Item_func_month(a); -+} -+ -+Item *create_func_oct(Item *a) -+{ -+ return new Item_func_conv(a,new Item_int((int32) 10,2), -+ new Item_int((int32) 8,1)); -+} -+ -+Item *create_func_period_add(Item* a, Item *b) -+{ -+ return new Item_func_period_add(a,b); -+} -+ -+Item *create_func_period_diff(Item* a, Item *b) -+{ -+ return new Item_func_period_diff(a,b); -+} -+ -+Item *create_func_pi(void) -+{ -+ return new Item_static_float_func("pi()", M_PI, 6, 8); -+} -+ -+Item *create_func_pow(Item* a, Item *b) -+{ -+ return new Item_func_pow(a,b); -+} -+ -+Item *create_func_current_user() -+{ -+ THD *thd=current_thd; -+ char buff[HOSTNAME_LENGTH+USERNAME_LENGTH+2]; -+ uint length; -+ -+ thd->lex->safe_to_cache_query= 0; -+ length= (uint) (strxmov(buff, thd->priv_user, "@", thd->priv_host, NullS) - -+ buff); -+ return new Item_static_string_func("current_user()", -+ thd->memdup(buff, length), length, -+ system_charset_info); -+} -+ -+Item *create_func_radians(Item *a) -+{ -+ return new Item_func_units((char*) "radians",a,M_PI/180,0.0); -+} -+ -+Item *create_func_release_lock(Item* a) -+{ -+ current_thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT); -+ return new Item_func_release_lock(a); -+} -+ -+Item *create_func_repeat(Item* a, Item *b) -+{ -+ return new Item_func_repeat(a,b); -+} -+ -+Item *create_func_reverse(Item* a) -+{ -+ return new Item_func_reverse(a); -+} -+ -+Item *create_func_rpad(Item* a, Item *b, Item *c) -+{ -+ return new Item_func_rpad(a,b,c); -+} -+ -+Item *create_func_rtrim(Item* a) -+{ -+ return new Item_func_rtrim(a); -+} -+ -+Item *create_func_sec_to_time(Item* a) -+{ -+ return new Item_func_sec_to_time(a); -+} -+ -+Item *create_func_sign(Item* a) -+{ -+ return new Item_func_sign(a); -+} -+ -+Item *create_func_sin(Item* a) -+{ -+ return new Item_func_sin(a); -+} -+ -+Item *create_func_sha(Item* a) -+{ -+ return new Item_func_sha(a); -+} -+ -+Item *create_func_space(Item *a) -+{ -+ CHARSET_INFO *cs= current_thd->variables.collation_connection; -+ Item *sp; -+ -+ if (cs->mbminlen > 1) -+ { -+ uint dummy_errors; -+ sp= new Item_string("",0,cs); -+ if (sp) -+ sp->str_value.copy(" ", 1, &my_charset_latin1, cs, &dummy_errors); -+ } -+ else -+ { -+ sp= new Item_string(" ",1,cs); -+ } -+ return sp ? new Item_func_repeat(sp, a) : 0; -+} -+ -+Item *create_func_soundex(Item* a) -+{ -+ return new Item_func_soundex(a); -+} -+ -+Item *create_func_sqrt(Item* a) -+{ -+ return new Item_func_sqrt(a); -+} -+ -+Item *create_func_strcmp(Item* a, Item *b) -+{ -+ return new Item_func_strcmp(a,b); -+} -+ -+Item *create_func_tan(Item* a) -+{ -+ return new Item_func_tan(a); -+} -+ -+Item *create_func_time_format(Item *a, Item *b) -+{ -+ return new Item_func_date_format(a,b,1); -+} -+ -+Item *create_func_time_to_sec(Item* a) -+{ -+ return new Item_func_time_to_sec(a); -+} -+ -+Item *create_func_to_days(Item* a) -+{ -+ return new Item_func_to_days(a); -+} -+ -+Item *create_func_ucase(Item* a) -+{ -+ return new Item_func_ucase(a); -+} -+ -+Item *create_func_unhex(Item* a) -+{ -+ return new Item_func_unhex(a); -+} -+ -+Item *create_func_uuid(void) -+{ -+ return new Item_func_uuid(); -+} -+ -+Item *create_func_version(void) -+{ -+ return new Item_static_string_func("version()", server_version, -+ (uint) strlen(server_version), -+ system_charset_info, DERIVATION_SYSCONST); -+} -+ -+Item *create_func_weekday(Item* a) -+{ -+ return new Item_func_weekday(new Item_func_to_days(a),0); -+} -+ -+Item *create_func_year(Item* a) -+{ -+ return new Item_func_year(a); -+} -+ -+Item *create_load_file(Item* a) -+{ -+ current_thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT); -+ return new Item_load_file(a); -+} -+ -+ -+Item *create_func_cast(Item *a, Cast_target cast_type, int len, int dec, -+ CHARSET_INFO *cs) -+{ -+ Item *res; -+ LINT_INIT(res); -+ -+ switch (cast_type) { -+ case ITEM_CAST_BINARY: res= new Item_func_binary(a); break; -+ case ITEM_CAST_SIGNED_INT: res= new Item_func_signed(a); break; -+ case ITEM_CAST_UNSIGNED_INT: res= new Item_func_unsigned(a); break; -+ case ITEM_CAST_DATE: res= new Item_date_typecast(a); break; -+ case ITEM_CAST_TIME: res= new Item_time_typecast(a); break; -+ case ITEM_CAST_DATETIME: res= new Item_datetime_typecast(a); break; -+ case ITEM_CAST_DECIMAL: -+ res= new Item_decimal_typecast(a, (len>0) ? len : 10, dec ? dec : 2); -+ break; -+ case ITEM_CAST_CHAR: -+ res= new Item_char_typecast(a, len, cs ? cs : -+ current_thd->variables.collation_connection); -+ break; -+ } -+ return res; -+} -+ -+Item *create_func_is_free_lock(Item* a) -+{ -+ current_thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT); -+ return new Item_func_is_free_lock(a); -+} -+ -+Item *create_func_is_used_lock(Item* a) -+{ -+ current_thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT); -+ return new Item_func_is_used_lock(a); -+} -+ -+Item *create_func_quote(Item* a) -+{ -+ return new Item_func_quote(a); -+} -+ -+#ifdef HAVE_SPATIAL -+Item *create_func_as_wkt(Item *a) -+{ -+ return new Item_func_as_wkt(a); -+} -+ -+Item *create_func_as_wkb(Item *a) -+{ -+ return new Item_func_as_wkb(a); -+} -+ -+Item *create_func_srid(Item *a) -+{ -+ return new Item_func_srid(a); -+} -+ -+Item *create_func_startpoint(Item *a) -+{ -+ return new Item_func_spatial_decomp(a, Item_func::SP_STARTPOINT); -+} -+ -+Item *create_func_endpoint(Item *a) -+{ -+ return new Item_func_spatial_decomp(a, Item_func::SP_ENDPOINT); -+} -+ -+Item *create_func_exteriorring(Item *a) -+{ -+ return new Item_func_spatial_decomp(a, Item_func::SP_EXTERIORRING); -+} -+ -+Item *create_func_pointn(Item *a, Item *b) -+{ -+ return new Item_func_spatial_decomp_n(a, b, Item_func::SP_POINTN); -+} -+ -+Item *create_func_interiorringn(Item *a, Item *b) -+{ -+ return new Item_func_spatial_decomp_n(a, b, Item_func::SP_INTERIORRINGN); -+} -+ -+Item *create_func_geometryn(Item *a, Item *b) -+{ -+ return new Item_func_spatial_decomp_n(a, b, Item_func::SP_GEOMETRYN); -+} -+ -+Item *create_func_centroid(Item *a) -+{ -+ return new Item_func_centroid(a); -+} -+ -+Item *create_func_envelope(Item *a) -+{ -+ return new Item_func_envelope(a); -+} -+ -+Item *create_func_equals(Item *a, Item *b) -+{ -+ return new Item_func_spatial_rel(a, b, Item_func::SP_EQUALS_FUNC); -+} -+ -+Item *create_func_disjoint(Item *a, Item *b) -+{ -+ return new Item_func_spatial_rel(a, b, Item_func::SP_DISJOINT_FUNC); -+} -+ -+Item *create_func_intersects(Item *a, Item *b) -+{ -+ return new Item_func_spatial_rel(a, b, Item_func::SP_INTERSECTS_FUNC); -+} -+ -+Item *create_func_touches(Item *a, Item *b) -+{ -+ return new Item_func_spatial_rel(a, b, Item_func::SP_TOUCHES_FUNC); -+} -+ -+Item *create_func_crosses(Item *a, Item *b) -+{ -+ return new Item_func_spatial_rel(a, b, Item_func::SP_CROSSES_FUNC); -+} -+ -+Item *create_func_within(Item *a, Item *b) -+{ -+ return new Item_func_spatial_rel(a, b, Item_func::SP_WITHIN_FUNC); -+} -+ -+Item *create_func_contains(Item *a, Item *b) -+{ -+ return new Item_func_spatial_rel(a, b, Item_func::SP_CONTAINS_FUNC); -+} -+ -+Item *create_func_overlaps(Item *a, Item *b) -+{ -+ return new Item_func_spatial_rel(a, b, Item_func::SP_OVERLAPS_FUNC); -+} -+ -+Item *create_func_isempty(Item *a) -+{ -+ return new Item_func_isempty(a); -+} -+ -+Item *create_func_issimple(Item *a) -+{ -+ return new Item_func_issimple(a); -+} -+ -+Item *create_func_isclosed(Item *a) -+{ -+ return new Item_func_isclosed(a); -+} -+ -+Item *create_func_geometry_type(Item *a) -+{ -+ return new Item_func_geometry_type(a); -+} -+ -+Item *create_func_dimension(Item *a) -+{ -+ return new Item_func_dimension(a); -+} -+ -+Item *create_func_x(Item *a) -+{ -+ return new Item_func_x(a); -+} -+ -+Item *create_func_y(Item *a) -+{ -+ return new Item_func_y(a); -+} -+ -+Item *create_func_numpoints(Item *a) -+{ -+ return new Item_func_numpoints(a); -+} -+ -+Item *create_func_numinteriorring(Item *a) -+{ -+ return new Item_func_numinteriorring(a); -+} -+ -+Item *create_func_numgeometries(Item *a) -+{ -+ return new Item_func_numgeometries(a); -+} -+ -+Item *create_func_area(Item *a) -+{ -+ return new Item_func_area(a); -+} -+ -+Item *create_func_glength(Item *a) -+{ -+ return new Item_func_glength(a); -+} -+ -+Item *create_func_point(Item *a, Item *b) -+{ -+ return new Item_func_point(a, b); -+} -+#endif /*HAVE_SPATIAL*/ -+ -+Item *create_func_crc32(Item* a) -+{ -+ return new Item_func_crc32(a); -+} -+ -+Item *create_func_compress(Item* a) -+{ -+ return new Item_func_compress(a); -+} -+ -+Item *create_func_uncompress(Item* a) -+{ -+ return new Item_func_uncompress(a); -+} -+ -+Item *create_func_uncompressed_length(Item* a) -+{ -+ return new Item_func_uncompressed_length(a); -+} -+ -+Item *create_func_datediff(Item *a, Item *b) -+{ -+ return new Item_func_minus(new Item_func_to_days(a), -+ new Item_func_to_days(b)); -+} -+ -+Item *create_func_weekofyear(Item *a) -+{ -+ return new Item_func_week(a, new Item_int((char*) "0", 3, 1)); -+} -+ -+Item *create_func_makedate(Item* a,Item* b) -+{ -+ return new Item_func_makedate(a, b); -+} -+ -+Item *create_func_addtime(Item* a,Item* b) -+{ -+ return new Item_func_add_time(a, b, 0, 0); -+} -+ -+Item *create_func_subtime(Item* a,Item* b) -+{ -+ return new Item_func_add_time(a, b, 0, 1); -+} -+ -+Item *create_func_timediff(Item* a,Item* b) -+{ -+ return new Item_func_timediff(a, b); -+} -+ -+Item *create_func_maketime(Item* a,Item* b,Item* c) -+{ -+ return new Item_func_maketime(a, b, c); -+} -+ -+Item *create_func_str_to_date(Item* a,Item* b) -+{ -+ return new Item_func_str_to_date(a, b); -+} -+ -+Item *create_func_last_day(Item *a) -+{ -+ return new Item_func_last_day(a); -+} -diff -Naur mysql.orig/sql/item_create.h mysql.xml/sql/item_create.h ---- mysql.orig/sql/item_create.h 2005-05-15 06:16:52.000000000 +0200 -+++ mysql.xml/sql/item_create.h 2005-05-20 15:19:29.000000000 +0200 -@@ -100,7 +100,8 @@ - Item *create_func_is_free_lock(Item* a); - Item *create_func_is_used_lock(Item* a); - Item *create_func_quote(Item* a); -- -+Item *create_func_xml_extractvalue(Item *a, Item *b); -+Item *create_func_xml_update(Item *a, Item *b, Item *c); - #ifdef HAVE_SPATIAL - - Item *create_func_geometry_from_text(Item *a); -diff -Naur mysql.orig/sql/item_xmlfunc.cc mysql.xml/sql/item_xmlfunc.cc ---- mysql.orig/sql/item_xmlfunc.cc 1970-01-01 01:00:00.000000000 +0100 -+++ mysql.xml/sql/item_xmlfunc.cc 2005-04-16 13:49:09.000000000 +0200 -@@ -0,0 +1,2555 @@ -+/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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 */ -+ -+ -+#ifdef __GNUC__ -+#pragma implementation -+#endif -+ -+#include "mysql_priv.h" -+#include "my_xml.h" -+ -+ -+/* -+ TODO: future development directions: -+ 1. add real constants for XPATH_NODESET_CMP and XPATH_NODESET -+ into enum Type in item.h. -+ 2. add nodeset_to_nodeset_comparator -+ 3. add lacking functions: -+ - name() -+ - last() -+ - lang() -+ - string() -+ - id() -+ - translate() -+ - local-name() -+ - starts-with() -+ - namespace-uri() -+ - substring-after() -+ - normalize-space() -+ - substring-before() -+ 4. add lacking axis: -+ - following-sibling -+ - following, -+ - preceding-sibling -+ - preceding -+*/ -+ -+ -+/* Structure to store a parsed XML tree */ -+typedef struct my_xml_node_st -+{ -+ uint level; /* level in XML tree, 0 means root node */ -+ enum my_xml_node_type type; /* node type: node, or attribute, or text */ -+ uint parent; /* link to the parent */ -+ const char *beg; /* beginning of the name or text */ -+ const char *end; /* end of the name or text */ -+ const char *tagend; /* where this tag ends */ -+} MY_XML_NODE; -+ -+ -+/* Lexical analizer token */ -+typedef struct my_xpath_lex_st -+{ -+ int term; /* token type, see MY_XPATH_LEX_XXXXX below */ -+ const char *beg; /* beginnign of the token */ -+ const char *end; /* end of the token */ -+} MY_XPATH_LEX; -+ -+ -+/* Structure to store nodesets */ -+typedef struct my_xpath_flt_st -+{ -+ uint num; /* absolute position in MY_XML_NODE array */ -+ uint pos; /* relative position in context */ -+} MY_XPATH_FLT; -+ -+ -+/* XPath function creator */ -+typedef struct my_xpath_function_names_st -+{ -+ const char *name; /* function name */ -+ size_t length; /* function name length */ -+ size_t minargs; /* min number of arguments */ -+ size_t maxargs; /* max number of arguments */ -+ Item *(*create)(struct my_xpath_st *xpath, Item **args, uint nargs); -+} MY_XPATH_FUNC; -+ -+ -+/* XPath query parser */ -+typedef struct my_xpath_st -+{ -+ int debug; -+ MY_XPATH_LEX query; /* Whole query */ -+ MY_XPATH_LEX lasttok; /* last scanned token */ -+ MY_XPATH_LEX prevtok; /* previous scanned token */ -+ int axis; /* last scanned axis */ -+ int extra; /* last scanned "extra", context dependent */ -+ MY_XPATH_FUNC *func; /* last scanned function creator */ -+ Item *item; /* current expression */ -+ Item *context; /* last scanned context */ -+ String *context_cache; /* last context provider */ -+ String *pxml; /* Parsed XML, an array of MY_XML_NODE */ -+ CHARSET_INFO *cs; /* character set/collation string comparison */ -+} MY_XPATH; -+ -+ -+/* Dynamic array of MY_XPATH_FLT */ -+class XPathFilter :public String -+{ -+public: -+ XPathFilter() :String() {} -+ inline bool append_element(MY_XPATH_FLT *flt) -+ { -+ String *str= this; -+ return str->append((const char*)flt, (uint32) sizeof(MY_XPATH_FLT)); -+ } -+ inline bool append_element(uint32 num, uint32 pos) -+ { -+ MY_XPATH_FLT add; -+ add.num= num; -+ add.pos= pos; -+ return append_element(&add); -+ } -+ inline MY_XPATH_FLT *element(uint i) -+ { -+ return (MY_XPATH_FLT*) (ptr() + i * sizeof(MY_XPATH_FLT)); -+ } -+ inline uint32 numelements() -+ { -+ return length() / sizeof(MY_XPATH_FLT); -+ } -+}; -+ -+ -+/* -+ Common features of the functions returning a node set. -+*/ -+class Item_nodeset_func :public Item_str_func -+{ -+protected: -+ String tmp_value, tmp2_value; -+ MY_XPATH_FLT *fltbeg, *fltend; -+ MY_XML_NODE *nodebeg, *nodeend; -+ uint numnodes; -+public: -+ String *pxml; -+ String context_cache; -+ Item_nodeset_func(String *pxml_arg) :Item_str_func(), pxml(pxml_arg) {} -+ Item_nodeset_func(Item *a, String *pxml_arg) -+ :Item_str_func(a), pxml(pxml_arg) {} -+ Item_nodeset_func(Item *a, Item *b, String *pxml_arg) -+ :Item_str_func(a, b), pxml(pxml_arg) {} -+ Item_nodeset_func(Item *a, Item *b, Item *c, String *pxml_arg) -+ :Item_str_func(a,b,c), pxml(pxml_arg) {} -+ void prepare_nodes() -+ { -+ nodebeg= (MY_XML_NODE*) pxml->ptr(); -+ nodeend= (MY_XML_NODE*) (pxml->ptr() + pxml->length()); -+ numnodes= nodeend - nodebeg; -+ } -+ void prepare(String *nodeset) -+ { -+ prepare_nodes(); -+ String *res= args[0]->val_nodeset(&tmp_value); -+ fltbeg= (MY_XPATH_FLT*) res->ptr(); -+ fltend= (MY_XPATH_FLT*) (res->ptr() + res->length()); -+ nodeset->length(0); -+ } -+ enum Type type() const { return XPATH_NODESET; } -+ String *val_str(String *str) -+ { -+ prepare_nodes(); -+ String *res= val_nodeset(&tmp2_value); -+ fltbeg= (MY_XPATH_FLT*) res->ptr(); -+ fltend= (MY_XPATH_FLT*) (res->ptr() + res->length()); -+ String active; -+ active.alloc(numnodes); -+ bzero((char*) active.ptr(), numnodes); -+ for (MY_XPATH_FLT *flt= fltbeg; flt < fltend; flt++) -+ { -+ MY_XML_NODE *node; -+ uint j; -+ for (j=0, node= nodebeg ; j < numnodes; j++, node++) -+ { -+ if (node->type == MY_XML_NODE_TEXT && -+ node->parent == flt->num) -+ active[j]= 1; -+ } -+ } -+ -+ str->length(0); -+ str->set_charset(collation.collation); -+ for (uint i=0 ; i < numnodes; i++) -+ { -+ if(active[i]) -+ { -+ if (str->length()) -+ str->append(" ", 1, &my_charset_latin1); -+ str->append(nodebeg[i].beg, nodebeg[i].end - nodebeg[i].beg); -+ } -+ } -+ return str; -+ } -+ enum Item_result result_type () const { return STRING_RESULT; } -+ void fix_length_and_dec() { max_length= MAX_BLOB_WIDTH; } -+ const char *func_name() const { return "nodeset"; } -+}; -+ -+ -+/* Returns an XML root */ -+class Item_nodeset_func_rootelement :public Item_nodeset_func -+{ -+public: -+ Item_nodeset_func_rootelement(String *pxml): Item_nodeset_func(pxml) {} -+ String *val_nodeset(String *nodeset); -+}; -+ -+ -+/* Returns a Union of two node sets */ -+class Item_nodeset_func_union :public Item_nodeset_func -+{ -+public: -+ Item_nodeset_func_union(Item *a, Item *b, String *pxml) -+ :Item_nodeset_func(a, b, pxml) {} -+ String *val_nodeset(String *nodeset); -+}; -+ -+ -+/* Makes one step towards the given axis */ -+class Item_nodeset_func_axisbyname :public Item_nodeset_func -+{ -+ const char *node_name; -+ uint node_namelen; -+public: -+ Item_nodeset_func_axisbyname(Item *a, const char *n_arg, uint l_arg, -+ String *pxml): -+ Item_nodeset_func(a, pxml), node_name(n_arg), node_namelen(l_arg) { } -+ bool validname(MY_XML_NODE *n) -+ { -+ if (node_name[0] == '*') -+ return 1; -+ return (node_namelen == (uint) (n->end - n->beg)) && -+ !memcmp(node_name, n->beg, node_namelen); -+ } -+}; -+ -+ -+/* Returns children */ -+class Item_nodeset_func_childbyname: public Item_nodeset_func_axisbyname -+{ -+public: -+ Item_nodeset_func_childbyname(Item *a, const char *n_arg, uint l_arg, -+ String *pxml): -+ Item_nodeset_func_axisbyname(a, n_arg, l_arg, pxml) {} -+ String *val_nodeset(String *nodeset); -+}; -+ -+ -+/* Returns descendants */ -+class Item_nodeset_func_descendantbyname: public Item_nodeset_func_axisbyname -+{ -+ bool need_self; -+public: -+ Item_nodeset_func_descendantbyname(Item *a, const char *n_arg, uint l_arg, -+ String *pxml, bool need_self_arg): -+ Item_nodeset_func_axisbyname(a, n_arg, l_arg, pxml), -+ need_self(need_self_arg) {} -+ String *val_nodeset(String *nodeset); -+}; -+ -+ -+/* Returns ancestors */ -+class Item_nodeset_func_ancestorbyname: public Item_nodeset_func_axisbyname -+{ -+ bool need_self; -+public: -+ Item_nodeset_func_ancestorbyname(Item *a, const char *n_arg, uint l_arg, -+ String *pxml, bool need_self_arg): -+ Item_nodeset_func_axisbyname(a, n_arg, l_arg, pxml), -+ need_self(need_self_arg) {} -+ String *val_nodeset(String *nodeset); -+}; -+ -+ -+/* Returns parents */ -+class Item_nodeset_func_parentbyname: public Item_nodeset_func_axisbyname -+{ -+public: -+ Item_nodeset_func_parentbyname(Item *a, const char *n_arg, uint l_arg, -+ String *pxml): -+ Item_nodeset_func_axisbyname(a, n_arg, l_arg, pxml) {} -+ String *val_nodeset(String *nodeset); -+}; -+ -+ -+/* Returns attributes */ -+class Item_nodeset_func_attributebyname: public Item_nodeset_func_axisbyname -+{ -+public: -+ Item_nodeset_func_attributebyname(Item *a, const char *n_arg, uint l_arg, -+ String *pxml): -+ Item_nodeset_func_axisbyname(a, n_arg, l_arg, pxml) {} -+ String *val_nodeset(String *nodeset); -+}; -+ -+ -+/* -+ Condition iterator: goes through all nodes in the current -+ context and checks a condition, returning those nodes -+ giving TRUE condition result. -+*/ -+class Item_nodeset_func_predicate :public Item_nodeset_func -+{ -+public: -+ Item_nodeset_func_predicate(Item *a, Item *b, String *pxml): -+ Item_nodeset_func(a, b, pxml) {} -+ String *val_nodeset(String *nodeset); -+}; -+ -+ -+/* Selects nodes with a given position in context */ -+class Item_nodeset_func_elementbyindex :public Item_nodeset_func -+{ -+public: -+ Item_nodeset_func_elementbyindex(Item *a, Item *b, String *pxml): -+ Item_nodeset_func(a, b, pxml) { } -+ String *val_nodeset(String *nodeset); -+}; -+ -+ -+/* -+ We need to distinguish a number from a boolean: -+ a[1] and a[true] are different things in XPath. -+*/ -+class Item_bool :public Item_int -+{ -+public: -+ Item_bool(int32 i): Item_int(i) {} -+ bool is_bool_func() { return 1; } -+}; -+ -+ -+/* -+ Converts its argument into a boolean value. -+ * a number is true if it is non-zero -+ * a node-set is true if and only if it is non-empty -+ * a string is true if and only if its length is non-zero -+*/ -+class Item_xpath_cast_bool :public Item_int_func -+{ -+ String *pxml; -+ String tmp_value; -+public: -+ Item_xpath_cast_bool(Item *a, String *pxml_arg) -+ :Item_int_func(a), pxml(pxml_arg) {} -+ bool is_bool_func() { return 1; } -+ longlong val_int() -+ { -+ if (args[0]->type() == XPATH_NODESET) -+ { -+ String *flt= args[0]->val_nodeset(&tmp_value); -+ return flt->length() == sizeof(MY_XPATH_FLT) ? 1 : 0; -+ } -+ return args[0]->val_real() ? 1 : 0; -+ } -+}; -+ -+ -+/* -+ Converts its argument into a number -+*/ -+class Item_xpath_cast_number :public Item_real_func -+{ -+public: -+ Item_xpath_cast_number(Item *a): Item_real_func(a) {} -+ virtual double val_real() { return args[0]->val_real(); } -+}; -+ -+ -+/* -+ Context cache, for predicate -+*/ -+class Item_nodeset_context_cache :public Item_nodeset_func -+{ -+public: -+ String *string_cache; -+ Item_nodeset_context_cache(String *str_arg, String *pxml): -+ Item_nodeset_func(pxml), string_cache(str_arg) { } -+ String *val_nodeset(String *res) -+ { return string_cache; } -+ void fix_length_and_dec() { max_length= MAX_BLOB_WIDTH; } -+}; -+ -+ -+class Item_func_xpath_position :public Item_int_func -+{ -+ String *pxml; -+ String tmp_value; -+public: -+ Item_func_xpath_position(Item *a, String *p) -+ :Item_int_func(a), pxml(p) {} -+ void fix_length_and_dec() { max_length=10; } -+ longlong val_int() -+ { -+ String *flt= args[0]->val_nodeset(&tmp_value); -+ if (flt->length() == sizeof(MY_XPATH_FLT)) -+ return ((MY_XPATH_FLT*)flt->ptr())->pos + 1; -+ return 0; -+ } -+}; -+ -+ -+class Item_func_xpath_count :public Item_int_func -+{ -+ String *pxml; -+ String tmp_value; -+public: -+ Item_func_xpath_count(Item *a, String *p) -+ :Item_int_func(a), pxml(p) {} -+ void fix_length_and_dec() { max_length=10; } -+ longlong val_int() -+ { -+ String *res= args[0]->val_nodeset(&tmp_value); -+ return res->length() / sizeof(MY_XPATH_FLT); -+ } -+}; -+ -+ -+class Item_func_xpath_sum :public Item_real_func -+{ -+ String *pxml; -+ String tmp_value; -+public: -+ Item_func_xpath_sum(Item *a, String *p) -+ :Item_real_func(a), pxml(p) {} -+ -+ double val_real() -+ { -+ double sum= 0; -+ String *res= args[0]->val_nodeset(&tmp_value); -+ MY_XPATH_FLT *fltbeg= (MY_XPATH_FLT*) res->ptr(); -+ MY_XPATH_FLT *fltend= (MY_XPATH_FLT*) (res->ptr() + res->length()); -+ uint numnodes= pxml->length() / sizeof(MY_XML_NODE); -+ MY_XML_NODE *nodebeg= (MY_XML_NODE*) pxml->ptr(); -+ -+ for (MY_XPATH_FLT *flt= fltbeg; flt < fltend; flt++) -+ { -+ MY_XML_NODE *self= &nodebeg[flt->num]; -+ for (uint j= flt->num + 1; j < numnodes; j++) -+ { -+ MY_XML_NODE *node= &nodebeg[j]; -+ if (node->level <= self->level) -+ break; -+ if ((node->parent == flt->num) && -+ (node->type == MY_XML_NODE_TEXT)) -+ { -+ char *end; -+ int err; -+ double add= my_strntod(collation.collation, (char*) node->beg, -+ node->end - node->beg, &end, &err); -+ if (!err) -+ sum+= add; -+ } -+ } -+ } -+ return sum; -+ } -+}; -+ -+ -+class Item_nodeset_to_const_comparator :public Item_bool_func -+{ -+ String *pxml; -+ String tmp_nodeset; -+public: -+ Item_nodeset_to_const_comparator(Item *nodeset, Item *cmpfunc, String *p) -+ :Item_bool_func(nodeset,cmpfunc), pxml(p) {} -+ enum Type type() const { return XPATH_NODESET_CMP; }; -+ bool is_bool_func() { return 1; } -+ -+ longlong val_int() -+ { -+ Item_func *comp= (Item_func*)args[1]; -+ Item_string *fake= (Item_string*)(comp->arguments()[1]); -+ String *res= args[0]->val_nodeset(&tmp_nodeset); -+ MY_XPATH_FLT *fltbeg= (MY_XPATH_FLT*) res->ptr(); -+ MY_XPATH_FLT *fltend= (MY_XPATH_FLT*) (res->ptr() + res->length()); -+ MY_XML_NODE *nodebeg= (MY_XML_NODE*) pxml->ptr(); -+ uint numnodes= pxml->length() / sizeof(MY_XML_NODE); -+ -+ for (MY_XPATH_FLT *flt= fltbeg; flt < fltend; flt++) -+ { -+ MY_XML_NODE *self= &nodebeg[flt->num]; -+ for (uint j= flt->num + 1; j < numnodes; j++) -+ { -+ MY_XML_NODE *node= &nodebeg[j]; -+ if (node->level <= self->level) -+ break; -+ if ((node->parent == flt->num) && -+ (node->type == MY_XML_NODE_TEXT)) -+ { -+ fake->str_value.set(node->beg, node->end - node->beg, -+ collation.collation); -+ if (args[1]->val_int()) -+ return 1; -+ } -+ } -+ } -+ return 0; -+ } -+}; -+ -+ -+String *Item_nodeset_func_rootelement::val_nodeset(String *nodeset) -+{ -+ nodeset->length(0); -+ ((XPathFilter*)nodeset)->append_element(0, 0); -+ return nodeset; -+} -+ -+ -+String * Item_nodeset_func_union::val_nodeset(String *nodeset) -+{ -+ uint numnodes= pxml->length() / sizeof(MY_XML_NODE); -+ String set0, *s0= args[0]->val_nodeset(&set0); -+ String set1, *s1= args[1]->val_nodeset(&set1); -+ String both_str; -+ both_str.alloc(numnodes); -+ char *both= (char*) both_str.ptr(); -+ bzero((void*)both, numnodes); -+ uint pos= 0; -+ MY_XPATH_FLT *flt; -+ -+ fltbeg= (MY_XPATH_FLT*) s0->ptr(); -+ fltend= (MY_XPATH_FLT*) (s0->ptr() + s0->length()); -+ for (flt= fltbeg; flt < fltend; flt++) -+ both[flt->num]= 1; -+ -+ fltbeg= (MY_XPATH_FLT*) s1->ptr(); -+ fltend= (MY_XPATH_FLT*) (s1->ptr() + s1->length()); -+ for (flt= fltbeg; flt < fltend; flt++) -+ both[flt->num]= 1; -+ -+ nodeset->length(0); -+ for (uint i= 0, pos= 0; i < numnodes; i++) -+ { -+ if (both[i]) -+ ((XPathFilter*)nodeset)->append_element(i, pos++); -+ } -+ return nodeset; -+} -+ -+ -+String *Item_nodeset_func_childbyname::val_nodeset(String *nodeset) -+{ -+ prepare(nodeset); -+ for (MY_XPATH_FLT *flt= fltbeg; flt < fltend; flt++) -+ { -+ MY_XML_NODE *self= &nodebeg[flt->num]; -+ for (uint pos= 0, j= flt->num + 1 ; j < numnodes; j++) -+ { -+ MY_XML_NODE *node= &nodebeg[j]; -+ if (node->level <= self->level) -+ break; -+ if ((node->parent == flt->num) && -+ (node->type == MY_XML_NODE_TAG) && -+ validname(node)) -+ ((XPathFilter*)nodeset)->append_element(j, pos++); -+ } -+ } -+ return nodeset; -+} -+ -+ -+String *Item_nodeset_func_descendantbyname::val_nodeset(String *nodeset) -+{ -+ prepare(nodeset); -+ for (MY_XPATH_FLT *flt= fltbeg; flt < fltend; flt++) -+ { -+ uint pos= 0; -+ MY_XML_NODE *self= &nodebeg[flt->num]; -+ if (need_self && validname(self)) -+ ((XPathFilter*)nodeset)->append_element(flt->num,pos++); -+ for (uint j= flt->num + 1 ; j < numnodes ; j++) -+ { -+ MY_XML_NODE *node= &nodebeg[j]; -+ if (node->level <= self->level) -+ break; -+ if ((node->type == MY_XML_NODE_TAG) && validname(node)) -+ ((XPathFilter*)nodeset)->append_element(j,pos++); -+ } -+ } -+ return nodeset; -+} -+ -+ -+String *Item_nodeset_func_ancestorbyname::val_nodeset(String *nodeset) -+{ -+ char *active; -+ String active_str; -+ prepare(nodeset); -+ active_str.alloc(numnodes); -+ active= (char*) active_str.ptr(); -+ bzero((void*)active, numnodes); -+ uint pos= 0; -+ -+ for (MY_XPATH_FLT *flt= fltbeg; flt < fltend; flt++) -+ { -+ /* -+ Go to the root and add all nodes on the way. -+ Don't add the root if context is the root itelf -+ */ -+ MY_XML_NODE *self= &nodebeg[flt->num]; -+ if (need_self && validname(self)) -+ { -+ active[flt->num]= 1; -+ pos++; -+ } -+ -+ for (uint j= self->parent; nodebeg[j].parent != j; j= nodebeg[j].parent) -+ { -+ if (flt->num && validname(&nodebeg[j])) -+ { -+ active[j]= 1; -+ pos++; -+ } -+ } -+ } -+ -+ for (uint j= 0; j < numnodes ; j++) -+ { -+ if (active[j]) -+ ((XPathFilter*)nodeset)->append_element(j, --pos); -+ } -+ return nodeset; -+} -+ -+ -+String *Item_nodeset_func_parentbyname::val_nodeset(String *nodeset) -+{ -+ char *active; -+ String active_str; -+ prepare(nodeset); -+ active_str.alloc(numnodes); -+ active= (char*) active_str.ptr(); -+ bzero((void*)active, numnodes); -+ for (MY_XPATH_FLT *flt= fltbeg; flt < fltend; flt++) -+ { -+ uint j= nodebeg[flt->num].parent; -+ if (flt->num && validname(&nodebeg[j])) -+ active[j]= 1; -+ } -+ for (uint j= 0, pos= 0; j < numnodes ; j++) -+ { -+ if (active[j]) -+ ((XPathFilter*)nodeset)->append_element(j, pos++); -+ } -+ return nodeset; -+} -+ -+ -+String *Item_nodeset_func_attributebyname::val_nodeset(String *nodeset) -+{ -+ prepare(nodeset); -+ for (MY_XPATH_FLT *flt= fltbeg; flt < fltend; flt++) -+ { -+ MY_XML_NODE *self= &nodebeg[flt->num]; -+ for (uint pos=0, j= flt->num + 1 ; j < numnodes; j++) -+ { -+ MY_XML_NODE *node= &nodebeg[j]; -+ if (node->level <= self->level) -+ break; -+ if ((node->parent == flt->num) && -+ (node->type == MY_XML_NODE_ATTR) && -+ validname(node)) -+ ((XPathFilter*)nodeset)->append_element(j, pos++); -+ } -+ } -+ return nodeset; -+} -+ -+ -+String *Item_nodeset_func_predicate::val_nodeset(String *str) -+{ -+ Item_nodeset_func *nodeset_func= (Item_nodeset_func*) args[0]; -+ Item_func *comp_func= (Item_func*)args[1]; -+ uint pos= 0; -+ prepare(str); -+ for (MY_XPATH_FLT *flt= fltbeg; flt < fltend; flt++) -+ { -+ nodeset_func->context_cache.length(0); -+ ((XPathFilter*)(&nodeset_func->context_cache))->append_element(flt->num, -+ flt->pos); -+ if (comp_func->val_int()) -+ ((XPathFilter*)str)->append_element(flt->num, pos++); -+ } -+ return str; -+}; -+ -+ -+String *Item_nodeset_func_elementbyindex::val_nodeset(String *nodeset) -+{ -+ prepare(nodeset); -+ int index= args[1]->val_int() - 1; -+ if (index >= 0) -+ { -+ MY_XPATH_FLT *flt; -+ uint pos; -+ for (pos= 0, flt= fltbeg; flt < fltend; flt++) -+ { -+ if (flt->pos == (uint) index || args[1]->is_bool_func()) -+ ((XPathFilter*)nodeset)->append_element(flt->num, pos++); -+ } -+ } -+ return nodeset; -+} -+ -+ -+/* -+ If item is a node set, then casts it to boolean, -+ otherwise returns the item itself. -+*/ -+static Item* nodeset2bool(MY_XPATH *xpath, Item *item) -+{ -+ if (item->type() == Item::XPATH_NODESET) -+ return new Item_xpath_cast_bool(item, xpath->pxml); -+ return item; -+} -+ -+ -+/* -+ XPath lexical tokens -+*/ -+#define MY_XPATH_LEX_DIGITS 'd' -+#define MY_XPATH_LEX_IDENT 'i' -+#define MY_XPATH_LEX_STRING 's' -+#define MY_XPATH_LEX_SLASH '/' -+#define MY_XPATH_LEX_LB '[' -+#define MY_XPATH_LEX_RB ']' -+#define MY_XPATH_LEX_LP '(' -+#define MY_XPATH_LEX_RP ')' -+#define MY_XPATH_LEX_EQ '=' -+#define MY_XPATH_LEX_LESS '<' -+#define MY_XPATH_LEX_GREATER '>' -+#define MY_XPATH_LEX_AT '@' -+#define MY_XPATH_LEX_COLON ':' -+#define MY_XPATH_LEX_ASTERISK '*' -+#define MY_XPATH_LEX_DOT '.' -+#define MY_XPATH_LEX_VLINE '|' -+#define MY_XPATH_LEX_MINUS '-' -+#define MY_XPATH_LEX_PLUS '+' -+#define MY_XPATH_LEX_EXCL '!' -+#define MY_XPATH_LEX_COMMA ',' -+#define MY_XPATH_LEX_DOLLAR '$' -+#define MY_XPATH_LEX_ERROR 'A' -+#define MY_XPATH_LEX_EOF 'B' -+#define MY_XPATH_LEX_AND 'C' -+#define MY_XPATH_LEX_OR 'D' -+#define MY_XPATH_LEX_DIV 'E' -+#define MY_XPATH_LEX_MOD 'F' -+#define MY_XPATH_LEX_FUNC 'G' -+#define MY_XPATH_LEX_NODETYPE 'H' -+#define MY_XPATH_LEX_AXIS 'I' -+#define MY_XPATH_LEX_LE 'J' -+#define MY_XPATH_LEX_GE 'K' -+ -+ -+/* -+ XPath axis type -+*/ -+#define MY_XPATH_AXIS_ANCESTOR 0 -+#define MY_XPATH_AXIS_ANCESTOR_OR_SELF 1 -+#define MY_XPATH_AXIS_ATTRIBUTE 2 -+#define MY_XPATH_AXIS_CHILD 3 -+#define MY_XPATH_AXIS_DESCENDANT 4 -+#define MY_XPATH_AXIS_DESCENDANT_OR_SELF 5 -+#define MY_XPATH_AXIS_FOLLOWING 6 -+#define MY_XPATH_AXIS_FOLLOWING_SIBLING 7 -+#define MY_XPATH_AXIS_NAMESPACE 8 -+#define MY_XPATH_AXIS_PARENT 9 -+#define MY_XPATH_AXIS_PRECEDING 10 -+#define MY_XPATH_AXIS_PRECEDING_SIBLING 11 -+#define MY_XPATH_AXIS_SELF 12 -+ -+ -+/* -+ Create scalar comparator -+ -+ SYNOPSYS -+ Create a comparator function for scalar arguments, -+ for the given arguments and operation. -+ -+ RETURN -+ The newly created item. -+*/ -+static Item *eq_func(int oper, Item *a, Item *b) -+{ -+ switch (oper) -+ { -+ case '=': return new Item_func_eq(a, b); -+ case '!': return new Item_func_ne(a, b); -+ case MY_XPATH_LEX_GE: return new Item_func_ge(a, b); -+ case MY_XPATH_LEX_LE: return new Item_func_le(a, b); -+ case MY_XPATH_LEX_GREATER: return new Item_func_gt(a, b); -+ case MY_XPATH_LEX_LESS: return new Item_func_lt(a, b); -+ } -+ return 0; -+} -+ -+ -+/* -+ Create scalar comparator -+ -+ SYNOPSYS -+ Create a comparator function for scalar arguments, -+ for the given arguments and reverse operation, e.g. -+ -+ A >= B is converted into A < B -+ -+ RETURN -+ The newly created item. -+*/ -+static Item *eq_func_reverse(int oper, Item *a, Item *b) -+{ -+ switch (oper) -+ { -+ case '=': return new Item_func_eq(a, b); -+ case '!': return new Item_func_ne(a, b); -+ case MY_XPATH_LEX_GE: return new Item_func_lt(a, b); -+ case MY_XPATH_LEX_LE: return new Item_func_gt(a, b); -+ case MY_XPATH_LEX_GREATER: return new Item_func_le(a, b); -+ case MY_XPATH_LEX_LESS: return new Item_func_ge(a, b); -+ } -+ return 0; -+} -+ -+ -+/* -+ Create a comparator -+ -+ SYNOPSYS -+ Create a comparator for scalar or non-scalar arguments, -+ for the given arguments and operation. -+ -+ RETURN -+ The newly created item. -+*/ -+static Item *create_comparator(MY_XPATH *xpath, int oper, Item *a, Item *b) -+{ -+ if (a->type() != Item::XPATH_NODESET && -+ b->type() != Item::XPATH_NODESET) -+ { -+ return eq_func(oper, a, b); // two scalar arguments -+ } -+ else if (a->type() == Item::XPATH_NODESET && -+ b->type() == Item::XPATH_NODESET) -+ { -+ return 0; // TODO: Comparison of two nodesets -+ } -+ else -+ { -+ /* -+ Compare a node set to a scalar value. -+ We just create a fake Item_string() argument, -+ which will be filled to the partular value -+ in a loop through all of the nodes in the node set. -+ */ -+ -+ Item *fake= new Item_string("", 0, xpath->cs); -+ Item_nodeset_func *nodeset; -+ Item *scalar, *comp; -+ if (a->type() == Item::XPATH_NODESET) -+ { -+ nodeset= (Item_nodeset_func*) a; -+ scalar= b; -+ comp= eq_func(oper, scalar, fake); -+ } -+ else -+ { -+ nodeset= (Item_nodeset_func*) b; -+ scalar= a; -+ comp= eq_func_reverse(oper, scalar, fake); -+ } -+ return new Item_nodeset_to_const_comparator(nodeset, comp, xpath->pxml); -+ } -+} -+ -+ -+/* -+ Create a step -+ -+ SYNOPSYS -+ Create a step function for the given argument and axis. -+ -+ RETURN -+ The newly created item. -+*/ -+static Item* nametestfunc(MY_XPATH *xpath, -+ int type, Item *arg, const char *beg, uint len) -+{ -+ DBUG_ASSERT(arg != 0); -+ DBUG_ASSERT(arg->type() == Item::XPATH_NODESET); -+ DBUG_ASSERT(beg != 0); -+ DBUG_ASSERT(len > 0); -+ -+ Item *res; -+ switch (type) -+ { -+ case MY_XPATH_AXIS_ANCESTOR: -+ res= new Item_nodeset_func_ancestorbyname(arg, beg, len, xpath->pxml, 0); -+ break; -+ case MY_XPATH_AXIS_ANCESTOR_OR_SELF: -+ res= new Item_nodeset_func_ancestorbyname(arg, beg, len, xpath->pxml, 1); -+ break; -+ case MY_XPATH_AXIS_PARENT: -+ res= new Item_nodeset_func_parentbyname(arg, beg, len, xpath->pxml); -+ break; -+ case MY_XPATH_AXIS_DESCENDANT: -+ res= new Item_nodeset_func_descendantbyname(arg, beg, len, xpath->pxml, 0); -+ break; -+ case MY_XPATH_AXIS_DESCENDANT_OR_SELF: -+ res= new Item_nodeset_func_descendantbyname(arg, beg, len, xpath->pxml, 1); -+ break; -+ case MY_XPATH_AXIS_ATTRIBUTE: -+ res= new Item_nodeset_func_attributebyname(arg, beg, len, xpath->pxml); -+ break; -+ default: -+ res= new Item_nodeset_func_childbyname(arg, beg, len, xpath->pxml); -+ } -+ return res; -+} -+ -+ -+/* -+ Tokens consisting of one character, for faster lexical analizer. -+*/ -+static char simpletok[128]= -+{ -+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -+/* -+ ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? -+ @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ -+ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ € -+*/ -+ 0,1,0,0,1,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0, -+ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0, -+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0 -+}; -+ -+ -+/* -+ XPath keywords -+*/ -+struct my_xpath_keyword_names_st -+{ -+ int tok; -+ const char *name; -+ size_t length; -+ int extra; -+}; -+ -+ -+static struct my_xpath_keyword_names_st my_keyword_names[] = -+{ -+ {MY_XPATH_LEX_AND , "and" , 3, 0 }, -+ {MY_XPATH_LEX_OR , "or" , 2, 0 }, -+ {MY_XPATH_LEX_DIV , "div" , 3, 0 }, -+ {MY_XPATH_LEX_MOD , "mod" , 3, 0 }, -+ -+ {MY_XPATH_LEX_NODETYPE, "comment" , 7, 0 }, -+ {MY_XPATH_LEX_NODETYPE, "text" , 4, 0 }, -+ {MY_XPATH_LEX_NODETYPE, "processing-instruction" , 22,0 }, -+ {MY_XPATH_LEX_NODETYPE, "node" , 4, 0 }, -+ -+ {MY_XPATH_LEX_AXIS,"ancestor" , 8,MY_XPATH_AXIS_ANCESTOR }, -+ {MY_XPATH_LEX_AXIS,"ancestor-or-self" ,16,MY_XPATH_AXIS_ANCESTOR_OR_SELF }, -+ {MY_XPATH_LEX_AXIS,"attribute" , 9,MY_XPATH_AXIS_ATTRIBUTE }, -+ {MY_XPATH_LEX_AXIS,"child" , 5,MY_XPATH_AXIS_CHILD }, -+ {MY_XPATH_LEX_AXIS,"descendant" ,10,MY_XPATH_AXIS_DESCENDANT }, -+ {MY_XPATH_LEX_AXIS,"descendant-or-self",18,MY_XPATH_AXIS_DESCENDANT_OR_SELF}, -+ {MY_XPATH_LEX_AXIS,"following" , 9,MY_XPATH_AXIS_FOLLOWING }, -+ {MY_XPATH_LEX_AXIS,"following-sibling" ,17,MY_XPATH_AXIS_FOLLOWING_SIBLING }, -+ {MY_XPATH_LEX_AXIS,"namespace" , 9,MY_XPATH_AXIS_NAMESPACE }, -+ {MY_XPATH_LEX_AXIS,"parent" , 6,MY_XPATH_AXIS_PARENT }, -+ {MY_XPATH_LEX_AXIS,"preceding" , 9,MY_XPATH_AXIS_PRECEDING }, -+ {MY_XPATH_LEX_AXIS,"preceding-sibling" ,17,MY_XPATH_AXIS_PRECEDING_SIBLING }, -+ {MY_XPATH_LEX_AXIS,"self" , 4,MY_XPATH_AXIS_SELF }, -+ -+ {0,NULL,0,0} -+}; -+ -+ -+/* -+ Lookup a keyword -+ -+ SYNOPSYS -+ Check that the last scanned identifier is a keyword. -+ -+ RETURN -+ - Token type, on lookup success. -+ - MY_XPATH_LEX_IDENT, on lookup failure. -+*/ -+static int my_xpath_keyword(MY_XPATH *x, const char *beg, const char *end) -+{ -+ struct my_xpath_keyword_names_st *k; -+ size_t length= end-beg; -+ for (k= my_keyword_names; k->name; k++) -+ { -+ if (length == k->length && !strncasecmp(beg, k->name, length)) -+ { -+ x->extra= k->extra; -+ return k->tok; -+ } -+ } -+ return MY_XPATH_LEX_IDENT; -+} -+ -+ -+/* -+ Functions to create an item, a-la those in item_create.cc -+*/ -+ -+static Item *create_func_true(MY_XPATH *xpath, Item **args, uint nargs) -+{ -+ return new Item_bool(1); -+} -+ -+ -+static Item *create_func_false(MY_XPATH *xpath, Item **args, uint nargs) -+{ -+ return new Item_bool(0); -+} -+ -+ -+static Item *create_func_not(MY_XPATH *xpath, Item **args, uint nargs) -+{ -+ return new Item_func_not(nodeset2bool(xpath, args[0])); -+} -+ -+ -+static Item *create_func_ceiling(MY_XPATH *xpath, Item **args, uint nargs) -+{ -+ return new Item_func_ceiling(args[0]); -+} -+ -+ -+static Item *create_func_floor(MY_XPATH *xpath, Item **args, uint nargs) -+{ -+ return new Item_func_floor(args[0]); -+} -+ -+ -+static Item *create_func_bool(MY_XPATH *xpath, Item **args, uint nargs) -+{ -+ return new Item_xpath_cast_bool(args[0], xpath->pxml); -+} -+ -+ -+static Item *create_func_number(MY_XPATH *xpath, Item **args, uint nargs) -+{ -+ return new Item_xpath_cast_number(args[0]); -+} -+ -+ -+static Item *create_func_round(MY_XPATH *xpath, Item **args, uint nargs) -+{ -+ return new Item_func_round(args[0], new Item_int((char*)"0",0,1),0); -+} -+ -+ -+static Item *create_func_last(MY_XPATH *xpath, Item **args, uint nargs) -+{ -+ return new Item_func_xpath_count(xpath->context, xpath->pxml); -+} -+ -+ -+static Item *create_func_position(MY_XPATH *xpath, Item **args, uint nargs) -+{ -+ return new Item_func_xpath_position(xpath->context, xpath->pxml); -+} -+ -+ -+static Item *create_func_contains(MY_XPATH *xpath, Item **args, uint nargs) -+{ -+ return new Item_xpath_cast_bool(new Item_func_locate(args[0], args[1]), -+ xpath->pxml); -+} -+ -+ -+static Item *create_func_concat(MY_XPATH *xpath, Item **args, uint nargs) -+{ -+ return new Item_func_concat(args[0], args[1]); -+} -+ -+ -+static Item *create_func_substr(MY_XPATH *xpath, Item **args, uint nargs) -+{ -+ if (nargs == 2) -+ return new Item_func_substr(args[0], args[1]); -+ else -+ return new Item_func_substr(args[0], args[1], args[2]); -+} -+ -+ -+static Item *create_func_count(MY_XPATH *xpath, Item **args, uint nargs) -+{ -+ if (args[0]->type() != Item::XPATH_NODESET) -+ return 0; -+ return new Item_func_xpath_count(args[0], xpath->pxml); -+} -+ -+ -+static Item *create_func_sum(MY_XPATH *xpath, Item **args, uint nargs) -+{ -+ if (args[0]->type() != Item::XPATH_NODESET) -+ return 0; -+ return new Item_func_xpath_sum(args[0], xpath->pxml); -+} -+ -+ -+/* -+ Functions names. Separate lists for names with -+ lengths 3,4,5 and 6 for faster lookups. -+*/ -+static MY_XPATH_FUNC my_func_names3[]= -+{ -+ {"sum", 3, 1 , 1 , create_func_sum}, -+ {"not", 3, 1 , 1 , create_func_not}, -+ {0 , 0, 0 , 0, 0} -+}; -+ -+ -+static MY_XPATH_FUNC my_func_names4[]= -+{ -+ {"last", 4, 0, 0, create_func_last}, -+ {"true", 4, 0, 0, create_func_true}, -+ {"name", 4, 0, 1, 0}, -+ {"lang", 4, 1, 1, 0}, -+ {0 , 0, 0, 0, 0} -+}; -+ -+ -+static MY_XPATH_FUNC my_func_names5[]= -+{ -+ {"count", 5, 1, 1, create_func_count}, -+ {"false", 5, 0, 0, create_func_false}, -+ {"floor", 5, 1, 1, create_func_floor}, -+ {"round", 5, 1, 1, create_func_round}, -+ {0 , 0, 0, 0, 0} -+}; -+ -+ -+static MY_XPATH_FUNC my_func_names6[]= -+{ -+ {"concat", 6, 2, 255, create_func_concat}, -+ {"number", 6, 0, 1 , create_func_number}, -+ {"string", 6, 0, 1 , 0}, -+ {0 , 0, 0, 0 , 0} -+}; -+ -+ -+/* Other functions, with name longer than 6, all together */ -+static MY_XPATH_FUNC my_func_names[] = -+{ -+ {"id" , 2 , 1 , 1 , 0}, -+ {"boolean" , 7 , 1 , 1 , create_func_bool}, -+ {"ceiling" , 7 , 1 , 1 , create_func_ceiling}, -+ {"position" , 8 , 0 , 0 , create_func_position}, -+ {"contains" , 8 , 2 , 2 , create_func_contains}, -+ {"substring" , 9 , 2 , 3 , create_func_substr}, -+ {"translate" , 9 , 3 , 3 , 0}, -+ -+ {"local-name" , 10 , 0 , 1 , 0}, -+ {"starts-with" , 11 , 2 , 2 , 0}, -+ {"namespace-uri" , 13 , 0 , 1 , 0}, -+ {"substring-after" , 15 , 2 , 2 , 0}, -+ {"normalize-space" , 15 , 0 , 1 , 0}, -+ {"substring-before" , 16 , 2 , 2 , 0}, -+ -+ {NULL,0,0,0,0} -+}; -+ -+ -+/* -+ Lookup a function by name -+ -+ SYNOPSYS -+ Lookup a function by its name. -+ -+ RETURN -+ Pointer to a MY_XPATH_FUNC variable on success. -+ 0 - on failure. -+ -+*/ -+MY_XPATH_FUNC * -+my_xpath_function(const char *beg, const char *end) -+{ -+ MY_XPATH_FUNC *k, *function_names; -+ uint length= end-beg; -+ switch (length) -+ { -+ case 1: return 0; -+ case 3: function_names= my_func_names3; break; -+ case 4: function_names= my_func_names4; break; -+ case 5: function_names= my_func_names5; break; -+ case 6: function_names= my_func_names6; break; -+ default: function_names= my_func_names; -+ } -+ for (k= function_names; k->name; k++) -+ if (k->create && length == k->length && !strncasecmp(beg, k->name, length)) -+ return k; -+ return NULL; -+} -+ -+ -+/* Initialize a lex analizer token */ -+static void -+my_xpath_lex_init(MY_XPATH_LEX *lex, -+ const char *str, const char *strend) -+{ -+ lex->beg= str; -+ lex->end= strend; -+} -+ -+ -+/* Initialize an XPath query parser */ -+static void -+my_xpath_init(MY_XPATH *xpath) -+{ -+ bzero((void*)xpath, sizeof(xpath[0])); -+} -+ -+ -+/* -+ Some ctype-alike helper functions. Note, we cannot -+ reuse cs->ident_map[], because in Xpath, unlike in SQL, -+ dash character is a valid identifier part. -+*/ -+static int -+my_xident_beg(int c) -+{ -+ return (((c) >= 'a' && (c) <= 'z') || -+ ((c) >= 'A' && (c) <= 'Z') || -+ ((c) == '_')); -+} -+ -+ -+static int -+my_xident_body(int c) -+{ -+ return (((c) >= 'a' && (c) <= 'z') || -+ ((c) >= 'A' && (c) <= 'Z') || -+ ((c) >= '0' && (c) <= '9') || -+ ((c)=='-')); -+} -+ -+ -+static int -+my_xdigit(int c) -+{ -+ return ((c) >= '0' && (c) <= '9'); -+} -+ -+ -+/* -+ Scan the next token -+ -+ SYNOPSYS -+ Scan the next token from the input. -+ lex->term is set to the scanned token type. -+ lex->beg and lex->end are set to the beginnig -+ and to the end of the token. -+ RETURN -+ N/A -+*/ -+static void -+my_xpath_lex_scan(MY_XPATH *xpath, -+ MY_XPATH_LEX *lex, const char *beg, const char *end) -+{ -+ int ch; -+ for ( ; beg < end && *beg == ' ' ; beg++); // skip leading spaces -+ lex->beg= beg; -+ -+ if (beg >= end) -+ { -+ lex->end= beg; -+ lex->term= MY_XPATH_LEX_EOF; // end of line reached -+ return; -+ } -+ ch= *beg++; -+ -+ if (ch > 0 && ch < 128 && simpletok[ch]) -+ { -+ // a token consisting of one character found -+ lex->end= beg; -+ lex->term= ch; -+ return; -+ } -+ -+ if (my_xident_beg(ch)) // ident, or a function call, or a keyword -+ { -+ // scan until the end of the identifier -+ for ( ; beg < end && my_xident_body(*beg); beg++); -+ lex->end= beg; -+ -+ // check if a function call -+ if (*beg == '(' && (xpath->func= my_xpath_function(lex->beg, beg))) -+ { -+ lex->term= MY_XPATH_LEX_FUNC; -+ return; -+ } -+ -+ // check if a keyword -+ lex->term= my_xpath_keyword(xpath, lex->beg, beg); -+ return; -+ } -+ -+ if (my_xdigit(ch)) // a sequence of digits -+ { -+ for ( ; beg < end && my_xdigit(*beg) ; beg++); -+ lex->end= beg; -+ lex->term= MY_XPATH_LEX_DIGITS; -+ return; -+ } -+ -+ if (ch == '"' || ch == '\'') // a string: either '...' or "..." -+ { -+ for ( ; beg < end && *beg != ch ; beg++); -+ if (beg < end) -+ { -+ lex->end= beg+1; -+ lex->term= MY_XPATH_LEX_STRING; -+ return; -+ } -+ else -+ { -+ // unexpected end-of-line, without closing quot sign -+ lex->end= end; -+ lex->term= MY_XPATH_LEX_ERROR; -+ return; -+ } -+ } -+ -+ lex->end= beg; -+ lex->term= MY_XPATH_LEX_ERROR; // unknown character -+ return; -+} -+ -+ -+/* -+ Scan the given token -+ -+ SYNOPSYS -+ Scan the given token and rotate lasttok to prevtok on success. -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int -+my_xpath_parse_term(MY_XPATH *xpath, int term) -+{ -+ if (xpath->lasttok.term == term) -+ { -+ xpath->prevtok= xpath->lasttok; -+ my_xpath_lex_scan(xpath, &xpath->lasttok, -+ xpath->lasttok.end, xpath->query.end); -+ return 1; -+ } -+ return 0; -+} -+ -+ -+/* -+ Scan AxisName -+ -+ SYNOPSYS -+ Scan an axis name and store the scanned axis type into xpath->axis. -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_AxisName(MY_XPATH *xpath) -+{ -+ int rc= my_xpath_parse_term(xpath, MY_XPATH_LEX_AXIS); -+ xpath->axis= xpath->extra; -+ return rc; -+} -+ -+ -+/********************************************* -+** Grammar rules, according to http://www.w3.org/TR/xpath -+** Implemented using recursive descendant method. -+** All the following grammar processing functions accept -+** a signle "xpath" argument and return 1 on success and 0 on error. -+** They also modify "xpath" argument by creating new items. -+*/ -+ -+/* [9] PredicateExpr ::= Expr */ -+#define my_xpath_parse_PredicateExpr(x) my_xpath_parse_Expr((x)) -+ -+/* [14] Expr ::= OrExpr */ -+#define my_xpath_parse_Expr(x) my_xpath_parse_OrExpr((x)) -+ -+static int my_xpath_parse_LocationPath(MY_XPATH *xpath); -+static int my_xpath_parse_AbsoluteLocationPath(MY_XPATH *xpath); -+static int my_xpath_parse_RelativeLocationPath(MY_XPATH *xpath); -+static int my_xpath_parse_AbbreviatedAbsoluteLocationPath(MY_XPATH *xpath); -+static int my_xpath_parse_AbbreviatedStep(MY_XPATH *xpath); -+static int my_xpath_parse_Step(MY_XPATH *xpath); -+static int my_xpath_parse_AxisSpecifier(MY_XPATH *xpath); -+static int my_xpath_parse_NodeTest(MY_XPATH *xpath); -+static int my_xpath_parse_AbbreviatedAxisSpecifier(MY_XPATH *xpath); -+static int my_xpath_parse_NameTest(MY_XPATH *xpath); -+static int my_xpath_parse_FunctionCall(MY_XPATH *xpath); -+static int my_xpath_parse_Number(MY_XPATH *xpath); -+static int my_xpath_parse_FilterExpr(MY_XPATH *xpath); -+static int my_xpath_parse_PathExpr(MY_XPATH *xpath); -+static int my_xpath_parse_OrExpr(MY_XPATH *xpath); -+static int my_xpath_parse_UnaryExpr(MY_XPATH *xpath); -+static int my_xpath_parse_MultiplicativeExpr(MY_XPATH *xpath); -+static int my_xpath_parse_AdditiveExpr(MY_XPATH *xpath); -+static int my_xpath_parse_RelationalExpr(MY_XPATH *xpath); -+static int my_xpath_parse_AndExpr(MY_XPATH *xpath); -+static int my_xpath_parse_EqualityExpr(MY_XPATH *xpath); -+static int my_xpath_parse_VariableReference(MY_XPATH *xpath); -+static int my_xpath_parse_slash_opt_slash(MY_XPATH *xpath); -+ -+ -+/* -+ Scan LocationPath -+ -+ SYNOPSYS -+ -+ [1] LocationPath ::= RelativeLocationPath -+ | AbsoluteLocationPath -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_LocationPath(MY_XPATH *xpath) -+{ -+ Item *context= xpath->context; -+ -+ int rc= my_xpath_parse_RelativeLocationPath(xpath) || -+ my_xpath_parse_AbsoluteLocationPath(xpath); -+ -+ xpath->item= xpath->context; -+ xpath->context= context; -+ return rc; -+} -+ -+ -+/* -+ Scan Absolute Location Path -+ -+ SYNOPSYS -+ -+ [2] AbsoluteLocationPath ::= '/' RelativeLocationPath? -+ | AbbreviatedAbsoluteLocationPath -+ [10] AbbreviatedAbsoluteLocationPath ::= '//' RelativeLocationPath -+ -+ We combine these two rules into one rule for better performance: -+ -+ [2,10] AbsoluteLocationPath ::= '/' RelativeLocationPath? -+ | '//' RelativeLocationPath -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_AbsoluteLocationPath(MY_XPATH *xpath) -+{ -+ if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH)) -+ return 0; -+ -+ xpath->context= new Item_nodeset_func_rootelement(xpath->pxml); -+ -+ if (my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH)) -+ { -+ xpath->context= new Item_nodeset_func_descendantbyname(xpath->context, -+ "*", 1, -+ xpath->pxml, 1); -+ return my_xpath_parse_RelativeLocationPath(xpath); -+ } -+ -+ if (my_xpath_parse_RelativeLocationPath(xpath)) -+ return 1; -+ -+ return 1; -+} -+ -+ -+/* -+ Scan Relative Location Path -+ -+ SYNOPSYS -+ -+ For better performance we combine these two rules -+ -+ [3] RelativeLocationPath ::= Step -+ | RelativeLocationPath '/' Step -+ | AbbreviatedRelativeLocationPath -+ [11] AbbreviatedRelativeLocationPath ::= RelativeLocationPath '//' Step -+ -+ -+ Into this one: -+ -+ [3-11] RelativeLocationPath ::= Step -+ | RelativeLocationPath '/' Step -+ | RelativeLocationPath '//' Step -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_RelativeLocationPath(MY_XPATH *xpath) -+{ -+ if (!my_xpath_parse_Step(xpath)) -+ return 0; -+ while (my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH)) -+ { -+ if (my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH)) -+ xpath->context= new Item_nodeset_func_descendantbyname(xpath->context, -+ "*", 1, -+ xpath->pxml, 1); -+ if (!my_xpath_parse_Step(xpath)) -+ return 0; -+ } -+ return 1; -+} -+ -+ -+/* -+ Scan non-abbreviated or abbreviated Step -+ -+ SYNOPSYS -+ -+ [4] Step ::= AxisSpecifier NodeTest Predicate* -+ | AbbreviatedStep -+ [8] Predicate ::= '[' PredicateExpr ']' -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int -+my_xpath_parse_AxisSpecifier_NodeTest_opt_Predicate_list(MY_XPATH *xpath) -+{ -+ if (!my_xpath_parse_AxisSpecifier(xpath)) -+ return 0; -+ -+ if (!my_xpath_parse_NodeTest(xpath)) -+ return 0; -+ -+ while (my_xpath_parse_term(xpath, MY_XPATH_LEX_LB)) -+ { -+ Item *prev_context= xpath->context; -+ String *context_cache; -+ context_cache= &((Item_nodeset_func*)xpath->context)->context_cache; -+ xpath->context= new Item_nodeset_context_cache(context_cache, xpath->pxml); -+ xpath->context_cache= context_cache; -+ -+ if(!my_xpath_parse_PredicateExpr(xpath)) -+ return 0; -+ -+ if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_RB)) -+ return 0; -+ -+ xpath->item= nodeset2bool(xpath, xpath->item); -+ -+ if (xpath->item->is_bool_func()) -+ { -+ xpath->context= new Item_nodeset_func_predicate(prev_context, -+ xpath->item, -+ xpath->pxml); -+ } -+ else -+ { -+ xpath->context= new Item_nodeset_func_elementbyindex(prev_context, -+ xpath->item, -+ xpath->pxml); -+ } -+ } -+ return 1; -+} -+ -+ -+static int my_xpath_parse_Step(MY_XPATH *xpath) -+{ -+ return -+ my_xpath_parse_AxisSpecifier_NodeTest_opt_Predicate_list(xpath) || -+ my_xpath_parse_AbbreviatedStep(xpath); -+} -+ -+ -+/* -+ Scan Abbreviated Axis Specifier -+ -+ SYNOPSYS -+ [5] AxisSpecifier ::= AxisName '::' -+ | AbbreviatedAxisSpecifier -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_AbbreviatedAxisSpecifier(MY_XPATH *xpath) -+{ -+ if (my_xpath_parse_term(xpath, MY_XPATH_LEX_AT)) -+ xpath->axis= MY_XPATH_AXIS_ATTRIBUTE; -+ else -+ xpath->axis= MY_XPATH_AXIS_CHILD; -+ return 1; -+} -+ -+ -+/* -+ Scan non-abbreviated axis specifier -+ -+ SYNOPSYS -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_AxisName_colon_colon(MY_XPATH *xpath) -+{ -+ return my_xpath_parse_AxisName(xpath) && -+ my_xpath_parse_term(xpath, MY_XPATH_LEX_COLON) && -+ my_xpath_parse_term(xpath, MY_XPATH_LEX_COLON); -+} -+ -+ -+/* -+ Scan Abbreviated AxisSpecifier -+ -+ SYNOPSYS -+ [13] AbbreviatedAxisSpecifier ::= '@'? -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_AxisSpecifier(MY_XPATH *xpath) -+{ -+ return my_xpath_parse_AxisName_colon_colon(xpath) || -+ my_xpath_parse_AbbreviatedAxisSpecifier(xpath); -+} -+ -+ -+/* -+ Scan NodeType followed by parens -+ -+ SYNOPSYS -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_NodeTest_lp_rp(MY_XPATH *xpath) -+{ -+ return my_xpath_parse_term(xpath, MY_XPATH_LEX_NODETYPE) && -+ my_xpath_parse_term(xpath, MY_XPATH_LEX_LP) && -+ my_xpath_parse_term(xpath, MY_XPATH_LEX_RP); -+} -+ -+ -+/* -+ Scan NodeTest -+ -+ SYNOPSYS -+ -+ [7] NodeTest ::= NameTest -+ | NodeType '(' ')' -+ | 'processing-instruction' '(' Literal ')' -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_NodeTest(MY_XPATH *xpath) -+{ -+ return my_xpath_parse_NameTest(xpath) || -+ my_xpath_parse_NodeTest_lp_rp(xpath); -+} -+ -+ -+/* -+ Scan Abbreviated Step -+ -+ SYNOPSYS -+ -+ [12] AbbreviatedStep ::= '.' | '..' -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_AbbreviatedStep(MY_XPATH *xpath) -+{ -+ if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_DOT)) -+ return 0; -+ if (my_xpath_parse_term(xpath, MY_XPATH_LEX_DOT)) -+ xpath->context= new Item_nodeset_func_parentbyname(xpath->context, "*", 1, -+ xpath->pxml); -+ return 1; -+} -+ -+ -+/* -+ Scan Primary Expression -+ -+ SYNOPSYS -+ -+ [15] PrimaryExpr ::= VariableReference -+ | '(' Expr ')' -+ | Literal -+ | Number -+ | FunctionCall -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_lp_Expr_rp(MY_XPATH *xpath) -+{ -+ return my_xpath_parse_term(xpath, MY_XPATH_LEX_LP) && -+ my_xpath_parse_Expr(xpath) && -+ my_xpath_parse_term(xpath, MY_XPATH_LEX_RP); -+} -+static int my_xpath_parse_PrimaryExpr_literal(MY_XPATH *xpath) -+{ -+ if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_STRING)) -+ return 0; -+ xpath->item= new Item_string(xpath->prevtok.beg + 1, -+ xpath->prevtok.end - xpath->prevtok.beg - 2, -+ xpath->cs); -+ return 1; -+} -+static int my_xpath_parse_PrimaryExpr(MY_XPATH *xpath) -+{ -+ return -+ my_xpath_parse_lp_Expr_rp(xpath) || -+ my_xpath_parse_VariableReference(xpath) || -+ my_xpath_parse_PrimaryExpr_literal(xpath) || -+ my_xpath_parse_Number(xpath) || -+ my_xpath_parse_FunctionCall(xpath); -+} -+ -+ -+/* -+ Scan Function Call -+ -+ SYNOPSYS -+ [16] FunctionCall ::= FunctionName '(' ( Argument ( ',' Argument )* )? ')' -+ [17] Argument ::= Expr -+ -+ RETURN -+ 1 - success -+ 0 - failure -+ -+*/ -+static int my_xpath_parse_FunctionCall(MY_XPATH *xpath) -+{ -+ Item *args[256]; -+ uint nargs; -+ -+ if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_FUNC)) -+ return 0; -+ -+ MY_XPATH_FUNC *func= xpath->func; -+ -+ if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_LP)) -+ return 0; -+ -+ for (nargs= 0 ; nargs < func->maxargs; ) -+ { -+ if (!my_xpath_parse_Expr(xpath)) -+ return 0; -+ args[nargs++]= xpath->item; -+ if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_COMMA)) -+ { -+ if (nargs < func->minargs) -+ return 0; -+ else -+ break; -+ } -+ } -+ if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_RP)) -+ return 0; -+ -+ return ((xpath->item= func->create(xpath, args, nargs))) ? 1 : 0; -+} -+ -+ -+/* -+ Scan Union Expression -+ -+ SYNOPSYS -+ [18] UnionExpr ::= PathExpr -+ | UnionExpr '|' PathExpr -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_UnionExpr(MY_XPATH *xpath) -+{ -+ if (!my_xpath_parse_PathExpr(xpath)) -+ return 0; -+ -+ while (my_xpath_parse_term(xpath, MY_XPATH_LEX_VLINE)) -+ { -+ Item *prev= xpath->item; -+ if (prev->type() != Item::XPATH_NODESET) -+ return 0; -+ -+ if (!my_xpath_parse_PathExpr(xpath) -+ || xpath->item->type() != Item::XPATH_NODESET) -+ return 0; -+ xpath->item= new Item_nodeset_func_union(prev, xpath->item, xpath->pxml); -+ } -+ return 1; -+} -+ -+ -+/* -+ Scan Path Expression -+ -+ SYNOPSYS -+ -+ [19] PathExpr ::= LocationPath -+ | FilterExpr -+ | FilterExpr '/' RelativeLocationPath -+ | FilterExpr '//' RelativeLocationPath -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int -+my_xpath_parse_FilterExpr_opt_slashes_RelativeLocationPath(MY_XPATH *xpath) -+{ -+ if (!my_xpath_parse_FilterExpr(xpath)) -+ return 0; -+ -+ if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH)) -+ return 1; -+ -+ my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH); -+ return my_xpath_parse_RelativeLocationPath(xpath); -+} -+static int my_xpath_parse_PathExpr(MY_XPATH *xpath) -+{ -+ return my_xpath_parse_LocationPath(xpath) || -+ my_xpath_parse_FilterExpr_opt_slashes_RelativeLocationPath(xpath); -+} -+ -+ -+ -+/* -+ Scan Filter Expression -+ -+ SYNOPSYS -+ [20] FilterExpr ::= PrimaryExpr -+ | FilterExpr Predicate -+ -+ or in other words: -+ -+ [20] FilterExpr ::= PrimaryExpr Predicate* -+ -+ RETURN -+ 1 - success -+ 0 - failure -+ -+*/ -+static int my_xpath_parse_FilterExpr(MY_XPATH *xpath) -+{ -+ return my_xpath_parse_PrimaryExpr(xpath); -+} -+ -+ -+/* -+ Scan Or Expression -+ -+ SYNOPSYS -+ [21] OrExpr ::= AndExpr -+ | OrExpr 'or' AndExpr -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_OrExpr(MY_XPATH *xpath) -+{ -+ if (!my_xpath_parse_AndExpr(xpath)) -+ return 0; -+ -+ while (my_xpath_parse_term(xpath, MY_XPATH_LEX_OR)) -+ { -+ Item *prev= xpath->item; -+ if (!my_xpath_parse_AndExpr(xpath)) -+ return 0; -+ xpath->item= new Item_cond_or(nodeset2bool(xpath, prev), -+ nodeset2bool(xpath, xpath->item)); -+ } -+ return 1; -+} -+ -+ -+/* -+ Scan And Expression -+ -+ SYNOPSYS -+ [22] AndExpr ::= EqualityExpr -+ | AndExpr 'and' EqualityExpr -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_AndExpr(MY_XPATH *xpath) -+{ -+ if (!my_xpath_parse_EqualityExpr(xpath)) -+ return 0; -+ -+ while (my_xpath_parse_term(xpath, MY_XPATH_LEX_AND)) -+ { -+ Item *prev= xpath->item; -+ if (!my_xpath_parse_EqualityExpr(xpath)) -+ return 0; -+ -+ xpath->item= new Item_cond_and(nodeset2bool(xpath,prev), -+ nodeset2bool(xpath,xpath->item)); -+ } -+ return 1; -+} -+ -+ -+/* -+ Scan Equality Expression -+ -+ SYNOPSYS -+ [23] EqualityExpr ::= RelationalExpr -+ | EqualityExpr '=' RelationalExpr -+ | EqualityExpr '!=' RelationalExpr -+ or in other words: -+ -+ [23] EqualityExpr ::= RelationalExpr ( EqualityOperator EqualityExpr )* -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_ne(MY_XPATH *xpath) -+{ -+ return my_xpath_parse_term(xpath, MY_XPATH_LEX_EXCL) && -+ my_xpath_parse_term(xpath, MY_XPATH_LEX_EQ); -+} -+static int my_xpath_parse_EqualityOperator(MY_XPATH *xpath) -+{ -+ if (my_xpath_parse_ne(xpath)) -+ { -+ xpath->extra= '!'; -+ return 1; -+ } -+ if (my_xpath_parse_term(xpath, MY_XPATH_LEX_EQ)) -+ { -+ xpath->extra= '='; -+ return 1; -+ } -+ return 0; -+} -+static int my_xpath_parse_EqualityExpr(MY_XPATH *xpath) -+{ -+ if (!my_xpath_parse_RelationalExpr(xpath)) -+ return 0; -+ while (my_xpath_parse_EqualityOperator(xpath)) -+ { -+ Item *prev= xpath->item; -+ int oper= xpath->extra; -+ if (!my_xpath_parse_RelationalExpr(xpath)) -+ return 0; -+ -+ if (!(xpath->item= create_comparator(xpath, oper, prev, xpath->item))) -+ return 0; -+ } -+ return 1; -+} -+ -+ -+/* -+ Scan Relational Expression -+ -+ SYNOPSYS -+ -+ [24] RelationalExpr ::= AdditiveExpr -+ | RelationalExpr '<' AdditiveExpr -+ | RelationalExpr '>' AdditiveExpr -+ | RelationalExpr '<=' AdditiveExpr -+ | RelationalExpr '>=' AdditiveExpr -+ or in other words: -+ -+ [24] RelationalExpr ::= AdditiveExpr (RelationalOperator RelationalExpr)* -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_RelationalOperator(MY_XPATH *xpath) -+{ -+ if (my_xpath_parse_term(xpath, MY_XPATH_LEX_LESS)) -+ { -+ xpath->extra= my_xpath_parse_term(xpath, MY_XPATH_LEX_EQ) ? -+ MY_XPATH_LEX_LE : MY_XPATH_LEX_LESS; -+ return 1; -+ } -+ else if (my_xpath_parse_term(xpath, MY_XPATH_LEX_GREATER)) -+ { -+ xpath->extra= my_xpath_parse_term(xpath, MY_XPATH_LEX_EQ) ? -+ MY_XPATH_LEX_GE : MY_XPATH_LEX_GREATER; -+ return 1; -+ } -+ return 0; -+} -+static int my_xpath_parse_RelationalExpr(MY_XPATH *xpath) -+{ -+ if (!my_xpath_parse_AdditiveExpr(xpath)) -+ return 0; -+ while (my_xpath_parse_RelationalOperator(xpath)) -+ { -+ Item *prev= xpath->item; -+ int oper= xpath->extra; -+ -+ if (!my_xpath_parse_AdditiveExpr(xpath)) -+ return 0; -+ -+ if (!(xpath->item= create_comparator(xpath, oper, prev, xpath->item))) -+ return 0; -+ } -+ return 1; -+} -+ -+ -+/* -+ Scan Additive Expression -+ -+ SYNOPSYS -+ -+ [25] AdditiveExpr ::= MultiplicativeExpr -+ | AdditiveExpr '+' MultiplicativeExpr -+ | AdditiveExpr '-' MultiplicativeExpr -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_AdditiveOperator(MY_XPATH *xpath) -+{ -+ return my_xpath_parse_term(xpath, MY_XPATH_LEX_PLUS) || -+ my_xpath_parse_term(xpath, MY_XPATH_LEX_MINUS); -+} -+static int my_xpath_parse_AdditiveExpr(MY_XPATH *xpath) -+{ -+ if (!my_xpath_parse_MultiplicativeExpr(xpath)) -+ return 0; -+ -+ while (my_xpath_parse_AdditiveOperator(xpath)) -+ { -+ int oper= xpath->prevtok.term; -+ Item *prev= xpath->item; -+ if (!my_xpath_parse_MultiplicativeExpr(xpath)) -+ return 0; -+ -+ if (oper == MY_XPATH_LEX_PLUS) -+ xpath->item= new Item_func_plus(prev, xpath->item); -+ else -+ xpath->item= new Item_func_minus(prev, xpath->item); -+ }; -+ return 1; -+} -+ -+ -+/* -+ Scan Multiplicative Expression -+ -+ SYNOPSYS -+ -+ [26] MultiplicativeExpr ::= UnaryExpr -+ | MultiplicativeExpr MultiplyOperator UnaryExpr -+ | MultiplicativeExpr 'div' UnaryExpr -+ | MultiplicativeExpr 'mod' UnaryExpr -+ or in other words: -+ -+ [26] MultiplicativeExpr ::= UnaryExpr (MulOper MultiplicativeExpr)* -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_MultiplicativeOperator(MY_XPATH *xpath) -+{ -+ return -+ my_xpath_parse_term(xpath, MY_XPATH_LEX_ASTERISK) || -+ my_xpath_parse_term(xpath, MY_XPATH_LEX_DIV) || -+ my_xpath_parse_term(xpath, MY_XPATH_LEX_MOD); -+} -+static int my_xpath_parse_MultiplicativeExpr(MY_XPATH *xpath) -+{ -+ if (!my_xpath_parse_UnaryExpr(xpath)) -+ return 0; -+ -+ while (my_xpath_parse_MultiplicativeOperator(xpath)) -+ { -+ int oper= xpath->prevtok.term; -+ Item *prev= xpath->item; -+ if (!my_xpath_parse_UnaryExpr(xpath)) -+ return 0; -+ switch (oper) -+ { -+ case MY_XPATH_LEX_ASTERISK: -+ xpath->item= new Item_func_mul(prev, xpath->item); -+ break; -+ case MY_XPATH_LEX_DIV: -+ xpath->item= new Item_func_int_div(prev, xpath->item); -+ break; -+ case MY_XPATH_LEX_MOD: -+ xpath->item= new Item_func_mod(prev, xpath->item); -+ break; -+ } -+ } -+ return 1; -+} -+ -+ -+/* -+ Scan Unary Expression -+ -+ SYNOPSYS -+ -+ [27] UnaryExpr ::= UnionExpr -+ | '-' UnaryExpr -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_UnaryExpr(MY_XPATH *xpath) -+{ -+ if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_MINUS)) -+ return my_xpath_parse_UnionExpr(xpath); -+ if (!my_xpath_parse_UnaryExpr(xpath)) -+ return 0; -+ xpath->item= new Item_func_neg(xpath->item); -+ return 1; -+} -+ -+ -+/* -+ Scan Number -+ -+ SYNOPSYS -+ -+ [30] Number ::= Digits ('.' Digits?)? | '.' Digits) -+ -+ or in other words: -+ -+ [30] Number ::= Digits -+ | Digits '.' -+ | Digits '.' Digits -+ | '.' Digits -+ -+ Note: the last rule is not supported yet, -+ as it is in conflict with abbreviated step. -+ 1 + .123 does not work, -+ 1 + 0.123 does. -+ Perhaps it is better to move this code into lex analizer. -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int my_xpath_parse_Number(MY_XPATH *xpath) -+{ -+ const char *beg; -+ if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_DIGITS)) -+ return 0; -+ beg= xpath->prevtok.beg; -+ if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_DOT)) -+ { -+ xpath->item= new Item_int(xpath->prevtok.beg, -+ xpath->prevtok.end - xpath->prevtok.beg); -+ return 1; -+ } -+ my_xpath_parse_term(xpath, MY_XPATH_LEX_DIGITS); -+ -+ xpath->item= new Item_float(beg, xpath->prevtok.end - beg); -+ return 1; -+} -+ -+ -+/* -+ Scan Variable reference -+ -+ SYNOPSYS -+ -+ [36] VariableReference ::= '$' QName -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int -+my_xpath_parse_VariableReference(MY_XPATH *xpath) -+{ -+ return my_xpath_parse_term(xpath, MY_XPATH_LEX_DOLLAR) && -+ my_xpath_parse_term(xpath, MY_XPATH_LEX_IDENT); -+} -+ -+ -+/* -+ Scan Name Test -+ -+ SYNOPSYS -+ -+ [37] NameTest ::= '*' -+ | NCName ':' '*' -+ | QName -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int -+my_xpath_parse_NodeTest_QName(MY_XPATH *xpath) -+{ -+ if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_IDENT)) -+ return 0; -+ DBUG_ASSERT(xpath->context); -+ uint len= xpath->prevtok.end - xpath->prevtok.beg; -+ xpath->context= nametestfunc(xpath, xpath->axis, xpath->context, -+ xpath->prevtok.beg, len); -+ return 1; -+} -+static int -+my_xpath_parse_NodeTest_asterisk(MY_XPATH *xpath) -+{ -+ if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_ASTERISK)) -+ return 0; -+ DBUG_ASSERT(xpath->context); -+ xpath->context= nametestfunc(xpath, xpath->axis, xpath->context, "*", 1); -+ return 1; -+} -+static int -+my_xpath_parse_NameTest(MY_XPATH *xpath) -+{ -+ return my_xpath_parse_NodeTest_asterisk(xpath) || -+ my_xpath_parse_NodeTest_QName(xpath); -+} -+ -+ -+/* -+ Scan an XPath expression -+ -+ SYNOPSYS -+ Scan xpath expression. -+ The expression is returned in xpath->expr. -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static int -+my_xpath_parse(MY_XPATH *xpath, const char *str, const char *strend) -+{ -+ my_xpath_lex_init(&xpath->query, str, strend); -+ my_xpath_lex_init(&xpath->prevtok, str, strend); -+ my_xpath_lex_scan(xpath, &xpath->lasttok, str, strend); -+ -+ return -+ my_xpath_parse_Expr(xpath) && -+ my_xpath_parse_term(xpath, MY_XPATH_LEX_EOF); -+} -+ -+ -+void Item_xml_str_func::fix_length_and_dec() -+{ -+ String *xp, tmp; -+ MY_XPATH xpath; -+ int rc; -+ -+ nodeset_func= 0; -+ -+ if (agg_arg_charsets(collation, args, arg_count, MY_COLL_CMP_CONV)) -+ return; -+ -+ if (collation.collation->mbminlen > 1) -+ { -+ /* UCS2 is not supported */ -+ my_printf_error(ER_UNKNOWN_ERROR, -+ "Character set '%s' is not supported by XPATH", -+ MYF(0), collation.collation->csname); -+ return; -+ } -+ -+ if (!args[1]->const_item()) -+ { -+ my_printf_error(ER_UNKNOWN_ERROR, -+ "Only constant XPATH queries are supported", MYF(0)); -+ return; -+ } -+ -+ xp= args[1]->val_str(&tmp); -+ my_xpath_init(&xpath); -+ xpath.cs= collation.collation; -+ xpath.debug= 0; -+ xpath.pxml= &pxml; -+ -+ rc= my_xpath_parse(&xpath, xp->ptr(), xp->ptr() + xp->length()); -+ -+ if (!rc) -+ { -+ char context[32]; -+ uint clen= xpath.query.end - xpath.lasttok.beg; -+ set_if_bigger(clen, sizeof(context) - 1); -+ memcpy(context, xpath.lasttok.beg, clen); -+ context[clen]= '\0'; -+ my_printf_error(ER_UNKNOWN_ERROR, "XPATH syntax error: '%s'", -+ MYF(0), context); -+ return; -+ } -+ -+ nodeset_func= xpath.item; -+ if (nodeset_func) -+ nodeset_func->fix_fields(current_thd, 0, &nodeset_func); -+ max_length= MAX_BLOB_WIDTH; -+} -+ -+ -+#define MAX_LEVEL 256 -+typedef struct -+{ -+ uint level; -+ String *pxml; // parsed XML -+ uint pos[MAX_LEVEL]; // Tag position stack -+} MY_XML_USER_DATA; -+ -+ -+/* -+ Find the parent node -+ -+ SYNOPSYS -+ Find the parent node, i.e. a tag or attrubute node on the given level. -+ -+ RETURN -+ 1 - success -+ 0 - failure -+*/ -+static uint xml_parent_tag(MY_XML_NODE *items, uint nitems, uint level) -+{ -+ if (!nitems) -+ return 0; -+ -+ MY_XML_NODE *p, *last= &items[nitems-1]; -+ for (p= last; p >= items; p--) -+ { -+ if (p->level == level && -+ (p->type == MY_XML_NODE_TAG || -+ p->type == MY_XML_NODE_ATTR)) -+ { -+ return p - items; -+ } -+ } -+ return 0; -+} -+ -+ -+/* -+ Process tag beginning -+ -+ SYNOPSYS -+ -+ A call-back function executed when XML parser -+ is entering a tag or an attribue. -+ Appends the new node into data->pxml. -+ Increments data->level. -+ -+ RETURN -+ Currently only MY_XML_OK -+*/ -+static int xml_enter(MY_XML_PARSER *st,const char *attr, uint len) -+{ -+ MY_XML_USER_DATA *data= (MY_XML_USER_DATA*)st->user_data; -+ MY_XML_NODE *nodes= (MY_XML_NODE*) data->pxml->ptr(); -+ uint numnodes= data->pxml->length() / sizeof(MY_XML_NODE); -+ uint parent= xml_parent_tag(nodes, numnodes, data->level - 1); -+ MY_XML_NODE node; -+ -+ data->pos[data->level]= numnodes; -+ node.level= data->level++; -+ node.type= st->current_node_type; // TAG or ATTR -+ node.beg= attr; -+ node.end= attr + len; -+ node.parent= parent; -+ data->pxml->append((const char*) &node, sizeof(MY_XML_NODE)); -+ return MY_XML_OK; -+} -+ -+ -+/* -+ Process text node -+ -+ SYNOPSYS -+ -+ A call-back function executed when XML parser -+ is entering into a tag or an attribue textual value. -+ The value is appended into data->pxml. -+ -+ RETURN -+ Currently only MY_XML_OK -+*/ -+static int xml_value(MY_XML_PARSER *st,const char *attr, uint len) -+{ -+ MY_XML_USER_DATA *data= (MY_XML_USER_DATA*)st->user_data; -+ MY_XML_NODE *nodes= (MY_XML_NODE*) data->pxml->ptr(); -+ uint numnodes= data->pxml->length() / sizeof(MY_XML_NODE); -+ uint parent= xml_parent_tag(nodes, numnodes, data->level - 1); -+ MY_XML_NODE node; -+ -+ node.level= data->level; -+ node.type= MY_XML_NODE_TEXT; -+ node.beg= attr; -+ node.end= attr + len; -+ node.parent= parent; -+ data->pxml->append((const char*) &node, sizeof(MY_XML_NODE)); -+ return MY_XML_OK; -+} -+ -+ -+/* -+ Leave a tag or an attribute -+ -+ SYNOPSYS -+ -+ A call-back function executed when XML parser -+ is leaving a tag or an attribue. -+ Decrements data->level. -+ -+ RETURN -+ Currently only MY_XML_OK -+*/ -+static int xml_leave(MY_XML_PARSER *st,const char *attr, uint len) -+{ -+ MY_XML_USER_DATA *data= (MY_XML_USER_DATA*)st->user_data; -+ DBUG_ASSERT(data->level > 0); -+ data->level--; -+ -+ MY_XML_NODE *nodes= (MY_XML_NODE*) data->pxml->ptr(); -+ nodes+= data->pos[data->level]; -+ nodes->tagend= st->cur; -+ -+ return MY_XML_OK; -+} -+ -+ -+/* -+ Parse raw XML -+ -+ SYNOPSYS -+ -+ -+ RETURN -+ Currently pointer to parsed XML on success -+ 0 on parse error -+*/ -+String *Item_xml_str_func::parse_xml(String *raw_xml, String *parsed_xml_buf) -+{ -+ MY_XML_PARSER p; -+ MY_XML_USER_DATA user_data; -+ int rc; -+ -+ parsed_xml_buf->length(0); -+ -+ /* Prepare XML parser */ -+ my_xml_parser_create(&p); -+ p.flags= MY_XML_FLAG_RELATIVE_NAMES | MY_XML_FLAG_SKIP_TEXT_NORMALIZATION; -+ user_data.level= 0; -+ user_data.pxml= parsed_xml_buf; -+ my_xml_set_enter_handler(&p, xml_enter); -+ my_xml_set_value_handler(&p, xml_value); -+ my_xml_set_leave_handler(&p, xml_leave); -+ my_xml_set_user_data(&p, (void*) &user_data); -+ -+ /* Add root node */ -+ p.current_node_type= MY_XML_NODE_TAG; -+ xml_enter(&p, raw_xml->ptr(), 0); -+ -+ /* Execute XML parser */ -+ rc= my_xml_parse(&p, raw_xml->ptr(), raw_xml->length()); -+ my_xml_parser_free(&p); -+ -+ return rc == MY_XML_OK ? parsed_xml_buf : 0; -+} -+ -+ -+String *Item_func_xml_extractvalue::val_str(String *str) -+{ -+ String *res; -+ if (!nodeset_func || -+ !(res= args[0]->val_str(str)) || -+ !parse_xml(res, &pxml)) -+ { -+ null_value= 1; -+ return 0; -+ } -+ res= nodeset_func->val_str(&tmp_value); -+ return res; -+} -+ -+ -+String *Item_func_xml_update::val_str(String *str) -+{ -+ String *res, *nodeset, *rep; -+ -+ if (!nodeset_func || -+ !(res= args[0]->val_str(str)) || -+ !(rep= args[2]->val_str(&tmp_value3)) || -+ !parse_xml(res, &pxml) || -+ !(nodeset= nodeset_func->val_nodeset(&tmp_value2))) -+ { -+ null_value= 1; -+ return 0; -+ } -+ -+ MY_XML_NODE *nodebeg= (MY_XML_NODE*) pxml.ptr(); -+ MY_XML_NODE *nodeend= (MY_XML_NODE*) pxml.ptr() + pxml.length(); -+ MY_XPATH_FLT *fltbeg= (MY_XPATH_FLT*) nodeset->ptr(); -+ MY_XPATH_FLT *fltend= (MY_XPATH_FLT*) (nodeset->ptr() + nodeset->length()); -+ -+ /* Allow replacing of one tag only */ -+ if (fltend - fltbeg != 1) -+ { -+ /* TODO: perhaps add a warning that more than one tag selected */ -+ return res; -+ } -+ -+ nodebeg+= fltbeg->num; -+ -+ tmp_value.length(0); -+ tmp_value.set_charset(collation.collation); -+ uint offs= nodebeg->type == MY_XML_NODE_TAG ? 1 : 0; -+ tmp_value.append(res->ptr(), nodebeg->beg - res->ptr() - offs); -+ tmp_value.append(rep->ptr(), rep->length()); -+ const char *end= nodebeg->tagend + offs; -+ tmp_value.append(end, res->ptr() + res->length() - end); -+ return &tmp_value; -+} -diff -Naur mysql.orig/sql/item_xmlfunc.h mysql.xml/sql/item_xmlfunc.h ---- mysql.orig/sql/item_xmlfunc.h 1970-01-01 01:00:00.000000000 +0100 -+++ mysql.xml/sql/item_xmlfunc.h 2005-04-13 07:03:10.000000000 +0200 -@@ -0,0 +1,54 @@ -+/* Copyright (C) 2000-2005 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 */ -+ -+ -+/* This file defines all XML functions */ -+ -+ -+#ifdef __GNUC__ -+#pragma interface /* gcc class implementation */ -+#endif -+ -+ -+class Item_xml_str_func: public Item_str_func -+{ -+protected: -+ String tmp_value, pxml; -+ Item *nodeset_func; -+public: -+ Item_xml_str_func(Item *a, Item *b): Item_str_func(a,b) {} -+ Item_xml_str_func(Item *a, Item *b, Item *c): Item_str_func(a,b,c) {} -+ void fix_length_and_dec(); -+ String *parse_xml(String *raw_xml, String *parsed_xml_buf); -+}; -+ -+ -+class Item_func_xml_extractvalue: public Item_xml_str_func -+{ -+public: -+ Item_func_xml_extractvalue(Item *a,Item *b) :Item_xml_str_func(a,b) {} -+ String *val_str(String *); -+}; -+ -+ -+class Item_func_xml_update: public Item_xml_str_func -+{ -+ String tmp_value2, tmp_value3; -+public: -+ Item_func_xml_update(Item *a,Item *b,Item *c) :Item_xml_str_func(a,b,c) {} -+ String *val_str(String *); -+}; -+ -diff -Naur mysql.orig/sql/lex.h mysql.xml/sql/lex.h ---- mysql.orig/sql/lex.h 2005-05-15 06:16:51.000000000 +0200 -+++ mysql.xml/sql/lex.h 2005-05-20 15:19:29.000000000 +0200 -@@ -607,6 +607,7 @@ - { "EQUALS", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_equals)}, - { "EXTERIORRING", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_exteriorring)}, - { "EXTRACT", SYM(EXTRACT_SYM)}, -+ { "EXTRACTVALUE", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_xml_extractvalue)}, - { "EXP", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_exp)}, - { "EXPORT_SET", SYM(EXPORT_SET)}, - { "FIELD", SYM(FIELD_FUNC)}, /* For compability */ -@@ -759,6 +760,7 @@ - { "UNHEX", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_unhex)}, - { "UNIQUE_USERS", SYM(UNIQUE_USERS)}, - { "UNIX_TIMESTAMP", SYM(UNIX_TIMESTAMP)}, -+ { "UPDATEXML", F_SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_xml_update)}, - { "UPPER", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)}, - { "UUID", F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_uuid)}, - { "VARIANCE", SYM(VARIANCE_SYM)}, -diff -Naur mysql.orig/strings/xml.c mysql.xml/strings/xml.c ---- mysql.orig/strings/xml.c 2005-05-15 06:16:51.000000000 +0200 -+++ mysql.xml/strings/xml.c 2005-05-20 15:19:29.000000000 +0200 -@@ -104,7 +104,8 @@ - a->end=p->cur; - if (a->beg[0]==p->cur[0])p->cur++; - a->beg++; -- my_xml_norm_text(a); -+ if (!(p->flags & MY_XML_FLAG_SKIP_TEXT_NORMALIZATION)) -+ my_xml_norm_text(a); - lex=MY_XML_STRING; - } - else -@@ -148,7 +149,11 @@ - memcpy(st->attrend,str,len); - st->attrend+=len; - st->attrend[0]='\0'; -- return st->enter ? st->enter(st,st->attr,st->attrend-st->attr) : MY_XML_OK; -+ -+ if (st->flags & MY_XML_FLAG_RELATIVE_NAMES) -+ return st->enter ? st->enter(st, str, len) : MY_XML_OK; -+ else -+ return st->enter ? st->enter(st,st->attr,st->attrend-st->attr) : MY_XML_OK; - } - - -@@ -167,7 +172,7 @@ - char s[32]; - char g[32]; - int rc; -- -+ - /* Find previous '.' or beginning */ - for( e=p->attrend; (e>p->attr) && (e[0]!='.') ; e--); - glen = (e[0]=='.') ? (p->attrend-e-1) : p->attrend-e; -@@ -179,9 +184,12 @@ - sprintf(p->errstr,"'</%s>' unexpected ('</%s>' wanted)",s,g); - return MY_XML_ERROR; - } -- -- rc = p->leave_xml ? p->leave_xml(p,p->attr,p->attrend-p->attr) : MY_XML_OK; -- -+ -+ if (p->flags & MY_XML_FLAG_RELATIVE_NAMES) -+ rc= p->leave_xml ? p->leave_xml(p, str, slen) : MY_XML_OK; -+ else -+ rc= p->leave_xml ? p->leave_xml(p,p->attr,p->attrend-p->attr) : MY_XML_OK; -+ - *e='\0'; - p->attrend=e; - -@@ -240,6 +248,7 @@ - - if (MY_XML_IDENT==lex) - { -+ p->current_node_type= MY_XML_NODE_TAG; - if(MY_XML_OK!=my_xml_enter(p,a.beg,a.end-a.beg)) - return MY_XML_ERROR; - } -@@ -258,6 +267,7 @@ - lex=my_xml_scan(p,&b); - if ( (lex==MY_XML_IDENT) || (lex==MY_XML_STRING) ) - { -+ p->current_node_type= MY_XML_NODE_ATTR; - if((MY_XML_OK!=my_xml_enter(p,a.beg,a.end-a.beg)) || - (MY_XML_OK!=my_xml_value(p,b.beg,b.end-b.beg)) || - (MY_XML_OK!=my_xml_leave(p,a.beg,a.end-a.beg))) -@@ -272,6 +282,7 @@ - } - else if ( (MY_XML_STRING==lex) || (MY_XML_IDENT==lex) ) - { -+ p->current_node_type= MY_XML_NODE_ATTR; - if((MY_XML_OK!=my_xml_enter(p,a.beg,a.end-a.beg)) || - (MY_XML_OK!=my_xml_leave(p,a.beg,a.end-a.beg))) - return MY_XML_ERROR; -@@ -318,7 +329,8 @@ - for ( ; (p->cur < p->end) && (p->cur[0]!='<') ; p->cur++); - a.end=p->cur; - -- my_xml_norm_text(&a); -+ if (!(p->flags & MY_XML_FLAG_SKIP_TEXT_NORMALIZATION)) -+ my_xml_norm_text(&a); - if (a.beg!=a.end) - { - my_xml_value(p,a.beg,a.end-a.beg); diff --git a/mysql-4.0-nisam.h.diff b/060_all_nisam_maykeylen-4.0.27.patch index c8d9d67..f195283 100644 --- a/mysql-4.0-nisam.h.diff +++ b/060_all_nisam_maykeylen-4.0.27.patch @@ -1,5 +1,5 @@ ---- include/nisam.h~ Sat Jun 22 18:03:36 2002 -+++ include/nisam.h Sat Jun 22 18:03:53 2002 +--- mysql.old/include/nisam.h Sat Jun 22 18:03:36 2002 ++++ mysql.new/include/nisam.h Sat Jun 22 18:03:53 2002 @@ -30,7 +30,7 @@ #define N_MAXKEY 16 /* Max allowed keys */ diff --git a/070_all_make-test.patch b/070_all_make-test.patch deleted file mode 100644 index 7bb65c9..0000000 --- a/070_all_make-test.patch +++ /dev/null @@ -1,14 +0,0 @@ -###MY_VER_RANGE [5.0.6_beta,5.0.6_beta] [5.1.0_alpha20050531,5.1.0_alpha20050531] ---- mysql.Makefile.am/Makefile.am 2005-06-02 22:44:41.000000000 +0200 -+++ mysql-5.0.6-beta/Makefile.am 2005-06-02 22:46:19.000000000 +0200 -@@ -104,8 +104,8 @@ - - test-force: - cd mysql-test; \ -- mysql-test-run --force ;\ -- mysql-test-run --ps-protocol --force -+ ./mysql-test-run --force ;\ -+ ./mysql-test-run --ps-protocol --force - - # Don't update the files from bitkeeper - %::SCCS/s.% diff --git a/080_all_slot_script-4.0.patch b/080_all_slot_script-4.0.patch new file mode 100644 index 0000000..36b4f3d --- /dev/null +++ b/080_all_slot_script-4.0.patch @@ -0,0 +1,646 @@ +diff -Naur -Naur mysql-4.0.26/scripts/Makefile.am mysql-4.0.26.new/scripts/Makefile.am +--- mysql-4.0.26/scripts/Makefile.am 2005-09-02 22:38:04.000000000 +0000 ++++ mysql-4.0.26.new/scripts/Makefile.am 2005-12-06 15:30:25.000000000 +0000 +@@ -81,11 +81,41 @@ + mysql_find_rows \ + mysqlhotcopy \ + mysqldumpslow \ ++ mysql_explain_log \ ++ mysql_tableinfo \ + mysqld_multi \ + make_win_src_distribution + + SUPERCLEANFILES = mysqlbug + ++sql_libexec_REPLACE = mysqld ++instance_manager_libexec_REPLACE= mysqlmanager ++client_bin_REPLACE = mysql mysqladmin mysqlcheck mysqlshow \ ++ mysqldump mysqlimport mysqltest mysqlbinlog \ ++ mysqltestmanagerc mysqltestmanager-pwgen ++extra_bin_REPLACE = replace comp_err perror resolveip my_print_defaults \ ++ resolve_stack_dump mysql_waitpid innochecksum ++myisam_bin_REPLACE = myisamchk myisamlog myisampack myisam_ftdump ++tools_bin_REPLACE = mysqltestmanager ++cw_cpcd_ndbbin_REPLACE = ndb_cpcd ++kernel_ndbbin_REPLACE = ndbd ++mgmsrv_ndbbin_REPLACE = ndb_mgmd ++sql_bin_REPLACE = mysql_tzinfo_to_sql ++tests_bin_REPLACE = mysql_client_test ++ndbtools_bin_REPLACE = ndb_test_platform ndb_waiter \ ++ ndb_drop_table ndb_delete_all \ ++ ndb_desc ndb_drop_index \ ++ ndb_show_tables ndb_select_all \ ++ ndb_select_count ndb_restore ndb_config ++EXTRA_REPLACE_BIN = safe_mysqld mysqlanalyze mysqloptimize mysqlrepair mysqld-max isamchk \ ++ $(sql_libexec_REPLACE) $(ndbtools_bin_REPLACE) \ ++ $(instance_manager_libexec_REPLACE) $(client_bin_REPLACE) \ ++ $(extra_bin_REPLACE) $(myisam_bin_REPLACE) $(tools_bin_REPLACE) \ ++ $(cw_cpcd_ndbbin_REPLACE) $(kernel_ndbbin_REPLACE) $(mgmsrv_ndbbin_REPLACE) \ ++ $(sql_bin_REPLACE) $(tests_bin_REPLACE) ++ ++dist_pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql ++ + # We want the right version and configure comand line in mysqlbug + mysqlbug: ${top_builddir}/config.status mysqlbug.sh + +@@ -93,8 +123,17 @@ + + .sh: + @RM@ -f $@ $@-t ++ bin_REPLACE='';\ ++ list='$(EXTRA_SCRIPTS) $(EXTRA_REPLACE_BIN)'; \ ++ for p in $${list}; do \ ++ f1=$${p/\.sh}; \ ++ f2=`echo "$${p}" | @SED@ -e 's|\.sh$$||' -e 's|^.*/||;$(transform)'`; \ ++ bin_REPLACE="$${bin_REPLACE}s!@mybin_$${f1}@!$${f2}!g;";\ ++ done; \ + @SED@ \ ++ -e "$${bin_REPLACE}" \ + -e 's!@''bindir''@!$(bindir)!g' \ ++ -e 's!@''sharedstatedir''@!$(sharedstatedir)!g' \ + -e 's!@''sbindir''@!$(sbindir)!g' \ + -e 's!@''scriptdir''@!$(bindir)!g' \ + -e 's!@''prefix''@!$(prefix)!g' \ +diff -Naur -Naur mysql-4.0.26/scripts/msql2mysql.sh mysql-4.0.26.new/scripts/msql2mysql.sh +--- mysql-4.0.26/scripts/msql2mysql.sh 2005-09-02 22:38:10.000000000 +0000 ++++ mysql-4.0.26.new/scripts/msql2mysql.sh 2005-12-06 15:26:25.000000000 +0000 +@@ -13,4 +13,4 @@ + # described in the License. Among other things, the License requires that + # the copyright notice and this notice be preserved on all copies. + +-@bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* ++@bindir@/@mybin_replace@ msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* +diff -Naur -Naur mysql-4.0.26/scripts/mysql_config.sh mysql-4.0.26.new/scripts/mysql_config.sh +--- mysql-4.0.26/scripts/mysql_config.sh 2005-09-02 22:37:59.000000000 +0000 ++++ mysql-4.0.26.new/scripts/mysql_config.sh 2005-12-06 15:26:25.000000000 +0000 +@@ -69,7 +69,7 @@ + + me=`get_full_path $0` + +-basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` ++basedir=`echo $me | sed -e 's;/bin/@mybin_mysql_config@;;'` + + ldata='@localstatedir@' + execdir='@libexecdir@' +diff -Naur -Naur mysql-4.0.26/scripts/mysql_config.sh.orig mysql-4.0.26.new/scripts/mysql_config.sh.orig +--- mysql-4.0.26/scripts/mysql_config.sh.orig 1970-01-01 00:00:00.000000000 +0000 ++++ mysql-4.0.26.new/scripts/mysql_config.sh.orig 2005-09-02 22:37:59.000000000 +0000 +@@ -0,0 +1,152 @@ ++#!/bin/sh ++# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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 ++ ++# This script reports various configuration settings that may be needed ++# when using the MySQL client library. ++ ++which () ++{ ++ IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' ++ for file ++ do ++ for dir in $PATH ++ do ++ if test -f $dir/$file ++ then ++ echo "$dir/$file" ++ continue 2 ++ fi ++ done ++ echo "which: no $file in ($PATH)" ++ exit 1 ++ done ++ IFS="$save_ifs" ++} ++ ++# ++# If we can find the given directory relatively to where mysql_config is ++# we should use this instead of the incompiled one. ++# This is to ensure that this script also works with the binary MySQL ++# version ++ ++fix_path () ++{ ++ var=$1 ++ shift ++ for filename ++ do ++ path=$basedir/$filename ++ if [ -d "$path" ] ; ++ then ++ eval "$var"=$path ++ return ++ fi ++ done ++} ++ ++get_full_path () ++{ ++ case $1 in ++ /*) echo "$1";; ++ ./*) tmp=`pwd`/$1; echo $tmp | sed -e 's;/\./;/;' ;; ++ *) which $1 ;; ++ esac ++} ++ ++me=`get_full_path $0` ++ ++basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` ++ ++ldata='@localstatedir@' ++execdir='@libexecdir@' ++bindir='@bindir@' ++pkglibdir='@pkglibdir@' ++fix_path pkglibdir lib/mysql lib ++pkgincludedir='@pkgincludedir@' ++fix_path pkgincludedir include/mysql include ++version='@VERSION@' ++socket='@MYSQL_UNIX_ADDR@' ++port='@MYSQL_TCP_PORT@' ++ldflags='@LDFLAGS@' ++client_libs='@CLIENT_LIBS@' ++ ++# Create options ++ ++libs="$ldflags -L$pkglibdir -lmysqlclient $client_libs" ++libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` ++libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @LIBS@ @openssl_libs@" ++libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` ++cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! ++include="-I$pkgincludedir" ++embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @WRAPLIBS@ @innodb_system_libs@" ++embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` ++ ++# Remove some options that a client doesn't have to care about ++for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \ ++ DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ ++ DEXTRA_DEBUG DHAVE_purify 'O[0-9]' 'W[-A-Za-z]*' ++do ++ cflags=`echo "$cflags"|sed -e "s/-$remove *//g"` ++done ++cflags=`echo "$cflags"|sed -e 's/ *\$//'` ++ ++usage () { ++ cat <<EOF ++Usage: $0 [OPTIONS] ++Options: ++ --cflags [$cflags] ++ --include [$include] ++ --libs [$libs] ++ --libs_r [$libs_r] ++ --socket [$socket] ++ --port [$port] ++ --version [$version] ++ --libmysqld-libs [$embedded_libs] ++EOF ++ exit 1 ++} ++ ++if test $# -le 0; then usage; fi ++ ++while test $# -gt 0; do ++ case $1 in ++ --cflags) echo "$cflags" ;; ++ --include) echo "$include" ;; ++ --libs) echo "$libs" ;; ++ --libs_r) echo "$libs_r" ;; ++ --socket) echo "$socket" ;; ++ --port) echo "$port" ;; ++ --version) echo "$version" ;; ++ --embedded-libs | --embedded | --libmysqld-libs) echo "$embedded_libs" ;; ++ *) usage ;; ++ esac ++ ++ shift ++done ++ ++#echo "ldata: '"$ldata"'" ++#echo "execdir: '"$execdir"'" ++#echo "bindir: '"$bindir"'" ++#echo "pkglibdir: '"$pkglibdir"'" ++#echo "pkgincludedir: '"$pkgincludedir"'" ++#echo "version: '"$version"'" ++#echo "socket: '"$socket"'" ++#echo "port: '"$port"'" ++#echo "ldflags: '"$ldflags"'" ++#echo "client_libs: '"$client_libs"'" ++ ++exit 0 +diff -Naur -Naur mysql-4.0.26/scripts/mysql_install_db.sh mysql-4.0.26.new/scripts/mysql_install_db.sh +--- mysql-4.0.26/scripts/mysql_install_db.sh 2005-09-02 22:38:00.000000000 +0000 ++++ mysql-4.0.26.new/scripts/mysql_install_db.sh 2005-12-06 15:37:24.000000000 +0000 +@@ -61,20 +61,20 @@ + + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x ./extra/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "./extra/@mybin_my_print_defaults@" + then +- print_defaults="./extra/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./extra/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + args= +@@ -95,10 +95,10 @@ + pkgdatadir=@pkgdatadir@ + else + bindir="$basedir/bin" +-if test -x "$basedir/libexec/mysqld" ++if test -x "$basedir/libexec/@mybin_mysqld@" + then + execdir="$basedir/libexec" +-elif test -x "$basedir/sbin/mysqld" ++elif test -x "$basedir/sbin/@mybin_mysqld@" + then + execdir="$basedir/sbin" + else +@@ -107,13 +107,13 @@ + fi + + mdata=$ldata/mysql +-mysqld=$execdir/mysqld ++mysqld=$execdir/@mybin_mysqld@ + mysqld_opt="" + scriptdir=$bindir + + if test "$windows" = 1 + then +- mysqld="./sql/mysqld" ++ mysqld="./sql/@mybin_mysqld@" + mysqld_opt="--language=./sql/share/english" + scriptdir="./scripts" + fi +@@ -137,22 +137,22 @@ + # Check if hostname is valid + if test "$windows" = 0 -a "$in_rpm" = 0 -a $force = 0 + then +- resolved=`$bindir/resolveip $hostname 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ $hostname 2>&1` + if [ $? -ne 0 ] + then +- resolved=`$bindir/resolveip localhost 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ localhost 2>&1` + if [ $? -ne 0 ] + then + echo "Neither host '$hostname' nor 'localhost' could not be looked up with" +- echo "$bindir/resolveip" ++ echo "$bindir/@mybin_resolveip@" + echo "Please configure the 'hostname' command to return a correct hostname." + echo "If you want to solve this at a later stage, restart this script with" + echo "the --force option" + exit 1 + fi +- echo "WARNING: The host '$hostname' could not be looked up with resolveip." ++ echo "WARNING: The host '$hostname' could not be looked up with @mybin_resolveip@." + echo "This probably means that your libc libraries are not 100 % compatible" +- echo "with this binary MySQL version. The MySQL daemon, mysqld, should work" ++ echo "with this binary MySQL version. The MySQL daemon, @mybin_mysqld@, should work" + echo "normally with the exception that host name resolving will not work." + echo "This means that you should use IP addresses instead of hostnames" + echo "when specifying MySQL privileges !" +@@ -371,8 +371,8 @@ + fi + echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" + echo "To do so, start the server, then issue the following commands:" +- echo "$bindir/mysqladmin -u root password 'new-password'" +- echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root -h $hostname password 'new-password'" + echo "See the manual for more instructions." + # + # Print message about upgrading unless we have created a new db table. +@@ -380,14 +380,14 @@ + then + echo + echo "NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run" +- echo "the $bindir/mysql_fix_privilege_tables. Otherwise you will not be" ++ echo "the $bindir/@mybin_mysql_fix_privilege_tables@. Otherwise you will not be" + echo "able to use the new GRANT command!" + fi + echo + if test "$in_rpm" = "0" + then + echo "You can start the MySQL daemon with:" +- echo "cd @prefix@ ; $bindir/mysqld_safe &" ++ echo "cd @prefix@ ; $bindir/@mybin_mysqld_safe@ &" + echo + echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:" + echo "cd sql-bench ; perl run-all-tests" +@@ -407,13 +407,13 @@ + echo "You can also try to start the mysqld daemon with:" + echo "$execdir/mysqld --skip-grant &" + echo "You can use the command line tool" +- echo "$bindir/mysql to connect to the mysql" ++ echo "$bindir/@mybin_mysql@ to connect to the mysql" + echo "database and look at the grant tables:" + echo +- echo "shell> $bindir/mysql -u root mysql" ++ echo "shell> $bindir/@mybin_mysql@ -u root mysql" + echo "mysql> show tables" + echo +- echo "Try 'mysqld --help' if you have problems with paths. Using --log" ++ echo "Try '@mybin_mysqld@ --help' if you have problems with paths. Using --log" + echo "gives you a log in $ldata that may be helpful." + echo + echo "The latest information about MySQL is available on the web at" +@@ -422,6 +422,6 @@ + echo "and the manual section that describes problems on your OS." + echo "Another information source is the MySQL email archive." + echo "Please check all of the above before mailing us!" +- echo "And if you do mail us, you MUST use the @scriptdir@/mysqlbug script!" ++ echo "And if you do mail us, you MUST use the @scriptdir@/@mybin_mysqlbug@ script!" + exit 1 + fi +diff -Naur -Naur mysql-4.0.26/scripts/mysql_secure_installation.sh mysql-4.0.26.new/scripts/mysql_secure_installation.sh +--- mysql-4.0.26/scripts/mysql_secure_installation.sh 2005-09-02 22:37:55.000000000 +0000 ++++ mysql-4.0.26.new/scripts/mysql_secure_installation.sh 2005-12-06 15:26:49.000000000 +0000 +@@ -30,7 +30,7 @@ + + do_query() { + echo $1 >$command +- mysql --defaults-file=$config <$command ++ @mybin_mysql@ --defaults-file=$config <$command + return $? + } + +diff -Naur -Naur mysql-4.0.26/scripts/mysqlaccess.sh mysql-4.0.26.new/scripts/mysqlaccess.sh +--- mysql-4.0.26/scripts/mysqlaccess.sh 2005-09-02 22:37:59.000000000 +0000 ++++ mysql-4.0.26.new/scripts/mysqlaccess.sh 2005-12-06 15:26:49.000000000 +0000 +@@ -17,7 +17,7 @@ + + # **************************** + # information on MySQL +- $MYSQL = '@bindir@/mysql'; # path to mysql executable ++ $MYSQL = '@bindir@/@mybin_mysql@'; # path to mysql executable + $SERVER = '3.21'; + $MYSQL_OPT = ' --batch --unbuffered'; + $ACCESS_DB = 'mysql'; # name of DB with grant-tables +@@ -32,7 +32,7 @@ + $ACCESS_U_BCK = 'user_backup'; + $ACCESS_D_BCK = 'db_backup'; + $DIFF = '/usr/bin/diff'; +- $MYSQLDUMP = '@bindir@/mysqldump'; ++ $MYSQLDUMP = '@bindir@/@mybin_mysqldump@'; + #path to mysqldump executable + + $MYSQLADMIN= 'http://foobar.com/MySQLadmin'; +diff -Naur -Naur mysql-4.0.26/scripts/mysqld_multi.sh mysql-4.0.26.new/scripts/mysqld_multi.sh +--- mysql-4.0.26/scripts/mysqld_multi.sh 2005-09-02 22:38:07.000000000 +0000 ++++ mysql-4.0.26.new/scripts/mysqld_multi.sh 2005-12-06 15:41:13.000000000 +0000 +@@ -10,8 +10,8 @@ + $opt_example = 0; + $opt_help = 0; + $opt_log = undef(); +-$opt_mysqladmin = "@bindir@/mysqladmin"; +-$opt_mysqld = "@libexecdir@/mysqld"; ++$opt_mysqladmin = "@bindir@/@mybin_mysqladmin@"; ++$opt_mysqld = "@libexecdir@/@mybin_mysqld@"; + $opt_no_log = 0; + $opt_password = undef(); + $opt_tcp_ip = 0; +@@ -37,11 +37,11 @@ + { + my ($flag_exit); + +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { + # We can't throw out yet, since --version, --help, or --example may + # have been given +- print "WARNING! my_print_defaults command not found!\n"; ++ print "WARNING! @mybin_my_print_defaults@ command not found!\n"; + print "Please make sure you have this command available and\n"; + print "in your path. The command is available from the latest\n"; + print "MySQL distribution.\n"; +@@ -67,9 +67,9 @@ + } + } + } +- my $com= "my_print_defaults "; ++ my $com= "@mybin_my_print_defaults@ "; + $com.= "--config-file=$opt_config_file " if (defined($opt_config_file)); +- $com.= "mysqld_multi"; ++ $com.= "@mybin_mysqld_multi@"; + my @defops = `$com`; + chop @defops; + splice @ARGV, 0, 0, @defops; +@@ -102,9 +102,9 @@ + print "Error with an option, see $my_progname --help for more info!\n"; + exit(1); + } +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { +- print "ABORT: Can't find command 'my_print_defaults'!\n"; ++ print "ABORT: Can't find command '@mybin_my_print_defaults@'!\n"; + print "This command is available from the latest MySQL\n"; + print "distribution. Please make sure you have the command\n"; + print "in your PATH.\n"; +@@ -149,7 +149,7 @@ + { + if ($my_print_defaults_exists) + { +- @mysqld_opts= `my_print_defaults mysqld`; ++ @mysqld_opts= `@mybin_my_print_defaults@ mysqld`; + chomp @mysqld_opts; + foreach my $opt (@mysqld_opts) + { +@@ -263,7 +263,7 @@ + @groups = &find_groups($groupids); + for ($i = 0; defined($groups[$i]); $i++) + { +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +@@ -574,8 +574,8 @@ + # give you extra performance in a threaded system! + # + [mysqld_multi] +-mysqld = @bindir@/mysqld_safe +-mysqladmin = @bindir@/mysqladmin ++mysqld = @bindir@/@mybin_safe_mysqld@ ++mysqladmin = @bindir@/@mybin_mysqladmin@ + user = root + password = your_password + +diff -Naur -Naur mysql-4.0.26/scripts/mysqld_safe.sh mysql-4.0.26.new/scripts/mysqld_safe.sh +--- mysql-4.0.26/scripts/mysqld_safe.sh 2005-09-02 22:37:59.000000000 +0000 ++++ mysql-4.0.26.new/scripts/mysqld_safe.sh 2005-12-06 15:43:55.000000000 +0000 +@@ -67,7 +67,7 @@ + then + MYSQLD="mysqld-$tmp" + else +- MYSQLD="mysqld" ++ MYSQLD="@mybin_mysqld@" + fi + ;; + --nice=*) niceness=`echo "$arg" | sed -e "s;--nice=;;"` ;; +@@ -87,7 +87,7 @@ + MY_PWD=`pwd` + # Check if we are starting this relative (for the binary release) + if test -d $MY_PWD/data/mysql -a -f ./share/mysql/english/errmsg.sys -a \ +- -x ./bin/mysqld ++ -x ./bin/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are + ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is +@@ -98,7 +98,7 @@ + fi + # Check if this is a 'moved install directory' + elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ +- -x ./libexec/mysqld ++ -x ./libexec/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are + ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is +@@ -113,11 +113,11 @@ + niceness=0 + + # Use the mysqld-max binary by default if the user doesn't specify a binary +-if test -x $ledir/mysqld-max ++if test -x $ledir/@mybin_mysqld-max@ + then +- MYSQLD=mysqld-max ++ MYSQLD=@mybin_mysqld-max@ + else +- MYSQLD=mysqld ++ MYSQLD=@mybin_mysqld@ + fi + + # these rely on $DATADIR by default, so we'll set them later on +@@ -126,17 +126,17 @@ + + # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] + # and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + args= +@@ -155,7 +155,7 @@ + echo "The file $ledir/$MYSQLD doesn't exist or is not executable" + echo "Please do a cd to the mysql installation directory and restart" + echo "this script from there as follows:" +- echo "./bin/mysqld_safe". ++ echo "./bin/@mybin_mysqld_safe@". + echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more" + echo "information" + exit 1 +@@ -284,12 +284,12 @@ + # checked and repaired during startup. You should add sensible key_buffer + # and sort_buffer values to my.cnf to improve check performance or require + # less disk space. +-# Alternatively, you can start mysqld with the "myisam-recover" option. See ++# Alternatively, you can start @mybin_mysqld@ with the "myisam-recover" option. See + # the manual for details. + # + # echo "Checking tables in $DATADIR" +-# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check $DATADIR/*/*.MYI +-# $MY_BASEDIR_VERSION/bin/isamchk --silent --force $DATADIR/*/*.ISM ++# $MY_BASEDIR_VERSION/bin/@mybin_myisamchk@ --silent --force --fast --medium-check $DATADIR/*/*.MYI ++# $MY_BASEDIR_VERSION/bin/@mybin_isamchk@ --silent --force $DATADIR/*/*.ISM + + echo "Starting $MYSQLD daemon with databases from $DATADIR" + +@@ -299,7 +299,7 @@ + # ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems + #fi + +-echo "`date +'%y%m%d %H:%M:%S mysqld started'`" >> $err_log ++echo "`date +'%y%m%d %H:%M:%S @mybin_mysqld@ started'`" >> $err_log + while true + do + rm -f $safe_mysql_unix_port $pid_file # Some extra safety +@@ -344,9 +344,9 @@ + I=`expr $I + 1` + done + fi +- echo "`date +'%y%m%d %H:%M:%S'` mysqld restarted" | tee -a $err_log ++ echo "`date +'%y%m%d %H:%M:%S'` @mybin_mysqld@ restarted" | tee -a $err_log + done + +-echo "`date +'%y%m%d %H:%M:%S'` mysqld ended" | tee -a $err_log ++echo "`date +'%y%m%d %H:%M:%S'` @mybin_mysqld@ ended" | tee -a $err_log + echo "" | tee -a $err_log + +diff -Naur -Naur mysql-4.0.26/scripts/mysqldumpslow.sh mysql-4.0.26.new/scripts/mysqldumpslow.sh +--- mysql-4.0.26/scripts/mysqldumpslow.sh 2005-09-02 22:37:59.000000000 +0000 ++++ mysql-4.0.26.new/scripts/mysqldumpslow.sh 2005-12-06 15:26:49.000000000 +0000 +@@ -32,16 +32,16 @@ + + + unless (@ARGV) { +- my $defaults = `my_print_defaults mysqld`; ++ my $defaults = `@mybin_my_print_defaults@ mysqld`; + my $basedir = ($defaults =~ m/--basedir=(.*)/)[0] +- or die "Can't determine basedir from 'my_print_defaults mysqld' output: $defaults"; ++ or die "Can't determine basedir from '@mybin_my_print_defaults@ mysqld' output: $defaults"; + warn "basedir=$basedir\n" if $opt{v}; + + my $datadir = ($defaults =~ m/--datadir=(.*)/)[0]; + if (!$datadir or $opt{i}) { + # determine the datadir from the instances section of /etc/my.cnf, if any +- my $instances = `my_print_defaults instances`; +- die "Can't determine datadir from 'my_print_defaults mysqld' output: $defaults" ++ my $instances = `@mybin_my_print_defaults@ instances`; ++ die "Can't determine datadir from '@mybin_my_print_defaults@ mysqld' output: $defaults" + unless $instances; + my @instances = ($instances =~ m/^--(\w+)-/mg); + die "No -i 'instance_name' specified to select among known instances: @instances.\n" +@@ -49,7 +49,7 @@ + die "Instance '$opt{i}' is unknown (known instances: @instances)\n" + unless grep { $_ eq $opt{i} } @instances; + $datadir = ($instances =~ m/--$opt{i}-datadir=(.*)/)[0] +- or die "Can't determine --$opt{i}-datadir from 'my_print_defaults instances' output: $instances"; ++ or die "Can't determine --$opt{i}-datadir from '@mybin_my_print_defaults@ instances' output: $instances"; + warn "datadir=$datadir\n" if $opt{v}; + } + diff --git a/080_all_slot_script-4.1.16.patch b/080_all_slot_script-4.1.16.patch new file mode 100644 index 0000000..29abc58 --- /dev/null +++ b/080_all_slot_script-4.1.16.patch @@ -0,0 +1,532 @@ +diff -Naur -Naur mysql-4.1.16.orig/scripts/Makefile.am mysql-4.1.16.new/scripts/Makefile.am +--- mysql-4.1.16.orig/scripts/Makefile.am 2005-11-30 20:36:23.000000000 +0000 ++++ mysql-4.1.16.new/scripts/Makefile.am 2006-01-14 18:32:53.000000000 +0000 +@@ -66,6 +66,32 @@ + mysqlaccess.conf \ + mysqlbug + ++sql_libexec_REPLACE = mysqld ++instance_manager_libexec_REPLACE= mysqlmanager ++client_bin_REPLACE = mysql mysqladmin mysqlcheck mysqlshow \ ++ mysqldump mysqlimport mysqltest mysqlbinlog \ ++ mysqltestmanagerc mysqltestmanager-pwgen ++extra_bin_REPLACE = replace comp_err perror resolveip my_print_defaults \ ++ resolve_stack_dump mysql_waitpid innochecksum ++myisam_bin_REPLACE = myisamchk myisamlog myisampack myisam_ftdump ++tools_bin_REPLACE = mysqltestmanager ++cw_cpcd_ndbbin_REPLACE = ndb_cpcd ++kernel_ndbbin_REPLACE = ndbd ++mgmsrv_ndbbin_REPLACE = ndb_mgmd ++sql_bin_REPLACE = mysql_tzinfo_to_sql ++tests_bin_REPLACE = mysql_client_test ++ndbtools_bin_REPLACE = ndb_test_platform ndb_waiter \ ++ ndb_drop_table ndb_delete_all \ ++ ndb_desc ndb_drop_index \ ++ ndb_show_tables ndb_select_all \ ++ ndb_select_count ndb_restore ndb_config ++EXTRA_REPLACE_BIN = safe_mysqld mysqlanalyze mysqloptimize mysqlrepair mysqld-max isamchk \ ++ $(sql_libexec_REPLACE) $(ndbtools_bin_REPLACE) \ ++ $(instance_manager_libexec_REPLACE) $(client_bin_REPLACE) \ ++ $(extra_bin_REPLACE) $(myisam_bin_REPLACE) $(tools_bin_REPLACE) \ ++ $(cw_cpcd_ndbbin_REPLACE) $(kernel_ndbbin_REPLACE) $(mgmsrv_ndbbin_REPLACE) \ ++ $(sql_bin_REPLACE) $(tests_bin_REPLACE) ++ + dist_pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql + + # mysqlbug should be distributed built so that people can report build +@@ -100,8 +126,17 @@ + + .sh: + @RM@ -f $@ $@-t ++ bin_REPLACE='';\ ++ list='$(EXTRA_SCRIPTS) $(EXTRA_REPLACE_BIN)'; \ ++ for p in $${list}; do \ ++ f1=$${p/\.sh}; \ ++ f2=`echo "$${p}" | @SED@ -e 's|\.sh$$||' -e 's|^.*/||;$(transform)'`; \ ++ bin_REPLACE="$${bin_REPLACE}s!@mybin_$${f1}@!$${f2}!g;";\ ++ done; \ + @SED@ \ ++ -e "$${bin_REPLACE}" \ + -e 's!@''bindir''@!$(bindir)!g' \ ++ -e 's!@''sharedstatedir''@!$(sharedstatedir)!g' \ + -e 's!@''sbindir''@!$(sbindir)!g' \ + -e 's!@''scriptdir''@!$(bindir)!g' \ + -e 's!@''prefix''@!$(prefix)!g' \ +diff -Naur -Naur mysql-4.1.16.orig/scripts/msql2mysql.sh mysql-4.1.16.new/scripts/msql2mysql.sh +--- mysql-4.1.16.orig/scripts/msql2mysql.sh 2005-11-30 20:36:34.000000000 +0000 ++++ mysql-4.1.16.new/scripts/msql2mysql.sh 2006-01-14 18:32:53.000000000 +0000 +@@ -13,4 +13,4 @@ + # described in the License. Among other things, the License requires that + # the copyright notice and this notice be preserved on all copies. + +-@bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* ++@bindir@/@mybin_replace@ msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* +diff -Naur -Naur mysql-4.1.16.orig/scripts/mysql_config.sh mysql-4.1.16.new/scripts/mysql_config.sh +--- mysql-4.1.16.orig/scripts/mysql_config.sh 2005-11-30 20:36:06.000000000 +0000 ++++ mysql-4.1.16.new/scripts/mysql_config.sh 2006-01-14 18:32:53.000000000 +0000 +@@ -77,7 +77,7 @@ + + me=`get_full_path $0` + +-basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` ++basedir=`echo $me | sed -e 's;/bin/@mybin_mysql_config@;;'` + + ldata='@localstatedir@' + execdir='@libexecdir@' +diff -Naur -Naur mysql-4.1.16.orig/scripts/mysql_create_system_tables.sh mysql-4.1.16.new/scripts/mysql_create_system_tables.sh +--- mysql-4.1.16.orig/scripts/mysql_create_system_tables.sh 2005-11-30 20:36:27.000000000 +0000 ++++ mysql-4.1.16.new/scripts/mysql_create_system_tables.sh 2006-01-14 18:32:53.000000000 +0000 +@@ -19,7 +19,7 @@ + new context from the manual (from fill_help_tables.sql). + + Usage: +- mysql_create_system_tables [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> ++ @mybin_mysql_create_system_tables@ [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> + " + exit + fi +diff -Naur -Naur mysql-4.1.16.orig/scripts/mysql_fix_privilege_tables.sh mysql-4.1.16.new/scripts/mysql_fix_privilege_tables.sh +--- mysql-4.1.16.orig/scripts/mysql_fix_privilege_tables.sh 2005-11-30 20:36:32.000000000 +0000 ++++ mysql-4.1.16.new/scripts/mysql_fix_privilege_tables.sh 2006-01-14 18:32:53.000000000 +0000 +@@ -76,17 +76,17 @@ + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments + +-print_defaults=my_print_defaults ++print_defaults=@mybin_my_print_defaults@ + for dir in ./bin @bindir@ @bindir@ extra $print_defaults_bindir/../bin $print_defaults_bindir/../extra + do +- if test -x $dir/my_print_defaults ++ if test -x $dir/@mybin_my_print_defaults@ + then +- print_defaults="$dir/my_print_defaults" ++ print_defaults="$dir/@mybin_my_print_defaults@" + break + fi + done + +-parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables` ++parse_arguments `$print_defaults $defaults @mybin_mysql_install_db@ @mybin_mysql_fix_privilege_tables@` + parse_arguments PICK-ARGS-FROM-ARGV "$@" + + if test -z "$basedir" +@@ -119,7 +119,7 @@ + password=$old_style_password + fi + +-cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" ++cmd="$bindir/@mybin_mysql@ --no-defaults --force --user=$user --host=$host" + if test ! -z "$password" ; then + cmd="$cmd --password=$password" + fi +@@ -137,7 +137,7 @@ + fi + + # Find where first mysql_fix_privilege_tables.sql is located +-for i in $basedir/support-files $basedir/share $basedir/share/mysql \ ++for i in @sharedstatedir@ $basedir/support-files $basedir/share $basedir/share/mysql \ + $basedir/scripts @pkgdatadir@ . ./scripts + do + if test -f $i/$file +diff -Naur -Naur mysql-4.1.16.orig/scripts/mysql_install_db.sh mysql-4.1.16.new/scripts/mysql_install_db.sh +--- mysql-4.1.16.orig/scripts/mysql_install_db.sh 2005-11-30 20:36:14.000000000 +0000 ++++ mysql-4.1.16.new/scripts/mysql_install_db.sh 2006-01-14 18:32:53.000000000 +0000 +@@ -57,20 +57,20 @@ + + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x ./extra/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "./extra/@mybin_my_print_defaults@" + then +- print_defaults="./extra/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./extra/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + args= +@@ -94,10 +94,10 @@ + pkgdatadir=@pkgdatadir@ + else + bindir="$basedir/bin" +- if test -x "$basedir/libexec/mysqld" ++ if test -x "$basedir/libexec/@mybin_mysqld@" + then + execdir="$basedir/libexec" +- elif test -x "$basedir/sbin/mysqld" ++ elif test -x "$basedir/sbin/@mybin_mysqld@" + then + execdir="$basedir/sbin" + else +@@ -106,7 +106,7 @@ + fi + + # find fill_help_tables.sh +-for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ ++for i in @sharedstatedir@ $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ + do + if test -f $i/fill_help_tables.sql + then +@@ -123,13 +123,13 @@ + fi + + mdata=$ldata/mysql +-mysqld=$execdir/mysqld ++mysqld=$execdir/@mybin_mysqld@ + mysqld_opt="" + scriptdir=$bindir + + if test "$windows" = 1 + then +- mysqld="./sql/mysqld" ++ mysqld="./sql/@mybin_mysqld@" + mysqld_opt="--language=./sql/share/english" + scriptdir="./scripts" + fi +@@ -153,14 +153,14 @@ + # Check if hostname is valid + if test "$windows" = 0 -a "$in_rpm" = 0 -a $force = 0 + then +- resolved=`$bindir/resolveip $hostname 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ $hostname 2>&1` + if [ $? -ne 0 ] + then +- resolved=`$bindir/resolveip localhost 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ localhost 2>&1` + if [ $? -ne 0 ] + then + echo "Neither host '$hostname' nor 'localhost' could be looked up with" +- echo "$bindir/resolveip" ++ echo "$bindir/@mybin_resolveip@" + echo "Please configure the 'hostname' command to return a correct hostname." + echo "If you want to solve this at a later stage, restart this script with" + echo "the --force option" +@@ -168,7 +168,7 @@ + fi + echo "WARNING: The host '$hostname' could not be looked up with resolveip." + echo "This probably means that your libc libraries are not 100 % compatible" +- echo "with this binary MySQL version. The MySQL daemon, mysqld, should work" ++ echo "with this binary MySQL version. The MySQL daemon, @mybin_mysqld@, should work" + echo "normally with the exception that host name resolving will not work." + echo "This means that you should use IP addresses instead of hostnames" + echo "when specifying MySQL privileges !" +@@ -213,7 +213,7 @@ + mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ + --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ + --skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" +-if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ ++if $scriptdir/@mybin_mysql_create_system_tables@ $create_option $mdata $hostname $windows \ + | eval "$mysqld_install_cmd_line" + then + if test -n "$fill_help_tables" +@@ -243,8 +243,8 @@ + then + echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" + echo "To do so, start the server, then issue the following commands:" +- echo "$bindir/mysqladmin -u root password 'new-password'" +- echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root -h $hostname password 'new-password'" + echo "See the manual for more instructions." + # + # Print message about upgrading unless we have created a new db table. +@@ -252,14 +252,14 @@ + then + echo + echo "NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run" +- echo "the $bindir/mysql_fix_privilege_tables. Otherwise you will not be" ++ echo "the $bindir/@mybin_mysql_fix_privilege_tables@. Otherwise you will not be" + echo "able to use the new GRANT command!" + fi + echo + if test "$in_rpm" = "0" + then + echo "You can start the MySQL daemon with:" +- echo "cd @prefix@ ; $bindir/mysqld_safe &" ++ echo "cd @prefix@ ; $bindir/@mybin_mysqld_safe@ &" + echo + echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:" + echo "cd sql-bench ; perl run-all-tests" +@@ -279,13 +279,13 @@ + echo "You can also try to start the mysqld daemon with:" + echo "$mysqld --skip-grant &" + echo "You can use the command line tool" +- echo "$bindir/mysql to connect to the mysql" ++ echo "$bindir/@mybin_mysql@ to connect to the mysql" + echo "database and look at the grant tables:" + echo +- echo "shell> $bindir/mysql -u root mysql" ++ echo "shell> $bindir/@mybin_mysql@ -u root mysql" + echo "mysql> show tables" + echo +- echo "Try 'mysqld --help' if you have problems with paths. Using --log" ++ echo "Try '@mybin_mysqld@ --help' if you have problems with paths. Using --log" + echo "gives you a log in $ldata that may be helpful." + echo + echo "The latest information about MySQL is available on the web at" +@@ -294,6 +294,6 @@ + echo "and the manual section that describes problems on your OS." + echo "Another information source is the MySQL email archive." + echo "Please check all of the above before mailing us!" +- echo "And if you do mail us, you MUST use the @scriptdir@/mysqlbug script!" ++ echo "And if you do mail us, you MUST use the @scriptdir@/@mybin_mysqlbug@ script!" + exit 1 + fi +diff -Naur -Naur mysql-4.1.16.orig/scripts/mysql_secure_installation.sh mysql-4.1.16.new/scripts/mysql_secure_installation.sh +--- mysql-4.1.16.orig/scripts/mysql_secure_installation.sh 2005-11-30 20:36:34.000000000 +0000 ++++ mysql-4.1.16.new/scripts/mysql_secure_installation.sh 2006-01-14 18:32:53.000000000 +0000 +@@ -30,7 +30,7 @@ + + do_query() { + echo $1 >$command +- mysql --defaults-file=$config <$command ++ @mybin_mysql@ --defaults-file=$config <$command + return $? + } + +diff -Naur -Naur mysql-4.1.16.orig/scripts/mysqlaccess.sh mysql-4.1.16.new/scripts/mysqlaccess.sh +--- mysql-4.1.16.orig/scripts/mysqlaccess.sh 2005-11-30 20:36:05.000000000 +0000 ++++ mysql-4.1.16.new/scripts/mysqlaccess.sh 2006-01-14 18:32:53.000000000 +0000 +@@ -17,7 +17,7 @@ + + # **************************** + # information on MySQL +- $MYSQL = '@bindir@/mysql'; # path to mysql executable ++ $MYSQL = '@bindir@/@mybin_mysql@'; # path to mysql executable + $SERVER = '3.21'; + $MYSQL_OPT = ' --batch --unbuffered'; + $ACCESS_DB = 'mysql'; # name of DB with grant-tables +@@ -32,7 +32,7 @@ + $ACCESS_U_BCK = 'user_backup'; + $ACCESS_D_BCK = 'db_backup'; + $DIFF = '/usr/bin/diff'; +- $MYSQLDUMP = '@bindir@/mysqldump'; ++ $MYSQLDUMP = '@bindir@/@mybin_mysqldump@'; + #path to mysqldump executable + + $MYSQLADMIN= 'http://foobar.com/MySQLadmin'; +diff -Naur -Naur mysql-4.1.16.orig/scripts/mysqld_multi.sh mysql-4.1.16.new/scripts/mysqld_multi.sh +--- mysql-4.1.16.orig/scripts/mysqld_multi.sh 2005-11-30 20:36:28.000000000 +0000 ++++ mysql-4.1.16.new/scripts/mysqld_multi.sh 2006-01-14 18:32:53.000000000 +0000 +@@ -10,8 +10,8 @@ + $opt_example = 0; + $opt_help = 0; + $opt_log = undef(); +-$opt_mysqladmin = "@bindir@/mysqladmin"; +-$opt_mysqld = "@libexecdir@/mysqld"; ++$opt_mysqladmin = "@bindir@/@mybin_mysqladmin@"; ++$opt_mysqld = "@libexecdir@/@mybin_mysqld@"; + $opt_no_log = 0; + $opt_password = undef(); + $opt_tcp_ip = 0; +@@ -39,11 +39,11 @@ + { + my ($flag_exit); + +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { + # We can't throw out yet, since --version, --help, or --example may + # have been given +- print "WARNING! my_print_defaults command not found!\n"; ++ print "WARNING! @mybin_my_print_defaults@ command not found!\n"; + print "Please make sure you have this command available and\n"; + print "in your path. The command is available from the latest\n"; + print "MySQL distribution.\n"; +@@ -69,9 +69,9 @@ + } + } + } +- my $com= "my_print_defaults "; ++ my $com= "@mybin_my_print_defaults@ "; + $com.= "--config-file=$opt_config_file " if (defined($opt_config_file)); +- $com.= "mysqld_multi"; ++ $com.= "@mybin_mysqld_multi@"; + my @defops = `$com`; + chop @defops; + splice @ARGV, 0, 0, @defops; +@@ -101,9 +101,9 @@ + print "Error with an option, see $my_progname --help for more info!\n"; + exit(1); + } +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { +- print "ABORT: Can't find command 'my_print_defaults'!\n"; ++ print "ABORT: Can't find command '@mybin_my_print_defaults@'!\n"; + print "This command is available from the latest MySQL\n"; + print "distribution. Please make sure you have the command\n"; + print "in your PATH.\n"; +@@ -165,7 +165,7 @@ + { + if ($my_print_defaults_exists) + { +- @mysqld_opts= `my_print_defaults mysqld`; ++ @mysqld_opts= `@mybin_my_print_defaults@ mysqld`; + chomp @mysqld_opts; + foreach my $opt (@mysqld_opts) + { +@@ -266,7 +266,7 @@ + @groups = &find_groups($groupids); + for ($i = 0; defined($groups[$i]); $i++) + { +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +@@ -295,7 +295,7 @@ + $tmp.= " '$options[$j]'"; + } + } +- if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent) ++ if ($opt_verbose && $com =~ m/\/@mybin_safe_mysqld@$/ && !$info_sent) + { + print "WARNING: safe_mysqld is being used to start mysqld. In this case you "; + print "may need to pass\n\"ledir=...\" under groups [mysqldN] to "; +@@ -366,7 +366,7 @@ + my ($i, @groups)= @_; + my ($mysqladmin_found, $com, $tmp, $j); + +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +diff -Naur -Naur mysql-4.1.16.orig/scripts/mysqld_safe.sh mysql-4.1.16.new/scripts/mysqld_safe.sh +--- mysql-4.1.16.orig/scripts/mysqld_safe.sh 2005-11-30 20:36:34.000000000 +0000 ++++ mysql-4.1.16.new/scripts/mysqld_safe.sh 2006-01-14 18:36:18.000000000 +0000 +@@ -68,7 +68,7 @@ + then + MYSQLD="mysqld-$tmp" + else +- MYSQLD="mysqld" ++ MYSQLD="@mybin_mysqld@" + fi + ;; + --nice=*) niceness=`echo "$arg" | sed -e "s;--nice=;;"` ;; +@@ -91,13 +91,13 @@ + + MY_PWD=`pwd` + # Check for the directories we would expect from a binary release install +-if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld ++if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are + ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is + # Check for the directories we would expect from a source install + elif test -f ./share/mysql/english/errmsg.sys -a \ +- -x ./libexec/mysqld ++ -x ./libexec/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are + ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is +@@ -137,17 +137,17 @@ + + # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] + # and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + args= +@@ -172,11 +172,11 @@ + # Use the mysqld-max binary by default if the user doesn't specify a binary + if test -z "$MYSQLD" + then +- if test -x $ledir/mysqld-max ++ if test -x $ledir/@mybin_mysqld-max@ + then +- MYSQLD=mysqld-max ++ MYSQLD=@mybin_mysqld-max@ + else +- MYSQLD=mysqld ++ MYSQLD=@mybin_mysqld@ + fi + fi + +@@ -185,7 +185,7 @@ + echo "The file $ledir/$MYSQLD doesn't exist or is not executable" + echo "Please do a cd to the mysql installation directory and restart" + echo "this script from there as follows:" +- echo "./bin/mysqld_safe". ++ echo "./bin/@mybin_mysqld_safe@". + echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more" + echo "information" + exit 1 +@@ -318,8 +318,8 @@ + # the manual for details. + # + # echo "Checking tables in $DATADIR" +-# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check $DATADIR/*/*.MYI +-# $MY_BASEDIR_VERSION/bin/isamchk --silent --force $DATADIR/*/*.ISM ++# $MY_BASEDIR_VERSION/bin/@mybin_myisamchk@ --silent --force --fast --medium-check $DATADIR/*/*.MYI ++# $MY_BASEDIR_VERSION/bin/@mybin_isamchk@ --silent --force $DATADIR/*/*.ISM + + echo "Starting $MYSQLD daemon with databases from $DATADIR" + +diff -Naur -Naur mysql-4.1.16.orig/scripts/mysqldumpslow.sh mysql-4.1.16.new/scripts/mysqldumpslow.sh +--- mysql-4.1.16.orig/scripts/mysqldumpslow.sh 2005-11-30 20:36:35.000000000 +0000 ++++ mysql-4.1.16.new/scripts/mysqldumpslow.sh 2006-01-14 18:32:53.000000000 +0000 +@@ -34,16 +34,16 @@ + $opt{'help'} and usage(); + + unless (@ARGV) { +- my $defaults = `my_print_defaults mysqld`; ++ my $defaults = `@mybin_my_print_defaults@ mysqld`; + my $basedir = ($defaults =~ m/--basedir=(.*)/)[0] +- or die "Can't determine basedir from 'my_print_defaults mysqld' output: $defaults"; ++ or die "Can't determine basedir from '@mybin_my_print_defaults@ mysqld' output: $defaults"; + warn "basedir=$basedir\n" if $opt{v}; + + my $datadir = ($defaults =~ m/--datadir=(.*)/)[0]; + if (!$datadir or $opt{i}) { + # determine the datadir from the instances section of /etc/my.cnf, if any +- my $instances = `my_print_defaults instances`; +- die "Can't determine datadir from 'my_print_defaults mysqld' output: $defaults" ++ my $instances = `@mybin_my_print_defaults@ instances`; ++ die "Can't determine datadir from '@mybin_my_print_defaults@ mysqld' output: $defaults" + unless $instances; + my @instances = ($instances =~ m/^--(\w+)-/mg); + die "No -i 'instance_name' specified to select among known instances: @instances.\n" +@@ -51,7 +51,7 @@ + die "Instance '$opt{i}' is unknown (known instances: @instances)\n" + unless grep { $_ eq $opt{i} } @instances; + $datadir = ($instances =~ m/--$opt{i}-datadir=(.*)/)[0] +- or die "Can't determine --$opt{i}-datadir from 'my_print_defaults instances' output: $instances"; ++ or die "Can't determine --$opt{i}-datadir from '@mybin_my_print_defaults@ instances' output: $instances"; + warn "datadir=$datadir\n" if $opt{v}; + } + diff --git a/080_all_slot_script-4.1.23.patch b/080_all_slot_script-4.1.23.patch new file mode 100644 index 0000000..fbdb051 --- /dev/null +++ b/080_all_slot_script-4.1.23.patch @@ -0,0 +1,545 @@ +diff -Naur mysql-4.1.23-bk-20070101.orig/scripts/Makefile.am mysql-4.1.23-bk-20070101/scripts/Makefile.am +--- mysql-4.1.23-bk-20070101.orig/scripts/Makefile.am 2007-01-01 20:44:41.000000000 +0100 ++++ mysql-4.1.23-bk-20070101/scripts/Makefile.am 2007-01-03 00:14:16.000000000 +0100 +@@ -66,6 +66,32 @@ + mysqlaccess.conf \ + mysqlbug + ++sql_libexec_REPLACE = mysqld ++instance_manager_libexec_REPLACE= mysqlmanager ++client_bin_REPLACE = mysql mysqladmin mysqlcheck mysqlshow \ ++ mysqldump mysqlimport mysqltest mysqlbinlog \ ++ mysqltestmanagerc mysqltestmanager-pwgen ++extra_bin_REPLACE = replace comp_err perror resolveip my_print_defaults \ ++ resolve_stack_dump mysql_waitpid innochecksum ++myisam_bin_REPLACE = myisamchk myisamlog myisampack myisam_ftdump ++tools_bin_REPLACE = mysqltestmanager ++cw_cpcd_ndbbin_REPLACE = ndb_cpcd ++kernel_ndbbin_REPLACE = ndbd ++mgmsrv_ndbbin_REPLACE = ndb_mgmd ++sql_bin_REPLACE = mysql_tzinfo_to_sql ++tests_bin_REPLACE = mysql_client_test ++ndbtools_bin_REPLACE = ndb_test_platform ndb_waiter \ ++ ndb_drop_table ndb_delete_all \ ++ ndb_desc ndb_drop_index \ ++ ndb_show_tables ndb_select_all \ ++ ndb_select_count ndb_restore ndb_config ++EXTRA_REPLACE_BIN = safe_mysqld mysqlanalyze mysqloptimize mysqlrepair mysqld-max isamchk \ ++ $(sql_libexec_REPLACE) $(ndbtools_bin_REPLACE) \ ++ $(instance_manager_libexec_REPLACE) $(client_bin_REPLACE) \ ++ $(extra_bin_REPLACE) $(myisam_bin_REPLACE) $(tools_bin_REPLACE) \ ++ $(cw_cpcd_ndbbin_REPLACE) $(kernel_ndbbin_REPLACE) $(mgmsrv_ndbbin_REPLACE) \ ++ $(sql_bin_REPLACE) $(tests_bin_REPLACE) ++ + dist_pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql + + # mysqlbug should be distributed built so that people can report build +@@ -100,8 +126,17 @@ + + .sh: + @RM@ -f $@ $@-t ++ bin_REPLACE='';\ ++ list='$(EXTRA_SCRIPTS) $(EXTRA_REPLACE_BIN)'; \ ++ for p in $${list}; do \ ++ f1=$${p/\.sh}; \ ++ f2=`echo "$${p}" | @SED@ -e 's|\.sh$$||' -e 's|^.*/||;$(transform)'`; \ ++ bin_REPLACE="$${bin_REPLACE}s!@mybin_$${f1}@!$${f2}!g;";\ ++ done; \ + @SED@ \ ++ -e "$${bin_REPLACE}" \ + -e 's!@''bindir''@!$(bindir)!g' \ ++ -e 's!@''sharedstatedir''@!$(sharedstatedir)!g' \ + -e 's!@''sbindir''@!$(sbindir)!g' \ + -e 's!@''scriptdir''@!$(bindir)!g' \ + -e 's!@''prefix''@!$(prefix)!g' \ +diff -Naur mysql-4.1.23-bk-20070101.orig/scripts/msql2mysql.sh mysql-4.1.23-bk-20070101/scripts/msql2mysql.sh +--- mysql-4.1.23-bk-20070101.orig/scripts/msql2mysql.sh 2007-01-01 20:44:41.000000000 +0100 ++++ mysql-4.1.23-bk-20070101/scripts/msql2mysql.sh 2007-01-03 00:14:16.000000000 +0100 +@@ -13,4 +13,4 @@ + # described in the License. Among other things, the License requires that + # the copyright notice and this notice be preserved on all copies. + +-@bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* ++@bindir@/@mybin_replace@ msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* +diff -Naur mysql-4.1.23-bk-20070101.orig/scripts/mysql_config.sh mysql-4.1.23-bk-20070101/scripts/mysql_config.sh +--- mysql-4.1.23-bk-20070101.orig/scripts/mysql_config.sh 2007-01-01 20:44:41.000000000 +0100 ++++ mysql-4.1.23-bk-20070101/scripts/mysql_config.sh 2007-01-03 00:14:16.000000000 +0100 +@@ -77,7 +77,7 @@ + + me=`get_full_path $0` + +-basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` ++basedir=`echo $me | sed -e 's;/bin/@mybin_mysql_config@;;'` + + ldata='@localstatedir@' + execdir='@libexecdir@' +diff -Naur mysql-4.1.23-bk-20070101.orig/scripts/mysql_create_system_tables.sh mysql-4.1.23-bk-20070101/scripts/mysql_create_system_tables.sh +--- mysql-4.1.23-bk-20070101.orig/scripts/mysql_create_system_tables.sh 2007-01-01 20:44:41.000000000 +0100 ++++ mysql-4.1.23-bk-20070101/scripts/mysql_create_system_tables.sh 2007-01-03 00:14:16.000000000 +0100 +@@ -19,7 +19,7 @@ + new context from the manual (from fill_help_tables.sql). + + Usage: +- mysql_create_system_tables [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> ++ @mybin_mysql_create_system_tables@ [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> + " + exit + fi +diff -Naur mysql-4.1.23-bk-20070101.orig/scripts/mysql_fix_privilege_tables.sh mysql-4.1.23-bk-20070101/scripts/mysql_fix_privilege_tables.sh +--- mysql-4.1.23-bk-20070101.orig/scripts/mysql_fix_privilege_tables.sh 2007-01-01 20:44:41.000000000 +0100 ++++ mysql-4.1.23-bk-20070101/scripts/mysql_fix_privilege_tables.sh 2007-01-03 00:19:37.000000000 +0100 +@@ -76,17 +76,17 @@ + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments + +-print_defaults=my_print_defaults ++print_defaults=@mybin_my_print_defaults@ + for dir in ./bin @bindir@ @bindir@ extra $print_defaults_bindir/../bin $print_defaults_bindir/../extra + do +- if test -x $dir/my_print_defaults ++ if test -x $dir/@mybin_my_print_defaults@ + then +- print_defaults="$dir/my_print_defaults" ++ print_defaults="$dir/@mybin_my_print_defaults@" + break + fi + done + +-parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables` ++parse_arguments `$print_defaults $defaults @mybin_mysql_install_db@ @mybin_mysql_fix_privilege_tables@` + parse_arguments PICK-ARGS-FROM-ARGV "$@" + + if test -z "$basedir" +@@ -103,10 +103,10 @@ + then + bindir="$basedir/bin" + fi +- if test -x "$basedir/libexec/mysqld" ++ if test -x "$basedir/libexec/@mybin_mysqld@" + then + execdir="$basedir/libexec" +- elif test -x "@libexecdir@/mysqld" ++ elif test -x "@libexecdir@/@mybin_mysqld@" + then + execdir="@libexecdir@" + else +@@ -119,7 +119,7 @@ + password=$old_style_password + fi + +-cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" ++cmd="$bindir/@mybin_mysql@ --no-defaults --force --user=$user --host=$host" + if test ! -z "$port"; then + cmd="$cmd --port=$port" + fi +@@ -134,7 +134,7 @@ + fi + + # Find where first mysql_fix_privilege_tables.sql is located +-for i in $basedir/support-files $basedir/share $basedir/share/mysql \ ++for i in @sharedstatedir@ $basedir/support-files $basedir/share $basedir/share/mysql \ + $basedir/scripts @pkgdatadir@ . ./scripts + do + if test -f $i/$file +diff -Naur mysql-4.1.23-bk-20070101.orig/scripts/mysql_install_db.sh mysql-4.1.23-bk-20070101/scripts/mysql_install_db.sh +--- mysql-4.1.23-bk-20070101.orig/scripts/mysql_install_db.sh 2007-01-01 20:44:41.000000000 +0100 ++++ mysql-4.1.23-bk-20070101/scripts/mysql_install_db.sh 2007-01-03 00:14:16.000000000 +0100 +@@ -57,20 +57,20 @@ + + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x ./extra/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "./extra/@mybin_my_print_defaults@" + then +- print_defaults="./extra/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./extra/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + args= +@@ -94,10 +94,10 @@ + pkgdatadir=@pkgdatadir@ + else + bindir="$basedir/bin" +- if test -x "$basedir/libexec/mysqld" ++ if test -x "$basedir/libexec/@mybin_mysqld@" + then + execdir="$basedir/libexec" +- elif test -x "$basedir/sbin/mysqld" ++ elif test -x "$basedir/sbin/@mybin_mysqld@" + then + execdir="$basedir/sbin" + else +@@ -106,7 +106,7 @@ + fi + + # find fill_help_tables.sh +-for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ ++for i in @sharedstatedir@ $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ + do + if test -f $i/fill_help_tables.sql + then +@@ -123,13 +123,13 @@ + fi + + mdata=$ldata/mysql +-mysqld=$execdir/mysqld ++mysqld=$execdir/@mybin_mysqld@ + mysqld_opt="" + scriptdir=$bindir + + if test "$windows" = 1 + then +- mysqld="./sql/mysqld" ++ mysqld="./sql/@mybin_mysqld@" + mysqld_opt="--language=./sql/share/english" + scriptdir="./scripts" + fi +@@ -153,14 +153,14 @@ + # Check if hostname is valid + if test "$windows" = 0 -a "$in_rpm" = 0 -a $force = 0 + then +- resolved=`$bindir/resolveip $hostname 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ $hostname 2>&1` + if [ $? -ne 0 ] + then +- resolved=`$bindir/resolveip localhost 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ localhost 2>&1` + if [ $? -ne 0 ] + then + echo "Neither host '$hostname' nor 'localhost' could be looked up with" +- echo "$bindir/resolveip" ++ echo "$bindir/@mybin_resolveip@" + echo "Please configure the 'hostname' command to return a correct hostname." + echo "If you want to solve this at a later stage, restart this script with" + echo "the --force option" +@@ -168,7 +168,7 @@ + fi + echo "WARNING: The host '$hostname' could not be looked up with resolveip." + echo "This probably means that your libc libraries are not 100 % compatible" +- echo "with this binary MySQL version. The MySQL daemon, mysqld, should work" ++ echo "with this binary MySQL version. The MySQL daemon, @mybin_mysqld@, should work" + echo "normally with the exception that host name resolving will not work." + echo "This means that you should use IP addresses instead of hostnames" + echo "when specifying MySQL privileges !" +@@ -213,7 +213,7 @@ + mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ + --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ + --skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" +-if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ ++if $scriptdir/@mybin_mysql_create_system_tables@ $create_option $mdata $hostname $windows \ + | eval "$mysqld_install_cmd_line" + then + if test -n "$fill_help_tables" +@@ -243,8 +243,8 @@ + then + echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" + echo "To do so, start the server, then issue the following commands:" +- echo "$bindir/mysqladmin -u root password 'new-password'" +- echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root -h $hostname password 'new-password'" + echo "See the manual for more instructions." + # + # Print message about upgrading unless we have created a new db table. +@@ -252,14 +252,14 @@ + then + echo + echo "NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run" +- echo "the $bindir/mysql_fix_privilege_tables. Otherwise you will not be" ++ echo "the $bindir/@mybin_mysql_fix_privilege_tables@. Otherwise you will not be" + echo "able to use the new GRANT command!" + fi + echo + if test "$in_rpm" = "0" + then + echo "You can start the MySQL daemon with:" +- echo "cd @prefix@ ; $bindir/mysqld_safe &" ++ echo "cd @prefix@ ; $bindir/@mybin_mysqld_safe@ &" + echo + echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:" + echo "cd sql-bench ; perl run-all-tests" +@@ -279,13 +279,13 @@ + echo "You can also try to start the mysqld daemon with:" + echo "$mysqld --skip-grant &" + echo "You can use the command line tool" +- echo "$bindir/mysql to connect to the mysql" ++ echo "$bindir/@mybin_mysql@ to connect to the mysql" + echo "database and look at the grant tables:" + echo +- echo "shell> $bindir/mysql -u root mysql" ++ echo "shell> $bindir/@mybin_mysql@ -u root mysql" + echo "mysql> show tables" + echo +- echo "Try 'mysqld --help' if you have problems with paths. Using --log" ++ echo "Try '@mybin_mysqld@ --help' if you have problems with paths. Using --log" + echo "gives you a log in $ldata that may be helpful." + echo + echo "The latest information about MySQL is available on the web at" +@@ -294,6 +294,6 @@ + echo "and the manual section that describes problems on your OS." + echo "Another information source is the MySQL email archive." + echo "Please check all of the above before mailing us!" +- echo "And if you do mail us, you MUST use the @scriptdir@/mysqlbug script!" ++ echo "And if you do mail us, you MUST use the @scriptdir@/@mybin_mysqlbug@ script!" + exit 1 + fi +diff -Naur mysql-4.1.23-bk-20070101.orig/scripts/mysql_secure_installation.sh mysql-4.1.23-bk-20070101/scripts/mysql_secure_installation.sh +--- mysql-4.1.23-bk-20070101.orig/scripts/mysql_secure_installation.sh 2007-01-01 20:44:41.000000000 +0100 ++++ mysql-4.1.23-bk-20070101/scripts/mysql_secure_installation.sh 2007-01-03 00:14:16.000000000 +0100 +@@ -30,7 +30,7 @@ + + do_query() { + echo $1 >$command +- mysql --defaults-file=$config <$command ++ @mybin_mysql@ --defaults-file=$config <$command + return $? + } + +diff -Naur mysql-4.1.23-bk-20070101.orig/scripts/mysqlaccess.sh mysql-4.1.23-bk-20070101/scripts/mysqlaccess.sh +--- mysql-4.1.23-bk-20070101.orig/scripts/mysqlaccess.sh 2007-01-01 20:44:41.000000000 +0100 ++++ mysql-4.1.23-bk-20070101/scripts/mysqlaccess.sh 2007-01-03 00:14:16.000000000 +0100 +@@ -17,7 +17,7 @@ + + # **************************** + # information on MySQL +- $MYSQL = '@bindir@/mysql'; # path to mysql executable ++ $MYSQL = '@bindir@/@mybin_mysql@'; # path to mysql executable + $SERVER = '3.21'; + $MYSQL_OPT = ' --batch --unbuffered'; + $ACCESS_DB = 'mysql'; # name of DB with grant-tables +@@ -32,7 +32,7 @@ + $ACCESS_U_BCK = 'user_backup'; + $ACCESS_D_BCK = 'db_backup'; + $DIFF = '/usr/bin/diff'; +- $MYSQLDUMP = '@bindir@/mysqldump'; ++ $MYSQLDUMP = '@bindir@/@mybin_mysqldump@'; + #path to mysqldump executable + + $MYSQLADMIN= 'http://foobar.com/MySQLadmin'; +diff -Naur mysql-4.1.23-bk-20070101.orig/scripts/mysqld_multi.sh mysql-4.1.23-bk-20070101/scripts/mysqld_multi.sh +--- mysql-4.1.23-bk-20070101.orig/scripts/mysqld_multi.sh 2007-01-01 20:44:41.000000000 +0100 ++++ mysql-4.1.23-bk-20070101/scripts/mysqld_multi.sh 2007-01-03 00:14:16.000000000 +0100 +@@ -10,8 +10,8 @@ + $opt_example = 0; + $opt_help = 0; + $opt_log = undef(); +-$opt_mysqladmin = "@bindir@/mysqladmin"; +-$opt_mysqld = "@libexecdir@/mysqld"; ++$opt_mysqladmin = "@bindir@/@mybin_mysqladmin@"; ++$opt_mysqld = "@libexecdir@/@mybin_mysqld@"; + $opt_no_log = 0; + $opt_password = undef(); + $opt_tcp_ip = 0; +@@ -39,11 +39,11 @@ + { + my ($flag_exit); + +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { + # We can't throw out yet, since --version, --help, or --example may + # have been given +- print "WARNING! my_print_defaults command not found!\n"; ++ print "WARNING! @mybin_my_print_defaults@ command not found!\n"; + print "Please make sure you have this command available and\n"; + print "in your path. The command is available from the latest\n"; + print "MySQL distribution.\n"; +@@ -69,9 +69,9 @@ + } + } + } +- my $com= "my_print_defaults "; ++ my $com= "@mybin_my_print_defaults@ "; + $com.= "--config-file=$opt_config_file " if (defined($opt_config_file)); +- $com.= "mysqld_multi"; ++ $com.= "@mybin_mysqld_multi@"; + my @defops = `$com`; + chop @defops; + splice @ARGV, 0, 0, @defops; +@@ -101,9 +101,9 @@ + print "Error with an option, see $my_progname --help for more info!\n"; + exit(1); + } +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { +- print "ABORT: Can't find command 'my_print_defaults'!\n"; ++ print "ABORT: Can't find command '@mybin_my_print_defaults@'!\n"; + print "This command is available from the latest MySQL\n"; + print "distribution. Please make sure you have the command\n"; + print "in your PATH.\n"; +@@ -165,7 +165,7 @@ + { + if ($my_print_defaults_exists) + { +- @mysqld_opts= `my_print_defaults mysqld`; ++ @mysqld_opts= `@mybin_my_print_defaults@ mysqld`; + chomp @mysqld_opts; + foreach my $opt (@mysqld_opts) + { +@@ -266,7 +266,7 @@ + @groups = &find_groups($groupids); + for ($i = 0; defined($groups[$i]); $i++) + { +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +@@ -295,7 +295,7 @@ + $tmp.= " '$options[$j]'"; + } + } +- if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent) ++ if ($opt_verbose && $com =~ m/\/@mybin_safe_mysqld@$/ && !$info_sent) + { + print "WARNING: safe_mysqld is being used to start mysqld. In this case you "; + print "may need to pass\n\"ledir=...\" under groups [mysqldN] to "; +@@ -366,7 +366,7 @@ + my ($i, @groups)= @_; + my ($mysqladmin_found, $com, $tmp, $j); + +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +diff -Naur mysql-4.1.23-bk-20070101.orig/scripts/mysqld_safe.sh mysql-4.1.23-bk-20070101/scripts/mysqld_safe.sh +--- mysql-4.1.23-bk-20070101.orig/scripts/mysqld_safe.sh 2007-01-01 20:44:41.000000000 +0100 ++++ mysql-4.1.23-bk-20070101/scripts/mysqld_safe.sh 2007-01-03 00:14:16.000000000 +0100 +@@ -93,7 +93,7 @@ + then + MYSQLD="mysqld-$tmp" + else +- MYSQLD="mysqld" ++ MYSQLD="@mybin_mysqld@" + fi + ;; + --nice=*) niceness=`echo "$arg" | sed -e "s;--nice=;;"` ;; +@@ -119,13 +119,13 @@ + + MY_PWD=`pwd` + # Check for the directories we would expect from a binary release install +-if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld ++if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are + ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is + # Check for the directories we would expect from a source install + elif test -f ./share/mysql/english/errmsg.sys -a \ +- -x ./libexec/mysqld ++ -x ./libexec/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are + ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is +@@ -165,17 +165,17 @@ + + # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] + # and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + args= +@@ -200,11 +200,11 @@ + # Use the mysqld-max binary by default if the user doesn't specify a binary + if test -z "$MYSQLD" + then +- if test -x $ledir/mysqld-max ++ if test -x $ledir/@mybin_mysqld-max@ + then +- MYSQLD=mysqld-max ++ MYSQLD=@mybin_mysqld-max@ + else +- MYSQLD=mysqld ++ MYSQLD=@mybin_mysqld@ + fi + fi + +@@ -213,7 +213,7 @@ + echo "The file $ledir/$MYSQLD doesn't exist or is not executable" + echo "Please do a cd to the mysql installation directory and restart" + echo "this script from there as follows:" +- echo "./bin/mysqld_safe". ++ echo "./bin/@mybin_mysqld_safe@". + echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more" + echo "information" + exit 1 +@@ -346,8 +346,8 @@ + # the manual for details. + # + # echo "Checking tables in $DATADIR" +-# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check $DATADIR/*/*.MYI +-# $MY_BASEDIR_VERSION/bin/isamchk --silent --force $DATADIR/*/*.ISM ++# $MY_BASEDIR_VERSION/bin/@mybin_myisamchk@ --silent --force --fast --medium-check $DATADIR/*/*.MYI ++# $MY_BASEDIR_VERSION/bin/@mybin_isamchk@ --silent --force $DATADIR/*/*.ISM + + echo "Starting $MYSQLD daemon with databases from $DATADIR" + +diff -Naur mysql-4.1.23-bk-20070101.orig/scripts/mysqldumpslow.sh mysql-4.1.23-bk-20070101/scripts/mysqldumpslow.sh +--- mysql-4.1.23-bk-20070101.orig/scripts/mysqldumpslow.sh 2007-01-01 20:44:41.000000000 +0100 ++++ mysql-4.1.23-bk-20070101/scripts/mysqldumpslow.sh 2007-01-03 00:14:16.000000000 +0100 +@@ -34,16 +34,16 @@ + $opt{'help'} and usage(); + + unless (@ARGV) { +- my $defaults = `my_print_defaults mysqld`; ++ my $defaults = `@mybin_my_print_defaults@ mysqld`; + my $basedir = ($defaults =~ m/--basedir=(.*)/)[0] +- or die "Can't determine basedir from 'my_print_defaults mysqld' output: $defaults"; ++ or die "Can't determine basedir from '@mybin_my_print_defaults@ mysqld' output: $defaults"; + warn "basedir=$basedir\n" if $opt{v}; + + my $datadir = ($defaults =~ m/--datadir=(.*)/)[0]; + if (!$datadir or $opt{i}) { + # determine the datadir from the instances section of /etc/my.cnf, if any +- my $instances = `my_print_defaults instances`; +- die "Can't determine datadir from 'my_print_defaults mysqld' output: $defaults" ++ my $instances = `@mybin_my_print_defaults@ instances`; ++ die "Can't determine datadir from '@mybin_my_print_defaults@ mysqld' output: $defaults" + unless $instances; + my @instances = ($instances =~ m/^--(\w+)-/mg); + die "No -i 'instance_name' specified to select among known instances: @instances.\n" +@@ -51,7 +51,7 @@ + die "Instance '$opt{i}' is unknown (known instances: @instances)\n" + unless grep { $_ eq $opt{i} } @instances; + $datadir = ($instances =~ m/--$opt{i}-datadir=(.*)/)[0] +- or die "Can't determine --$opt{i}-datadir from 'my_print_defaults instances' output: $instances"; ++ or die "Can't determine --$opt{i}-datadir from '@mybin_my_print_defaults@ instances' output: $instances"; + warn "datadir=$datadir\n" if $opt{v}; + } + diff --git a/080_all_slot_script-5.0.17.patch b/080_all_slot_script-5.0.17.patch new file mode 100644 index 0000000..ceb858a --- /dev/null +++ b/080_all_slot_script-5.0.17.patch @@ -0,0 +1,542 @@ +diff -Naur -Naur mysql-5.0.18.orig/scripts/Makefile.am mysql-5.0.18.new/scripts/Makefile.am +--- mysql-5.0.18.orig/scripts/Makefile.am 2005-12-21 19:39:51.000000000 +0000 ++++ mysql-5.0.18.new/scripts/Makefile.am 2006-01-15 12:22:57.000000000 +0000 +@@ -66,6 +66,32 @@ + mysqlaccess.conf \ + mysqlbug + ++sql_libexec_REPLACE = mysqld ++instance_manager_libexec_REPLACE= mysqlmanager ++client_bin_REPLACE = mysql mysqladmin mysqlcheck mysqlshow \ ++ mysqldump mysqlimport mysqltest mysqlbinlog \ ++ mysqltestmanagerc mysqltestmanager-pwgen ++extra_bin_REPLACE = replace comp_err perror resolveip my_print_defaults \ ++ resolve_stack_dump mysql_waitpid innochecksum ++myisam_bin_REPLACE = myisamchk myisamlog myisampack myisam_ftdump ++tools_bin_REPLACE = mysqltestmanager ++cw_cpcd_ndbbin_REPLACE = ndb_cpcd ++kernel_ndbbin_REPLACE = ndbd ++mgmsrv_ndbbin_REPLACE = ndb_mgmd ++sql_bin_REPLACE = mysql_tzinfo_to_sql ++tests_bin_REPLACE = mysql_client_test ++ndbtools_bin_REPLACE = ndb_test_platform ndb_waiter \ ++ ndb_drop_table ndb_delete_all \ ++ ndb_desc ndb_drop_index \ ++ ndb_show_tables ndb_select_all \ ++ ndb_select_count ndb_restore ndb_config ++EXTRA_REPLACE_BIN = safe_mysqld mysqlanalyze mysqloptimize mysqlrepair mysqld-max isamchk \ ++ $(sql_libexec_REPLACE) $(ndbtools_bin_REPLACE) \ ++ $(instance_manager_libexec_REPLACE) $(client_bin_REPLACE) \ ++ $(extra_bin_REPLACE) $(myisam_bin_REPLACE) $(tools_bin_REPLACE) \ ++ $(cw_cpcd_ndbbin_REPLACE) $(kernel_ndbbin_REPLACE) $(mgmsrv_ndbbin_REPLACE) \ ++ $(sql_bin_REPLACE) $(tests_bin_REPLACE) ++ + dist_pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql + + # mysqlbug should be distributed built so that people can report build +@@ -100,8 +126,17 @@ + + .sh: + @RM@ -f $@ $@-t ++ bin_REPLACE='';\ ++ list='$(EXTRA_SCRIPTS) $(EXTRA_REPLACE_BIN)'; \ ++ for p in $${list}; do \ ++ f1=$${p/\.sh}; \ ++ f2=`echo "$${p}" | @SED@ -e 's|\.sh$$||' -e 's|^.*/||;$(transform)'`; \ ++ bin_REPLACE="$${bin_REPLACE}s!@mybin_$${f1}@!$${f2}!g;";\ ++ done; \ + @SED@ \ ++ -e "$${bin_REPLACE}" \ + -e 's!@''bindir''@!$(bindir)!g' \ ++ -e 's!@''sharedstatedir''@!$(sharedstatedir)!g' \ + -e 's!@''sbindir''@!$(sbindir)!g' \ + -e 's!@''scriptdir''@!$(bindir)!g' \ + -e 's!@''prefix''@!$(prefix)!g' \ +diff -Naur -Naur mysql-5.0.18.orig/scripts/msql2mysql.sh mysql-5.0.18.new/scripts/msql2mysql.sh +--- mysql-5.0.18.orig/scripts/msql2mysql.sh 2005-12-21 19:40:02.000000000 +0000 ++++ mysql-5.0.18.new/scripts/msql2mysql.sh 2006-01-15 12:22:57.000000000 +0000 +@@ -13,4 +13,4 @@ + # described in the License. Among other things, the License requires that + # the copyright notice and this notice be preserved on all copies. + +-@bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* ++@bindir@/@mybin_replace@ msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* +diff -Naur -Naur mysql-5.0.18.orig/scripts/mysql_config.sh mysql-5.0.18.new/scripts/mysql_config.sh +--- mysql-5.0.18.orig/scripts/mysql_config.sh 2005-12-21 19:39:36.000000000 +0000 ++++ mysql-5.0.18.new/scripts/mysql_config.sh 2006-01-15 12:43:37.000000000 +0000 +@@ -77,15 +77,15 @@ + + me=`get_full_path $0` + +-basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` ++basedir=`echo $me | sed -e 's;/bin/@mybin_mysql_config@;;'` + + ldata='@localstatedir@' + execdir='@libexecdir@' + bindir='@bindir@' + pkglibdir='@pkglibdir@' +-fix_path pkglibdir lib/mysql lib ++fix_path pkglibdir "lib${pkglibdir##*lib}" lib/mysql lib + pkgincludedir='@pkgincludedir@' +-fix_path pkgincludedir include/mysql include ++fix_path pkgincludedir "include${pkgincludedir##*include}" include/mysql include + version='@VERSION@' + socket='@MYSQL_UNIX_ADDR@' + port='@MYSQL_TCP_PORT@' +diff -Naur -Naur mysql-5.0.18.orig/scripts/mysql_create_system_tables.sh mysql-5.0.18.new/scripts/mysql_create_system_tables.sh +--- mysql-5.0.18.orig/scripts/mysql_create_system_tables.sh 2005-12-21 19:39:52.000000000 +0000 ++++ mysql-5.0.18.new/scripts/mysql_create_system_tables.sh 2006-01-15 12:22:57.000000000 +0000 +@@ -19,7 +19,7 @@ + new context from the manual (from fill_help_tables.sql). + + Usage: +- mysql_create_system_tables [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> ++ @mybin_mysql_create_system_tables@ [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> + " + exit + fi +diff -Naur -Naur mysql-5.0.18.orig/scripts/mysql_fix_privilege_tables.sh mysql-5.0.18.new/scripts/mysql_fix_privilege_tables.sh +--- mysql-5.0.18.orig/scripts/mysql_fix_privilege_tables.sh 2005-12-21 19:39:59.000000000 +0000 ++++ mysql-5.0.18.new/scripts/mysql_fix_privilege_tables.sh 2006-01-15 12:22:57.000000000 +0000 +@@ -77,17 +77,17 @@ + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments + +-print_defaults=my_print_defaults ++print_defaults=@mybin_my_print_defaults@ + for dir in ./bin @bindir@ @bindir@ extra $print_defaults_bindir/../bin $print_defaults_bindir/../extra + do +- if test -x $dir/my_print_defaults ++ if test -x $dir/@mybin_my_print_defaults@ + then +- print_defaults="$dir/my_print_defaults" ++ print_defaults="$dir/@mybin_my_print_defaults@" + break + fi + done + +-parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables` ++parse_arguments `$print_defaults $defaults @mybin_mysql_install_db@ @mybin_mysql_fix_privilege_tables@` + parse_arguments PICK-ARGS-FROM-ARGV "$@" + + if test -z "$password" +@@ -118,7 +118,7 @@ + exit 1 + fi + +-cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" ++cmd="$bindir/@mybin_mysql@ --no-defaults --force --user=$user --host=$host" + if test ! -z "$password" ; then + cmd="$cmd --password=$password" + fi +@@ -136,7 +136,7 @@ + fi + + # Find where first mysql_fix_privilege_tables.sql is located +-for i in $basedir/support-files $basedir/share $basedir/share/mysql \ ++for i in @sharedstatedir@ $basedir/support-files $basedir/share $basedir/share/mysql \ + $basedir/scripts $pkgdatadir . "$dirname" + do + if test -f $i/$file +diff -Naur -Naur mysql-5.0.18.orig/scripts/mysql_install_db.sh mysql-5.0.18.new/scripts/mysql_install_db.sh +--- mysql-5.0.18.orig/scripts/mysql_install_db.sh 2005-12-21 19:39:42.000000000 +0000 ++++ mysql-5.0.18.new/scripts/mysql_install_db.sh 2006-01-15 12:22:57.000000000 +0000 +@@ -57,20 +57,20 @@ + + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x ./extra/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "./extra/@mybin_my_print_defaults@" + then +- print_defaults="./extra/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./extra/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + args= +@@ -94,10 +94,10 @@ + pkgdatadir=@pkgdatadir@ + else + bindir="$basedir/bin" +- if test -x "$basedir/libexec/mysqld" ++ if test -x "$basedir/libexec/@mybin_mysqld@" + then + execdir="$basedir/libexec" +- elif test -x "$basedir/sbin/mysqld" ++ elif test -x "$basedir/sbin/@mybin_mysqld@" + then + execdir="$basedir/sbin" + else +@@ -106,7 +106,7 @@ + fi + + # find fill_help_tables.sh +-for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ ++for i in @sharedstatedir@ $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ + do + if test -f $i/fill_help_tables.sql + then +@@ -123,13 +123,13 @@ + fi + + mdata=$ldata/mysql +-mysqld=$execdir/mysqld ++mysqld=$execdir/@mybin_mysqld@ + mysqld_opt="" + scriptdir=$bindir + + if test "$windows" = 1 + then +- mysqld="./sql/mysqld" ++ mysqld="./sql/@mybin_mysqld@" + mysqld_opt="--language=./sql/share/english" + scriptdir="./scripts" + fi +@@ -153,14 +153,14 @@ + # Check if hostname is valid + if test "$windows" = 0 -a "$in_rpm" = 0 -a $force = 0 + then +- resolved=`$bindir/resolveip $hostname 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ $hostname 2>&1` + if [ $? -ne 0 ] + then +- resolved=`$bindir/resolveip localhost 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ localhost 2>&1` + if [ $? -ne 0 ] + then + echo "Neither host '$hostname' nor 'localhost' could be looked up with" +- echo "$bindir/resolveip" ++ echo "$bindir/@mybin_resolveip@" + echo "Please configure the 'hostname' command to return a correct hostname." + echo "If you want to solve this at a later stage, restart this script with" + echo "the --force option" +@@ -168,7 +168,7 @@ + fi + echo "WARNING: The host '$hostname' could not be looked up with resolveip." + echo "This probably means that your libc libraries are not 100 % compatible" +- echo "with this binary MySQL version. The MySQL daemon, mysqld, should work" ++ echo "with this binary MySQL version. The MySQL daemon, @mybin_mysqld@, should work" + echo "normally with the exception that host name resolving will not work." + echo "This means that you should use IP addresses instead of hostnames" + echo "when specifying MySQL privileges !" +@@ -213,7 +213,7 @@ + mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ + --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ + --skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" +-if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ ++if $scriptdir/@mybin_mysql_create_system_tables@ $create_option $mdata $hostname $windows \ + | eval "$mysqld_install_cmd_line" + then + if test -n "$fill_help_tables" +@@ -243,8 +243,8 @@ + then + echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" + echo "To do so, start the server, then issue the following commands:" +- echo "$bindir/mysqladmin -u root password 'new-password'" +- echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root -h $hostname password 'new-password'" + echo "See the manual for more instructions." + # + # Print message about upgrading unless we have created a new db table. +@@ -252,14 +252,14 @@ + then + echo + echo "NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run" +- echo "the $bindir/mysql_fix_privilege_tables. Otherwise you will not be" ++ echo "the $bindir/@mybin_mysql_fix_privilege_tables@. Otherwise you will not be" + echo "able to use the new GRANT command!" + fi + echo + if test "$in_rpm" = "0" + then + echo "You can start the MySQL daemon with:" +- echo "cd @prefix@ ; $bindir/mysqld_safe &" ++ echo "cd @prefix@ ; $bindir/@mybin_mysqld_safe@ &" + echo + echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:" + echo "cd sql-bench ; perl run-all-tests" +@@ -279,13 +279,13 @@ + echo "You can also try to start the mysqld daemon with:" + echo "$mysqld --skip-grant &" + echo "You can use the command line tool" +- echo "$bindir/mysql to connect to the mysql" ++ echo "$bindir/@mybin_mysql@ to connect to the mysql" + echo "database and look at the grant tables:" + echo +- echo "shell> $bindir/mysql -u root mysql" ++ echo "shell> $bindir/@mybin_mysql@ -u root mysql" + echo "mysql> show tables" + echo +- echo "Try 'mysqld --help' if you have problems with paths. Using --log" ++ echo "Try '@mybin_mysqld@ --help' if you have problems with paths. Using --log" + echo "gives you a log in $ldata that may be helpful." + echo + echo "The latest information about MySQL is available on the web at" +@@ -294,6 +294,6 @@ + echo "and the manual section that describes problems on your OS." + echo "Another information source is the MySQL email archive." + echo "Please check all of the above before mailing us!" +- echo "And if you do mail us, you MUST use the @scriptdir@/mysqlbug script!" ++ echo "And if you do mail us, you MUST use the @scriptdir@/@mybin_mysqlbug@ script!" + exit 1 + fi +diff -Naur -Naur mysql-5.0.18.orig/scripts/mysql_secure_installation.sh mysql-5.0.18.new/scripts/mysql_secure_installation.sh +--- mysql-5.0.18.orig/scripts/mysql_secure_installation.sh 2005-12-21 19:40:02.000000000 +0000 ++++ mysql-5.0.18.new/scripts/mysql_secure_installation.sh 2006-01-15 12:22:57.000000000 +0000 +@@ -30,7 +30,7 @@ + + do_query() { + echo $1 >$command +- mysql --defaults-file=$config <$command ++ @mybin_mysql@ --defaults-file=$config <$command + return $? + } + +diff -Naur -Naur mysql-5.0.18.orig/scripts/mysqlaccess.sh mysql-5.0.18.new/scripts/mysqlaccess.sh +--- mysql-5.0.18.orig/scripts/mysqlaccess.sh 2005-12-21 19:39:32.000000000 +0000 ++++ mysql-5.0.18.new/scripts/mysqlaccess.sh 2006-01-15 12:22:57.000000000 +0000 +@@ -17,7 +17,7 @@ + + # **************************** + # information on MySQL +- $MYSQL = '@bindir@/mysql'; # path to mysql executable ++ $MYSQL = '@bindir@/@mybin_mysql@'; # path to mysql executable + $SERVER = '3.21'; + $MYSQL_OPT = ' --batch --unbuffered'; + $ACCESS_DB = 'mysql'; # name of DB with grant-tables +@@ -32,7 +32,7 @@ + $ACCESS_U_BCK = 'user_backup'; + $ACCESS_D_BCK = 'db_backup'; + $DIFF = '/usr/bin/diff'; +- $MYSQLDUMP = '@bindir@/mysqldump'; ++ $MYSQLDUMP = '@bindir@/@mybin_mysqldump@'; + #path to mysqldump executable + + $MYSQLADMIN= 'http://foobar.com/MySQLadmin'; +diff -Naur -Naur mysql-5.0.18.orig/scripts/mysqld_multi.sh mysql-5.0.18.new/scripts/mysqld_multi.sh +--- mysql-5.0.18.orig/scripts/mysqld_multi.sh 2005-12-21 19:39:55.000000000 +0000 ++++ mysql-5.0.18.new/scripts/mysqld_multi.sh 2006-01-15 12:22:57.000000000 +0000 +@@ -10,8 +10,8 @@ + $opt_example = 0; + $opt_help = 0; + $opt_log = undef(); +-$opt_mysqladmin = "@bindir@/mysqladmin"; +-$opt_mysqld = "@libexecdir@/mysqld"; ++$opt_mysqladmin = "@bindir@/@mybin_mysqladmin@"; ++$opt_mysqld = "@libexecdir@/@mybin_mysqld@"; + $opt_no_log = 0; + $opt_password = undef(); + $opt_tcp_ip = 0; +@@ -39,11 +39,11 @@ + { + my $flag_exit= 0; + +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { + # We can't throw out yet, since --version, --help, or --example may + # have been given +- print "WARNING: my_print_defaults command not found.\n"; ++ print "WARNING: @mybin_my_print_defaults@ command not found.\n"; + print "Please make sure you have this command available and\n"; + print "in your path. The command is available from the latest\n"; + print "MySQL distribution.\n"; +@@ -74,9 +74,9 @@ + } + } + } +- my $com= "my_print_defaults "; ++ my $com= "@mybin_my_print_defaults@ "; + $com.= "--config-file=$opt_config_file " if (defined($opt_config_file)); +- $com.= "mysqld_multi"; ++ $com.= "@mybin_mysqld_multi@"; + my @defops = `$com`; + chop @defops; + splice @ARGV, 0, 0, @defops; +@@ -113,9 +113,9 @@ + print "Error with an option, see $my_progname --help for more info.\n"; + exit(1); + } +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { +- print "ABORT: Can't find command 'my_print_defaults'.\n"; ++ print "ABORT: Can't find command '@mybin_my_print_defaults@'.\n"; + print "This command is available from the latest MySQL\n"; + print "distribution. Please make sure you have the command\n"; + print "in your PATH.\n"; +@@ -202,7 +202,7 @@ + { + if ($my_print_defaults_exists) + { +- @mysqld_opts= `my_print_defaults mysqld`; ++ @mysqld_opts= `@mybin_my_print_defaults@ mysqld`; + chomp @mysqld_opts; + foreach my $opt (@mysqld_opts) + { +@@ -303,7 +303,7 @@ + @groups = &find_groups($groupids); + for ($i = 0; defined($groups[$i]); $i++) + { +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +@@ -330,7 +330,7 @@ + $tmp.= " $options[$j]"; + } + } +- if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent) ++ if ($opt_verbose && $com =~ m/\/@mybin_safe_mysqld@$/ && !$info_sent) + { + print "WARNING: safe_mysqld is being used to start mysqld. In this case you "; + print "may need to pass\n\"ledir=...\" under groups [mysqldN] to "; +@@ -401,7 +401,7 @@ + my ($i, @groups)= @_; + my ($mysqladmin_found, $com, $tmp, $j); + +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +diff -Naur -Naur mysql-5.0.18.orig/scripts/mysqld_safe.sh mysql-5.0.18.new/scripts/mysqld_safe.sh +--- mysql-5.0.18.orig/scripts/mysqld_safe.sh 2005-12-21 19:40:02.000000000 +0000 ++++ mysql-5.0.18.new/scripts/mysqld_safe.sh 2006-01-15 12:22:57.000000000 +0000 +@@ -87,7 +87,7 @@ + then + MYSQLD="mysqld-$tmp" + else +- MYSQLD="mysqld" ++ MYSQLD="@mybin_mysqld@" + fi + ;; + --nice=*) niceness=`echo "$arg" | sed -e "s;--nice=;;"` ;; +@@ -113,13 +113,13 @@ + + MY_PWD=`pwd` + # Check for the directories we would expect from a binary release install +-if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld ++if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are + ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is + # Check for the directories we would expect from a source install + elif test -f ./share/mysql/english/errmsg.sys -a \ +- -x ./libexec/mysqld ++ -x ./libexec/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are + ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is +@@ -181,17 +181,17 @@ + + # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] + # and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + args= +@@ -216,11 +216,11 @@ + # Use the mysqld-max binary by default if the user doesn't specify a binary + if test -z "$MYSQLD" + then +- if test -x $ledir/mysqld-max ++ if test -x $ledir/@mybin_mysqld-max@ + then +- MYSQLD=mysqld-max ++ MYSQLD=@mybin_mysqld-max@ + else +- MYSQLD=mysqld ++ MYSQLD=@mybin_mysqld@ + fi + fi + +@@ -229,7 +229,7 @@ + echo "The file $ledir/$MYSQLD doesn't exist or is not executable" + echo "Please do a cd to the mysql installation directory and restart" + echo "this script from there as follows:" +- echo "./bin/mysqld_safe". ++ echo "./bin/@mybin_mysqld_safe@". + echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more" + echo "information" + exit 1 +@@ -362,8 +362,8 @@ + # the manual for details. + # + # echo "Checking tables in $DATADIR" +-# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check $DATADIR/*/*.MYI +-# $MY_BASEDIR_VERSION/bin/isamchk --silent --force $DATADIR/*/*.ISM ++# $MY_BASEDIR_VERSION/bin/@mybin_myisamchk@ --silent --force --fast --medium-check $DATADIR/*/*.MYI ++# $MY_BASEDIR_VERSION/bin/@mybin_isamchk@ --silent --force $DATADIR/*/*.ISM + + echo "Starting $MYSQLD daemon with databases from $DATADIR" + +diff -Naur -Naur mysql-5.0.18.orig/scripts/mysqldumpslow.sh mysql-5.0.18.new/scripts/mysqldumpslow.sh +--- mysql-5.0.18.orig/scripts/mysqldumpslow.sh 2005-12-21 19:40:05.000000000 +0000 ++++ mysql-5.0.18.new/scripts/mysqldumpslow.sh 2006-01-15 12:22:57.000000000 +0000 +@@ -34,16 +34,16 @@ + $opt{'help'} and usage(); + + unless (@ARGV) { +- my $defaults = `my_print_defaults mysqld`; ++ my $defaults = `@mybin_my_print_defaults@ mysqld`; + my $basedir = ($defaults =~ m/--basedir=(.*)/)[0] +- or die "Can't determine basedir from 'my_print_defaults mysqld' output: $defaults"; ++ or die "Can't determine basedir from '@mybin_my_print_defaults@ mysqld' output: $defaults"; + warn "basedir=$basedir\n" if $opt{v}; + + my $datadir = ($defaults =~ m/--datadir=(.*)/)[0]; + if (!$datadir or $opt{i}) { + # determine the datadir from the instances section of /etc/my.cnf, if any +- my $instances = `my_print_defaults instances`; +- die "Can't determine datadir from 'my_print_defaults mysqld' output: $defaults" ++ my $instances = `@mybin_my_print_defaults@ instances`; ++ die "Can't determine datadir from '@mybin_my_print_defaults@ mysqld' output: $defaults" + unless $instances; + my @instances = ($instances =~ m/^--(\w+)-/mg); + die "No -i 'instance_name' specified to select among known instances: @instances.\n" +@@ -51,7 +51,7 @@ + die "Instance '$opt{i}' is unknown (known instances: @instances)\n" + unless grep { $_ eq $opt{i} } @instances; + $datadir = ($instances =~ m/--$opt{i}-datadir=(.*)/)[0] +- or die "Can't determine --$opt{i}-datadir from 'my_print_defaults instances' output: $instances"; ++ or die "Can't determine --$opt{i}-datadir from '@mybin_my_print_defaults@ instances' output: $instances"; + warn "datadir=$datadir\n" if $opt{v}; + } + diff --git a/080_all_slot_script-5.0.21.patch b/080_all_slot_script-5.0.21.patch new file mode 100644 index 0000000..8122f6f --- /dev/null +++ b/080_all_slot_script-5.0.21.patch @@ -0,0 +1,545 @@ +diff -Naur mysql-5.0.21-nightly-20060410.a/scripts/Makefile.am mysql-5.0.21-nightly-20060410.b/scripts/Makefile.am +--- mysql-5.0.21-nightly-20060410.a/scripts/Makefile.am 2006-04-10 04:02:46.000000000 +0000 ++++ mysql-5.0.21-nightly-20060410.b/scripts/Makefile.am 2006-04-12 16:16:09.000000000 +0000 +@@ -68,6 +68,32 @@ + mysqlaccess.conf \ + mysqlbug + ++sql_libexec_REPLACE = mysqld ++instance_manager_libexec_REPLACE= mysqlmanager ++client_bin_REPLACE = mysql mysqladmin mysqlcheck mysqlshow \ ++ mysqldump mysqlimport mysqltest mysqlbinlog \ ++ mysqltestmanagerc mysqltestmanager-pwgen ++extra_bin_REPLACE = replace comp_err perror resolveip my_print_defaults \ ++ resolve_stack_dump mysql_waitpid innochecksum ++myisam_bin_REPLACE = myisamchk myisamlog myisampack myisam_ftdump ++tools_bin_REPLACE = mysqltestmanager ++cw_cpcd_ndbbin_REPLACE = ndb_cpcd ++kernel_ndbbin_REPLACE = ndbd ++mgmsrv_ndbbin_REPLACE = ndb_mgmd ++sql_bin_REPLACE = mysql_tzinfo_to_sql ++tests_bin_REPLACE = mysql_client_test ++ndbtools_bin_REPLACE = ndb_test_platform ndb_waiter \ ++ ndb_drop_table ndb_delete_all \ ++ ndb_desc ndb_drop_index \ ++ ndb_show_tables ndb_select_all \ ++ ndb_select_count ndb_restore ndb_config ++EXTRA_REPLACE_BIN = safe_mysqld mysqlanalyze mysqloptimize mysqlrepair mysqld-max isamchk \ ++ $(sql_libexec_REPLACE) $(ndbtools_bin_REPLACE) \ ++ $(instance_manager_libexec_REPLACE) $(client_bin_REPLACE) \ ++ $(extra_bin_REPLACE) $(myisam_bin_REPLACE) $(tools_bin_REPLACE) \ ++ $(cw_cpcd_ndbbin_REPLACE) $(kernel_ndbbin_REPLACE) $(mgmsrv_ndbbin_REPLACE) \ ++ $(sql_bin_REPLACE) $(tests_bin_REPLACE) ++ + dist_pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql + + # mysqlbug should be distributed built so that people can report build +@@ -103,8 +129,17 @@ + + .sh: + @RM@ -f $@ $@-t ++ bin_REPLACE='';\ ++ list='$(EXTRA_SCRIPTS) $(EXTRA_REPLACE_BIN)'; \ ++ for p in $${list}; do \ ++ f1=$${p/\.sh}; \ ++ f2=`echo "$${p}" | @SED@ -e 's|\.sh$$||' -e 's|^.*/||;$(transform)'`; \ ++ bin_REPLACE="$${bin_REPLACE}s!@mybin_$${f1}@!$${f2}!g;";\ ++ done; \ + @SED@ \ ++ -e "$${bin_REPLACE}" \ + -e 's!@''bindir''@!$(bindir)!g' \ ++ -e 's!@''sharedstatedir''@!$(sharedstatedir)!g' \ + -e 's!@''sbindir''@!$(sbindir)!g' \ + -e 's!@''scriptdir''@!$(bindir)!g' \ + -e 's!@''prefix''@!$(prefix)!g' \ +diff -Naur mysql-5.0.21-nightly-20060410.a/scripts/msql2mysql.sh mysql-5.0.21-nightly-20060410.b/scripts/msql2mysql.sh +--- mysql-5.0.21-nightly-20060410.a/scripts/msql2mysql.sh 2006-04-10 04:02:50.000000000 +0000 ++++ mysql-5.0.21-nightly-20060410.b/scripts/msql2mysql.sh 2006-04-12 16:16:09.000000000 +0000 +@@ -13,4 +13,4 @@ + # described in the License. Among other things, the License requires that + # the copyright notice and this notice be preserved on all copies. + +-@bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* ++@bindir@/@mybin_replace@ msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* +diff -Naur mysql-5.0.21-nightly-20060410.a/scripts/mysqlaccess.sh mysql-5.0.21-nightly-20060410.b/scripts/mysqlaccess.sh +--- mysql-5.0.21-nightly-20060410.a/scripts/mysqlaccess.sh 2006-04-10 04:02:43.000000000 +0000 ++++ mysql-5.0.21-nightly-20060410.b/scripts/mysqlaccess.sh 2006-04-12 16:16:09.000000000 +0000 +@@ -17,7 +17,7 @@ + + # **************************** + # information on MySQL +- $MYSQL = '@bindir@/mysql'; # path to mysql executable ++ $MYSQL = '@bindir@/@mybin_mysql@'; # path to mysql executable + $SERVER = '3.21'; + $MYSQL_OPT = ' --batch --unbuffered'; + $ACCESS_DB = 'mysql'; # name of DB with grant-tables +@@ -32,7 +32,7 @@ + $ACCESS_U_BCK = 'user_backup'; + $ACCESS_D_BCK = 'db_backup'; + $DIFF = '/usr/bin/diff'; +- $MYSQLDUMP = '@bindir@/mysqldump'; ++ $MYSQLDUMP = '@bindir@/@mybin_mysqldump@'; + #path to mysqldump executable + + $MYSQLADMIN= 'http://foobar.com/MySQLadmin'; +diff -Naur mysql-5.0.21-nightly-20060410.a/scripts/mysql_config.sh mysql-5.0.21-nightly-20060410.b/scripts/mysql_config.sh +--- mysql-5.0.21-nightly-20060410.a/scripts/mysql_config.sh 2006-04-10 04:02:44.000000000 +0000 ++++ mysql-5.0.21-nightly-20060410.b/scripts/mysql_config.sh 2006-04-12 16:19:06.000000000 +0000 +@@ -77,7 +77,7 @@ + + me=`get_full_path $0` + +-basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` ++basedir=`echo $me | sed -e 's;/bin/@mybin_mysql_config@;;'` + + ldata='@localstatedir@' + execdir='@libexecdir@' +@@ -86,10 +86,10 @@ + # If installed, search for the compiled in directory first (might be "lib64") + pkglibdir='@pkglibdir@' + pkglibdir_rel=`echo $pkglibdir | sed -e "s;^$basedir/;;"` +-fix_path pkglibdir $pkglibdir_rel lib/mysql lib ++fix_path pkglibdir $pkglibdir_rel "lib${pkglibdir##*lib}" lib/mysql lib + + pkgincludedir='@pkgincludedir@' +-fix_path pkgincludedir include/mysql include ++fix_path pkgincludedir "include${pkgincludedir##*include}" include/mysql include + + version='@VERSION@' + socket='@MYSQL_UNIX_ADDR@' +diff -Naur mysql-5.0.21-nightly-20060410.a/scripts/mysql_create_system_tables.sh mysql-5.0.21-nightly-20060410.b/scripts/mysql_create_system_tables.sh +--- mysql-5.0.21-nightly-20060410.a/scripts/mysql_create_system_tables.sh 2006-04-10 04:02:46.000000000 +0000 ++++ mysql-5.0.21-nightly-20060410.b/scripts/mysql_create_system_tables.sh 2006-04-12 16:16:09.000000000 +0000 +@@ -19,7 +19,7 @@ + new context from the manual (from fill_help_tables.sql). + + Usage: +- mysql_create_system_tables [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> ++ @mybin_mysql_create_system_tables@ [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> + " + exit + fi +diff -Naur mysql-5.0.21-nightly-20060410.a/scripts/mysqld_multi.sh mysql-5.0.21-nightly-20060410.b/scripts/mysqld_multi.sh +--- mysql-5.0.21-nightly-20060410.a/scripts/mysqld_multi.sh 2006-04-10 04:02:48.000000000 +0000 ++++ mysql-5.0.21-nightly-20060410.b/scripts/mysqld_multi.sh 2006-04-12 16:16:09.000000000 +0000 +@@ -10,8 +10,8 @@ + $opt_example = 0; + $opt_help = 0; + $opt_log = undef(); +-$opt_mysqladmin = "@bindir@/mysqladmin"; +-$opt_mysqld = "@libexecdir@/mysqld"; ++$opt_mysqladmin = "@bindir@/@mybin_mysqladmin@"; ++$opt_mysqld = "@libexecdir@/@mybin_mysqld@"; + $opt_no_log = 0; + $opt_password = undef(); + $opt_tcp_ip = 0; +@@ -39,11 +39,11 @@ + { + my $flag_exit= 0; + +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { + # We can't throw out yet, since --version, --help, or --example may + # have been given +- print "WARNING: my_print_defaults command not found.\n"; ++ print "WARNING: @mybin_my_print_defaults@ command not found.\n"; + print "Please make sure you have this command available and\n"; + print "in your path. The command is available from the latest\n"; + print "MySQL distribution.\n"; +@@ -74,9 +74,9 @@ + } + } + } +- my $com= "my_print_defaults "; ++ my $com= "@mybin_my_print_defaults@ "; + $com.= "--config-file=$opt_config_file " if (defined($opt_config_file)); +- $com.= "mysqld_multi"; ++ $com.= "@mybin_mysqld_multi@"; + my @defops = `$com`; + chop @defops; + splice @ARGV, 0, 0, @defops; +@@ -113,9 +113,9 @@ + print "Error with an option, see $my_progname --help for more info.\n"; + exit(1); + } +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { +- print "ABORT: Can't find command 'my_print_defaults'.\n"; ++ print "ABORT: Can't find command '@mybin_my_print_defaults@'.\n"; + print "This command is available from the latest MySQL\n"; + print "distribution. Please make sure you have the command\n"; + print "in your PATH.\n"; +@@ -202,7 +202,7 @@ + { + if ($my_print_defaults_exists) + { +- @mysqld_opts= `my_print_defaults mysqld`; ++ @mysqld_opts= `@mybin_my_print_defaults@ mysqld`; + chomp @mysqld_opts; + foreach my $opt (@mysqld_opts) + { +@@ -303,7 +303,7 @@ + @groups = &find_groups($groupids); + for ($i = 0; defined($groups[$i]); $i++) + { +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +@@ -330,7 +330,7 @@ + $tmp.= " $options[$j]"; + } + } +- if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent) ++ if ($opt_verbose && $com =~ m/\/@mybin_safe_mysqld@$/ && !$info_sent) + { + print "WARNING: safe_mysqld is being used to start mysqld. In this case you "; + print "may need to pass\n\"ledir=...\" under groups [mysqldN] to "; +@@ -401,7 +401,7 @@ + my ($i, @groups)= @_; + my ($mysqladmin_found, $com, $tmp, $j); + +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +diff -Naur mysql-5.0.21-nightly-20060410.a/scripts/mysqld_safe.sh mysql-5.0.21-nightly-20060410.b/scripts/mysqld_safe.sh +--- mysql-5.0.21-nightly-20060410.a/scripts/mysqld_safe.sh 2006-04-10 04:02:50.000000000 +0000 ++++ mysql-5.0.21-nightly-20060410.b/scripts/mysqld_safe.sh 2006-04-12 16:16:09.000000000 +0000 +@@ -87,7 +87,7 @@ + then + MYSQLD="mysqld-$tmp" + else +- MYSQLD="mysqld" ++ MYSQLD="@mybin_mysqld@" + fi + ;; + --nice=*) niceness=`echo "$arg" | sed -e "s;--nice=;;"` ;; +@@ -113,13 +113,13 @@ + + MY_PWD=`pwd` + # Check for the directories we would expect from a binary release install +-if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld ++if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are + ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is + # Check for the directories we would expect from a source install + elif test -f ./share/mysql/english/errmsg.sys -a \ +- -x ./libexec/mysqld ++ -x ./libexec/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are + ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is +@@ -181,17 +181,17 @@ + + # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] + # and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + args= +@@ -216,11 +216,11 @@ + # Use the mysqld-max binary by default if the user doesn't specify a binary + if test -z "$MYSQLD" + then +- if test -x $ledir/mysqld-max ++ if test -x $ledir/@mybin_mysqld-max@ + then +- MYSQLD=mysqld-max ++ MYSQLD=@mybin_mysqld-max@ + else +- MYSQLD=mysqld ++ MYSQLD=@mybin_mysqld@ + fi + fi + +@@ -229,7 +229,7 @@ + echo "The file $ledir/$MYSQLD doesn't exist or is not executable" + echo "Please do a cd to the mysql installation directory and restart" + echo "this script from there as follows:" +- echo "./bin/mysqld_safe". ++ echo "./bin/@mybin_mysqld_safe@". + echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more" + echo "information" + exit 1 +@@ -362,8 +362,8 @@ + # the manual for details. + # + # echo "Checking tables in $DATADIR" +-# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check $DATADIR/*/*.MYI +-# $MY_BASEDIR_VERSION/bin/isamchk --silent --force $DATADIR/*/*.ISM ++# $MY_BASEDIR_VERSION/bin/@mybin_myisamchk@ --silent --force --fast --medium-check $DATADIR/*/*.MYI ++# $MY_BASEDIR_VERSION/bin/@mybin_isamchk@ --silent --force $DATADIR/*/*.ISM + + echo "Starting $MYSQLD daemon with databases from $DATADIR" + +diff -Naur mysql-5.0.21-nightly-20060410.a/scripts/mysqldumpslow.sh mysql-5.0.21-nightly-20060410.b/scripts/mysqldumpslow.sh +--- mysql-5.0.21-nightly-20060410.a/scripts/mysqldumpslow.sh 2006-04-10 04:02:50.000000000 +0000 ++++ mysql-5.0.21-nightly-20060410.b/scripts/mysqldumpslow.sh 2006-04-12 16:16:09.000000000 +0000 +@@ -34,16 +34,16 @@ + $opt{'help'} and usage(); + + unless (@ARGV) { +- my $defaults = `my_print_defaults mysqld`; ++ my $defaults = `@mybin_my_print_defaults@ mysqld`; + my $basedir = ($defaults =~ m/--basedir=(.*)/)[0] +- or die "Can't determine basedir from 'my_print_defaults mysqld' output: $defaults"; ++ or die "Can't determine basedir from '@mybin_my_print_defaults@ mysqld' output: $defaults"; + warn "basedir=$basedir\n" if $opt{v}; + + my $datadir = ($defaults =~ m/--datadir=(.*)/)[0]; + if (!$datadir or $opt{i}) { + # determine the datadir from the instances section of /etc/my.cnf, if any +- my $instances = `my_print_defaults instances`; +- die "Can't determine datadir from 'my_print_defaults mysqld' output: $defaults" ++ my $instances = `@mybin_my_print_defaults@ instances`; ++ die "Can't determine datadir from '@mybin_my_print_defaults@ mysqld' output: $defaults" + unless $instances; + my @instances = ($instances =~ m/^--(\w+)-/mg); + die "No -i 'instance_name' specified to select among known instances: @instances.\n" +@@ -51,7 +51,7 @@ + die "Instance '$opt{i}' is unknown (known instances: @instances)\n" + unless grep { $_ eq $opt{i} } @instances; + $datadir = ($instances =~ m/--$opt{i}-datadir=(.*)/)[0] +- or die "Can't determine --$opt{i}-datadir from 'my_print_defaults instances' output: $instances"; ++ or die "Can't determine --$opt{i}-datadir from '@mybin_my_print_defaults@ instances' output: $instances"; + warn "datadir=$datadir\n" if $opt{v}; + } + +diff -Naur mysql-5.0.21-nightly-20060410.a/scripts/mysql_fix_privilege_tables.sh mysql-5.0.21-nightly-20060410.b/scripts/mysql_fix_privilege_tables.sh +--- mysql-5.0.21-nightly-20060410.a/scripts/mysql_fix_privilege_tables.sh 2006-04-10 04:02:49.000000000 +0000 ++++ mysql-5.0.21-nightly-20060410.b/scripts/mysql_fix_privilege_tables.sh 2006-04-12 16:16:09.000000000 +0000 +@@ -77,17 +77,17 @@ + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments + +-print_defaults=my_print_defaults ++print_defaults=@mybin_my_print_defaults@ + for dir in ./bin @bindir@ @bindir@ extra $print_defaults_bindir/../bin $print_defaults_bindir/../extra + do +- if test -x $dir/my_print_defaults ++ if test -x $dir/@mybin_my_print_defaults@ + then +- print_defaults="$dir/my_print_defaults" ++ print_defaults="$dir/@mybin_my_print_defaults@" + break + fi + done + +-parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables` ++parse_arguments `$print_defaults $defaults @mybin_mysql_install_db@ @mybin_mysql_fix_privilege_tables@` + parse_arguments PICK-ARGS-FROM-ARGV "$@" + + if test -z "$password" +@@ -118,7 +118,7 @@ + exit 1 + fi + +-cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" ++cmd="$bindir/@mybin_mysql@ --no-defaults --force --user=$user --host=$host" + if test ! -z "$password" ; then + cmd="$cmd --password=$password" + fi +@@ -136,7 +136,7 @@ + fi + + # Find where first mysql_fix_privilege_tables.sql is located +-for i in $basedir/support-files $basedir/share $basedir/share/mysql \ ++for i in @sharedstatedir@ $basedir/support-files $basedir/share $basedir/share/mysql \ + $basedir/scripts $pkgdatadir . "$dirname" + do + if test -f $i/$file +diff -Naur mysql-5.0.21-nightly-20060410.a/scripts/mysql_install_db.sh mysql-5.0.21-nightly-20060410.b/scripts/mysql_install_db.sh +--- mysql-5.0.21-nightly-20060410.a/scripts/mysql_install_db.sh 2006-04-10 04:02:44.000000000 +0000 ++++ mysql-5.0.21-nightly-20060410.b/scripts/mysql_install_db.sh 2006-04-12 16:16:09.000000000 +0000 +@@ -58,20 +58,20 @@ + + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x ./extra/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "./extra/@mybin_my_print_defaults@" + then +- print_defaults="./extra/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./extra/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + args= +@@ -95,10 +95,10 @@ + pkgdatadir=@pkgdatadir@ + else + bindir="$basedir/bin" +- if test -x "$basedir/libexec/mysqld" ++ if test -x "$basedir/libexec/@mybin_mysqld@" + then + execdir="$basedir/libexec" +- elif test -x "$basedir/sbin/mysqld" ++ elif test -x "$basedir/sbin/@mybin_mysqld@" + then + execdir="$basedir/sbin" + else +@@ -107,7 +107,7 @@ + fi + + # find fill_help_tables.sh +-for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ ++for i in @sharedstatedir@ $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ + do + if test -f $i/fill_help_tables.sql + then +@@ -124,13 +124,13 @@ + fi + + mdata=$ldata/mysql +-mysqld=$execdir/mysqld ++mysqld=$execdir/@mybin_mysqld@ + mysqld_opt="" + scriptdir=$bindir + + if test "$windows" = 1 + then +- mysqld="./sql/mysqld" ++ mysqld="./sql/@mybin_mysqld@" + mysqld_opt="--language=./sql/share/english" + scriptdir="./scripts" + fi +@@ -154,14 +154,14 @@ + # Check if hostname is valid + if test "$windows" = 0 -a "$in_rpm" = 0 -a $force = 0 + then +- resolved=`$bindir/resolveip $hostname 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ $hostname 2>&1` + if [ $? -ne 0 ] + then +- resolved=`$bindir/resolveip localhost 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ localhost 2>&1` + if [ $? -ne 0 ] + then + echo "Neither host '$hostname' nor 'localhost' could be looked up with" +- echo "$bindir/resolveip" ++ echo "$bindir/@mybin_resolveip@" + echo "Please configure the 'hostname' command to return a correct hostname." + echo "If you want to solve this at a later stage, restart this script with" + echo "the --force option" +@@ -169,7 +169,7 @@ + fi + echo "WARNING: The host '$hostname' could not be looked up with resolveip." + echo "This probably means that your libc libraries are not 100 % compatible" +- echo "with this binary MySQL version. The MySQL daemon, mysqld, should work" ++ echo "with this binary MySQL version. The MySQL daemon, @mybin_mysqld@, should work" + echo "normally with the exception that host name resolving will not work." + echo "This means that you should use IP addresses instead of hostnames" + echo "when specifying MySQL privileges !" +@@ -214,7 +214,7 @@ + mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ + --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ + --skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" +-if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ ++if $scriptdir/@mybin_mysql_create_system_tables@ $create_option $mdata $hostname $windows \ + | eval "$mysqld_install_cmd_line" + then + if test -n "$fill_help_tables" +@@ -244,8 +244,8 @@ + then + echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" + echo "To do so, start the server, then issue the following commands:" +- echo "$bindir/mysqladmin -u root password 'new-password'" +- echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root -h $hostname password 'new-password'" + echo "See the manual for more instructions." + # + # Print message about upgrading unless we have created a new db table. +@@ -253,14 +253,14 @@ + then + echo + echo "NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run" +- echo "the $bindir/mysql_fix_privilege_tables. Otherwise you will not be" ++ echo "the $bindir/@mybin_mysql_fix_privilege_tables@. Otherwise you will not be" + echo "able to use the new GRANT command!" + fi + echo + if test "$in_rpm" = "0" + then + echo "You can start the MySQL daemon with:" +- echo "cd @prefix@ ; $bindir/mysqld_safe &" ++ echo "cd @prefix@ ; $bindir/@mybin_mysqld_safe@ &" + echo + echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:" + echo "cd sql-bench ; perl run-all-tests" +@@ -280,13 +280,13 @@ + echo "You can also try to start the mysqld daemon with:" + echo "$mysqld --skip-grant &" + echo "You can use the command line tool" +- echo "$bindir/mysql to connect to the mysql" ++ echo "$bindir/@mybin_mysql@ to connect to the mysql" + echo "database and look at the grant tables:" + echo +- echo "shell> $bindir/mysql -u root mysql" ++ echo "shell> $bindir/@mybin_mysql@ -u root mysql" + echo "mysql> show tables" + echo +- echo "Try 'mysqld --help' if you have problems with paths. Using --log" ++ echo "Try '@mybin_mysqld@ --help' if you have problems with paths. Using --log" + echo "gives you a log in $ldata that may be helpful." + echo + echo "The latest information about MySQL is available on the web at" +@@ -295,6 +295,6 @@ + echo "and the manual section that describes problems on your OS." + echo "Another information source is the MySQL email archive." + echo "Please check all of the above before mailing us!" +- echo "And if you do mail us, you MUST use the @scriptdir@/mysqlbug script!" ++ echo "And if you do mail us, you MUST use the @scriptdir@/@mybin_mysqlbug@ script!" + exit 1 + fi +diff -Naur mysql-5.0.21-nightly-20060410.a/scripts/mysql_secure_installation.sh mysql-5.0.21-nightly-20060410.b/scripts/mysql_secure_installation.sh +--- mysql-5.0.21-nightly-20060410.a/scripts/mysql_secure_installation.sh 2006-04-10 04:02:50.000000000 +0000 ++++ mysql-5.0.21-nightly-20060410.b/scripts/mysql_secure_installation.sh 2006-04-12 16:16:09.000000000 +0000 +@@ -30,7 +30,7 @@ + + do_query() { + echo $1 >$command +- mysql --defaults-file=$config <$command ++ @mybin_mysql@ --defaults-file=$config <$command + return $? + } + diff --git a/080_all_slot_script-5.0.34.patch b/080_all_slot_script-5.0.34.patch new file mode 100644 index 0000000..65b41fd --- /dev/null +++ b/080_all_slot_script-5.0.34.patch @@ -0,0 +1,2434 @@ +diff -Naur mysql-5.0.34-bk-20070101.orig/scripts/Makefile.am mysql-5.0.34-bk-20070101/scripts/Makefile.am +--- mysql-5.0.34-bk-20070101.orig/scripts/Makefile.am 2007-01-01 19:10:29.000000000 +0100 ++++ mysql-5.0.34-bk-20070101/scripts/Makefile.am 2007-01-03 00:48:04.000000000 +0100 +@@ -68,6 +68,32 @@ + mysqlbug \ + make_win_bin_dist + ++sql_libexec_REPLACE = mysqld ++instance_manager_libexec_REPLACE= mysqlmanager ++client_bin_REPLACE = mysql mysqladmin mysqlcheck mysqlshow \ ++ mysqldump mysqlimport mysqltest mysqlbinlog \ ++ mysqltestmanagerc mysqltestmanager-pwgen ++extra_bin_REPLACE = replace comp_err perror resolveip my_print_defaults \ ++ resolve_stack_dump mysql_waitpid innochecksum ++myisam_bin_REPLACE = myisamchk myisamlog myisampack myisam_ftdump ++tools_bin_REPLACE = mysqltestmanager ++cw_cpcd_ndbbin_REPLACE = ndb_cpcd ++kernel_ndbbin_REPLACE = ndbd ++mgmsrv_ndbbin_REPLACE = ndb_mgmd ++sql_bin_REPLACE = mysql_tzinfo_to_sql ++tests_bin_REPLACE = mysql_client_test ++ndbtools_bin_REPLACE = ndb_test_platform ndb_waiter \ ++ ndb_drop_table ndb_delete_all \ ++ ndb_desc ndb_drop_index \ ++ ndb_show_tables ndb_select_all \ ++ ndb_select_count ndb_restore ndb_config ++EXTRA_REPLACE_BIN = safe_mysqld mysqlanalyze mysqloptimize mysqlrepair mysqld-max isamchk \ ++ $(sql_libexec_REPLACE) $(ndbtools_bin_REPLACE) \ ++ $(instance_manager_libexec_REPLACE) $(client_bin_REPLACE) \ ++ $(extra_bin_REPLACE) $(myisam_bin_REPLACE) $(tools_bin_REPLACE) \ ++ $(cw_cpcd_ndbbin_REPLACE) $(kernel_ndbbin_REPLACE) $(mgmsrv_ndbbin_REPLACE) \ ++ $(sql_bin_REPLACE) $(tests_bin_REPLACE) ++ + dist_pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql + + # mysqlbug should be distributed built so that people can report build +@@ -103,8 +129,17 @@ + + .sh: + @RM@ -f $@ $@-t ++ bin_REPLACE='';\ ++ list='$(EXTRA_SCRIPTS) $(EXTRA_REPLACE_BIN)'; \ ++ for p in $${list}; do \ ++ f1=$${p/\.sh}; \ ++ f2=`echo "$${p}" | @SED@ -e 's|\.sh$$||' -e 's|^.*/||;$(transform)'`; \ ++ bin_REPLACE="$${bin_REPLACE}s!@mybin_$${f1}@!$${f2}!g;";\ ++ done; \ + @SED@ \ ++ -e "$${bin_REPLACE}" \ + -e 's!@''bindir''@!$(bindir)!g' \ ++ -e 's!@''sharedstatedir''@!$(sharedstatedir)!g' \ + -e 's!@''sbindir''@!$(sbindir)!g' \ + -e 's!@''scriptdir''@!$(bindir)!g' \ + -e 's!@''prefix''@!$(prefix)!g' \ +diff -Naur mysql-5.0.34-bk-20070101.orig/scripts/Makefile.am.orig mysql-5.0.34-bk-20070101/scripts/Makefile.am.orig +--- mysql-5.0.34-bk-20070101.orig/scripts/Makefile.am.orig 1970-01-01 01:00:00.000000000 +0100 ++++ mysql-5.0.34-bk-20070101/scripts/Makefile.am.orig 2007-01-01 19:10:29.000000000 +0100 +@@ -0,0 +1,158 @@ ++# Copyright (C) 2000-2006 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; version 2 of the License. ++# ++# 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 ++ ++## Process this file with automake to create Makefile.in ++ ++bin_SCRIPTS = @server_scripts@ \ ++ msql2mysql \ ++ mysql_config \ ++ mysql_fix_privilege_tables \ ++ mysql_fix_extensions \ ++ mysql_setpermission \ ++ mysql_secure_installation \ ++ mysql_zap \ ++ mysqlaccess \ ++ mysqlbug \ ++ mysql_convert_table_format \ ++ mysql_find_rows \ ++ mysqlhotcopy \ ++ mysqldumpslow \ ++ mysql_explain_log \ ++ mysql_tableinfo \ ++ mysql_upgrade_shell \ ++ mysqld_multi \ ++ mysql_create_system_tables ++ ++noinst_SCRIPTS = make_binary_distribution \ ++ make_sharedlib_distribution \ ++ make_win_src_distribution ++ ++EXTRA_SCRIPTS = make_binary_distribution.sh \ ++ make_sharedlib_distribution.sh \ ++ make_win_src_distribution.sh \ ++ msql2mysql.sh \ ++ mysql_config.sh \ ++ mysql_fix_privilege_tables.sh \ ++ mysql_fix_extensions.sh \ ++ mysql_install_db.sh \ ++ mysql_setpermission.sh \ ++ mysql_secure_installation.sh \ ++ mysql_zap.sh \ ++ mysqlaccess.sh \ ++ mysqlbug.sh \ ++ mysql_convert_table_format.sh \ ++ mysql_find_rows.sh \ ++ mysqlhotcopy.sh \ ++ mysqldumpslow.sh \ ++ mysql_explain_log.sh \ ++ mysqld_multi.sh \ ++ mysql_tableinfo.sh \ ++ mysql_upgrade_shell.sh \ ++ mysqld_safe.sh \ ++ mysql_create_system_tables.sh ++ ++EXTRA_DIST = $(EXTRA_SCRIPTS) \ ++ mysqlaccess.conf \ ++ mysqlbug \ ++ make_win_bin_dist ++ ++dist_pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql ++ ++# mysqlbug should be distributed built so that people can report build ++# failures with it. ++CLEANFILES = @server_scripts@ \ ++ make_binary_distribution \ ++ make_sharedlib_distribution \ ++ msql2mysql \ ++ mysql_config \ ++ mysql_fix_privilege_tables \ ++ mysql_fix_extensions \ ++ mysql_setpermission \ ++ mysql_secure_installation \ ++ mysql_zap \ ++ mysqlaccess \ ++ mysql_convert_table_format \ ++ mysql_find_rows \ ++ mysqlhotcopy \ ++ mysqldumpslow \ ++ mysql_explain_log \ ++ mysql_tableinfo \ ++ mysql_upgrade_shell \ ++ mysqld_multi \ ++ make_win_src_distribution \ ++ mysql_create_system_tables ++ ++DISTCLEANFILES = mysqlbug ++ ++# We want the right version and configure comand line in mysqlbug ++mysqlbug: ${top_builddir}/config.status mysqlbug.sh ++ ++SUFFIXES = .sh ++ ++.sh: ++ @RM@ -f $@ $@-t ++ @SED@ \ ++ -e 's!@''bindir''@!$(bindir)!g' \ ++ -e 's!@''sbindir''@!$(sbindir)!g' \ ++ -e 's!@''scriptdir''@!$(bindir)!g' \ ++ -e 's!@''prefix''@!$(prefix)!g' \ ++ -e 's!@''datadir''@!$(datadir)!g' \ ++ -e 's!@''localstatedir''@!$(localstatedir)!g' \ ++ -e 's!@''libexecdir''@!$(libexecdir)!g' \ ++ -e 's!@''pkglibdir''@!$(pkglibdir)!g' \ ++ -e 's!@''pkgincludedir''@!$(pkgincludedir)!g' \ ++ -e 's!@''pkgdatadir''@!$(pkgdatadir)!g' \ ++ -e 's!@''sysconfdir''@!$(sysconfdir)!g' \ ++ -e 's!@''CC''@!@CC@!'\ ++ -e 's!@''CXX''@!@CXX@!'\ ++ -e 's!@''GXX''@!@GXX@!'\ ++ -e 's!@''CC_VERSION''@!@CC_VERSION@!'\ ++ -e 's!@''CXX_VERSION''@!@CXX_VERSION@!'\ ++ -e 's!@''PERL''@!@PERL@!' \ ++ -e 's!@''ASFLAGS''@!@SAVE_ASFLAGS@!'\ ++ -e 's!@''CFLAGS''@!@SAVE_CFLAGS@!'\ ++ -e 's!@''CXXFLAGS''@!@SAVE_CXXFLAGS@!'\ ++ -e 's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'\ ++ -e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \ ++ -e 's!@''ZLIB_LIBS''@!@ZLIB_LIBS@!' \ ++ -e 's!@''LIBS''@!@LIBS@!' \ ++ -e 's!@''WRAPLIBS''@!@WRAPLIBS@!' \ ++ -e 's!@''innodb_system_libs''@!@innodb_system_libs@!' \ ++ -e 's!@''openssl_libs''@!@openssl_libs@!' \ ++ -e 's!@''VERSION''@!@VERSION@!' \ ++ -e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \ ++ -e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \ ++ -e 's!@''COMPILATION_COMMENT''@!@COMPILATION_COMMENT@!' \ ++ -e 's!@''MACHINE_TYPE''@!@MACHINE_TYPE@!' \ ++ -e 's!@''HOSTNAME''@!@HOSTNAME@!' \ ++ -e 's!@''SYSTEM_TYPE''@!@SYSTEM_TYPE@!' \ ++ -e 's!@''CHECK_PID''@!@CHECK_PID@!' \ ++ -e 's!@''FIND_PROC''@!@FIND_PROC@!' \ ++ -e 's!@''MYSQLD_DEFAULT_SWITCHES''@!@MYSQLD_DEFAULT_SWITCHES@!' \ ++ -e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \ ++ -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \ ++ -e 's!@''TARGET_LINUX''@!@TARGET_LINUX@!' \ ++ -e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \ ++ -e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \ ++ -e 's!@''STATIC_NSS_FLAGS''@!@STATIC_NSS_FLAGS@!' \ ++ -e 's!@''NON_THREADED_LIBS''@!@NON_THREADED_LIBS@!' \ ++ -e 's!@''ZLIB_DEPS''@!@ZLIB_DEPS@!' \ ++ -e "s!@MAKE@!$(MAKE)!" \ ++ $< > $@-t ++ @CHMOD@ +x $@-t ++ @MV@ $@-t $@ ++ ++# Don't update the files from bitkeeper ++%::SCCS/s.% +diff -Naur mysql-5.0.34-bk-20070101.orig/scripts/msql2mysql.sh mysql-5.0.34-bk-20070101/scripts/msql2mysql.sh +--- mysql-5.0.34-bk-20070101.orig/scripts/msql2mysql.sh 2007-01-01 19:10:29.000000000 +0100 ++++ mysql-5.0.34-bk-20070101/scripts/msql2mysql.sh 2007-01-03 00:48:04.000000000 +0100 +@@ -13,4 +13,4 @@ + # described in the License. Among other things, the License requires that + # the copyright notice and this notice be preserved on all copies. + +-@bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* ++@bindir@/@mybin_replace@ msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* +diff -Naur mysql-5.0.34-bk-20070101.orig/scripts/mysql_config.sh mysql-5.0.34-bk-20070101/scripts/mysql_config.sh +--- mysql-5.0.34-bk-20070101.orig/scripts/mysql_config.sh 2007-01-01 19:10:29.000000000 +0100 ++++ mysql-5.0.34-bk-20070101/scripts/mysql_config.sh 2007-01-03 00:48:04.000000000 +0100 +@@ -76,7 +76,7 @@ + + me=`get_full_path $0` + +-basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` ++basedir=`echo $me | sed -e 's;/bin/@mybin_mysql_config@;;'` + + ldata='@localstatedir@' + execdir='@libexecdir@' +@@ -85,10 +85,10 @@ + # If installed, search for the compiled in directory first (might be "lib64") + pkglibdir='@pkglibdir@' + pkglibdir_rel=`echo $pkglibdir | sed -e "s;^$basedir/;;"` +-fix_path pkglibdir $pkglibdir_rel lib/mysql lib ++fix_path pkglibdir $pkglibdir_rel "lib${pkglibdir##*lib}" lib/mysql lib + + pkgincludedir='@pkgincludedir@' +-fix_path pkgincludedir include/mysql include ++fix_path pkgincludedir "include${pkgincludedir##*include}" include/mysql include + + version='@VERSION@' + socket='@MYSQL_UNIX_ADDR@' +diff -Naur mysql-5.0.34-bk-20070101.orig/scripts/mysql_config.sh.orig mysql-5.0.34-bk-20070101/scripts/mysql_config.sh.orig +--- mysql-5.0.34-bk-20070101.orig/scripts/mysql_config.sh.orig 1970-01-01 01:00:00.000000000 +0100 ++++ mysql-5.0.34-bk-20070101/scripts/mysql_config.sh.orig 2007-01-01 19:10:29.000000000 +0100 +@@ -0,0 +1,182 @@ ++#!/bin/sh ++# Copyright (C) 2000-2006 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; version 2 of the License. ++# ++# 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 ++ ++# This script reports various configuration settings that may be needed ++# when using the MySQL client library. ++ ++which () ++{ ++ IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' ++ for file ++ do ++ for dir in $PATH ++ do ++ if test -f $dir/$file ++ then ++ echo "$dir/$file" ++ continue 2 ++ fi ++ done ++ echo "which: no $file in ($PATH)" ++ exit 1 ++ done ++ IFS="$save_ifs" ++} ++ ++# ++# If we can find the given directory relatively to where mysql_config is ++# we should use this instead of the incompiled one. ++# This is to ensure that this script also works with the binary MySQL ++# version ++ ++fix_path () ++{ ++ var=$1 ++ shift ++ for filename ++ do ++ path=$basedir/$filename ++ if [ -d "$path" ] ; ++ then ++ eval "$var"=$path ++ return ++ fi ++ done ++} ++ ++get_full_path () ++{ ++ file=$1 ++ ++ # if the file is a symlink, try to resolve it ++ if [ -h $file ]; ++ then ++ file=`ls -l $file | awk '{ print $NF }'` ++ fi ++ ++ case $file in ++ /*) echo "$file";; ++ */*) tmp=`pwd`/$file; echo $tmp | sed -e 's;/\./;/;' ;; ++ *) which $file ;; ++ esac ++} ++ ++me=`get_full_path $0` ++ ++basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` ++ ++ldata='@localstatedir@' ++execdir='@libexecdir@' ++bindir='@bindir@' ++ ++# If installed, search for the compiled in directory first (might be "lib64") ++pkglibdir='@pkglibdir@' ++pkglibdir_rel=`echo $pkglibdir | sed -e "s;^$basedir/;;"` ++fix_path pkglibdir $pkglibdir_rel lib/mysql lib ++ ++pkgincludedir='@pkgincludedir@' ++fix_path pkgincludedir include/mysql include ++ ++version='@VERSION@' ++socket='@MYSQL_UNIX_ADDR@' ++port='@MYSQL_TCP_PORT@' ++ldflags='@LDFLAGS@' ++ ++# Create options ++# We intentionally add a space to the beginning and end of lib strings, simplifies replace later ++libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" ++libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ " ++libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@ " ++embedded_libs=" $ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@ @openssl_libs@ " ++ ++cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! ++include="-I$pkgincludedir" ++ ++# Remove some options that a client doesn't have to care about ++# FIXME until we have a --cxxflags, we need to remove -Xa ++# and -xstrconst to make --cflags usable for Sun Forte C++ ++for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \ ++ DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ ++ DEXTRA_DEBUG DHAVE_purify O 'O[0-9]' 'xO[0-9]' 'W[-A-Za-z]*' \ ++ Xa xstrconst "xc99=none" \ ++ unroll2 ip mp restrict ++do ++ # The first option we might strip will always have a space before it because ++ # we set -I$pkgincludedir as the first option ++ cflags=`echo "$cflags"|sed -e "s/ -$remove */ /g"` ++done ++cflags=`echo "$cflags"|sed -e 's/ *\$//'` ++ ++# Same for --libs(_r) ++for remove in lmtmalloc static-libcxa i-static ++do ++ # We know the strings starts with a space ++ libs=`echo "$libs"|sed -e "s/ -$remove */ /g"` ++ libs_r=`echo "$libs_r"|sed -e "s/ -$remove */ /g"` ++ embedded_libs=`echo "$embedded_libs"|sed -e "s/ -$remove */ /g"` ++done ++ ++# Strip trailing and ending space if any, and '+' (FIXME why?) ++libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` ++libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` ++embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` ++ ++usage () { ++ cat <<EOF ++Usage: $0 [OPTIONS] ++Options: ++ --cflags [$cflags] ++ --include [$include] ++ --libs [$libs] ++ --libs_r [$libs_r] ++ --socket [$socket] ++ --port [$port] ++ --version [$version] ++ --libmysqld-libs [$embedded_libs] ++EOF ++ exit 1 ++} ++ ++if test $# -le 0; then usage; fi ++ ++while test $# -gt 0; do ++ case $1 in ++ --cflags) echo "$cflags" ;; ++ --include) echo "$include" ;; ++ --libs) echo "$libs" ;; ++ --libs_r) echo "$libs_r" ;; ++ --socket) echo "$socket" ;; ++ --port) echo "$port" ;; ++ --version) echo "$version" ;; ++ --embedded-libs | --embedded | --libmysqld-libs) echo "$embedded_libs" ;; ++ *) usage ;; ++ esac ++ ++ shift ++done ++ ++#echo "ldata: '"$ldata"'" ++#echo "execdir: '"$execdir"'" ++#echo "bindir: '"$bindir"'" ++#echo "pkglibdir: '"$pkglibdir"'" ++#echo "pkgincludedir: '"$pkgincludedir"'" ++#echo "version: '"$version"'" ++#echo "socket: '"$socket"'" ++#echo "port: '"$port"'" ++#echo "ldflags: '"$ldflags"'" ++#echo "client_libs: '"$client_libs"'" ++ ++exit 0 +diff -Naur mysql-5.0.34-bk-20070101.orig/scripts/mysql_create_system_tables.sh mysql-5.0.34-bk-20070101/scripts/mysql_create_system_tables.sh +--- mysql-5.0.34-bk-20070101.orig/scripts/mysql_create_system_tables.sh 2007-01-01 19:10:29.000000000 +0100 ++++ mysql-5.0.34-bk-20070101/scripts/mysql_create_system_tables.sh 2007-01-03 00:48:04.000000000 +0100 +@@ -31,7 +31,7 @@ + new context from the manual (from fill_help_tables.sql). + + Usage: +- mysql_create_system_tables [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> ++ @mybin_mysql_create_system_tables@ [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> + " + exit + fi +diff -Naur mysql-5.0.34-bk-20070101.orig/scripts/mysql_create_system_tables.sh.orig mysql-5.0.34-bk-20070101/scripts/mysql_create_system_tables.sh.orig +--- mysql-5.0.34-bk-20070101.orig/scripts/mysql_create_system_tables.sh.orig 1970-01-01 01:00:00.000000000 +0100 ++++ mysql-5.0.34-bk-20070101/scripts/mysql_create_system_tables.sh.orig 2007-01-01 19:10:29.000000000 +0100 +@@ -0,0 +1,779 @@ ++#!/bin/sh ++# Copyright (C) 1997-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; version 2 of the License. ++# ++# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ ++# This script writes on stdout SQL commands to generate all not ++# existing MySQL system tables. It also replaces the help tables with ++# new context from the manual (from fill_help_tables.sql). ++ ++# $1 - "test" or "real" or "verbose" variant of database ++# $2 - path to mysql-database directory ++# $3 - hostname ++# $4 - windows option ++ ++if test "$1" = "" ++then ++ echo " ++This script writes on stdout SQL commands to generate all not ++existing MySQL system tables. It also replaces the help tables with ++new context from the manual (from fill_help_tables.sql). ++ ++Usage: ++ mysql_create_system_tables [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> ++" ++ exit ++fi ++ ++mdata=$2 ++hostname=$3 ++windows=$4 ++ ++# Initialize variables ++c_d="" i_d="" ++c_h="" i_h="" ++c_u="" i_u="" ++c_f="" i_f="" ++c_t="" c_c="" ++c_ht="" ++c_hc="" ++c_hr="" ++c_hk="" ++i_ht="" ++c_tzn="" c_tz="" c_tzt="" c_tztt="" c_tzls="" ++i_tzn="" i_tz="" i_tzt="" i_tztt="" i_tzls="" ++c_p="" c_pp="" ++ ++# Check for old tables ++if test ! -f $mdata/db.frm ++then ++ if test "$1" = "verbose" ; then ++ echo "Preparing db table" 1>&2; ++ fi ++ ++ # mysqld --bootstrap wants one command/line ++ c_d="$c_d CREATE TABLE db (" ++ c_d="$c_d Host char(60) binary DEFAULT '' NOT NULL," ++ c_d="$c_d Db char(64) binary DEFAULT '' NOT NULL," ++ c_d="$c_d User char(16) binary DEFAULT '' NOT NULL," ++ c_d="$c_d Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_d="$c_d Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_d="$c_d Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_d="$c_d Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_d="$c_d Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_d="$c_d Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_d="$c_d Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_d="$c_d References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_d="$c_d Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_d="$c_d Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_d="$c_d Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_d="$c_d Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_d="$c_d Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_d="$c_d Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_d="$c_d Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_d="$c_d Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_d="$c_d Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_d="$c_d PRIMARY KEY Host (Host,Db,User)," ++ c_d="$c_d KEY User (User)" ++ c_d="$c_d ) engine=MyISAM" ++ c_d="$c_d CHARACTER SET utf8 COLLATE utf8_bin" ++ c_d="$c_d comment='Database privileges';" ++ ++ i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); ++ INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N');" ++fi ++ ++if test ! -f $mdata/host.frm ++then ++ if test "$1" = "verbose" ; then ++ echo "Preparing host table" 1>&2; ++ fi ++ ++ c_h="$c_h CREATE TABLE host (" ++ c_h="$c_h Host char(60) binary DEFAULT '' NOT NULL," ++ c_h="$c_h Db char(64) binary DEFAULT '' NOT NULL," ++ c_h="$c_h Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_h="$c_h Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_h="$c_h Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_h="$c_h Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_h="$c_h Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_h="$c_h Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_h="$c_h Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_h="$c_h References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_h="$c_h Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_h="$c_h Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_h="$c_h Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_h="$c_h Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_h="$c_h Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_h="$c_h Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_h="$c_h Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_h="$c_h Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_h="$c_h Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_h="$c_h PRIMARY KEY Host (Host,Db)" ++ c_h="$c_h ) engine=MyISAM" ++ c_h="$c_h CHARACTER SET utf8 COLLATE utf8_bin" ++ c_h="$c_h comment='Host privileges; Merged with database privileges';" ++fi ++ ++if test ! -f $mdata/user.frm ++then ++ if test "$1" = "verbose" ; then ++ echo "Preparing user table" 1>&2; ++ fi ++ ++ c_u="$c_u CREATE TABLE user (" ++ c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL," ++ c_u="$c_u User char(16) binary DEFAULT '' NOT NULL," ++ c_u="$c_u Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL," ++ c_u="$c_u Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL," ++ c_u="$c_u ssl_cipher BLOB NOT NULL," ++ c_u="$c_u x509_issuer BLOB NOT NULL," ++ c_u="$c_u x509_subject BLOB NOT NULL," ++ c_u="$c_u max_questions int(11) unsigned DEFAULT 0 NOT NULL," ++ c_u="$c_u max_updates int(11) unsigned DEFAULT 0 NOT NULL," ++ c_u="$c_u max_connections int(11) unsigned DEFAULT 0 NOT NULL," ++ c_u="$c_u max_user_connections int(11) unsigned DEFAULT 0 NOT NULL," ++ c_u="$c_u PRIMARY KEY Host (Host,User)" ++ c_u="$c_u ) engine=MyISAM" ++ c_u="$c_u CHARACTER SET utf8 COLLATE utf8_bin" ++ c_u="$c_u comment='Users and global privileges';" ++ ++ if test "$1" = "test" ++ then ++ i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); ++ INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); ++ REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); ++ INSERT INTO user (host,user) values ('localhost',''); ++ INSERT INTO user (host,user) values ('$hostname','');" ++ else ++ i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);" ++ if test "$windows" = "0" ++ then ++ i_u="$i_u ++ INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); ++ INSERT INTO user (host,user) values ('$hostname',''); ++ INSERT INTO user (host,user) values ('localhost','');" ++ else ++ i_u="$i_u ++ INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" ++ fi ++ fi ++fi ++ ++if test ! -f $mdata/func.frm ++then ++ if test "$1" = "verbose" ; then ++ echo "Preparing func table" 1>&2; ++ fi ++ ++ c_f="$c_f CREATE TABLE func (" ++ c_f="$c_f name char(64) binary DEFAULT '' NOT NULL," ++ c_f="$c_f ret tinyint(1) DEFAULT '0' NOT NULL," ++ c_f="$c_f dl char(128) DEFAULT '' NOT NULL," ++ c_f="$c_f type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL," ++ c_f="$c_f PRIMARY KEY (name)" ++ c_f="$c_f ) engine=MyISAM" ++ c_f="$c_f CHARACTER SET utf8 COLLATE utf8_bin" ++ c_f="$c_f comment='User defined functions';" ++fi ++ ++if test ! -f $mdata/tables_priv.frm ++then ++ if test "$1" = "verbose" ; then ++ echo "Preparing tables_priv table" 1>&2; ++ fi ++ ++ c_t="$c_t CREATE TABLE tables_priv (" ++ c_t="$c_t Host char(60) binary DEFAULT '' NOT NULL," ++ c_t="$c_t Db char(64) binary DEFAULT '' NOT NULL," ++ c_t="$c_t User char(16) binary DEFAULT '' NOT NULL," ++ c_t="$c_t Table_name char(64) binary DEFAULT '' NOT NULL," ++ c_t="$c_t Grantor char(77) DEFAULT '' NOT NULL," ++ c_t="$c_t Timestamp timestamp(14)," ++ c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL," ++ c_t="$c_t Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL," ++ c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name)," ++ c_t="$c_t KEY Grantor (Grantor)" ++ c_t="$c_t ) engine=MyISAM" ++ c_t="$c_t CHARACTER SET utf8 COLLATE utf8_bin" ++ c_t="$c_t comment='Table privileges';" ++fi ++ ++if test ! -f $mdata/columns_priv.frm ++then ++ if test "$1" = "verbose" ; then ++ echo "Preparing columns_priv table" 1>&2; ++ fi ++ ++ c_c="$c_c CREATE TABLE columns_priv (" ++ c_c="$c_c Host char(60) binary DEFAULT '' NOT NULL," ++ c_c="$c_c Db char(64) binary DEFAULT '' NOT NULL," ++ c_c="$c_c User char(16) binary DEFAULT '' NOT NULL," ++ c_c="$c_c Table_name char(64) binary DEFAULT '' NOT NULL," ++ c_c="$c_c Column_name char(64) binary DEFAULT '' NOT NULL," ++ c_c="$c_c Timestamp timestamp(14)," ++ c_c="$c_c Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL," ++ c_c="$c_c PRIMARY KEY (Host,Db,User,Table_name,Column_name)" ++ c_c="$c_c ) engine=MyISAM" ++ c_c="$c_c CHARACTER SET utf8 COLLATE utf8_bin" ++ c_c="$c_c comment='Column privileges';" ++fi ++ ++if test ! -f $mdata/procs_priv.frm ++then ++ if test "$1" = "verbose" ; then ++ echo "Preparing procs_priv table" 1>&2; ++ fi ++ ++ c_pp="$c_pp CREATE TABLE procs_priv (" ++ c_pp="$c_pp Host char(60) binary DEFAULT '' NOT NULL," ++ c_pp="$c_pp Db char(64) binary DEFAULT '' NOT NULL," ++ c_pp="$c_pp User char(16) binary DEFAULT '' NOT NULL," ++ c_pp="$c_pp Routine_name char(64) binary DEFAULT '' NOT NULL," ++ c_pp="$c_pp Routine_type enum('FUNCTION','PROCEDURE') NOT NULL," ++ c_pp="$c_pp Grantor char(77) DEFAULT '' NOT NULL," ++ c_pp="$c_pp Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL," ++ c_pp="$c_pp Timestamp timestamp(14)," ++ c_pp="$c_pp PRIMARY KEY (Host,Db,User,Routine_name,Routine_type)," ++ c_pp="$c_pp KEY Grantor (Grantor)" ++ c_pp="$c_pp ) engine=MyISAM" ++ c_pp="$c_pp CHARACTER SET utf8 COLLATE utf8_bin" ++ c_pp="$c_pp comment='Procedure privileges';" ++fi ++ ++if test ! -f $mdata/help_topic.frm ++then ++ if test "$1" = "verbose" ; then ++ echo "Preparing help_topic table" 1>&2; ++ fi ++ ++ c_ht="$c_ht CREATE TABLE help_topic (" ++ c_ht="$c_ht help_topic_id int unsigned not null," ++ c_ht="$c_ht name char(64) not null," ++ c_ht="$c_ht help_category_id smallint unsigned not null," ++ c_ht="$c_ht description text not null," ++ c_ht="$c_ht example text not null," ++ c_ht="$c_ht url char(128) not null," ++ c_ht="$c_ht primary key (help_topic_id)," ++ c_ht="$c_ht unique index (name)" ++ c_ht="$c_ht ) engine=MyISAM" ++ c_ht="$c_ht CHARACTER SET utf8" ++ c_ht="$c_ht comment='help topics';" ++fi ++ ++old_categories="yes" ++ ++if test ! -f $mdata/help_category.frm ++then ++ if test "$1" = "verbose" ; then ++ echo "Preparing help_category table" 1>&2; ++ fi ++ ++ c_hc="$c_hc CREATE TABLE help_category (" ++ c_hc="$c_hc help_category_id smallint unsigned not null," ++ c_hc="$c_hc name char(64) not null," ++ c_hc="$c_hc parent_category_id smallint unsigned null," ++ c_hc="$c_hc url char(128) not null," ++ c_hc="$c_hc primary key (help_category_id)," ++ c_hc="$c_hc unique index (name)" ++ c_hc="$c_hc ) engine=MyISAM" ++ c_hc="$c_hc CHARACTER SET utf8" ++ c_hc="$c_hc comment='help categories';" ++fi ++ ++if test ! -f $mdata/help_keyword.frm ++then ++ if test "$1" = "verbose" ; then ++ echo "Preparing help_keyword table" 1>&2; ++ fi ++ ++ c_hk="$c_hk CREATE TABLE help_keyword (" ++ c_hk="$c_hk help_keyword_id int unsigned not null," ++ c_hk="$c_hk name char(64) not null," ++ c_hk="$c_hk primary key (help_keyword_id)," ++ c_hk="$c_hk unique index (name)" ++ c_hk="$c_hk ) engine=MyISAM" ++ c_hk="$c_hk CHARACTER SET utf8" ++ c_hk="$c_hk comment='help keywords';" ++fi ++ ++if test ! -f $mdata/help_relation.frm ++then ++ if test "$1" = "verbose" ; then ++ echo "Preparing help_relation table" 1>&2; ++ fi ++ ++ c_hr="$c_hr CREATE TABLE help_relation (" ++ c_hr="$c_hr help_topic_id int unsigned not null references help_topic," ++ c_hr="$c_hr help_keyword_id int unsigned not null references help_keyword," ++ c_hr="$c_hr primary key (help_keyword_id, help_topic_id)" ++ c_hr="$c_hr ) engine=MyISAM" ++ c_hr="$c_hr CHARACTER SET utf8" ++ c_hr="$c_hr comment='keyword-topic relation';" ++fi ++ ++if test ! -f $mdata/time_zone_name.frm ++then ++ if test "$1" = "verbose" ; then ++ echo "Preparing time_zone_name table" 1>&2; ++ fi ++ ++ c_tzn="$c_tzn CREATE TABLE time_zone_name (" ++ c_tzn="$c_tzn Name char(64) NOT NULL," ++ c_tzn="$c_tzn Time_zone_id int unsigned NOT NULL," ++ c_tzn="$c_tzn PRIMARY KEY Name (Name)" ++ c_tzn="$c_tzn ) engine=MyISAM CHARACTER SET utf8" ++ c_tzn="$c_tzn comment='Time zone names';" ++ ++ if test "$1" = "test" ++ then ++ i_tzn="$i_tzn INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES" ++ i_tzn="$i_tzn ('MET', 1), ('UTC', 2), ('Universal', 2), " ++ i_tzn="$i_tzn ('Europe/Moscow',3), ('leap/Europe/Moscow',4), " ++ i_tzn="$i_tzn ('Japan', 5);" ++ fi ++fi ++ ++if test ! -f $mdata/time_zone.frm ++then ++ if test "$1" = "verbose" ; then ++ echo "Preparing time_zone table" 1>&2; ++ fi ++ ++ c_tz="$c_tz CREATE TABLE time_zone (" ++ c_tz="$c_tz Time_zone_id int unsigned NOT NULL auto_increment," ++ c_tz="$c_tz Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," ++ c_tz="$c_tz PRIMARY KEY TzId (Time_zone_id)" ++ c_tz="$c_tz ) engine=MyISAM CHARACTER SET utf8" ++ c_tz="$c_tz comment='Time zones';" ++ ++ if test "$1" = "test" ++ then ++ i_tz="$i_tz INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)" ++ i_tz="$i_tz VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N');" ++ fi ++fi ++ ++if test ! -f $mdata/time_zone_transition.frm ++then ++ if test "$1" = "verbose" ; then ++ echo "Preparing time_zone_transition table" 1>&2; ++ fi ++ ++ c_tzt="$c_tzt CREATE TABLE time_zone_transition (" ++ c_tzt="$c_tzt Time_zone_id int unsigned NOT NULL," ++ c_tzt="$c_tzt Transition_time bigint signed NOT NULL," ++ c_tzt="$c_tzt Transition_type_id int unsigned NOT NULL," ++ c_tzt="$c_tzt PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)" ++ c_tzt="$c_tzt ) engine=MyISAM CHARACTER SET utf8" ++ c_tzt="$c_tzt comment='Time zone transitions';" ++ ++ if test "$1" = "test" ++ then ++ i_tzt="$i_tzt INSERT INTO time_zone_transition" ++ i_tzt="$i_tzt (Time_zone_id, Transition_time, Transition_type_id)" ++ i_tzt="$i_tzt VALUES" ++ i_tzt="$i_tzt (1, -1693706400, 0) ,(1, -1680483600, 1)" ++ i_tzt="$i_tzt ,(1, -1663455600, 2) ,(1, -1650150000, 3)" ++ i_tzt="$i_tzt ,(1, -1632006000, 2) ,(1, -1618700400, 3)" ++ i_tzt="$i_tzt ,(1, -938905200, 2) ,(1, -857257200, 3)" ++ i_tzt="$i_tzt ,(1, -844556400, 2) ,(1, -828226800, 3)" ++ i_tzt="$i_tzt ,(1, -812502000, 2) ,(1, -796777200, 3)" ++ i_tzt="$i_tzt ,(1, 228877200, 2) ,(1, 243997200, 3)" ++ i_tzt="$i_tzt ,(1, 260326800, 2) ,(1, 276051600, 3)" ++ i_tzt="$i_tzt ,(1, 291776400, 2) ,(1, 307501200, 3)" ++ i_tzt="$i_tzt ,(1, 323830800, 2) ,(1, 338950800, 3)" ++ i_tzt="$i_tzt ,(1, 354675600, 2) ,(1, 370400400, 3)" ++ i_tzt="$i_tzt ,(1, 386125200, 2) ,(1, 401850000, 3)" ++ i_tzt="$i_tzt ,(1, 417574800, 2) ,(1, 433299600, 3)" ++ i_tzt="$i_tzt ,(1, 449024400, 2) ,(1, 465354000, 3)" ++ i_tzt="$i_tzt ,(1, 481078800, 2) ,(1, 496803600, 3)" ++ i_tzt="$i_tzt ,(1, 512528400, 2) ,(1, 528253200, 3)" ++ i_tzt="$i_tzt ,(1, 543978000, 2) ,(1, 559702800, 3)" ++ i_tzt="$i_tzt ,(1, 575427600, 2) ,(1, 591152400, 3)" ++ i_tzt="$i_tzt ,(1, 606877200, 2) ,(1, 622602000, 3)" ++ i_tzt="$i_tzt ,(1, 638326800, 2) ,(1, 654656400, 3)" ++ i_tzt="$i_tzt ,(1, 670381200, 2) ,(1, 686106000, 3)" ++ i_tzt="$i_tzt ,(1, 701830800, 2) ,(1, 717555600, 3)" ++ i_tzt="$i_tzt ,(1, 733280400, 2) ,(1, 749005200, 3)" ++ i_tzt="$i_tzt ,(1, 764730000, 2) ,(1, 780454800, 3)" ++ i_tzt="$i_tzt ,(1, 796179600, 2) ,(1, 811904400, 3)" ++ i_tzt="$i_tzt ,(1, 828234000, 2) ,(1, 846378000, 3)" ++ i_tzt="$i_tzt ,(1, 859683600, 2) ,(1, 877827600, 3)" ++ i_tzt="$i_tzt ,(1, 891133200, 2) ,(1, 909277200, 3)" ++ i_tzt="$i_tzt ,(1, 922582800, 2) ,(1, 941331600, 3)" ++ i_tzt="$i_tzt ,(1, 954032400, 2) ,(1, 972781200, 3)" ++ i_tzt="$i_tzt ,(1, 985482000, 2) ,(1, 1004230800, 3)" ++ i_tzt="$i_tzt ,(1, 1017536400, 2) ,(1, 1035680400, 3)" ++ i_tzt="$i_tzt ,(1, 1048986000, 2) ,(1, 1067130000, 3)" ++ i_tzt="$i_tzt ,(1, 1080435600, 2) ,(1, 1099184400, 3)" ++ i_tzt="$i_tzt ,(1, 1111885200, 2) ,(1, 1130634000, 3)" ++ i_tzt="$i_tzt ,(1, 1143334800, 2) ,(1, 1162083600, 3)" ++ i_tzt="$i_tzt ,(1, 1174784400, 2) ,(1, 1193533200, 3)" ++ i_tzt="$i_tzt ,(1, 1206838800, 2) ,(1, 1224982800, 3)" ++ i_tzt="$i_tzt ,(1, 1238288400, 2) ,(1, 1256432400, 3)" ++ i_tzt="$i_tzt ,(1, 1269738000, 2) ,(1, 1288486800, 3)" ++ i_tzt="$i_tzt ,(1, 1301187600, 2) ,(1, 1319936400, 3)" ++ i_tzt="$i_tzt ,(1, 1332637200, 2) ,(1, 1351386000, 3)" ++ i_tzt="$i_tzt ,(1, 1364691600, 2) ,(1, 1382835600, 3)" ++ i_tzt="$i_tzt ,(1, 1396141200, 2) ,(1, 1414285200, 3)" ++ i_tzt="$i_tzt ,(1, 1427590800, 2) ,(1, 1445734800, 3)" ++ i_tzt="$i_tzt ,(1, 1459040400, 2) ,(1, 1477789200, 3)" ++ i_tzt="$i_tzt ,(1, 1490490000, 2) ,(1, 1509238800, 3)" ++ i_tzt="$i_tzt ,(1, 1521939600, 2) ,(1, 1540688400, 3)" ++ i_tzt="$i_tzt ,(1, 1553994000, 2) ,(1, 1572138000, 3)" ++ i_tzt="$i_tzt ,(1, 1585443600, 2) ,(1, 1603587600, 3)" ++ i_tzt="$i_tzt ,(1, 1616893200, 2) ,(1, 1635642000, 3)" ++ i_tzt="$i_tzt ,(1, 1648342800, 2) ,(1, 1667091600, 3)" ++ i_tzt="$i_tzt ,(1, 1679792400, 2) ,(1, 1698541200, 3)" ++ i_tzt="$i_tzt ,(1, 1711846800, 2) ,(1, 1729990800, 3)" ++ i_tzt="$i_tzt ,(1, 1743296400, 2) ,(1, 1761440400, 3)" ++ i_tzt="$i_tzt ,(1, 1774746000, 2) ,(1, 1792890000, 3)" ++ i_tzt="$i_tzt ,(1, 1806195600, 2) ,(1, 1824944400, 3)" ++ i_tzt="$i_tzt ,(1, 1837645200, 2) ,(1, 1856394000, 3)" ++ i_tzt="$i_tzt ,(1, 1869094800, 2) ,(1, 1887843600, 3)" ++ i_tzt="$i_tzt ,(1, 1901149200, 2) ,(1, 1919293200, 3)" ++ i_tzt="$i_tzt ,(1, 1932598800, 2) ,(1, 1950742800, 3)" ++ i_tzt="$i_tzt ,(1, 1964048400, 2) ,(1, 1982797200, 3)" ++ i_tzt="$i_tzt ,(1, 1995498000, 2) ,(1, 2014246800, 3)" ++ i_tzt="$i_tzt ,(1, 2026947600, 2) ,(1, 2045696400, 3)" ++ i_tzt="$i_tzt ,(1, 2058397200, 2) ,(1, 2077146000, 3)" ++ i_tzt="$i_tzt ,(1, 2090451600, 2) ,(1, 2108595600, 3)" ++ i_tzt="$i_tzt ,(1, 2121901200, 2) ,(1, 2140045200, 3)" ++ i_tzt="$i_tzt ,(3, -1688265000, 2) ,(3, -1656819048, 1)" ++ i_tzt="$i_tzt ,(3, -1641353448, 2) ,(3, -1627965048, 3)" ++ i_tzt="$i_tzt ,(3, -1618716648, 1) ,(3, -1596429048, 3)" ++ i_tzt="$i_tzt ,(3, -1593829848, 5) ,(3, -1589860800, 4)" ++ i_tzt="$i_tzt ,(3, -1542427200, 5) ,(3, -1539493200, 6)" ++ i_tzt="$i_tzt ,(3, -1525323600, 5) ,(3, -1522728000, 4)" ++ i_tzt="$i_tzt ,(3, -1491188400, 7) ,(3, -1247536800, 4)" ++ i_tzt="$i_tzt ,(3, 354920400, 5) ,(3, 370728000, 4)" ++ i_tzt="$i_tzt ,(3, 386456400, 5) ,(3, 402264000, 4)" ++ i_tzt="$i_tzt ,(3, 417992400, 5) ,(3, 433800000, 4)" ++ i_tzt="$i_tzt ,(3, 449614800, 5) ,(3, 465346800, 8)" ++ i_tzt="$i_tzt ,(3, 481071600, 9) ,(3, 496796400, 8)" ++ i_tzt="$i_tzt ,(3, 512521200, 9) ,(3, 528246000, 8)" ++ i_tzt="$i_tzt ,(3, 543970800, 9) ,(3, 559695600, 8)" ++ i_tzt="$i_tzt ,(3, 575420400, 9) ,(3, 591145200, 8)" ++ i_tzt="$i_tzt ,(3, 606870000, 9) ,(3, 622594800, 8)" ++ i_tzt="$i_tzt ,(3, 638319600, 9) ,(3, 654649200, 8)" ++ i_tzt="$i_tzt ,(3, 670374000, 10) ,(3, 686102400, 11)" ++ i_tzt="$i_tzt ,(3, 695779200, 8) ,(3, 701812800, 5)" ++ i_tzt="$i_tzt ,(3, 717534000, 4) ,(3, 733273200, 9)" ++ i_tzt="$i_tzt ,(3, 748998000, 8) ,(3, 764722800, 9)" ++ i_tzt="$i_tzt ,(3, 780447600, 8) ,(3, 796172400, 9)" ++ i_tzt="$i_tzt ,(3, 811897200, 8) ,(3, 828226800, 9)" ++ i_tzt="$i_tzt ,(3, 846370800, 8) ,(3, 859676400, 9)" ++ i_tzt="$i_tzt ,(3, 877820400, 8) ,(3, 891126000, 9)" ++ i_tzt="$i_tzt ,(3, 909270000, 8) ,(3, 922575600, 9)" ++ i_tzt="$i_tzt ,(3, 941324400, 8) ,(3, 954025200, 9)" ++ i_tzt="$i_tzt ,(3, 972774000, 8) ,(3, 985474800, 9)" ++ i_tzt="$i_tzt ,(3, 1004223600, 8) ,(3, 1017529200, 9)" ++ i_tzt="$i_tzt ,(3, 1035673200, 8) ,(3, 1048978800, 9)" ++ i_tzt="$i_tzt ,(3, 1067122800, 8) ,(3, 1080428400, 9)" ++ i_tzt="$i_tzt ,(3, 1099177200, 8) ,(3, 1111878000, 9)" ++ i_tzt="$i_tzt ,(3, 1130626800, 8) ,(3, 1143327600, 9)" ++ i_tzt="$i_tzt ,(3, 1162076400, 8) ,(3, 1174777200, 9)" ++ i_tzt="$i_tzt ,(3, 1193526000, 8) ,(3, 1206831600, 9)" ++ i_tzt="$i_tzt ,(3, 1224975600, 8) ,(3, 1238281200, 9)" ++ i_tzt="$i_tzt ,(3, 1256425200, 8) ,(3, 1269730800, 9)" ++ i_tzt="$i_tzt ,(3, 1288479600, 8) ,(3, 1301180400, 9)" ++ i_tzt="$i_tzt ,(3, 1319929200, 8) ,(3, 1332630000, 9)" ++ i_tzt="$i_tzt ,(3, 1351378800, 8) ,(3, 1364684400, 9)" ++ i_tzt="$i_tzt ,(3, 1382828400, 8) ,(3, 1396134000, 9)" ++ i_tzt="$i_tzt ,(3, 1414278000, 8) ,(3, 1427583600, 9)" ++ i_tzt="$i_tzt ,(3, 1445727600, 8) ,(3, 1459033200, 9)" ++ i_tzt="$i_tzt ,(3, 1477782000, 8) ,(3, 1490482800, 9)" ++ i_tzt="$i_tzt ,(3, 1509231600, 8) ,(3, 1521932400, 9)" ++ i_tzt="$i_tzt ,(3, 1540681200, 8) ,(3, 1553986800, 9)" ++ i_tzt="$i_tzt ,(3, 1572130800, 8) ,(3, 1585436400, 9)" ++ i_tzt="$i_tzt ,(3, 1603580400, 8) ,(3, 1616886000, 9)" ++ i_tzt="$i_tzt ,(3, 1635634800, 8) ,(3, 1648335600, 9)" ++ i_tzt="$i_tzt ,(3, 1667084400, 8) ,(3, 1679785200, 9)" ++ i_tzt="$i_tzt ,(3, 1698534000, 8) ,(3, 1711839600, 9)" ++ i_tzt="$i_tzt ,(3, 1729983600, 8) ,(3, 1743289200, 9)" ++ i_tzt="$i_tzt ,(3, 1761433200, 8) ,(3, 1774738800, 9)" ++ i_tzt="$i_tzt ,(3, 1792882800, 8) ,(3, 1806188400, 9)" ++ i_tzt="$i_tzt ,(3, 1824937200, 8) ,(3, 1837638000, 9)" ++ i_tzt="$i_tzt ,(3, 1856386800, 8) ,(3, 1869087600, 9)" ++ i_tzt="$i_tzt ,(3, 1887836400, 8) ,(3, 1901142000, 9)" ++ i_tzt="$i_tzt ,(3, 1919286000, 8) ,(3, 1932591600, 9)" ++ i_tzt="$i_tzt ,(3, 1950735600, 8) ,(3, 1964041200, 9)" ++ i_tzt="$i_tzt ,(3, 1982790000, 8) ,(3, 1995490800, 9)" ++ i_tzt="$i_tzt ,(3, 2014239600, 8) ,(3, 2026940400, 9)" ++ i_tzt="$i_tzt ,(3, 2045689200, 8) ,(3, 2058390000, 9)" ++ i_tzt="$i_tzt ,(3, 2077138800, 8) ,(3, 2090444400, 9)" ++ i_tzt="$i_tzt ,(3, 2108588400, 8) ,(3, 2121894000, 9)" ++ i_tzt="$i_tzt ,(3, 2140038000, 8)" ++ i_tzt="$i_tzt ,(4, -1688265000, 2) ,(4, -1656819048, 1)" ++ i_tzt="$i_tzt ,(4, -1641353448, 2) ,(4, -1627965048, 3)" ++ i_tzt="$i_tzt ,(4, -1618716648, 1) ,(4, -1596429048, 3)" ++ i_tzt="$i_tzt ,(4, -1593829848, 5) ,(4, -1589860800, 4)" ++ i_tzt="$i_tzt ,(4, -1542427200, 5) ,(4, -1539493200, 6)" ++ i_tzt="$i_tzt ,(4, -1525323600, 5) ,(4, -1522728000, 4)" ++ i_tzt="$i_tzt ,(4, -1491188400, 7) ,(4, -1247536800, 4)" ++ i_tzt="$i_tzt ,(4, 354920409, 5) ,(4, 370728010, 4)" ++ i_tzt="$i_tzt ,(4, 386456410, 5) ,(4, 402264011, 4)" ++ i_tzt="$i_tzt ,(4, 417992411, 5) ,(4, 433800012, 4)" ++ i_tzt="$i_tzt ,(4, 449614812, 5) ,(4, 465346812, 8)" ++ i_tzt="$i_tzt ,(4, 481071612, 9) ,(4, 496796413, 8)" ++ i_tzt="$i_tzt ,(4, 512521213, 9) ,(4, 528246013, 8)" ++ i_tzt="$i_tzt ,(4, 543970813, 9) ,(4, 559695613, 8)" ++ i_tzt="$i_tzt ,(4, 575420414, 9) ,(4, 591145214, 8)" ++ i_tzt="$i_tzt ,(4, 606870014, 9) ,(4, 622594814, 8)" ++ i_tzt="$i_tzt ,(4, 638319615, 9) ,(4, 654649215, 8)" ++ i_tzt="$i_tzt ,(4, 670374016, 10) ,(4, 686102416, 11)" ++ i_tzt="$i_tzt ,(4, 695779216, 8) ,(4, 701812816, 5)" ++ i_tzt="$i_tzt ,(4, 717534017, 4) ,(4, 733273217, 9)" ++ i_tzt="$i_tzt ,(4, 748998018, 8) ,(4, 764722818, 9)" ++ i_tzt="$i_tzt ,(4, 780447619, 8) ,(4, 796172419, 9)" ++ i_tzt="$i_tzt ,(4, 811897219, 8) ,(4, 828226820, 9)" ++ i_tzt="$i_tzt ,(4, 846370820, 8) ,(4, 859676420, 9)" ++ i_tzt="$i_tzt ,(4, 877820421, 8) ,(4, 891126021, 9)" ++ i_tzt="$i_tzt ,(4, 909270021, 8) ,(4, 922575622, 9)" ++ i_tzt="$i_tzt ,(4, 941324422, 8) ,(4, 954025222, 9)" ++ i_tzt="$i_tzt ,(4, 972774022, 8) ,(4, 985474822, 9)" ++ i_tzt="$i_tzt ,(4, 1004223622, 8) ,(4, 1017529222, 9)" ++ i_tzt="$i_tzt ,(4, 1035673222, 8) ,(4, 1048978822, 9)" ++ i_tzt="$i_tzt ,(4, 1067122822, 8) ,(4, 1080428422, 9)" ++ i_tzt="$i_tzt ,(4, 1099177222, 8) ,(4, 1111878022, 9)" ++ i_tzt="$i_tzt ,(4, 1130626822, 8) ,(4, 1143327622, 9)" ++ i_tzt="$i_tzt ,(4, 1162076422, 8) ,(4, 1174777222, 9)" ++ i_tzt="$i_tzt ,(4, 1193526022, 8) ,(4, 1206831622, 9)" ++ i_tzt="$i_tzt ,(4, 1224975622, 8) ,(4, 1238281222, 9)" ++ i_tzt="$i_tzt ,(4, 1256425222, 8) ,(4, 1269730822, 9)" ++ i_tzt="$i_tzt ,(4, 1288479622, 8) ,(4, 1301180422, 9)" ++ i_tzt="$i_tzt ,(4, 1319929222, 8) ,(4, 1332630022, 9)" ++ i_tzt="$i_tzt ,(4, 1351378822, 8) ,(4, 1364684422, 9)" ++ i_tzt="$i_tzt ,(4, 1382828422, 8) ,(4, 1396134022, 9)" ++ i_tzt="$i_tzt ,(4, 1414278022, 8) ,(4, 1427583622, 9)" ++ i_tzt="$i_tzt ,(4, 1445727622, 8) ,(4, 1459033222, 9)" ++ i_tzt="$i_tzt ,(4, 1477782022, 8) ,(4, 1490482822, 9)" ++ i_tzt="$i_tzt ,(4, 1509231622, 8) ,(4, 1521932422, 9)" ++ i_tzt="$i_tzt ,(4, 1540681222, 8) ,(4, 1553986822, 9)" ++ i_tzt="$i_tzt ,(4, 1572130822, 8) ,(4, 1585436422, 9)" ++ i_tzt="$i_tzt ,(4, 1603580422, 8) ,(4, 1616886022, 9)" ++ i_tzt="$i_tzt ,(4, 1635634822, 8) ,(4, 1648335622, 9)" ++ i_tzt="$i_tzt ,(4, 1667084422, 8) ,(4, 1679785222, 9)" ++ i_tzt="$i_tzt ,(4, 1698534022, 8) ,(4, 1711839622, 9)" ++ i_tzt="$i_tzt ,(4, 1729983622, 8) ,(4, 1743289222, 9)" ++ i_tzt="$i_tzt ,(4, 1761433222, 8) ,(4, 1774738822, 9)" ++ i_tzt="$i_tzt ,(4, 1792882822, 8) ,(4, 1806188422, 9)" ++ i_tzt="$i_tzt ,(4, 1824937222, 8) ,(4, 1837638022, 9)" ++ i_tzt="$i_tzt ,(4, 1856386822, 8) ,(4, 1869087622, 9)" ++ i_tzt="$i_tzt ,(4, 1887836422, 8) ,(4, 1901142022, 9)" ++ i_tzt="$i_tzt ,(4, 1919286022, 8) ,(4, 1932591622, 9)" ++ i_tzt="$i_tzt ,(4, 1950735622, 8) ,(4, 1964041222, 9)" ++ i_tzt="$i_tzt ,(4, 1982790022, 8) ,(4, 1995490822, 9)" ++ i_tzt="$i_tzt ,(4, 2014239622, 8) ,(4, 2026940422, 9)" ++ i_tzt="$i_tzt ,(4, 2045689222, 8) ,(4, 2058390022, 9)" ++ i_tzt="$i_tzt ,(4, 2077138822, 8) ,(4, 2090444422, 9)" ++ i_tzt="$i_tzt ,(4, 2108588422, 8) ,(4, 2121894022, 9)" ++ i_tzt="$i_tzt ,(4, 2140038022, 8)" ++ i_tzt="$i_tzt ,(5, -1009875600, 1);" ++ fi ++fi ++ ++if test ! -f $mdata/time_zone_transition_type.frm ++then ++ if test "$1" = "verbose" ; then ++ echo "Preparing time_zone_transition_type table" 1>&2; ++ fi ++ ++ c_tztt="$c_tztt CREATE TABLE time_zone_transition_type (" ++ c_tztt="$c_tztt Time_zone_id int unsigned NOT NULL," ++ c_tztt="$c_tztt Transition_type_id int unsigned NOT NULL," ++ c_tztt="$c_tztt Offset int signed DEFAULT 0 NOT NULL," ++ c_tztt="$c_tztt Is_DST tinyint unsigned DEFAULT 0 NOT NULL," ++ c_tztt="$c_tztt Abbreviation char(8) DEFAULT '' NOT NULL," ++ c_tztt="$c_tztt PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)" ++ c_tztt="$c_tztt ) engine=MyISAM CHARACTER SET utf8" ++ c_tztt="$c_tztt comment='Time zone transition types';" ++ ++ if test "$1" = "test" ++ then ++ i_tztt="$i_tztt INSERT INTO time_zone_transition_type (Time_zone_id," ++ i_tztt="$i_tztt Transition_type_id, Offset, Is_DST, Abbreviation) VALUES" ++ i_tztt="$i_tztt (1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET')" ++ i_tztt="$i_tztt ,(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET')" ++ i_tztt="$i_tztt ,(2, 0, 0, 0, 'UTC')" ++ i_tztt="$i_tztt ,(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST')" ++ i_tztt="$i_tztt ,(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST')" ++ i_tztt="$i_tztt ,(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD')" ++ i_tztt="$i_tztt ,(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET')" ++ i_tztt="$i_tztt ,(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD')" ++ i_tztt="$i_tztt ,(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET')" ++ i_tztt="$i_tztt ,(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST')" ++ i_tztt="$i_tztt ,(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST')" ++ i_tztt="$i_tztt ,(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')" ++ i_tztt="$i_tztt ,(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')" ++ i_tztt="$i_tztt ,(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')" ++ i_tztt="$i_tztt ,(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET')" ++ i_tztt="$i_tztt ,(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST');" ++ fi ++fi ++ ++if test ! -f $mdata/time_zone_leap_second.frm ++then ++ if test "$1" = "verbose" ; then ++ echo "Preparing time_zone_leap_second table" 1>&2; ++ fi ++ ++ c_tzls="$c_tzls CREATE TABLE time_zone_leap_second (" ++ c_tzls="$c_tzls Transition_time bigint signed NOT NULL," ++ c_tzls="$c_tzls Correction int signed NOT NULL," ++ c_tzls="$c_tzls PRIMARY KEY TranTime (Transition_time)" ++ c_tzls="$c_tzls ) engine=MyISAM CHARACTER SET utf8" ++ c_tzls="$c_tzls comment='Leap seconds information for time zones';" ++ ++ if test "$1" = "test" ++ then ++ i_tzls="$i_tzls INSERT INTO time_zone_leap_second " ++ i_tzls="$i_tzls (Transition_time, Correction) VALUES " ++ i_tzls="$i_tzls (78796800, 1) ,(94694401, 2) ,(126230402, 3)" ++ i_tzls="$i_tzls ,(157766403, 4) ,(189302404, 5) ,(220924805, 6)" ++ i_tzls="$i_tzls ,(252460806, 7) ,(283996807, 8) ,(315532808, 9)" ++ i_tzls="$i_tzls ,(362793609, 10) ,(394329610, 11) ,(425865611, 12)" ++ i_tzls="$i_tzls ,(489024012, 13) ,(567993613, 14) ,(631152014, 15)" ++ i_tzls="$i_tzls ,(662688015, 16) ,(709948816, 17) ,(741484817, 18)" ++ i_tzls="$i_tzls ,(773020818, 19) ,(820454419, 20) ,(867715220, 21)" ++ i_tzls="$i_tzls ,(915148821, 22);" ++ fi ++fi ++ ++if test ! -f $mdata/proc.frm ++then ++ c_p="$c_p CREATE TABLE proc (" ++ c_p="$c_p db char(64) collate utf8_bin DEFAULT '' NOT NULL," ++ c_p="$c_p name char(64) DEFAULT '' NOT NULL," ++ c_p="$c_p type enum('FUNCTION','PROCEDURE') NOT NULL," ++ c_p="$c_p specific_name char(64) DEFAULT '' NOT NULL," ++ c_p="$c_p language enum('SQL') DEFAULT 'SQL' NOT NULL," ++ c_p="$c_p sql_data_access enum('CONTAINS_SQL'," ++ c_p="$c_p 'NO_SQL'," ++ c_p="$c_p 'READS_SQL_DATA'," ++ c_p="$c_p 'MODIFIES_SQL_DATA'" ++ c_p="$c_p ) DEFAULT 'CONTAINS_SQL' NOT NULL," ++ c_p="$c_p is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL," ++ c_p="$c_p security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL," ++ c_p="$c_p param_list blob DEFAULT '' NOT NULL," ++ c_p="$c_p returns char(64) DEFAULT '' NOT NULL," ++ c_p="$c_p body longblob DEFAULT '' NOT NULL," ++ c_p="$c_p definer char(77) collate utf8_bin DEFAULT '' NOT NULL," ++ c_p="$c_p created timestamp," ++ c_p="$c_p modified timestamp," ++ c_p="$c_p sql_mode set(" ++ c_p="$c_p 'REAL_AS_FLOAT'," ++ c_p="$c_p 'PIPES_AS_CONCAT'," ++ c_p="$c_p 'ANSI_QUOTES'," ++ c_p="$c_p 'IGNORE_SPACE'," ++ c_p="$c_p 'NOT_USED'," ++ c_p="$c_p 'ONLY_FULL_GROUP_BY'," ++ c_p="$c_p 'NO_UNSIGNED_SUBTRACTION'," ++ c_p="$c_p 'NO_DIR_IN_CREATE'," ++ c_p="$c_p 'POSTGRESQL'," ++ c_p="$c_p 'ORACLE'," ++ c_p="$c_p 'MSSQL'," ++ c_p="$c_p 'DB2'," ++ c_p="$c_p 'MAXDB'," ++ c_p="$c_p 'NO_KEY_OPTIONS'," ++ c_p="$c_p 'NO_TABLE_OPTIONS'," ++ c_p="$c_p 'NO_FIELD_OPTIONS'," ++ c_p="$c_p 'MYSQL323'," ++ c_p="$c_p 'MYSQL40'," ++ c_p="$c_p 'ANSI'," ++ c_p="$c_p 'NO_AUTO_VALUE_ON_ZERO'," ++ c_p="$c_p 'NO_BACKSLASH_ESCAPES'," ++ c_p="$c_p 'STRICT_TRANS_TABLES'," ++ c_p="$c_p 'STRICT_ALL_TABLES'," ++ c_p="$c_p 'NO_ZERO_IN_DATE'," ++ c_p="$c_p 'NO_ZERO_DATE'," ++ c_p="$c_p 'INVALID_DATES'," ++ c_p="$c_p 'ERROR_FOR_DIVISION_BY_ZERO'," ++ c_p="$c_p 'TRADITIONAL'," ++ c_p="$c_p 'NO_AUTO_CREATE_USER'," ++ c_p="$c_p 'HIGH_NOT_PRECEDENCE'" ++ c_p="$c_p ) DEFAULT '' NOT NULL," ++ c_p="$c_p comment char(64) collate utf8_bin DEFAULT '' NOT NULL," ++ c_p="$c_p PRIMARY KEY (db,name,type)" ++ c_p="$c_p ) engine=MyISAM" ++ c_p="$c_p character set utf8" ++ c_p="$c_p comment='Stored Procedures';" ++fi ++ ++cat << END_OF_DATA ++use mysql; ++set table_type=myisam; ++$c_d ++$i_d ++ ++$c_h ++$i_h ++ ++$c_u ++$i_u ++ ++$c_f ++$i_f ++ ++$c_t ++$c_c ++ ++$c_ht ++$c_hc ++$c_hr ++$c_hk ++ ++$c_tzn ++$i_tzn ++$c_tz ++$i_tz ++$c_tzt ++$i_tzt ++$c_tztt ++$i_tztt ++$c_tzls ++$i_tzls ++ ++$c_p ++$c_pp ++ ++END_OF_DATA ++ +diff -Naur mysql-5.0.34-bk-20070101.orig/scripts/mysql_fix_privilege_tables.sh mysql-5.0.34-bk-20070101/scripts/mysql_fix_privilege_tables.sh +--- mysql-5.0.34-bk-20070101.orig/scripts/mysql_fix_privilege_tables.sh 2007-01-01 19:10:29.000000000 +0100 ++++ mysql-5.0.34-bk-20070101/scripts/mysql_fix_privilege_tables.sh 2007-01-03 00:50:06.000000000 +0100 +@@ -92,17 +92,17 @@ + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments + +-print_defaults=my_print_defaults ++print_defaults=@mybin_my_print_defaults@ + for dir in ./bin @bindir@ @bindir@ extra $print_defaults_bindir/../bin $print_defaults_bindir/../extra + do +- if test -x $dir/my_print_defaults ++ if test -x $dir/@mybin_my_print_defaults@ + then +- print_defaults="$dir/my_print_defaults" ++ print_defaults="$dir/@mybin_my_print_defaults@" + break + fi + done + +-parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables` ++parse_arguments `$print_defaults $defaults @mybin_mysql_install_db@ @mybin_mysql_fix_privilege_tables@` + parse_arguments PICK-ARGS-FROM-ARGV "$@" + + if test -z "$password" +@@ -118,7 +118,7 @@ + then + for i in @bindir@ $basedir/bin "$dirname/../client" + do +- if test -f $i/mysql ++ if test -f $i/@mybin_mysql@ + then + bindir=$i + break +@@ -133,7 +133,7 @@ + exit 1 + fi + +-cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" ++cmd="$bindir/@mybin_mysql@ --no-defaults --force --user=$user --host=$host" + if test ! -z "$port"; then + cmd="$cmd --port=$port" + fi +@@ -148,7 +148,7 @@ + fi + + # Find where first mysql_fix_privilege_tables.sql is located +-for i in $basedir/support-files $basedir/share $basedir/share/mysql \ ++for i in @sharedstatedir@ $basedir/support-files $basedir/share $basedir/share/mysql \ + $basedir/scripts $pkgdatadir . "$dirname" + do + if test -f $i/$file +diff -Naur mysql-5.0.34-bk-20070101.orig/scripts/mysql_install_db.sh mysql-5.0.34-bk-20070101/scripts/mysql_install_db.sh +--- mysql-5.0.34-bk-20070101.orig/scripts/mysql_install_db.sh 2007-01-01 19:10:29.000000000 +0100 ++++ mysql-5.0.34-bk-20070101/scripts/mysql_install_db.sh 2007-01-03 00:55:51.000000000 +0100 +@@ -70,20 +70,20 @@ + + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x ./extra/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "./extra/@mybin_my_print_defaults@" + then +- print_defaults="./extra/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./extra/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + args= +@@ -108,10 +108,10 @@ + pkgdatadir=@pkgdatadir@ + else + bindir="$basedir/bin" +- if test -x "$basedir/libexec/mysqld" ++ if test -x "$basedir/libexec/@mybin_mysqld@" + then + execdir="$basedir/libexec" +- elif test -x "$basedir/sbin/mysqld" ++ elif test -x "$basedir/sbin/@mybin_mysqld@" + then + execdir="$basedir/sbin" + else +@@ -124,7 +124,8 @@ + then + fill_help_tables=$srcdir/scripts/fill_help_tables.sql + else +- for i in $basedir/support-files $basedir/share $basedir/share/mysql \ ++ for i in @sharedstatedir@ \ ++ $basedir/support-files $basedir/share $basedir/share/mysql \ + $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ + do + if test -f $i/fill_help_tables.sql +@@ -143,13 +144,13 @@ + fi + + mdata=$ldata/mysql +-mysqld=$execdir/mysqld ++mysqld=$execdir/@mybin_mysqld@ + mysqld_opt="" + scriptdir=$bindir + + if test "$windows" = 1 + then +- mysqld="./sql/mysqld" ++ mysqld="./sql/@mybin_mysqld@" + if test -n "$srcdir" -a -f $srcdir/sql/share/english/errmsg.sys + then + langdir=$srcdir/sql/share/english +@@ -179,14 +180,14 @@ + # Check if hostname is valid + if test "$windows" = 0 -a "$in_rpm" = 0 -a $force = 0 + then +- resolved=`$bindir/resolveip $hostname 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ $hostname 2>&1` + if [ $? -ne 0 ] + then +- resolved=`$bindir/resolveip localhost 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ localhost 2>&1` + if [ $? -ne 0 ] + then + echo "Neither host '$hostname' nor 'localhost' could be looked up with" +- echo "$bindir/resolveip" ++ echo "$bindir/@mybin_resolveip@" + echo "Please configure the 'hostname' command to return a correct hostname." + echo "If you want to solve this at a later stage, restart this script with" + echo "the --force option" +@@ -194,7 +195,7 @@ + fi + echo "WARNING: The host '$hostname' could not be looked up with resolveip." + echo "This probably means that your libc libraries are not 100 % compatible" +- echo "with this binary MySQL version. The MySQL daemon, mysqld, should work" ++ echo "with this binary MySQL version. The MySQL daemon, @mybin_mysqld@, should work" + echo "normally with the exception that host name resolving will not work." + echo "This means that you should use IP addresses instead of hostnames" + echo "when specifying MySQL privileges !" +@@ -239,7 +240,7 @@ + mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ + --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ + --skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" +-if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ ++if $scriptdir/@mybin_mysql_create_system_tables@ $create_option $mdata $hostname $windows \ + | eval "$mysqld_install_cmd_line" + then + if test -n "$fill_help_tables" +@@ -269,8 +270,8 @@ + then + echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" + echo "To do so, start the server, then issue the following commands:" +- echo "$bindir/mysqladmin -u root password 'new-password'" +- echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root -h $hostname password 'new-password'" + echo "See the manual for more instructions." + # + # Print message about upgrading unless we have created a new db table. +@@ -278,14 +279,14 @@ + then + echo + echo "NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run" +- echo "the $bindir/mysql_fix_privilege_tables. Otherwise you will not be" ++ echo "the $bindir/@mybin_mysql_fix_privilege_tables@. Otherwise you will not be" + echo "able to use the new GRANT command!" + fi + echo + if test "$in_rpm" = "0" + then + echo "You can start the MySQL daemon with:" +- echo "cd @prefix@ ; $bindir/mysqld_safe &" ++ echo "cd @prefix@ ; $bindir/@mybin_mysqld_safe@ &" + echo + echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:" + echo "cd sql-bench ; perl run-all-tests" +@@ -305,13 +306,13 @@ + echo "You can also try to start the mysqld daemon with:" + echo "$mysqld --skip-grant &" + echo "You can use the command line tool" +- echo "$bindir/mysql to connect to the mysql" ++ echo "$bindir/@mybin_mysql@ to connect to the mysql" + echo "database and look at the grant tables:" + echo +- echo "shell> $bindir/mysql -u root mysql" ++ echo "shell> $bindir/@mybin_mysql@ -u root mysql" + echo "mysql> show tables" + echo +- echo "Try 'mysqld --help' if you have problems with paths. Using --log" ++ echo "Try '@mybin_mysqld@ --help' if you have problems with paths. Using --log" + echo "gives you a log in $ldata that may be helpful." + echo + echo "The latest information about MySQL is available on the web at" +@@ -320,6 +321,6 @@ + echo "and the manual section that describes problems on your OS." + echo "Another information source is the MySQL email archive." + echo "Please check all of the above before mailing us!" +- echo "And if you do mail us, you MUST use the @scriptdir@/mysqlbug script!" ++ echo "And if you do mail us, you MUST use the @scriptdir@/@mybin_mysqlbug@ script!" + exit 1 + fi +diff -Naur mysql-5.0.34-bk-20070101.orig/scripts/mysql_secure_installation.sh mysql-5.0.34-bk-20070101/scripts/mysql_secure_installation.sh +--- mysql-5.0.34-bk-20070101.orig/scripts/mysql_secure_installation.sh 2007-01-01 19:10:29.000000000 +0100 ++++ mysql-5.0.34-bk-20070101/scripts/mysql_secure_installation.sh 2007-01-03 00:48:04.000000000 +0100 +@@ -29,7 +29,7 @@ + + do_query() { + echo $1 >$command +- mysql --defaults-file=$config <$command ++ @mybin_mysql@ --defaults-file=$config <$command + return $? + } + +diff -Naur mysql-5.0.34-bk-20070101.orig/scripts/mysql_secure_installation.sh.orig mysql-5.0.34-bk-20070101/scripts/mysql_secure_installation.sh.orig +--- mysql-5.0.34-bk-20070101.orig/scripts/mysql_secure_installation.sh.orig 1970-01-01 01:00:00.000000000 +0100 ++++ mysql-5.0.34-bk-20070101/scripts/mysql_secure_installation.sh.orig 2007-01-01 19:10:29.000000000 +0100 +@@ -0,0 +1,311 @@ ++#!/bin/sh ++ ++# Copyright (C) 2002 MySQL AB and Jeremy Cole ++# ++# 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; version 2 of the License. ++# ++# 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 ++ ++config=".my.cnf.$$" ++command=".mysql.$$" ++ ++trap "interrupt" 2 ++ ++rootpass="" ++ ++prepare() { ++ touch $config $command ++ chmod 600 $config $command ++} ++ ++do_query() { ++ echo $1 >$command ++ mysql --defaults-file=$config <$command ++ return $? ++} ++ ++make_config() { ++ echo "# mysql_secure_installation config file" >$config ++ echo "[mysql]" >>$config ++ echo "user=root" >>$config ++ echo "password=$rootpass" >>$config ++} ++ ++get_root_password() { ++ status=1 ++ while [ $status -eq 1 ]; do ++ stty -echo ++ echo -n "Enter current password for root (enter for none): " ++ read password ++ echo ++ stty echo ++ if [ "x$password" = "x" ]; then ++ hadpass=0 ++ else ++ hadpass=1 ++ fi ++ rootpass=$password ++ make_config ++ do_query "" ++ status=$? ++ done ++ echo "OK, successfully used password, moving on..." ++ echo ++} ++ ++set_root_password() { ++ stty -echo ++ echo -n "New password: " ++ read password1 ++ echo ++ echo -n "Re-enter new password: " ++ read password2 ++ echo ++ stty echo ++ ++ if [ "$password1" != "$password2" ]; then ++ echo "Sorry, passwords do not match." ++ echo ++ return 1 ++ fi ++ ++ if [ "$password1" = "" ]; then ++ echo "Sorry, you can't use an empty password here." ++ echo ++ return 1 ++ fi ++ ++ do_query "UPDATE mysql.user SET Password=PASSWORD('$password1') WHERE User='root';" ++ if [ $? -eq 0 ]; then ++ echo "Password updated successfully!" ++ echo "Reloading privilege tables.." ++ if ! reload_privilege_tables; then ++ exit 1 ++ fi ++ echo ++ rootpass=$password1 ++ make_config ++ else ++ echo "Password update failed!" ++ exit 1 ++ fi ++ ++ return 0 ++} ++ ++remove_anonymous_users() { ++ do_query "DELETE FROM mysql.user WHERE User='';" ++ if [ $? -eq 0 ]; then ++ echo " ... Success!" ++ else ++ echo " ... Failed!" ++ exit 1 ++ fi ++ ++ return 0 ++} ++ ++remove_remote_root() { ++ do_query "DELETE FROM mysql.user WHERE User='root' AND Host!='localhost';" ++ if [ $? -eq 0 ]; then ++ echo " ... Success!" ++ else ++ echo " ... Failed!" ++ fi ++} ++ ++remove_test_database() { ++ echo " - Dropping test database..." ++ do_query "DROP DATABASE test;" ++ if [ $? -eq 0 ]; then ++ echo " ... Success!" ++ else ++ echo " ... Failed! Not critical, keep moving..." ++ fi ++ ++ echo " - Removing privileges on test database..." ++ do_query "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'" ++ if [ $? -eq 0 ]; then ++ echo " ... Success!" ++ else ++ echo " ... Failed! Not critical, keep moving..." ++ fi ++ ++ return 0 ++} ++ ++reload_privilege_tables() { ++ do_query "FLUSH PRIVILEGES;" ++ if [ $? -eq 0 ]; then ++ echo " ... Success!" ++ return 0 ++ else ++ echo " ... Failed!" ++ return 1 ++ fi ++} ++ ++interrupt() { ++ echo ++ echo "Aborting!" ++ echo ++ cleanup ++ stty echo ++ exit 1 ++} ++ ++cleanup() { ++ echo "Cleaning up..." ++ rm -f $config $command ++} ++ ++ ++# The actual script starts here ++ ++prepare ++ ++echo ++echo ++echo ++echo ++echo "NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL" ++echo " SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!" ++echo ++echo ++ ++echo "In order to log into MySQL to secure it, we'll need the current" ++echo "password for the root user. If you've just installed MySQL, and" ++echo "you haven't set the root password yet, the password will be blank," ++echo "so you should just press enter here." ++echo ++ ++get_root_password ++ ++ ++# ++# Set the root password ++# ++ ++echo "Setting the root password ensures that nobody can log into the MySQL" ++echo "root user without the proper authorisation." ++echo ++ ++if [ $hadpass -eq 0 ]; then ++ echo -n "Set root password? [Y/n] " ++else ++ echo "You already have a root password set, so you can safely answer 'n'." ++ echo ++ echo -n "Change the root password? [Y/n] " ++fi ++ ++read reply ++if [ "$reply" = "n" ]; then ++ echo " ... skipping." ++else ++ status=1 ++ while [ $status -eq 1 ]; do ++ set_root_password ++ status=$? ++ done ++fi ++echo ++ ++ ++# ++# Remove anonymous users ++# ++ ++echo "By default, a MySQL installation has an anonymous user, allowing anyone" ++echo "to log into MySQL without having to have a user account created for" ++echo "them. This is intended only for testing, and to make the installation" ++echo "go a bit smoother. You should remove them before moving into a" ++echo "production environment." ++echo ++ ++echo -n "Remove anonymous users? [Y/n] " ++ ++read reply ++if [ "$reply" = "n" ]; then ++ echo " ... skipping." ++else ++ remove_anonymous_users ++fi ++echo ++ ++ ++# ++# Disallow remote root login ++# ++ ++echo "Normally, root should only be allowed to connect from 'localhost'. This" ++echo "ensures that someone cannot guess at the root password from the network." ++echo ++ ++echo -n "Disallow root login remotely? [Y/n] " ++read reply ++if [ "$reply" = "n" ]; then ++ echo " ... skipping." ++else ++ remove_remote_root ++fi ++echo ++ ++ ++# ++# Remove test database ++# ++ ++echo "By default, MySQL comes with a database named 'test' that anyone can" ++echo "access. This is also intended only for testing, and should be removed" ++echo "before moving into a production environment." ++echo ++ ++echo -n "Remove test database and access to it? [Y/n] " ++read reply ++if [ "$reply" = "n" ]; then ++ echo " ... skipping." ++else ++ remove_test_database ++fi ++echo ++ ++ ++# ++# Reload privilege tables ++# ++ ++echo "Reloading the privilege tables will ensure that all changes made so far" ++echo "will take effect immediately." ++echo ++ ++echo -n "Reload privilege tables now? [Y/n] " ++read reply ++if [ "$reply" = "n" ]; then ++ echo " ... skipping." ++else ++ reload_privilege_tables ++fi ++echo ++ ++cleanup ++ ++echo ++echo ++echo ++echo "All done! If you've completed all of the above steps, your MySQL" ++echo "installation should now be secure." ++echo ++echo "Thanks for using MySQL!" ++echo ++echo ++ ++ +diff -Naur mysql-5.0.34-bk-20070101.orig/scripts/mysqlaccess.sh mysql-5.0.34-bk-20070101/scripts/mysqlaccess.sh +--- mysql-5.0.34-bk-20070101.orig/scripts/mysqlaccess.sh 2007-01-01 19:10:29.000000000 +0100 ++++ mysql-5.0.34-bk-20070101/scripts/mysqlaccess.sh 2007-01-03 00:48:04.000000000 +0100 +@@ -17,7 +17,7 @@ + + # **************************** + # information on MySQL +- $MYSQL = '@bindir@/mysql'; # path to mysql executable ++ $MYSQL = '@bindir@/@mybin_mysql@'; # path to mysql executable + $SERVER = '3.21'; + $MYSQL_OPT = ' --batch --unbuffered'; + $ACCESS_DB = 'mysql'; # name of DB with grant-tables +@@ -32,7 +32,7 @@ + $ACCESS_U_BCK = 'user_backup'; + $ACCESS_D_BCK = 'db_backup'; + $DIFF = '/usr/bin/diff'; +- $MYSQLDUMP = '@bindir@/mysqldump'; ++ $MYSQLDUMP = '@bindir@/@mybin_mysqldump@'; + #path to mysqldump executable + + $MYSQLADMIN= 'http://foobar.com/MySQLadmin'; +diff -Naur mysql-5.0.34-bk-20070101.orig/scripts/mysqld_multi.sh mysql-5.0.34-bk-20070101/scripts/mysqld_multi.sh +--- mysql-5.0.34-bk-20070101.orig/scripts/mysqld_multi.sh 2007-01-01 19:10:30.000000000 +0100 ++++ mysql-5.0.34-bk-20070101/scripts/mysqld_multi.sh 2007-01-03 00:48:04.000000000 +0100 +@@ -10,8 +10,8 @@ + $opt_example = 0; + $opt_help = 0; + $opt_log = undef(); +-$opt_mysqladmin = "@bindir@/mysqladmin"; +-$opt_mysqld = "@libexecdir@/mysqld"; ++$opt_mysqladmin = "@bindir@/@mybin_mysqladmin@"; ++$opt_mysqld = "@libexecdir@/@mybin_mysqld@"; + $opt_no_log = 0; + $opt_password = undef(); + $opt_tcp_ip = 0; +@@ -39,11 +39,11 @@ + { + my $flag_exit= 0; + +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { + # We can't throw out yet, since --version, --help, or --example may + # have been given +- print "WARNING: my_print_defaults command not found.\n"; ++ print "WARNING: @mybin_my_print_defaults@ command not found.\n"; + print "Please make sure you have this command available and\n"; + print "in your path. The command is available from the latest\n"; + print "MySQL distribution.\n"; +@@ -74,9 +74,9 @@ + } + } + } +- my $com= "my_print_defaults "; ++ my $com= "@mybin_my_print_defaults@ "; + $com.= "--config-file=$opt_config_file " if (defined($opt_config_file)); +- $com.= "mysqld_multi"; ++ $com.= "@mybin_mysqld_multi@"; + my @defops = `$com`; + chop @defops; + splice @ARGV, 0, 0, @defops; +@@ -113,9 +113,9 @@ + print "Error with an option, see $my_progname --help for more info.\n"; + exit(1); + } +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { +- print "ABORT: Can't find command 'my_print_defaults'.\n"; ++ print "ABORT: Can't find command '@mybin_my_print_defaults@'.\n"; + print "This command is available from the latest MySQL\n"; + print "distribution. Please make sure you have the command\n"; + print "in your PATH.\n"; +@@ -202,7 +202,7 @@ + { + if ($my_print_defaults_exists) + { +- @mysqld_opts= `my_print_defaults mysqld`; ++ @mysqld_opts= `@mybin_my_print_defaults@ mysqld`; + chomp @mysqld_opts; + foreach my $opt (@mysqld_opts) + { +@@ -303,7 +303,7 @@ + @groups = &find_groups($groupids); + for ($i = 0; defined($groups[$i]); $i++) + { +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +@@ -330,7 +330,7 @@ + $tmp.= " $options[$j]"; + } + } +- if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent) ++ if ($opt_verbose && $com =~ m/\/@mybin_safe_mysqld@$/ && !$info_sent) + { + print "WARNING: safe_mysqld is being used to start mysqld. In this case you "; + print "may need to pass\n\"ledir=...\" under groups [mysqldN] to "; +@@ -401,7 +401,7 @@ + my ($i, @groups)= @_; + my ($mysqladmin_found, $com, $tmp, $j); + +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +diff -Naur mysql-5.0.34-bk-20070101.orig/scripts/mysqld_safe.sh mysql-5.0.34-bk-20070101/scripts/mysqld_safe.sh +--- mysql-5.0.34-bk-20070101.orig/scripts/mysqld_safe.sh 2007-01-01 19:10:30.000000000 +0100 ++++ mysql-5.0.34-bk-20070101/scripts/mysqld_safe.sh 2007-01-03 00:48:04.000000000 +0100 +@@ -87,7 +87,7 @@ + then + MYSQLD="mysqld-$tmp" + else +- MYSQLD="mysqld" ++ MYSQLD="@mybin_mysqld@" + fi + ;; + --nice=*) niceness=`echo "$arg" | sed -e "s;--nice=;;"` ;; +@@ -113,13 +113,13 @@ + + MY_PWD=`pwd` + # Check for the directories we would expect from a binary release install +-if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld ++if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are + ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is + # Check for the directories we would expect from a source install + elif test -f ./share/mysql/english/errmsg.sys -a \ +- -x ./libexec/mysqld ++ -x ./libexec/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are + ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is +@@ -181,17 +181,17 @@ + + # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] + # and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + args= +@@ -216,11 +216,11 @@ + # Use the mysqld-max binary by default if the user doesn't specify a binary + if test -z "$MYSQLD" + then +- if test -x $ledir/mysqld-max ++ if test -x $ledir/@mybin_mysqld-max@ + then +- MYSQLD=mysqld-max ++ MYSQLD=@mybin_mysqld-max@ + else +- MYSQLD=mysqld ++ MYSQLD=@mybin_mysqld@ + fi + fi + +@@ -229,7 +229,7 @@ + echo "The file $ledir/$MYSQLD doesn't exist or is not executable" + echo "Please do a cd to the mysql installation directory and restart" + echo "this script from there as follows:" +- echo "./bin/mysqld_safe". ++ echo "./bin/@mybin_mysqld_safe@". + echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more" + echo "information" + exit 1 +@@ -365,8 +365,8 @@ + # the manual for details. + # + # echo "Checking tables in $DATADIR" +-# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check $DATADIR/*/*.MYI +-# $MY_BASEDIR_VERSION/bin/isamchk --silent --force $DATADIR/*/*.ISM ++# $MY_BASEDIR_VERSION/bin/@mybin_myisamchk@ --silent --force --fast --medium-check $DATADIR/*/*.MYI ++# $MY_BASEDIR_VERSION/bin/@mybin_isamchk@ --silent --force $DATADIR/*/*.ISM + + echo "Starting $MYSQLD daemon with databases from $DATADIR" + +diff -Naur mysql-5.0.34-bk-20070101.orig/scripts/mysqld_safe.sh.orig mysql-5.0.34-bk-20070101/scripts/mysqld_safe.sh.orig +--- mysql-5.0.34-bk-20070101.orig/scripts/mysqld_safe.sh.orig 1970-01-01 01:00:00.000000000 +0100 ++++ mysql-5.0.34-bk-20070101/scripts/mysqld_safe.sh.orig 2007-01-01 19:10:30.000000000 +0100 +@@ -0,0 +1,429 @@ ++#!/bin/sh ++# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB ++# This file is public domain and comes with NO WARRANTY of any kind ++# ++# scripts to start the MySQL daemon and restart it if it dies unexpectedly ++# ++# This should be executed in the MySQL base directory if you are using a ++# binary installation that has other paths than you are using. ++# ++# mysql.server works by first doing a cd to the base directory and from there ++# executing mysqld_safe ++ ++KILL_MYSQLD=1; ++MYSQLD= ++ ++trap '' 1 2 3 15 # we shouldn't let anyone kill us ++ ++umask 007 ++ ++defaults= ++case "$1" in ++ --no-defaults|--defaults-file=*|--defaults-extra-file=*) ++ defaults="$1"; shift ++ ;; ++esac ++ ++usage () { ++ cat <<EOF ++Usage: $0 [OPTIONS] ++ --no-defaults Don't read the system defaults file ++ --defaults-file=FILE Use the specified defaults file ++ --defaults-extra-file=FILE Also use defaults from the specified file ++ --ledir=DIRECTORY Look for mysqld in the specified directory ++ --log-error=FILE Log errors to the specified log file ++ --open-files-limit=LIMIT Limit the number of open files ++ --core-file-size=LIMIT Limit core files to the specified size ++ --timezone=TZ Set the system timezone ++ --mysqld=FILE Use the specified file as mysqld ++ --mysqld-version=VERSION Use "mysqld-VERSION" as mysqld ++ --nice=NICE Set the scheduling priority of mysqld ++ --skip-kill-mysqld Don't try to kill stray mysqld processes ++ ++All other options are passed to the mysqld program. ++ ++EOF ++ exit 1 ++} ++ ++ ++parse_arguments() { ++ # We only need to pass arguments through to the server if we don't ++ # handle them here. So, we collect unrecognized options (passed on ++ # the command line) into the args variable. ++ pick_args= ++ if test "$1" = PICK-ARGS-FROM-ARGV ++ then ++ pick_args=1 ++ shift ++ fi ++ ++ for arg do ++ case "$arg" in ++ --skip-kill-mysqld*) ++ KILL_MYSQLD=0; ++ ;; ++ # these get passed explicitly to mysqld ++ --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;; ++ --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;; ++ --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;; ++ --user=*) user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1 ;; ++ ++ # these two might have been set in a [mysqld_safe] section of my.cnf ++ # they are added to mysqld command line to override settings from my.cnf ++ --socket=*) mysql_unix_port=`echo "$arg" | sed -e "s;--socket=;;"` ;; ++ --port=*) mysql_tcp_port=`echo "$arg" | sed -e "s;--port=;;"` ;; ++ ++ # mysqld_safe-specific options - must be set in my.cnf ([mysqld_safe])! ++ --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;; ++ --log-error=*) err_log=`echo "$arg" | sed -e "s;--log-error=;;"` ;; ++ --open-files-limit=*) open_files=`echo "$arg" | sed -e "s;--open-files-limit=;;"` ;; ++ --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core-file-size=;;"` ;; ++ --timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;; ++ --mysqld=*) MYSQLD=`echo "$arg" | sed -e "s;--mysqld=;;"` ;; ++ --mysqld-version=*) ++ tmp=`echo "$arg" | sed -e "s;--mysqld-version=;;"` ++ if test -n "$tmp" ++ then ++ MYSQLD="mysqld-$tmp" ++ else ++ MYSQLD="mysqld" ++ fi ++ ;; ++ --nice=*) niceness=`echo "$arg" | sed -e "s;--nice=;;"` ;; ++ --help) ++ usage ++ ;; ++ *) ++ if test -n "$pick_args" ++ then ++ # This sed command makes sure that any special chars are quoted, ++ # so the arg gets passed exactly to the server. ++ args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'` ++ fi ++ ;; ++ esac ++ done ++} ++ ++ ++# ++# First, try to find BASEDIR and ledir (where mysqld is) ++# ++ ++MY_PWD=`pwd` ++# Check for the directories we would expect from a binary release install ++if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld ++then ++ MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are ++ ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is ++# Check for the directories we would expect from a source install ++elif test -f ./share/mysql/english/errmsg.sys -a \ ++ -x ./libexec/mysqld ++then ++ MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are ++ ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is ++# Since we didn't find anything, used the compiled-in defaults ++else ++ MY_BASEDIR_VERSION=@prefix@ ++ ledir=@libexecdir@ ++fi ++ ++# ++# Second, try to find the data directory ++# ++ ++# Try where the binary installs put it ++if test -d $MY_BASEDIR_VERSION/data/mysql ++then ++ DATADIR=$MY_BASEDIR_VERSION/data ++ if test -z "$defaults" -a -r "$DATADIR/my.cnf" ++ then ++ defaults="--defaults-extra-file=$DATADIR/my.cnf" ++ fi ++# Next try where the source installs put it ++elif test -d $MY_BASEDIR_VERSION/var/mysql ++then ++ DATADIR=$MY_BASEDIR_VERSION/var ++# Or just give up and use our compiled-in default ++else ++ DATADIR=@localstatedir@ ++fi ++ ++if test -z "$MYSQL_HOME" ++then ++ if test -r "$MY_BASEDIR_VERSION/my.cnf" && test -r "$DATADIR/my.cnf" ++ then ++ echo "WARNING: Found two instances of my.cnf -" ++ echo "$MY_BASEDIR_VERSION/my.cnf and" ++ echo "$DATADIR/my.cnf" ++ echo "IGNORING $DATADIR/my.cnf" ++ echo ++ MYSQL_HOME=$MY_BASEDIR_VERSION ++ elif test -r "$DATADIR/my.cnf" ++ then ++ echo "WARNING: Found $DATADIR/my.cnf" ++ echo "Datadir is deprecated place for my.cnf, please move it to $MY_BASEDIR_VERSION" ++ echo ++ MYSQL_HOME=$DATADIR ++ else ++ MYSQL_HOME=$MY_BASEDIR_VERSION ++ fi ++fi ++export MYSQL_HOME ++ ++user=@MYSQLD_USER@ ++niceness=0 ++ ++# these rely on $DATADIR by default, so we'll set them later on ++pid_file= ++err_log= ++ ++# Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] ++# and then merge with the command line arguments ++if test -x ./bin/my_print_defaults ++then ++ print_defaults="./bin/my_print_defaults" ++elif test -x @bindir@/my_print_defaults ++then ++ print_defaults="@bindir@/my_print_defaults" ++elif test -x @bindir@/mysql_print_defaults ++then ++ print_defaults="@bindir@/mysql_print_defaults" ++else ++ print_defaults="my_print_defaults" ++fi ++ ++args= ++SET_USER=2 ++parse_arguments `$print_defaults $defaults --loose-verbose mysqld server` ++if test $SET_USER -eq 2 ++then ++ SET_USER=0 ++fi ++parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysqld` ++parse_arguments PICK-ARGS-FROM-ARGV "$@" ++safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}} ++ ++# Make sure that directory for $safe_mysql_unix_port exists ++mysql_unix_port_dir=`dirname $safe_mysql_unix_port` ++if [ ! -d $mysql_unix_port_dir ] ++then ++ mkdir $mysql_unix_port_dir ++ chown $user $mysql_unix_port_dir ++fi ++ ++# Use the mysqld-max binary by default if the user doesn't specify a binary ++if test -z "$MYSQLD" ++then ++ if test -x $ledir/mysqld-max ++ then ++ MYSQLD=mysqld-max ++ else ++ MYSQLD=mysqld ++ fi ++fi ++ ++if test ! -x $ledir/$MYSQLD ++then ++ echo "The file $ledir/$MYSQLD doesn't exist or is not executable" ++ echo "Please do a cd to the mysql installation directory and restart" ++ echo "this script from there as follows:" ++ echo "./bin/mysqld_safe". ++ echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more" ++ echo "information" ++ exit 1 ++fi ++ ++if test -z "$pid_file" ++then ++ pid_file=$DATADIR/`@HOSTNAME@`.pid ++else ++ case "$pid_file" in ++ /* ) ;; ++ * ) pid_file="$DATADIR/$pid_file" ;; ++ esac ++fi ++test -z "$err_log" && err_log=$DATADIR/`@HOSTNAME@`.err ++ ++if test -n "$mysql_unix_port" ++then ++ args="--socket=$mysql_unix_port $args" ++fi ++if test -n "$mysql_tcp_port" ++then ++ args="--port=$mysql_tcp_port $args" ++fi ++ ++if test $niceness -eq 0 ++then ++ NOHUP_NICENESS="nohup" ++else ++ NOHUP_NICENESS="nohup nice -$niceness" ++fi ++ ++# Using nice with no args to get the niceness level is GNU-specific. ++# This check could be extended for other operating systems (e.g., ++# BSD could use "nohup sh -c 'ps -o nice -p $$' | tail -1"). ++# But, it also seems that GNU nohup is the only one which messes ++# with the priority, so this is okay. ++if nohup nice > /dev/null 2>&1 ++then ++ normal_niceness=`nice` ++ nohup_niceness=`nohup nice` ++ ++ numeric_nice_values=1 ++ for val in $normal_niceness $nohup_niceness ++ do ++ case "$val" in ++ -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | \ ++ [0-9] | [0-9][0-9] | [0-9][0-9][0-9] ) ++ ;; ++ * ) ++ numeric_nice_values=0 ;; ++ esac ++ done ++ ++ if test $numeric_nice_values -eq 1 ++ then ++ nice_value_diff=`expr $nohup_niceness - $normal_niceness` ++ if test $? -eq 0 && test $nice_value_diff -gt 0 && \ ++ nice --$nice_value_diff echo testing > /dev/null 2>&1 ++ then ++ # nohup increases the priority (bad), and we are permitted ++ # to lower the priority with respect to the value the user ++ # might have been given ++ niceness=`expr $niceness - $nice_value_diff` ++ NOHUP_NICENESS="nice -$niceness nohup" ++ fi ++ fi ++else ++ if nohup echo testing > /dev/null 2>&1 ++ then ++ : ++ else ++ # nohup doesn't work on this system ++ NOHUP_NICENESS="" ++ fi ++fi ++ ++USER_OPTION="" ++if test -w / -o "$USER" = "root" ++then ++ if test "$user" != "root" -o $SET_USER = 1 ++ then ++ USER_OPTION="--user=$user" ++ fi ++ # If we are root, change the err log to the right user. ++ touch $err_log; chown $user $err_log ++ if test -n "$open_files" ++ then ++ ulimit -n $open_files ++ args="--open-files-limit=$open_files $args" ++ fi ++fi ++ ++# Try to set the core file size (even if we aren't root) because many systems ++# don't specify a hard limit on core file size. ++if test -n "$core_file_size" ++then ++ ulimit -c $core_file_size ++fi ++ ++# ++# If there exists an old pid file, check if the daemon is already running ++# Note: The switches to 'ps' may depend on your operating system ++if test -f $pid_file ++then ++ PID=`cat $pid_file` ++ if @CHECK_PID@ ++ then ++ if @FIND_PROC@ ++ then # The pid contains a mysqld process ++ echo "A mysqld process already exists" ++ echo "A mysqld process already exists at " `date` >> $err_log ++ exit 1 ++ fi ++ fi ++ rm -f $pid_file ++ if test -f $pid_file ++ then ++ echo "Fatal error: Can't remove the pid file: $pid_file" ++ echo "Fatal error: Can't remove the pid file: $pid_file at " `date` >> $err_log ++ echo "Please remove it manually and start $0 again" ++ echo "mysqld daemon not started" ++ exit 1 ++ fi ++fi ++ ++# ++# Uncomment the following lines if you want all tables to be automatically ++# checked and repaired during startup. You should add sensible key_buffer ++# and sort_buffer values to my.cnf to improve check performance or require ++# less disk space. ++# Alternatively, you can start mysqld with the "myisam-recover" option. See ++# the manual for details. ++# ++# echo "Checking tables in $DATADIR" ++# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check $DATADIR/*/*.MYI ++# $MY_BASEDIR_VERSION/bin/isamchk --silent --force $DATADIR/*/*.ISM ++ ++echo "Starting $MYSQLD daemon with databases from $DATADIR" ++ ++# Does this work on all systems? ++#if type ulimit | grep "shell builtin" > /dev/null ++#then ++# ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems ++#fi ++ ++echo "`date +'%y%m%d %H:%M:%S mysqld started'`" >> $err_log ++while true ++do ++ rm -f $safe_mysql_unix_port $pid_file # Some extra safety ++ if test -z "$args" ++ then ++ $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 ++ else ++ eval "$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ $args >> $err_log 2>&1" ++ fi ++ if test ! -f $pid_file # This is removed if normal shutdown ++ then ++ echo "STOPPING server from pid file $pid_file" ++ break ++ fi ++ ++ if @TARGET_LINUX@ && test $KILL_MYSQLD -eq 1 ++ then ++ # Test if one process was hanging. ++ # This is only a fix for Linux (running as base 3 mysqld processes) ++ # but should work for the rest of the servers. ++ # The only thing is ps x => redhat 5 gives warnings when using ps -x. ++ # kill -9 is used or the process won't react on the kill. ++ numofproces=`ps xaww | grep -v "grep" | grep "$ledir/$MYSQLD\>" | grep -c "pid-file=$pid_file"` ++ ++ echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log ++ I=1 ++ while test "$I" -le "$numofproces" ++ do ++ PROC=`ps xaww | grep "$ledir/$MYSQLD\>" | grep -v "grep" | grep "pid-file=$pid_file" | sed -n '$p'` ++ ++ for T in $PROC ++ do ++ break ++ done ++ # echo "TEST $I - $T **" ++ if kill -9 $T ++ then ++ echo "$MYSQLD process hanging, pid $T - killed" | tee -a $err_log ++ else ++ break ++ fi ++ I=`expr $I + 1` ++ done ++ fi ++ echo "`date +'%y%m%d %H:%M:%S'` mysqld restarted" | tee -a $err_log ++done ++ ++echo "`date +'%y%m%d %H:%M:%S'` mysqld ended" | tee -a $err_log ++echo "" | tee -a $err_log ++ +diff -Naur mysql-5.0.34-bk-20070101.orig/scripts/mysqldumpslow.sh mysql-5.0.34-bk-20070101/scripts/mysqldumpslow.sh +--- mysql-5.0.34-bk-20070101.orig/scripts/mysqldumpslow.sh 2007-01-01 19:10:30.000000000 +0100 ++++ mysql-5.0.34-bk-20070101/scripts/mysqldumpslow.sh 2007-01-03 00:48:04.000000000 +0100 +@@ -34,16 +34,16 @@ + $opt{'help'} and usage(); + + unless (@ARGV) { +- my $defaults = `my_print_defaults mysqld`; ++ my $defaults = `@mybin_my_print_defaults@ mysqld`; + my $basedir = ($defaults =~ m/--basedir=(.*)/)[0] +- or die "Can't determine basedir from 'my_print_defaults mysqld' output: $defaults"; ++ or die "Can't determine basedir from '@mybin_my_print_defaults@ mysqld' output: $defaults"; + warn "basedir=$basedir\n" if $opt{v}; + + my $datadir = ($defaults =~ m/--datadir=(.*)/)[0]; + if (!$datadir or $opt{i}) { + # determine the datadir from the instances section of /etc/my.cnf, if any +- my $instances = `my_print_defaults instances`; +- die "Can't determine datadir from 'my_print_defaults mysqld' output: $defaults" ++ my $instances = `@mybin_my_print_defaults@ instances`; ++ die "Can't determine datadir from '@mybin_my_print_defaults@ mysqld' output: $defaults" + unless $instances; + my @instances = ($instances =~ m/^--(\w+)-/mg); + die "No -i 'instance_name' specified to select among known instances: @instances.\n" +@@ -51,7 +51,7 @@ + die "Instance '$opt{i}' is unknown (known instances: @instances)\n" + unless grep { $_ eq $opt{i} } @instances; + $datadir = ($instances =~ m/--$opt{i}-datadir=(.*)/)[0] +- or die "Can't determine --$opt{i}-datadir from 'my_print_defaults instances' output: $instances"; ++ or die "Can't determine --$opt{i}-datadir from '@mybin_my_print_defaults@ instances' output: $instances"; + warn "datadir=$datadir\n" if $opt{v}; + } + diff --git a/080_all_slot_script-5.1.10.patch b/080_all_slot_script-5.1.10.patch new file mode 100644 index 0000000..6faf367 --- /dev/null +++ b/080_all_slot_script-5.1.10.patch @@ -0,0 +1,539 @@ +diff -Naur mysql-5.1.10-beta-nightly-20060410.a/scripts/Makefile.am mysql-5.1.10-beta-nightly-20060410.b/scripts/Makefile.am +--- mysql-5.1.10-beta-nightly-20060410.a/scripts/Makefile.am 2006-04-10 04:27:52.000000000 +0000 ++++ mysql-5.1.10-beta-nightly-20060410.b/scripts/Makefile.am 2006-04-12 15:54:41.000000000 +0000 +@@ -66,6 +66,32 @@ + mysqlaccess.conf \ + mysqlbug + ++sql_libexec_REPLACE = mysqld ++instance_manager_libexec_REPLACE= mysqlmanager ++client_bin_REPLACE = mysql mysqladmin mysqlcheck mysqlshow \ ++ mysqldump mysqlimport mysqltest mysqlbinlog \ ++ mysqltestmanagerc mysqltestmanager-pwgen ++extra_bin_REPLACE = replace comp_err perror resolveip my_print_defaults \ ++ resolve_stack_dump mysql_waitpid innochecksum ++myisam_bin_REPLACE = myisamchk myisamlog myisampack myisam_ftdump ++tools_bin_REPLACE = mysqltestmanager ++cw_cpcd_ndbbin_REPLACE = ndb_cpcd ++kernel_ndbbin_REPLACE = ndbd ++mgmsrv_ndbbin_REPLACE = ndb_mgmd ++sql_bin_REPLACE = mysql_tzinfo_to_sql ++tests_bin_REPLACE = mysql_client_test ++ndbtools_bin_REPLACE = ndb_test_platform ndb_waiter \ ++ ndb_drop_table ndb_delete_all \ ++ ndb_desc ndb_drop_index \ ++ ndb_show_tables ndb_select_all \ ++ ndb_select_count ndb_restore ndb_config ++EXTRA_REPLACE_BIN = safe_mysqld mysqlanalyze mysqloptimize mysqlrepair mysqld-max isamchk \ ++ $(sql_libexec_REPLACE) $(ndbtools_bin_REPLACE) \ ++ $(instance_manager_libexec_REPLACE) $(client_bin_REPLACE) \ ++ $(extra_bin_REPLACE) $(myisam_bin_REPLACE) $(tools_bin_REPLACE) \ ++ $(cw_cpcd_ndbbin_REPLACE) $(kernel_ndbbin_REPLACE) $(mgmsrv_ndbbin_REPLACE) \ ++ $(sql_bin_REPLACE) $(tests_bin_REPLACE) ++ + dist_pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql + + # mysqlbug should be distributed built so that people can report build +@@ -101,8 +127,17 @@ + + .sh: + @RM@ -f $@ $@-t ++ bin_REPLACE='';\ ++ list='$(EXTRA_SCRIPTS) $(EXTRA_REPLACE_BIN)'; \ ++ for p in $${list}; do \ ++ f1=$${p/\.sh}; \ ++ f2=`echo "$${p}" | @SED@ -e 's|\.sh$$||' -e 's|^.*/||;$(transform)'`; \ ++ bin_REPLACE="$${bin_REPLACE}s!@mybin_$${f1}@!$${f2}!g;";\ ++ done; \ + @SED@ \ ++ -e "$${bin_REPLACE}" \ + -e 's!@''bindir''@!$(bindir)!g' \ ++ -e 's!@''sharedstatedir''@!$(sharedstatedir)!g' \ + -e 's!@''sbindir''@!$(sbindir)!g' \ + -e 's!@''scriptdir''@!$(bindir)!g' \ + -e 's!@''prefix''@!$(prefix)!g' \ +diff -Naur mysql-5.1.10-beta-nightly-20060410.a/scripts/msql2mysql.sh mysql-5.1.10-beta-nightly-20060410.b/scripts/msql2mysql.sh +--- mysql-5.1.10-beta-nightly-20060410.a/scripts/msql2mysql.sh 2006-04-10 04:27:53.000000000 +0000 ++++ mysql-5.1.10-beta-nightly-20060410.b/scripts/msql2mysql.sh 2006-04-12 15:54:41.000000000 +0000 +@@ -13,4 +13,4 @@ + # described in the License. Among other things, the License requires that + # the copyright notice and this notice be preserved on all copies. + +-@bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* ++@bindir@/@mybin_replace@ msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* +diff -Naur mysql-5.1.10-beta-nightly-20060410.a/scripts/mysqlaccess.sh mysql-5.1.10-beta-nightly-20060410.b/scripts/mysqlaccess.sh +--- mysql-5.1.10-beta-nightly-20060410.a/scripts/mysqlaccess.sh 2006-04-10 04:27:54.000000000 +0000 ++++ mysql-5.1.10-beta-nightly-20060410.b/scripts/mysqlaccess.sh 2006-04-12 15:54:41.000000000 +0000 +@@ -17,7 +17,7 @@ + + # **************************** + # information on MySQL +- $MYSQL = '@bindir@/mysql'; # path to mysql executable ++ $MYSQL = '@bindir@/@mybin_mysql@'; # path to mysql executable + $SERVER = '3.21'; + $MYSQL_OPT = ' --batch --unbuffered'; + $ACCESS_DB = 'mysql'; # name of DB with grant-tables +@@ -32,7 +32,7 @@ + $ACCESS_U_BCK = 'user_backup'; + $ACCESS_D_BCK = 'db_backup'; + $DIFF = '/usr/bin/diff'; +- $MYSQLDUMP = '@bindir@/mysqldump'; ++ $MYSQLDUMP = '@bindir@/@mybin_mysqldump@'; + #path to mysqldump executable + + $MYSQLADMIN= 'http://foobar.com/MySQLadmin'; +diff -Naur mysql-5.1.10-beta-nightly-20060410.a/scripts/mysql_config.sh mysql-5.1.10-beta-nightly-20060410.b/scripts/mysql_config.sh +--- mysql-5.1.10-beta-nightly-20060410.a/scripts/mysql_config.sh 2006-04-10 04:27:46.000000000 +0000 ++++ mysql-5.1.10-beta-nightly-20060410.b/scripts/mysql_config.sh 2006-04-12 16:00:49.000000000 +0000 +@@ -77,7 +77,7 @@ + + me=`get_full_path $0` + +-basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` ++basedir=`echo $me | sed -e 's;/bin/@mybin_mysql_config@;;'` + + ldata='@localstatedir@' + execdir='@libexecdir@' +@@ -86,10 +86,10 @@ + # If installed, search for the compiled in directory first (might be "lib64") + pkglibdir='@pkglibdir@' + pkglibdir_rel=`echo $pkglibdir | sed -e "s;^$basedir/;;"` +-fix_path pkglibdir $pkglibdir_rel lib/mysql lib ++fix_path pkglibdir $pkglibdir_rel "lib${pkglibdir##*lib}" lib/mysql lib + + pkgincludedir='@pkgincludedir@' +-fix_path pkgincludedir include/mysql include ++fix_path pkgincludedir "include${pkgincludedir##*include}" include/mysql include + + version='@VERSION@' + socket='@MYSQL_UNIX_ADDR@' +diff -Naur mysql-5.1.10-beta-nightly-20060410.a/scripts/mysql_create_system_tables.sh mysql-5.1.10-beta-nightly-20060410.b/scripts/mysql_create_system_tables.sh +--- mysql-5.1.10-beta-nightly-20060410.a/scripts/mysql_create_system_tables.sh 2006-04-10 04:27:55.000000000 +0000 ++++ mysql-5.1.10-beta-nightly-20060410.b/scripts/mysql_create_system_tables.sh 2006-04-12 15:54:41.000000000 +0000 +@@ -19,7 +19,7 @@ + new context from the manual (from fill_help_tables.sql). + + Usage: +- mysql_create_system_tables [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> ++ @mybin_mysql_create_system_tables@ [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> + " + exit + fi +diff -Naur mysql-5.1.10-beta-nightly-20060410.a/scripts/mysqld_multi.sh mysql-5.1.10-beta-nightly-20060410.b/scripts/mysqld_multi.sh +--- mysql-5.1.10-beta-nightly-20060410.a/scripts/mysqld_multi.sh 2006-04-10 04:27:53.000000000 +0000 ++++ mysql-5.1.10-beta-nightly-20060410.b/scripts/mysqld_multi.sh 2006-04-12 15:54:41.000000000 +0000 +@@ -10,8 +10,8 @@ + $opt_example = 0; + $opt_help = 0; + $opt_log = undef(); +-$opt_mysqladmin = "@bindir@/mysqladmin"; +-$opt_mysqld = "@libexecdir@/mysqld"; ++$opt_mysqladmin = "@bindir@/@mybin_mysqladmin@"; ++$opt_mysqld = "@libexecdir@/@mybin_mysqld@"; + $opt_no_log = 0; + $opt_password = undef(); + $opt_tcp_ip = 0; +@@ -39,11 +39,11 @@ + { + my $flag_exit= 0; + +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { + # We can't throw out yet, since --version, --help, or --example may + # have been given +- print "WARNING: my_print_defaults command not found.\n"; ++ print "WARNING: @mybin_my_print_defaults@ command not found.\n"; + print "Please make sure you have this command available and\n"; + print "in your path. The command is available from the latest\n"; + print "MySQL distribution.\n"; +@@ -74,9 +74,9 @@ + } + } + } +- my $com= "my_print_defaults "; ++ my $com= "@mybin_my_print_defaults@ "; + $com.= "--config-file=$opt_config_file " if (defined($opt_config_file)); +- $com.= "mysqld_multi"; ++ $com.= "@mybin_mysqld_multi@"; + my @defops = `$com`; + chop @defops; + splice @ARGV, 0, 0, @defops; +@@ -113,9 +113,9 @@ + print "Error with an option, see $my_progname --help for more info.\n"; + exit(1); + } +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { +- print "ABORT: Can't find command 'my_print_defaults'.\n"; ++ print "ABORT: Can't find command '@mybin_my_print_defaults@'.\n"; + print "This command is available from the latest MySQL\n"; + print "distribution. Please make sure you have the command\n"; + print "in your PATH.\n"; +@@ -202,7 +202,7 @@ + { + if ($my_print_defaults_exists) + { +- @mysqld_opts= `my_print_defaults mysqld`; ++ @mysqld_opts= `@mybin_my_print_defaults@ mysqld`; + chomp @mysqld_opts; + foreach my $opt (@mysqld_opts) + { +@@ -303,7 +303,7 @@ + @groups = &find_groups($groupids); + for ($i = 0; defined($groups[$i]); $i++) + { +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +@@ -330,7 +330,7 @@ + $tmp.= " $options[$j]"; + } + } +- if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent) ++ if ($opt_verbose && $com =~ m/\/@mybin_safe_mysqld@$/ && !$info_sent) + { + print "WARNING: safe_mysqld is being used to start mysqld. In this case you "; + print "may need to pass\n\"ledir=...\" under groups [mysqldN] to "; +@@ -401,7 +401,7 @@ + my ($i, @groups)= @_; + my ($mysqladmin_found, $com, $tmp, $j); + +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +diff -Naur mysql-5.1.10-beta-nightly-20060410.a/scripts/mysqld_safe.sh mysql-5.1.10-beta-nightly-20060410.b/scripts/mysqld_safe.sh +--- mysql-5.1.10-beta-nightly-20060410.a/scripts/mysqld_safe.sh 2006-04-10 04:27:54.000000000 +0000 ++++ mysql-5.1.10-beta-nightly-20060410.b/scripts/mysqld_safe.sh 2006-04-12 16:02:34.000000000 +0000 +@@ -87,7 +87,7 @@ + then + MYSQLD="mysqld-$tmp" + else +- MYSQLD="mysqld" ++ MYSQLD="@mybin_mysqld@" + fi + ;; + --nice=*) niceness=`echo "$arg" | sed -e "s;--nice=;;"` ;; +@@ -113,13 +113,13 @@ + + MY_PWD=`pwd` + # Check for the directories we would expect from a binary release install +-if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld ++if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are + ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is + # Check for the directories we would expect from a source install + elif test -f ./share/mysql/english/errmsg.sys -a \ +- -x ./libexec/mysqld ++ -x ./libexec/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are + ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is +@@ -181,17 +181,17 @@ + + # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] + # and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + args= +@@ -216,7 +216,7 @@ + # If the user doesn't specify a binary, we assume name "mysqld" + if test -z "$MYSQLD" + then +- MYSQLD=mysqld ++ MYSQLD=@mybin_mysqld@ + fi + + if test ! -x $ledir/$MYSQLD +@@ -224,7 +224,7 @@ + echo "The file $ledir/$MYSQLD doesn't exist or is not executable" + echo "Please do a cd to the mysql installation directory and restart" + echo "this script from there as follows:" +- echo "./bin/mysqld_safe". ++ echo "./bin/@mybin_mysqld_safe@". + echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more" + echo "information" + exit 1 +@@ -357,8 +357,8 @@ + # the manual for details. + # + # echo "Checking tables in $DATADIR" +-# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check $DATADIR/*/*.MYI +-# $MY_BASEDIR_VERSION/bin/isamchk --silent --force $DATADIR/*/*.ISM ++# $MY_BASEDIR_VERSION/bin/@mybin_myisamchk@ --silent --force --fast --medium-check $DATADIR/*/*.MYI ++# $MY_BASEDIR_VERSION/bin/@mybin_isamchk@ --silent --force $DATADIR/*/*.ISM + + echo "Starting $MYSQLD daemon with databases from $DATADIR" + +diff -Naur mysql-5.1.10-beta-nightly-20060410.a/scripts/mysqldumpslow.sh mysql-5.1.10-beta-nightly-20060410.b/scripts/mysqldumpslow.sh +--- mysql-5.1.10-beta-nightly-20060410.a/scripts/mysqldumpslow.sh 2006-04-10 04:27:54.000000000 +0000 ++++ mysql-5.1.10-beta-nightly-20060410.b/scripts/mysqldumpslow.sh 2006-04-12 15:54:41.000000000 +0000 +@@ -34,16 +34,16 @@ + $opt{'help'} and usage(); + + unless (@ARGV) { +- my $defaults = `my_print_defaults mysqld`; ++ my $defaults = `@mybin_my_print_defaults@ mysqld`; + my $basedir = ($defaults =~ m/--basedir=(.*)/)[0] +- or die "Can't determine basedir from 'my_print_defaults mysqld' output: $defaults"; ++ or die "Can't determine basedir from '@mybin_my_print_defaults@ mysqld' output: $defaults"; + warn "basedir=$basedir\n" if $opt{v}; + + my $datadir = ($defaults =~ m/--datadir=(.*)/)[0]; + if (!$datadir or $opt{i}) { + # determine the datadir from the instances section of /etc/my.cnf, if any +- my $instances = `my_print_defaults instances`; +- die "Can't determine datadir from 'my_print_defaults mysqld' output: $defaults" ++ my $instances = `@mybin_my_print_defaults@ instances`; ++ die "Can't determine datadir from '@mybin_my_print_defaults@ mysqld' output: $defaults" + unless $instances; + my @instances = ($instances =~ m/^--(\w+)-/mg); + die "No -i 'instance_name' specified to select among known instances: @instances.\n" +@@ -51,7 +51,7 @@ + die "Instance '$opt{i}' is unknown (known instances: @instances)\n" + unless grep { $_ eq $opt{i} } @instances; + $datadir = ($instances =~ m/--$opt{i}-datadir=(.*)/)[0] +- or die "Can't determine --$opt{i}-datadir from 'my_print_defaults instances' output: $instances"; ++ or die "Can't determine --$opt{i}-datadir from '@mybin_my_print_defaults@ instances' output: $instances"; + warn "datadir=$datadir\n" if $opt{v}; + } + +diff -Naur mysql-5.1.10-beta-nightly-20060410.a/scripts/mysql_fix_privilege_tables.sh mysql-5.1.10-beta-nightly-20060410.b/scripts/mysql_fix_privilege_tables.sh +--- mysql-5.1.10-beta-nightly-20060410.a/scripts/mysql_fix_privilege_tables.sh 2006-04-10 04:27:53.000000000 +0000 ++++ mysql-5.1.10-beta-nightly-20060410.b/scripts/mysql_fix_privilege_tables.sh 2006-04-12 15:54:41.000000000 +0000 +@@ -77,17 +77,17 @@ + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments + +-print_defaults=my_print_defaults ++print_defaults=@mybin_my_print_defaults@ + for dir in ./bin @bindir@ @bindir@ extra $print_defaults_bindir/../bin $print_defaults_bindir/../extra + do +- if test -x $dir/my_print_defaults ++ if test -x $dir/@mybin_my_print_defaults@ + then +- print_defaults="$dir/my_print_defaults" ++ print_defaults="$dir/@mybin_my_print_defaults@" + break + fi + done + +-parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables` ++parse_arguments `$print_defaults $defaults @mybin_mysql_install_db@ @mybin_mysql_fix_privilege_tables@` + parse_arguments PICK-ARGS-FROM-ARGV "$@" + + if test -z "$password" +@@ -118,7 +118,7 @@ + exit 1 + fi + +-cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" ++cmd="$bindir/@mybin_mysql@ --no-defaults --force --user=$user --host=$host" + if test ! -z "$password" ; then + cmd="$cmd --password=$password" + fi +@@ -136,7 +136,7 @@ + fi + + # Find where first mysql_fix_privilege_tables.sql is located +-for i in $basedir/support-files $basedir/share $basedir/share/mysql \ ++for i in @sharedstatedir@ $basedir/support-files $basedir/share $basedir/share/mysql \ + $basedir/scripts $pkgdatadir . "$dirname" + do + if test -f $i/$file +diff -Naur mysql-5.1.10-beta-nightly-20060410.a/scripts/mysql_install_db.sh mysql-5.1.10-beta-nightly-20060410.b/scripts/mysql_install_db.sh +--- mysql-5.1.10-beta-nightly-20060410.a/scripts/mysql_install_db.sh 2006-04-10 04:27:54.000000000 +0000 ++++ mysql-5.1.10-beta-nightly-20060410.b/scripts/mysql_install_db.sh 2006-04-12 15:54:41.000000000 +0000 +@@ -58,20 +58,20 @@ + + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x ./extra/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "./extra/@mybin_my_print_defaults@" + then +- print_defaults="./extra/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./extra/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + args= +@@ -95,10 +95,10 @@ + pkgdatadir=@pkgdatadir@ + else + bindir="$basedir/bin" +- if test -x "$basedir/libexec/mysqld" ++ if test -x "$basedir/libexec/@mybin_mysqld@" + then + execdir="$basedir/libexec" +- elif test -x "$basedir/sbin/mysqld" ++ elif test -x "$basedir/sbin/@mybin_mysqld@" + then + execdir="$basedir/sbin" + else +@@ -107,7 +107,7 @@ + fi + + # find fill_help_tables.sh +-for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ ++for i in @sharedstatedir@ $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ + do + if test -f $i/fill_help_tables.sql + then +@@ -124,13 +124,13 @@ + fi + + mdata=$ldata/mysql +-mysqld=$execdir/mysqld ++mysqld=$execdir/@mybin_mysqld@ + mysqld_opt="" + scriptdir=$bindir + + if test "$windows" = 1 + then +- mysqld="./sql/mysqld" ++ mysqld="./sql/@mybin_mysqld@" + mysqld_opt="--language=./sql/share/english" + scriptdir="./scripts" + fi +@@ -154,14 +154,14 @@ + # Check if hostname is valid + if test "$windows" = 0 -a "$in_rpm" = 0 -a $force = 0 + then +- resolved=`$bindir/resolveip $hostname 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ $hostname 2>&1` + if [ $? -ne 0 ] + then +- resolved=`$bindir/resolveip localhost 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ localhost 2>&1` + if [ $? -ne 0 ] + then + echo "Neither host '$hostname' nor 'localhost' could be looked up with" +- echo "$bindir/resolveip" ++ echo "$bindir/@mybin_resolveip@" + echo "Please configure the 'hostname' command to return a correct hostname." + echo "If you want to solve this at a later stage, restart this script with" + echo "the --force option" +@@ -169,7 +169,7 @@ + fi + echo "WARNING: The host '$hostname' could not be looked up with resolveip." + echo "This probably means that your libc libraries are not 100 % compatible" +- echo "with this binary MySQL version. The MySQL daemon, mysqld, should work" ++ echo "with this binary MySQL version. The MySQL daemon, @mybin_mysqld@, should work" + echo "normally with the exception that host name resolving will not work." + echo "This means that you should use IP addresses instead of hostnames" + echo "when specifying MySQL privileges !" +@@ -214,7 +214,7 @@ + mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ + --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ + --skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" +-if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ ++if $scriptdir/@mybin_mysql_create_system_tables@ $create_option $mdata $hostname $windows \ + | eval "$mysqld_install_cmd_line" + then + if test -n "$fill_help_tables" +@@ -244,8 +244,8 @@ + then + echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" + echo "To do so, start the server, then issue the following commands:" +- echo "$bindir/mysqladmin -u root password 'new-password'" +- echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root -h $hostname password 'new-password'" + echo "See the manual for more instructions." + # + # Print message about upgrading unless we have created a new db table. +@@ -253,14 +253,14 @@ + then + echo + echo "NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run" +- echo "the $bindir/mysql_fix_privilege_tables. Otherwise you will not be" ++ echo "the $bindir/@mybin_mysql_fix_privilege_tables@. Otherwise you will not be" + echo "able to use the new GRANT command!" + fi + echo + if test "$in_rpm" = "0" + then + echo "You can start the MySQL daemon with:" +- echo "cd @prefix@ ; $bindir/mysqld_safe &" ++ echo "cd @prefix@ ; $bindir/@mybin_mysqld_safe@ &" + echo + echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:" + echo "cd sql-bench ; perl run-all-tests" +@@ -280,13 +280,13 @@ + echo "You can also try to start the mysqld daemon with:" + echo "$mysqld --skip-grant &" + echo "You can use the command line tool" +- echo "$bindir/mysql to connect to the mysql" ++ echo "$bindir/@mybin_mysql@ to connect to the mysql" + echo "database and look at the grant tables:" + echo +- echo "shell> $bindir/mysql -u root mysql" ++ echo "shell> $bindir/@mybin_mysql@ -u root mysql" + echo "mysql> show tables" + echo +- echo "Try 'mysqld --help' if you have problems with paths. Using --log" ++ echo "Try '@mybin_mysqld@ --help' if you have problems with paths. Using --log" + echo "gives you a log in $ldata that may be helpful." + echo + echo "The latest information about MySQL is available on the web at" +@@ -295,6 +295,6 @@ + echo "and the manual section that describes problems on your OS." + echo "Another information source is the MySQL email archive." + echo "Please check all of the above before mailing us!" +- echo "And if you do mail us, you MUST use the @scriptdir@/mysqlbug script!" ++ echo "And if you do mail us, you MUST use the @scriptdir@/@mybin_mysqlbug@ script!" + exit 1 + fi +diff -Naur mysql-5.1.10-beta-nightly-20060410.a/scripts/mysql_secure_installation.sh mysql-5.1.10-beta-nightly-20060410.b/scripts/mysql_secure_installation.sh +--- mysql-5.1.10-beta-nightly-20060410.a/scripts/mysql_secure_installation.sh 2006-04-10 04:27:53.000000000 +0000 ++++ mysql-5.1.10-beta-nightly-20060410.b/scripts/mysql_secure_installation.sh 2006-04-12 15:54:41.000000000 +0000 +@@ -30,7 +30,7 @@ + + do_query() { + echo $1 >$command +- mysql --defaults-file=$config <$command ++ @mybin_mysql@ --defaults-file=$config <$command + return $? + } + diff --git a/080_all_slot_script-5.1.12.patch b/080_all_slot_script-5.1.12.patch new file mode 100644 index 0000000..a265dc4 --- /dev/null +++ b/080_all_slot_script-5.1.12.patch @@ -0,0 +1,539 @@ +diff -Naur mysql_old/scripts/Makefile.am mysql_new/scripts/Makefile.am +--- mysql_old/scripts/Makefile.am 2006-10-05 15:18:45.000000000 +0200 ++++ mysql_new/scripts/Makefile.am 2006-10-05 15:50:09.000000000 +0200 +@@ -61,6 +61,32 @@ + mysqlbug \ + make_win_bin_dist + ++sql_libexec_REPLACE = mysqld ++instance_manager_libexec_REPLACE= mysqlmanager ++client_bin_REPLACE = mysql mysqladmin mysqlcheck mysqlshow \ ++ mysqldump mysqlimport mysqltest mysqlbinlog \ ++ mysqltestmanagerc mysqltestmanager-pwgen ++extra_bin_REPLACE = replace comp_err perror resolveip my_print_defaults \ ++ resolve_stack_dump mysql_waitpid innochecksum ++myisam_bin_REPLACE = myisamchk myisamlog myisampack myisam_ftdump ++tools_bin_REPLACE = mysqltestmanager ++cw_cpcd_ndbbin_REPLACE = ndb_cpcd ++kernel_ndbbin_REPLACE = ndbd ++mgmsrv_ndbbin_REPLACE = ndb_mgmd ++sql_bin_REPLACE = mysql_tzinfo_to_sql ++tests_bin_REPLACE = mysql_client_test ++ndbtools_bin_REPLACE = ndb_test_platform ndb_waiter \ ++ ndb_drop_table ndb_delete_all \ ++ ndb_desc ndb_drop_index \ ++ ndb_show_tables ndb_select_all \ ++ ndb_select_count ndb_restore ndb_config ++EXTRA_REPLACE_BIN = safe_mysqld mysqlanalyze mysqloptimize mysqlrepair mysqld-max isamchk \ ++ $(sql_libexec_REPLACE) $(ndbtools_bin_REPLACE) \ ++ $(instance_manager_libexec_REPLACE) $(client_bin_REPLACE) \ ++ $(extra_bin_REPLACE) $(myisam_bin_REPLACE) $(tools_bin_REPLACE) \ ++ $(cw_cpcd_ndbbin_REPLACE) $(kernel_ndbbin_REPLACE) $(mgmsrv_ndbbin_REPLACE) \ ++ $(sql_bin_REPLACE) $(tests_bin_REPLACE) ++ + dist_pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql + + # mysqlbug should be distributed built so that people can report build +@@ -93,8 +119,17 @@ + + .sh: + @RM@ -f $@ $@-t ++ bin_REPLACE='';\ ++ list='$(EXTRA_SCRIPTS) $(EXTRA_REPLACE_BIN)'; \ ++ for p in $${list}; do \ ++ f1=$${p/\.sh}; \ ++ f2=`echo "$${p}" | @SED@ -e 's|\.sh$$||' -e 's|^.*/||;$(transform)'`; \ ++ bin_REPLACE="$${bin_REPLACE}s!@mybin_$${f1}@!$${f2}!g;";\ ++ done; \ + @SED@ \ ++ -e "$${bin_REPLACE}" \ + -e 's!@''bindir''@!$(bindir)!g' \ ++ -e 's!@''sharedstatedir''@!$(sharedstatedir)!g' \ + -e 's!@''sbindir''@!$(sbindir)!g' \ + -e 's!@''scriptdir''@!$(bindir)!g' \ + -e 's!@''prefix''@!$(prefix)!g' \ +diff -Naur mysql_old/scripts/msql2mysql.sh mysql_new/scripts/msql2mysql.sh +--- mysql_old/scripts/msql2mysql.sh 2006-10-05 15:18:45.000000000 +0200 ++++ mysql_new/scripts/msql2mysql.sh 2006-10-05 15:50:09.000000000 +0200 +@@ -13,4 +13,4 @@ + # described in the License. Among other things, the License requires that + # the copyright notice and this notice be preserved on all copies. + +-@bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* ++@bindir@/@mybin_replace@ msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* +diff -Naur mysql_old/scripts/mysql_config.sh mysql_new/scripts/mysql_config.sh +--- mysql_old/scripts/mysql_config.sh 2006-10-05 15:18:45.000000000 +0200 ++++ mysql_new/scripts/mysql_config.sh 2006-10-05 15:50:09.000000000 +0200 +@@ -77,7 +77,7 @@ + + me=`get_full_path $0` + +-basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` ++basedir=`echo $me | sed -e 's;/bin/@mybin_mysql_config@;;'` + + ldata='@localstatedir@' + execdir='@libexecdir@' +@@ -86,10 +86,10 @@ + # If installed, search for the compiled in directory first (might be "lib64") + pkglibdir='@pkglibdir@' + pkglibdir_rel=`echo $pkglibdir | sed -e "s;^$basedir/;;"` +-fix_path pkglibdir $pkglibdir_rel lib/mysql lib ++fix_path pkglibdir $pkglibdir_rel "lib${pkglibdir##*lib}" lib/mysql lib + + pkgincludedir='@pkgincludedir@' +-fix_path pkgincludedir include/mysql include ++fix_path pkgincludedir "include${pkgincludedir##*include}" include/mysql include + + version='@VERSION@' + socket='@MYSQL_UNIX_ADDR@' +diff -Naur mysql_old/scripts/mysql_create_system_tables.sh mysql_new/scripts/mysql_create_system_tables.sh +--- mysql_old/scripts/mysql_create_system_tables.sh 2006-10-05 15:18:45.000000000 +0200 ++++ mysql_new/scripts/mysql_create_system_tables.sh 2006-10-05 15:50:09.000000000 +0200 +@@ -19,7 +19,7 @@ + new context from the manual (from fill_help_tables.sql). + + Usage: +- mysql_create_system_tables [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> ++ @mybin_mysql_create_system_tables@ [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> + " + exit + fi +diff -Naur mysql_old/scripts/mysql_fix_privilege_tables.sh mysql_new/scripts/mysql_fix_privilege_tables.sh +--- mysql_old/scripts/mysql_fix_privilege_tables.sh 2006-10-05 15:18:45.000000000 +0200 ++++ mysql_new/scripts/mysql_fix_privilege_tables.sh 2006-10-05 15:50:09.000000000 +0200 +@@ -77,17 +77,17 @@ + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments + +-print_defaults=my_print_defaults ++print_defaults=@mybin_my_print_defaults@ + for dir in ./bin @bindir@ @bindir@ extra $print_defaults_bindir/../bin $print_defaults_bindir/../extra + do +- if test -x $dir/my_print_defaults ++ if test -x $dir/@mybin_my_print_defaults@ + then +- print_defaults="$dir/my_print_defaults" ++ print_defaults="$dir/@mybin_my_print_defaults@" + break + fi + done + +-parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables` ++parse_arguments `$print_defaults $defaults @mybin_mysql_install_db@ @mybin_mysql_fix_privilege_tables@` + parse_arguments PICK-ARGS-FROM-ARGV "$@" + + if test -z "$password" +@@ -118,7 +118,7 @@ + exit 1 + fi + +-cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" ++cmd="$bindir/@mybin_mysql@ --no-defaults --force --user=$user --host=$host" + if test ! -z "$password" ; then + cmd="$cmd --password=$password" + fi +@@ -136,7 +136,7 @@ + fi + + # Find where first mysql_fix_privilege_tables.sql is located +-for i in $basedir/support-files $basedir/share $basedir/share/mysql \ ++for i in @sharedstatedir@ $basedir/support-files $basedir/share $basedir/share/mysql \ + $basedir/scripts $pkgdatadir . "$dirname" + do + if test -f $i/$file +diff -Naur mysql_old/scripts/mysql_install_db.sh mysql_new/scripts/mysql_install_db.sh +--- mysql_old/scripts/mysql_install_db.sh 2006-10-05 15:18:45.000000000 +0200 ++++ mysql_new/scripts/mysql_install_db.sh 2006-10-05 15:51:01.000000000 +0200 +@@ -57,20 +57,20 @@ + + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x ./extra/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "./extra/@mybin_my_print_defaults@" + then +- print_defaults="./extra/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./extra/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + args= +@@ -94,10 +94,10 @@ + pkgdatadir=@pkgdatadir@ + else + bindir="$basedir/bin" +- if test -x "$basedir/libexec/mysqld" ++ if test -x "$basedir/libexec/@mybin_mysqld@" + then + execdir="$basedir/libexec" +- elif test -x "$basedir/sbin/mysqld" ++ elif test -x "$basedir/sbin/@mybin_mysqld@" + then + execdir="$basedir/sbin" + else +@@ -106,7 +106,7 @@ + fi + + # find fill_help_tables.sh +-for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ ++for i in @sharedstatedir@ $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ + do + if test -f $i/fill_help_tables.sql + then +@@ -123,13 +123,13 @@ + fi + + mdata=$ldata/mysql +-mysqld=$execdir/mysqld ++mysqld=$execdir/@mybin_mysqld@ + mysqld_opt="" + scriptdir=$bindir + + if test "$windows" = 1 + then +- mysqld="./sql/mysqld" ++ mysqld="./sql/@mybin_mysqld@" + mysqld_opt="--language=./sql/share/english" + scriptdir="./scripts" + fi +@@ -153,14 +153,14 @@ + # Check if hostname is valid + if test "$windows" = 0 -a "$in_rpm" = 0 -a $force = 0 + then +- resolved=`$bindir/resolveip $hostname 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ $hostname 2>&1` + if [ $? -ne 0 ] + then +- resolved=`$bindir/resolveip localhost 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ localhost 2>&1` + if [ $? -ne 0 ] + then + echo "Neither host '$hostname' nor 'localhost' could be looked up with" +- echo "$bindir/resolveip" ++ echo "$bindir/@mybin_resolveip@" + echo "Please configure the 'hostname' command to return a correct hostname." + echo "If you want to solve this at a later stage, restart this script with" + echo "the --force option" +@@ -168,7 +168,7 @@ + fi + echo "WARNING: The host '$hostname' could not be looked up with resolveip." + echo "This probably means that your libc libraries are not 100 % compatible" +- echo "with this binary MySQL version. The MySQL daemon, mysqld, should work" ++ echo "with this binary MySQL version. The MySQL daemon, @mybin_mysqld@, should work" + echo "normally with the exception that host name resolving will not work." + echo "This means that you should use IP addresses instead of hostnames" + echo "when specifying MySQL privileges !" +@@ -213,7 +213,7 @@ + mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ + --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ + --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" +-if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ ++if $scriptdir/@mybin_mysql_create_system_tables@ $create_option $mdata $hostname $windows \ + | eval "$mysqld_install_cmd_line" + then + if test -n "$fill_help_tables" +@@ -243,8 +243,8 @@ + then + echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" + echo "To do so, start the server, then issue the following commands:" +- echo "$bindir/mysqladmin -u root password 'new-password'" +- echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root -h $hostname password 'new-password'" + echo "See the manual for more instructions." + # + # Print message about upgrading unless we have created a new db table. +@@ -252,14 +252,14 @@ + then + echo + echo "NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run" +- echo "the $bindir/mysql_fix_privilege_tables. Otherwise you will not be" ++ echo "the $bindir/@mybin_mysql_fix_privilege_tables@. Otherwise you will not be" + echo "able to use the new GRANT command!" + fi + echo + if test "$in_rpm" = "0" + then + echo "You can start the MySQL daemon with:" +- echo "cd @prefix@ ; $bindir/mysqld_safe &" ++ echo "cd @prefix@ ; $bindir/@mybin_mysqld_safe@ &" + echo + fi + echo "Please report any problems with the @scriptdir@/mysqlbug script!" +@@ -276,13 +276,13 @@ + echo "You can also try to start the mysqld daemon with:" + echo "$mysqld --skip-grant &" + echo "You can use the command line tool" +- echo "$bindir/mysql to connect to the mysql" ++ echo "$bindir/@mybin_mysql@ to connect to the mysql" + echo "database and look at the grant tables:" + echo +- echo "shell> $bindir/mysql -u root mysql" ++ echo "shell> $bindir/@mybin_mysql@ -u root mysql" + echo "mysql> show tables" + echo +- echo "Try 'mysqld --help' if you have problems with paths. Using --log" ++ echo "Try '@mybin_mysqld@ --help' if you have problems with paths. Using --log" + echo "gives you a log in $ldata that may be helpful." + echo + echo "The latest information about MySQL is available on the web at" +@@ -291,6 +291,6 @@ + echo "and the manual section that describes problems on your OS." + echo "Another information source is the MySQL email archive." + echo "Please check all of the above before mailing us!" +- echo "And if you do mail us, you MUST use the @scriptdir@/mysqlbug script!" ++ echo "And if you do mail us, you MUST use the @scriptdir@/@mybin_mysqlbug@ script!" + exit 1 + fi +diff -Naur mysql_old/scripts/mysql_secure_installation.sh mysql_new/scripts/mysql_secure_installation.sh +--- mysql_old/scripts/mysql_secure_installation.sh 2006-10-05 15:18:45.000000000 +0200 ++++ mysql_new/scripts/mysql_secure_installation.sh 2006-10-05 15:50:09.000000000 +0200 +@@ -30,7 +30,7 @@ + + do_query() { + echo $1 >$command +- mysql --defaults-file=$config <$command ++ @mybin_mysql@ --defaults-file=$config <$command + return $? + } + +diff -Naur mysql_old/scripts/mysqlaccess.sh mysql_new/scripts/mysqlaccess.sh +--- mysql_old/scripts/mysqlaccess.sh 2006-10-05 15:18:45.000000000 +0200 ++++ mysql_new/scripts/mysqlaccess.sh 2006-10-05 15:50:09.000000000 +0200 +@@ -17,7 +17,7 @@ + + # **************************** + # information on MySQL +- $MYSQL = '@bindir@/mysql'; # path to mysql executable ++ $MYSQL = '@bindir@/@mybin_mysql@'; # path to mysql executable + $SERVER = '3.21'; + $MYSQL_OPT = ' --batch --unbuffered'; + $ACCESS_DB = 'mysql'; # name of DB with grant-tables +@@ -32,7 +32,7 @@ + $ACCESS_U_BCK = 'user_backup'; + $ACCESS_D_BCK = 'db_backup'; + $DIFF = '/usr/bin/diff'; +- $MYSQLDUMP = '@bindir@/mysqldump'; ++ $MYSQLDUMP = '@bindir@/@mybin_mysqldump@'; + #path to mysqldump executable + + $MYSQLADMIN= 'http://foobar.com/MySQLadmin'; +diff -Naur mysql_old/scripts/mysqld_multi.sh mysql_new/scripts/mysqld_multi.sh +--- mysql_old/scripts/mysqld_multi.sh 2006-10-05 15:18:45.000000000 +0200 ++++ mysql_new/scripts/mysqld_multi.sh 2006-10-05 15:50:09.000000000 +0200 +@@ -10,8 +10,8 @@ + $opt_example = 0; + $opt_help = 0; + $opt_log = undef(); +-$opt_mysqladmin = "@bindir@/mysqladmin"; +-$opt_mysqld = "@libexecdir@/mysqld"; ++$opt_mysqladmin = "@bindir@/@mybin_mysqladmin@"; ++$opt_mysqld = "@libexecdir@/@mybin_mysqld@"; + $opt_no_log = 0; + $opt_password = undef(); + $opt_tcp_ip = 0; +@@ -39,11 +39,11 @@ + { + my $flag_exit= 0; + +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { + # We can't throw out yet, since --version, --help, or --example may + # have been given +- print "WARNING: my_print_defaults command not found.\n"; ++ print "WARNING: @mybin_my_print_defaults@ command not found.\n"; + print "Please make sure you have this command available and\n"; + print "in your path. The command is available from the latest\n"; + print "MySQL distribution.\n"; +@@ -74,9 +74,9 @@ + } + } + } +- my $com= "my_print_defaults "; ++ my $com= "@mybin_my_print_defaults@ "; + $com.= "--config-file=$opt_config_file " if (defined($opt_config_file)); +- $com.= "mysqld_multi"; ++ $com.= "@mybin_mysqld_multi@"; + my @defops = `$com`; + chop @defops; + splice @ARGV, 0, 0, @defops; +@@ -113,9 +113,9 @@ + print "Error with an option, see $my_progname --help for more info.\n"; + exit(1); + } +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { +- print "ABORT: Can't find command 'my_print_defaults'.\n"; ++ print "ABORT: Can't find command '@mybin_my_print_defaults@'.\n"; + print "This command is available from the latest MySQL\n"; + print "distribution. Please make sure you have the command\n"; + print "in your PATH.\n"; +@@ -202,7 +202,7 @@ + { + if ($my_print_defaults_exists) + { +- @mysqld_opts= `my_print_defaults mysqld`; ++ @mysqld_opts= `@mybin_my_print_defaults@ mysqld`; + chomp @mysqld_opts; + foreach my $opt (@mysqld_opts) + { +@@ -303,7 +303,7 @@ + @groups = &find_groups($groupids); + for ($i = 0; defined($groups[$i]); $i++) + { +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +@@ -330,7 +330,7 @@ + $tmp.= " $options[$j]"; + } + } +- if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent) ++ if ($opt_verbose && $com =~ m/\/@mybin_safe_mysqld@$/ && !$info_sent) + { + print "WARNING: safe_mysqld is being used to start mysqld. In this case you "; + print "may need to pass\n\"ledir=...\" under groups [mysqldN] to "; +@@ -401,7 +401,7 @@ + my ($i, @groups)= @_; + my ($mysqladmin_found, $com, $tmp, $j); + +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +diff -Naur mysql_old/scripts/mysqld_safe.sh mysql_new/scripts/mysqld_safe.sh +--- mysql_old/scripts/mysqld_safe.sh 2006-10-05 15:18:45.000000000 +0200 ++++ mysql_new/scripts/mysqld_safe.sh 2006-10-05 15:50:09.000000000 +0200 +@@ -91,7 +91,7 @@ + then + MYSQLD="mysqld-$tmp" + else +- MYSQLD="mysqld" ++ MYSQLD="@mybin_mysqld@" + fi + ;; + --nice=*) niceness=`echo "$arg" | sed -e "s;--nice=;;"` ;; +@@ -115,13 +115,13 @@ + + MY_PWD=`pwd` + # Check for the directories we would expect from a binary release install +-if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld ++if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are + ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is + # Check for the directories we would expect from a source install + elif test -f ./share/mysql/english/errmsg.sys -a \ +- -x ./libexec/mysqld ++ -x ./libexec/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are + ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is +@@ -183,17 +183,17 @@ + + # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] + # and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + append_arg_to_args () { +@@ -222,7 +222,7 @@ + # If the user doesn't specify a binary, we assume name "mysqld" + if test -z "$MYSQLD" + then +- MYSQLD=mysqld ++ MYSQLD=@mybin_mysqld@ + fi + + if test ! -x $ledir/$MYSQLD +@@ -230,7 +230,7 @@ + echo "The file $ledir/$MYSQLD doesn't exist or is not executable" + echo "Please do a cd to the mysql installation directory and restart" + echo "this script from there as follows:" +- echo "./bin/mysqld_safe". ++ echo "./bin/@mybin_mysqld_safe@". + echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more" + echo "information" + exit 1 +@@ -390,8 +390,8 @@ + # the manual for details. + # + # echo "Checking tables in $DATADIR" +-# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check $DATADIR/*/*.MYI +-# $MY_BASEDIR_VERSION/bin/isamchk --silent --force $DATADIR/*/*.ISM ++# $MY_BASEDIR_VERSION/bin/@mybin_myisamchk@ --silent --force --fast --medium-check $DATADIR/*/*.MYI ++# $MY_BASEDIR_VERSION/bin/@mybin_isamchk@ --silent --force $DATADIR/*/*.ISM + + echo "Starting $MYSQLD daemon with databases from $DATADIR" + +diff -Naur mysql_old/scripts/mysqldumpslow.sh mysql_new/scripts/mysqldumpslow.sh +--- mysql_old/scripts/mysqldumpslow.sh 2006-10-05 15:18:45.000000000 +0200 ++++ mysql_new/scripts/mysqldumpslow.sh 2006-10-05 15:50:09.000000000 +0200 +@@ -34,16 +34,16 @@ + $opt{'help'} and usage(); + + unless (@ARGV) { +- my $defaults = `my_print_defaults mysqld`; ++ my $defaults = `@mybin_my_print_defaults@ mysqld`; + my $basedir = ($defaults =~ m/--basedir=(.*)/)[0] +- or die "Can't determine basedir from 'my_print_defaults mysqld' output: $defaults"; ++ or die "Can't determine basedir from '@mybin_my_print_defaults@ mysqld' output: $defaults"; + warn "basedir=$basedir\n" if $opt{v}; + + my $datadir = ($defaults =~ m/--datadir=(.*)/)[0]; + if (!$datadir or $opt{i}) { + # determine the datadir from the instances section of /etc/my.cnf, if any +- my $instances = `my_print_defaults instances`; +- die "Can't determine datadir from 'my_print_defaults mysqld' output: $defaults" ++ my $instances = `@mybin_my_print_defaults@ instances`; ++ die "Can't determine datadir from '@mybin_my_print_defaults@ mysqld' output: $defaults" + unless $instances; + my @instances = ($instances =~ m/^--(\w+)-/mg); + die "No -i 'instance_name' specified to select among known instances: @instances.\n" +@@ -51,7 +51,7 @@ + die "Instance '$opt{i}' is unknown (known instances: @instances)\n" + unless grep { $_ eq $opt{i} } @instances; + $datadir = ($instances =~ m/--$opt{i}-datadir=(.*)/)[0] +- or die "Can't determine --$opt{i}-datadir from 'my_print_defaults instances' output: $instances"; ++ or die "Can't determine --$opt{i}-datadir from '@mybin_my_print_defaults@ instances' output: $instances"; + warn "datadir=$datadir\n" if $opt{v}; + } + diff --git a/080_all_slot_script-5.1.14.patch b/080_all_slot_script-5.1.14.patch new file mode 100644 index 0000000..ef2c85d --- /dev/null +++ b/080_all_slot_script-5.1.14.patch @@ -0,0 +1,540 @@ +diff -Naur -Naur mysqlold/scripts/Makefile.am mysql/scripts/Makefile.am +--- mysqlold/scripts/Makefile.am 2006-12-06 17:05:36.000000000 +0000 ++++ mysql/scripts/Makefile.am 2006-12-12 13:21:16.000000000 +0000 +@@ -61,6 +61,32 @@ + mysqlbug \ + make_win_bin_dist + ++sql_libexec_REPLACE = mysqld ++instance_manager_libexec_REPLACE= mysqlmanager ++client_bin_REPLACE = mysql mysqladmin mysqlcheck mysqlshow \ ++ mysqldump mysqlimport mysqltest mysqlbinlog \ ++ mysqltestmanagerc mysqltestmanager-pwgen ++extra_bin_REPLACE = replace comp_err perror resolveip my_print_defaults \ ++ resolve_stack_dump mysql_waitpid innochecksum ++myisam_bin_REPLACE = myisamchk myisamlog myisampack myisam_ftdump ++tools_bin_REPLACE = mysqltestmanager ++cw_cpcd_ndbbin_REPLACE = ndb_cpcd ++kernel_ndbbin_REPLACE = ndbd ++mgmsrv_ndbbin_REPLACE = ndb_mgmd ++sql_bin_REPLACE = mysql_tzinfo_to_sql ++tests_bin_REPLACE = mysql_client_test ++ndbtools_bin_REPLACE = ndb_test_platform ndb_waiter \ ++ ndb_drop_table ndb_delete_all \ ++ ndb_desc ndb_drop_index \ ++ ndb_show_tables ndb_select_all \ ++ ndb_select_count ndb_restore ndb_config ++EXTRA_REPLACE_BIN = safe_mysqld mysqlanalyze mysqloptimize mysqlrepair mysqld-max isamchk \ ++ $(sql_libexec_REPLACE) $(ndbtools_bin_REPLACE) \ ++ $(instance_manager_libexec_REPLACE) $(client_bin_REPLACE) \ ++ $(extra_bin_REPLACE) $(myisam_bin_REPLACE) $(tools_bin_REPLACE) \ ++ $(cw_cpcd_ndbbin_REPLACE) $(kernel_ndbbin_REPLACE) $(mgmsrv_ndbbin_REPLACE) \ ++ $(sql_bin_REPLACE) $(tests_bin_REPLACE) ++ + dist_pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql + + # mysqlbug should be distributed built so that people can report build +@@ -93,8 +119,17 @@ + + .sh: + @RM@ -f $@ $@-t ++ bin_REPLACE='';\ ++ list='$(EXTRA_SCRIPTS) $(EXTRA_REPLACE_BIN)'; \ ++ for p in $${list}; do \ ++ f1=$${p/\.sh}; \ ++ f2=`echo "$${p}" | @SED@ -e 's|\.sh$$||' -e 's|^.*/||;$(transform)'`; \ ++ bin_REPLACE="$${bin_REPLACE}s!@mybin_$${f1}@!$${f2}!g;";\ ++ done; \ + @SED@ \ ++ -e "$${bin_REPLACE}" \ + -e 's!@''bindir''@!$(bindir)!g' \ ++ -e 's!@''sharedstatedir''@!$(sharedstatedir)!g' \ + -e 's!@''sbindir''@!$(sbindir)!g' \ + -e 's!@''scriptdir''@!$(bindir)!g' \ + -e 's!@''prefix''@!$(prefix)!g' \ +diff -Naur -Naur mysqlold/scripts/msql2mysql.sh mysql/scripts/msql2mysql.sh +--- mysqlold/scripts/msql2mysql.sh 2006-12-06 17:05:23.000000000 +0000 ++++ mysql/scripts/msql2mysql.sh 2006-12-12 13:21:16.000000000 +0000 +@@ -13,4 +13,4 @@ + # described in the License. Among other things, the License requires that + # the copyright notice and this notice be preserved on all copies. + +-@bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* ++@bindir@/@mybin_replace@ msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* +diff -Naur -Naur mysqlold/scripts/mysqlaccess.sh mysql/scripts/mysqlaccess.sh +--- mysqlold/scripts/mysqlaccess.sh 2006-12-06 17:05:55.000000000 +0000 ++++ mysql/scripts/mysqlaccess.sh 2006-12-12 13:21:16.000000000 +0000 +@@ -17,7 +17,7 @@ + + # **************************** + # information on MySQL +- $MYSQL = '@bindir@/mysql'; # path to mysql executable ++ $MYSQL = '@bindir@/@mybin_mysql@'; # path to mysql executable + $SERVER = '3.21'; + $MYSQL_OPT = ' --batch --unbuffered'; + $ACCESS_DB = 'mysql'; # name of DB with grant-tables +@@ -32,7 +32,7 @@ + $ACCESS_U_BCK = 'user_backup'; + $ACCESS_D_BCK = 'db_backup'; + $DIFF = '/usr/bin/diff'; +- $MYSQLDUMP = '@bindir@/mysqldump'; ++ $MYSQLDUMP = '@bindir@/@mybin_mysqldump@'; + #path to mysqldump executable + + $MYSQLADMIN= 'http://foobar.com/MySQLadmin'; +diff -Naur -Naur mysqlold/scripts/mysql_config.sh mysql/scripts/mysql_config.sh +--- mysqlold/scripts/mysql_config.sh 2006-12-06 17:05:26.000000000 +0000 ++++ mysql/scripts/mysql_config.sh 2006-12-12 13:21:16.000000000 +0000 +@@ -77,7 +77,7 @@ + + me=`get_full_path $0` + +-basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` ++basedir=`echo $me | sed -e 's;/bin/@mybin_mysql_config@;;'` + + ldata='@localstatedir@' + execdir='@libexecdir@' +@@ -86,10 +86,10 @@ + # If installed, search for the compiled in directory first (might be "lib64") + pkglibdir='@pkglibdir@' + pkglibdir_rel=`echo $pkglibdir | sed -e "s;^$basedir/;;"` +-fix_path pkglibdir $pkglibdir_rel lib/mysql lib ++fix_path pkglibdir $pkglibdir_rel "lib${pkglibdir##*lib}" lib/mysql lib + + pkgincludedir='@pkgincludedir@' +-fix_path pkgincludedir include/mysql include ++fix_path pkgincludedir "include${pkgincludedir##*include}" include/mysql include + + version='@VERSION@' + socket='@MYSQL_UNIX_ADDR@' +diff -Naur -Naur mysqlold/scripts/mysql_create_system_tables.sh mysql/scripts/mysql_create_system_tables.sh +--- mysqlold/scripts/mysql_create_system_tables.sh 2006-12-06 17:05:24.000000000 +0000 ++++ mysql/scripts/mysql_create_system_tables.sh 2006-12-12 13:21:16.000000000 +0000 +@@ -19,7 +19,7 @@ + new context from the manual (from fill_help_tables.sql). + + Usage: +- mysql_create_system_tables [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> ++ @mybin_mysql_create_system_tables@ [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> + " + exit + fi +diff -Naur -Naur mysqlold/scripts/mysqld_multi.sh mysql/scripts/mysqld_multi.sh +--- mysqlold/scripts/mysqld_multi.sh 2006-12-06 17:05:26.000000000 +0000 ++++ mysql/scripts/mysqld_multi.sh 2006-12-12 13:21:16.000000000 +0000 +@@ -10,8 +10,8 @@ + $opt_example = 0; + $opt_help = 0; + $opt_log = undef(); +-$opt_mysqladmin = "@bindir@/mysqladmin"; +-$opt_mysqld = "@libexecdir@/mysqld"; ++$opt_mysqladmin = "@bindir@/@mybin_mysqladmin@"; ++$opt_mysqld = "@libexecdir@/@mybin_mysqld@"; + $opt_no_log = 0; + $opt_password = undef(); + $opt_tcp_ip = 0; +@@ -39,11 +39,11 @@ + { + my $flag_exit= 0; + +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { + # We can't throw out yet, since --version, --help, or --example may + # have been given +- print "WARNING: my_print_defaults command not found.\n"; ++ print "WARNING: @mybin_my_print_defaults@ command not found.\n"; + print "Please make sure you have this command available and\n"; + print "in your path. The command is available from the latest\n"; + print "MySQL distribution.\n"; +@@ -74,9 +74,9 @@ + } + } + } +- my $com= "my_print_defaults "; ++ my $com= "@mybin_my_print_defaults@ "; + $com.= "--config-file=$opt_config_file " if (defined($opt_config_file)); +- $com.= "mysqld_multi"; ++ $com.= "@mybin_mysqld_multi@"; + my @defops = `$com`; + chop @defops; + splice @ARGV, 0, 0, @defops; +@@ -113,9 +113,9 @@ + print "Error with an option, see $my_progname --help for more info.\n"; + exit(1); + } +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { +- print "ABORT: Can't find command 'my_print_defaults'.\n"; ++ print "ABORT: Can't find command '@mybin_my_print_defaults@'.\n"; + print "This command is available from the latest MySQL\n"; + print "distribution. Please make sure you have the command\n"; + print "in your PATH.\n"; +@@ -202,7 +202,7 @@ + { + if ($my_print_defaults_exists) + { +- @mysqld_opts= `my_print_defaults mysqld`; ++ @mysqld_opts= `@mybin_my_print_defaults@ mysqld`; + chomp @mysqld_opts; + foreach my $opt (@mysqld_opts) + { +@@ -303,7 +303,7 @@ + @groups = &find_groups($groupids); + for ($i = 0; defined($groups[$i]); $i++) + { +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +@@ -330,7 +330,7 @@ + $tmp.= " $options[$j]"; + } + } +- if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent) ++ if ($opt_verbose && $com =~ m/\/@mybin_safe_mysqld@$/ && !$info_sent) + { + print "WARNING: safe_mysqld is being used to start mysqld. In this case you "; + print "may need to pass\n\"ledir=...\" under groups [mysqldN] to "; +@@ -401,7 +401,7 @@ + my ($i, @groups)= @_; + my ($mysqladmin_found, $com, $tmp, $j); + +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +diff -Naur -Naur mysqlold/scripts/mysqld_safe.sh mysql/scripts/mysqld_safe.sh +--- mysqlold/scripts/mysqld_safe.sh 2006-12-06 17:05:24.000000000 +0000 ++++ mysql/scripts/mysqld_safe.sh 2006-12-12 13:21:16.000000000 +0000 +@@ -91,7 +91,7 @@ + then + MYSQLD="mysqld-$tmp" + else +- MYSQLD="mysqld" ++ MYSQLD="@mybin_mysqld@" + fi + ;; + --nice=*) niceness=`echo "$arg" | sed -e "s;--nice=;;"` ;; +@@ -115,13 +115,13 @@ + + MY_PWD=`pwd` + # Check for the directories we would expect from a binary release install +-if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld ++if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are + ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is + # Check for the directories we would expect from a source install + elif test -f ./share/mysql/english/errmsg.sys -a \ +- -x ./libexec/mysqld ++ -x ./libexec/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are + ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is +@@ -183,17 +183,17 @@ + + # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] + # and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + append_arg_to_args () { +@@ -222,7 +222,7 @@ + # If the user doesn't specify a binary, we assume name "mysqld" + if test -z "$MYSQLD" + then +- MYSQLD=mysqld ++ MYSQLD=@mybin_mysqld@ + fi + + if test ! -x $ledir/$MYSQLD +@@ -230,7 +230,7 @@ + echo "The file $ledir/$MYSQLD doesn't exist or is not executable" + echo "Please do a cd to the mysql installation directory and restart" + echo "this script from there as follows:" +- echo "./bin/mysqld_safe". ++ echo "./bin/@mybin_mysqld_safe@". + echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more" + echo "information" + exit 1 +@@ -390,8 +390,8 @@ + # the manual for details. + # + # echo "Checking tables in $DATADIR" +-# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check $DATADIR/*/*.MYI +-# $MY_BASEDIR_VERSION/bin/isamchk --silent --force $DATADIR/*/*.ISM ++# $MY_BASEDIR_VERSION/bin/@mybin_myisamchk@ --silent --force --fast --medium-check $DATADIR/*/*.MYI ++# $MY_BASEDIR_VERSION/bin/@mybin_isamchk@ --silent --force $DATADIR/*/*.ISM + + echo "Starting $MYSQLD daemon with databases from $DATADIR" + +diff -Naur -Naur mysqlold/scripts/mysqldumpslow.sh mysql/scripts/mysqldumpslow.sh +--- mysqlold/scripts/mysqldumpslow.sh 2006-12-06 17:05:38.000000000 +0000 ++++ mysql/scripts/mysqldumpslow.sh 2006-12-12 13:21:16.000000000 +0000 +@@ -34,16 +34,16 @@ + $opt{'help'} and usage(); + + unless (@ARGV) { +- my $defaults = `my_print_defaults mysqld`; ++ my $defaults = `@mybin_my_print_defaults@ mysqld`; + my $basedir = ($defaults =~ m/--basedir=(.*)/)[0] +- or die "Can't determine basedir from 'my_print_defaults mysqld' output: $defaults"; ++ or die "Can't determine basedir from '@mybin_my_print_defaults@ mysqld' output: $defaults"; + warn "basedir=$basedir\n" if $opt{v}; + + my $datadir = ($defaults =~ m/--datadir=(.*)/)[0]; + if (!$datadir or $opt{i}) { + # determine the datadir from the instances section of /etc/my.cnf, if any +- my $instances = `my_print_defaults instances`; +- die "Can't determine datadir from 'my_print_defaults mysqld' output: $defaults" ++ my $instances = `@mybin_my_print_defaults@ instances`; ++ die "Can't determine datadir from '@mybin_my_print_defaults@ mysqld' output: $defaults" + unless $instances; + my @instances = ($instances =~ m/^--(\w+)-/mg); + die "No -i 'instance_name' specified to select among known instances: @instances.\n" +@@ -51,7 +51,7 @@ + die "Instance '$opt{i}' is unknown (known instances: @instances)\n" + unless grep { $_ eq $opt{i} } @instances; + $datadir = ($instances =~ m/--$opt{i}-datadir=(.*)/)[0] +- or die "Can't determine --$opt{i}-datadir from 'my_print_defaults instances' output: $instances"; ++ or die "Can't determine --$opt{i}-datadir from '@mybin_my_print_defaults@ instances' output: $instances"; + warn "datadir=$datadir\n" if $opt{v}; + } + +diff -Naur -Naur mysqlold/scripts/mysql_fix_privilege_tables.sh mysql/scripts/mysql_fix_privilege_tables.sh +--- mysqlold/scripts/mysql_fix_privilege_tables.sh 2006-12-06 17:05:18.000000000 +0000 ++++ mysql/scripts/mysql_fix_privilege_tables.sh 2006-12-12 13:21:16.000000000 +0000 +@@ -77,17 +77,17 @@ + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments + +-print_defaults=my_print_defaults ++print_defaults=@mybin_my_print_defaults@ + for dir in ./bin @bindir@ @bindir@ extra $print_defaults_bindir/../bin $print_defaults_bindir/../extra + do +- if test -x $dir/my_print_defaults ++ if test -x $dir/@mybin_my_print_defaults@ + then +- print_defaults="$dir/my_print_defaults" ++ print_defaults="$dir/@mybin_my_print_defaults@" + break + fi + done + +-parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables` ++parse_arguments `$print_defaults $defaults @mybin_mysql_install_db@ @mybin_mysql_fix_privilege_tables@` + parse_arguments PICK-ARGS-FROM-ARGV "$@" + + if test -z "$password" +@@ -118,7 +118,7 @@ + exit 1 + fi + +-cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" ++cmd="$bindir/@mybin_mysql@ --no-defaults --force --user=$user --host=$host" + if test ! -z "$password" ; then + cmd="$cmd --password=$password" + fi +@@ -136,7 +136,7 @@ + fi + + # Find where first mysql_fix_privilege_tables.sql is located +-for i in $basedir/support-files $basedir/share $basedir/share/mysql \ ++for i in @sharedstatedir@ $basedir/support-files $basedir/share $basedir/share/mysql \ + $basedir/scripts $pkgdatadir . "$dirname" + do + if test -f $i/$file +diff -Naur -Naur mysqlold/scripts/mysql_install_db.sh mysql/scripts/mysql_install_db.sh +--- mysqlold/scripts/mysql_install_db.sh 2006-12-06 17:05:24.000000000 +0000 ++++ mysql/scripts/mysql_install_db.sh 2006-12-12 13:26:18.000000000 +0000 +@@ -58,20 +58,20 @@ + + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x ./extra/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "./extra/@mybin_my_print_defaults@" + then +- print_defaults="./extra/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./extra/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + args= +@@ -96,10 +96,10 @@ + pkgdatadir=@pkgdatadir@ + else + bindir="$basedir/bin" +- if test -x "$basedir/libexec/mysqld" ++ if test -x "$basedir/libexec/@mybin_mysqld@" + then + execdir="$basedir/libexec" +- elif test -x "$basedir/sbin/mysqld" ++ elif test -x "$basedir/sbin/@mybin_mysqld@" + then + execdir="$basedir/sbin" + else +@@ -112,7 +112,8 @@ + then + fill_help_tables=$srcdir/scripts/fill_help_tables.sql + else +- for i in $basedir/support-files $basedir/share $basedir/share/mysql \ ++ for i in @sharedstatedir@ \ ++ $basedir/support-files $basedir/share $basedir/share/mysql \ + $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ + do + if test -f $i/fill_help_tables.sql +@@ -131,13 +132,13 @@ + fi + + mdata=$ldata/mysql +-mysqld=$execdir/mysqld ++mysqld=$execdir/@mybin_mysqld@ + mysqld_opt="" + scriptdir=$bindir + + if test "$windows" = 1 + then +- mysqld="./sql/mysqld" ++ mysqld="./sql/@mybin_mysqld@" + if test -n "$srcdir" -a -f $srcdir/sql/share/english/errmsg.sys + then + langdir=$srcdir/sql/share/english +@@ -167,14 +168,14 @@ + # Check if hostname is valid + if test "$windows" = 0 -a "$in_rpm" = 0 -a $force = 0 + then +- resolved=`$bindir/resolveip $hostname 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ $hostname 2>&1` + if [ $? -ne 0 ] + then +- resolved=`$bindir/resolveip localhost 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ localhost 2>&1` + if [ $? -ne 0 ] + then + echo "Neither host '$hostname' nor 'localhost' could be looked up with" +- echo "$bindir/resolveip" ++ echo "$bindir/@mybin_resolveip@" + echo "Please configure the 'hostname' command to return a correct hostname." + echo "If you want to solve this at a later stage, restart this script with" + echo "the --force option" +@@ -182,7 +183,7 @@ + fi + echo "WARNING: The host '$hostname' could not be looked up with resolveip." + echo "This probably means that your libc libraries are not 100 % compatible" +- echo "with this binary MySQL version. The MySQL daemon, mysqld, should work" ++ echo "with this binary MySQL version. The MySQL daemon, @mybin_mysqld@, should work" + echo "normally with the exception that host name resolving will not work." + echo "This means that you should use IP addresses instead of hostnames" + echo "when specifying MySQL privileges !" +@@ -227,7 +228,7 @@ + mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ + --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ + --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" +-if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ ++if $scriptdir/@mybin_mysql_create_system_tables@ $create_option $mdata $hostname $windows \ + | eval "$mysqld_install_cmd_line" + then + if test -n "$fill_help_tables" +@@ -257,8 +258,8 @@ + then + echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" + echo "To do so, start the server, then issue the following commands:" +- echo "$bindir/mysqladmin -u root password 'new-password'" +- echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root -h $hostname password 'new-password'" + echo "See the manual for more instructions." + # + # Print message about upgrading unless we have created a new db table. +@@ -266,14 +267,14 @@ + then + echo + echo "NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run" +- echo "the $bindir/mysql_fix_privilege_tables. Otherwise you will not be" ++ echo "the $bindir/@mybin_mysql_fix_privilege_tables@. Otherwise you will not be" + echo "able to use the new GRANT command!" + fi + echo + if test "$in_rpm" = "0" + then + echo "You can start the MySQL daemon with:" +- echo "cd @prefix@ ; $bindir/mysqld_safe &" ++ echo "cd @prefix@ ; $bindir/@mybin_mysqld_safe@ &" + echo + fi + echo "Please report any problems with the @scriptdir@/mysqlbug script!" +@@ -290,13 +291,13 @@ + echo "You can also try to start the mysqld daemon with:" + echo "$mysqld --skip-grant &" + echo "You can use the command line tool" +- echo "$bindir/mysql to connect to the mysql" ++ echo "$bindir/@mybin_mysql@ to connect to the mysql" + echo "database and look at the grant tables:" + echo +- echo "shell> $bindir/mysql -u root mysql" ++ echo "shell> $bindir/@mybin_mysql@ -u root mysql" + echo "mysql> show tables" + echo +- echo "Try 'mysqld --help' if you have problems with paths. Using --log" ++ echo "Try '@mybin_mysqld@ --help' if you have problems with paths. Using --log" + echo "gives you a log in $ldata that may be helpful." + echo + echo "The latest information about MySQL is available on the web at" +@@ -305,6 +306,6 @@ + echo "and the manual section that describes problems on your OS." + echo "Another information source is the MySQL email archive." + echo "Please check all of the above before mailing us!" +- echo "And if you do mail us, you MUST use the @scriptdir@/mysqlbug script!" ++ echo "And if you do mail us, you MUST use the @scriptdir@/@mybin_mysqlbug@ script!" + exit 1 + fi +diff -Naur -Naur mysqlold/scripts/mysql_secure_installation.sh mysql/scripts/mysql_secure_installation.sh +--- mysqlold/scripts/mysql_secure_installation.sh 2006-12-06 17:05:52.000000000 +0000 ++++ mysql/scripts/mysql_secure_installation.sh 2006-12-12 13:21:16.000000000 +0000 +@@ -30,7 +30,7 @@ + + do_query() { + echo $1 >$command +- mysql --defaults-file=$config <$command ++ @mybin_mysql@ --defaults-file=$config <$command + return $? + } + diff --git a/080_all_slot_script-5.1.15.patch b/080_all_slot_script-5.1.15.patch new file mode 100644 index 0000000..40502d8 --- /dev/null +++ b/080_all_slot_script-5.1.15.patch @@ -0,0 +1,540 @@ +diff -Naur -Naur mysqlold/scripts/Makefile.am mysql/scripts/Makefile.am +--- mysqlold/scripts/Makefile.am 2006-12-11 22:21:18.000000000 +0000 ++++ mysql/scripts/Makefile.am 2006-12-11 22:25:49.000000000 +0000 +@@ -61,6 +61,32 @@ + mysqlbug \ + make_win_bin_dist + ++sql_libexec_REPLACE = mysqld ++instance_manager_libexec_REPLACE= mysqlmanager ++client_bin_REPLACE = mysql mysqladmin mysqlcheck mysqlshow \ ++ mysqldump mysqlimport mysqltest mysqlbinlog \ ++ mysqltestmanagerc mysqltestmanager-pwgen ++extra_bin_REPLACE = replace comp_err perror resolveip my_print_defaults \ ++ resolve_stack_dump mysql_waitpid innochecksum ++myisam_bin_REPLACE = myisamchk myisamlog myisampack myisam_ftdump ++tools_bin_REPLACE = mysqltestmanager ++cw_cpcd_ndbbin_REPLACE = ndb_cpcd ++kernel_ndbbin_REPLACE = ndbd ++mgmsrv_ndbbin_REPLACE = ndb_mgmd ++sql_bin_REPLACE = mysql_tzinfo_to_sql ++tests_bin_REPLACE = mysql_client_test ++ndbtools_bin_REPLACE = ndb_test_platform ndb_waiter \ ++ ndb_drop_table ndb_delete_all \ ++ ndb_desc ndb_drop_index \ ++ ndb_show_tables ndb_select_all \ ++ ndb_select_count ndb_restore ndb_config ++EXTRA_REPLACE_BIN = safe_mysqld mysqlanalyze mysqloptimize mysqlrepair mysqld-max isamchk \ ++ $(sql_libexec_REPLACE) $(ndbtools_bin_REPLACE) \ ++ $(instance_manager_libexec_REPLACE) $(client_bin_REPLACE) \ ++ $(extra_bin_REPLACE) $(myisam_bin_REPLACE) $(tools_bin_REPLACE) \ ++ $(cw_cpcd_ndbbin_REPLACE) $(kernel_ndbbin_REPLACE) $(mgmsrv_ndbbin_REPLACE) \ ++ $(sql_bin_REPLACE) $(tests_bin_REPLACE) ++ + dist_pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql + + # mysqlbug should be distributed built so that people can report build +@@ -93,8 +119,17 @@ + + .sh: + @RM@ -f $@ $@-t ++ bin_REPLACE='';\ ++ list='$(EXTRA_SCRIPTS) $(EXTRA_REPLACE_BIN)'; \ ++ for p in $${list}; do \ ++ f1=$${p/\.sh}; \ ++ f2=`echo "$${p}" | @SED@ -e 's|\.sh$$||' -e 's|^.*/||;$(transform)'`; \ ++ bin_REPLACE="$${bin_REPLACE}s!@mybin_$${f1}@!$${f2}!g;";\ ++ done; \ + @SED@ \ ++ -e "$${bin_REPLACE}" \ + -e 's!@''bindir''@!$(bindir)!g' \ ++ -e 's!@''sharedstatedir''@!$(sharedstatedir)!g' \ + -e 's!@''sbindir''@!$(sbindir)!g' \ + -e 's!@''scriptdir''@!$(bindir)!g' \ + -e 's!@''prefix''@!$(prefix)!g' \ +diff -Naur -Naur mysqlold/scripts/msql2mysql.sh mysql/scripts/msql2mysql.sh +--- mysqlold/scripts/msql2mysql.sh 2006-12-11 22:21:18.000000000 +0000 ++++ mysql/scripts/msql2mysql.sh 2006-12-11 22:25:49.000000000 +0000 +@@ -13,4 +13,4 @@ + # described in the License. Among other things, the License requires that + # the copyright notice and this notice be preserved on all copies. + +-@bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* ++@bindir@/@mybin_replace@ msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* +diff -Naur -Naur mysqlold/scripts/mysqlaccess.sh mysql/scripts/mysqlaccess.sh +--- mysqlold/scripts/mysqlaccess.sh 2006-12-11 22:21:19.000000000 +0000 ++++ mysql/scripts/mysqlaccess.sh 2006-12-11 22:25:49.000000000 +0000 +@@ -17,7 +17,7 @@ + + # **************************** + # information on MySQL +- $MYSQL = '@bindir@/mysql'; # path to mysql executable ++ $MYSQL = '@bindir@/@mybin_mysql@'; # path to mysql executable + $SERVER = '3.21'; + $MYSQL_OPT = ' --batch --unbuffered'; + $ACCESS_DB = 'mysql'; # name of DB with grant-tables +@@ -32,7 +32,7 @@ + $ACCESS_U_BCK = 'user_backup'; + $ACCESS_D_BCK = 'db_backup'; + $DIFF = '/usr/bin/diff'; +- $MYSQLDUMP = '@bindir@/mysqldump'; ++ $MYSQLDUMP = '@bindir@/@mybin_mysqldump@'; + #path to mysqldump executable + + $MYSQLADMIN= 'http://foobar.com/MySQLadmin'; +diff -Naur -Naur mysqlold/scripts/mysql_config.sh mysql/scripts/mysql_config.sh +--- mysqlold/scripts/mysql_config.sh 2006-12-11 22:21:18.000000000 +0000 ++++ mysql/scripts/mysql_config.sh 2006-12-11 22:25:49.000000000 +0000 +@@ -77,7 +77,7 @@ + + me=`get_full_path $0` + +-basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` ++basedir=`echo $me | sed -e 's;/bin/@mybin_mysql_config@;;'` + + ldata='@localstatedir@' + execdir='@libexecdir@' +@@ -86,10 +86,10 @@ + # If installed, search for the compiled in directory first (might be "lib64") + pkglibdir='@pkglibdir@' + pkglibdir_rel=`echo $pkglibdir | sed -e "s;^$basedir/;;"` +-fix_path pkglibdir $pkglibdir_rel lib/mysql lib ++fix_path pkglibdir $pkglibdir_rel "lib${pkglibdir##*lib}" lib/mysql lib + + pkgincludedir='@pkgincludedir@' +-fix_path pkgincludedir include/mysql include ++fix_path pkgincludedir "include${pkgincludedir##*include}" include/mysql include + + version='@VERSION@' + socket='@MYSQL_UNIX_ADDR@' +diff -Naur -Naur mysqlold/scripts/mysql_create_system_tables.sh mysql/scripts/mysql_create_system_tables.sh +--- mysqlold/scripts/mysql_create_system_tables.sh 2006-12-11 22:21:18.000000000 +0000 ++++ mysql/scripts/mysql_create_system_tables.sh 2006-12-11 22:25:49.000000000 +0000 +@@ -19,7 +19,7 @@ + new context from the manual (from fill_help_tables.sql). + + Usage: +- mysql_create_system_tables [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> ++ @mybin_mysql_create_system_tables@ [test|verbose|real] <path to mysql-database directory> <hostname> <windows option> + " + exit + fi +diff -Naur -Naur mysqlold/scripts/mysqld_multi.sh mysql/scripts/mysqld_multi.sh +--- mysqlold/scripts/mysqld_multi.sh 2006-12-11 22:21:19.000000000 +0000 ++++ mysql/scripts/mysqld_multi.sh 2006-12-11 22:25:49.000000000 +0000 +@@ -10,8 +10,8 @@ + $opt_example = 0; + $opt_help = 0; + $opt_log = undef(); +-$opt_mysqladmin = "@bindir@/mysqladmin"; +-$opt_mysqld = "@libexecdir@/mysqld"; ++$opt_mysqladmin = "@bindir@/@mybin_mysqladmin@"; ++$opt_mysqld = "@libexecdir@/@mybin_mysqld@"; + $opt_no_log = 0; + $opt_password = undef(); + $opt_tcp_ip = 0; +@@ -39,11 +39,11 @@ + { + my $flag_exit= 0; + +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { + # We can't throw out yet, since --version, --help, or --example may + # have been given +- print "WARNING: my_print_defaults command not found.\n"; ++ print "WARNING: @mybin_my_print_defaults@ command not found.\n"; + print "Please make sure you have this command available and\n"; + print "in your path. The command is available from the latest\n"; + print "MySQL distribution.\n"; +@@ -74,9 +74,9 @@ + } + } + } +- my $com= "my_print_defaults "; ++ my $com= "@mybin_my_print_defaults@ "; + $com.= "--config-file=$opt_config_file " if (defined($opt_config_file)); +- $com.= "mysqld_multi"; ++ $com.= "@mybin_mysqld_multi@"; + my @defops = `$com`; + chop @defops; + splice @ARGV, 0, 0, @defops; +@@ -113,9 +113,9 @@ + print "Error with an option, see $my_progname --help for more info.\n"; + exit(1); + } +- if (!defined(my_which(my_print_defaults))) ++ if (!defined(my_which(@mybin_my_print_defaults@))) + { +- print "ABORT: Can't find command 'my_print_defaults'.\n"; ++ print "ABORT: Can't find command '@mybin_my_print_defaults@'.\n"; + print "This command is available from the latest MySQL\n"; + print "distribution. Please make sure you have the command\n"; + print "in your PATH.\n"; +@@ -202,7 +202,7 @@ + { + if ($my_print_defaults_exists) + { +- @mysqld_opts= `my_print_defaults mysqld`; ++ @mysqld_opts= `@mybin_my_print_defaults@ mysqld`; + chomp @mysqld_opts; + foreach my $opt (@mysqld_opts) + { +@@ -303,7 +303,7 @@ + @groups = &find_groups($groupids); + for ($i = 0; defined($groups[$i]); $i++) + { +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +@@ -330,7 +330,7 @@ + $tmp.= " $options[$j]"; + } + } +- if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent) ++ if ($opt_verbose && $com =~ m/\/@mybin_safe_mysqld@$/ && !$info_sent) + { + print "WARNING: safe_mysqld is being used to start mysqld. In this case you "; + print "may need to pass\n\"ledir=...\" under groups [mysqldN] to "; +@@ -401,7 +401,7 @@ + my ($i, @groups)= @_; + my ($mysqladmin_found, $com, $tmp, $j); + +- $com = "my_print_defaults"; ++ $com = "@mybin_my_print_defaults@"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; +diff -Naur -Naur mysqlold/scripts/mysqld_safe.sh mysql/scripts/mysqld_safe.sh +--- mysqlold/scripts/mysqld_safe.sh 2006-12-11 22:21:19.000000000 +0000 ++++ mysql/scripts/mysqld_safe.sh 2006-12-11 22:25:49.000000000 +0000 +@@ -91,7 +91,7 @@ + then + MYSQLD="mysqld-$tmp" + else +- MYSQLD="mysqld" ++ MYSQLD="@mybin_mysqld@" + fi + ;; + --nice=*) niceness=`echo "$arg" | sed -e "s;--nice=;;"` ;; +@@ -115,13 +115,13 @@ + + MY_PWD=`pwd` + # Check for the directories we would expect from a binary release install +-if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld ++if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are + ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is + # Check for the directories we would expect from a source install + elif test -f ./share/mysql/english/errmsg.sys -a \ +- -x ./libexec/mysqld ++ -x ./libexec/@mybin_mysqld@ + then + MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are + ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is +@@ -183,17 +183,17 @@ + + # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] + # and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + append_arg_to_args () { +@@ -222,7 +222,7 @@ + # If the user doesn't specify a binary, we assume name "mysqld" + if test -z "$MYSQLD" + then +- MYSQLD=mysqld ++ MYSQLD=@mybin_mysqld@ + fi + + if test ! -x $ledir/$MYSQLD +@@ -230,7 +230,7 @@ + echo "The file $ledir/$MYSQLD doesn't exist or is not executable" + echo "Please do a cd to the mysql installation directory and restart" + echo "this script from there as follows:" +- echo "./bin/mysqld_safe". ++ echo "./bin/@mybin_mysqld_safe@". + echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more" + echo "information" + exit 1 +@@ -390,8 +390,8 @@ + # the manual for details. + # + # echo "Checking tables in $DATADIR" +-# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check $DATADIR/*/*.MYI +-# $MY_BASEDIR_VERSION/bin/isamchk --silent --force $DATADIR/*/*.ISM ++# $MY_BASEDIR_VERSION/bin/@mybin_myisamchk@ --silent --force --fast --medium-check $DATADIR/*/*.MYI ++# $MY_BASEDIR_VERSION/bin/@mybin_isamchk@ --silent --force $DATADIR/*/*.ISM + + echo "Starting $MYSQLD daemon with databases from $DATADIR" + +diff -Naur -Naur mysqlold/scripts/mysqldumpslow.sh mysql/scripts/mysqldumpslow.sh +--- mysqlold/scripts/mysqldumpslow.sh 2006-12-11 22:21:19.000000000 +0000 ++++ mysql/scripts/mysqldumpslow.sh 2006-12-11 22:25:49.000000000 +0000 +@@ -34,16 +34,16 @@ + $opt{'help'} and usage(); + + unless (@ARGV) { +- my $defaults = `my_print_defaults mysqld`; ++ my $defaults = `@mybin_my_print_defaults@ mysqld`; + my $basedir = ($defaults =~ m/--basedir=(.*)/)[0] +- or die "Can't determine basedir from 'my_print_defaults mysqld' output: $defaults"; ++ or die "Can't determine basedir from '@mybin_my_print_defaults@ mysqld' output: $defaults"; + warn "basedir=$basedir\n" if $opt{v}; + + my $datadir = ($defaults =~ m/--datadir=(.*)/)[0]; + if (!$datadir or $opt{i}) { + # determine the datadir from the instances section of /etc/my.cnf, if any +- my $instances = `my_print_defaults instances`; +- die "Can't determine datadir from 'my_print_defaults mysqld' output: $defaults" ++ my $instances = `@mybin_my_print_defaults@ instances`; ++ die "Can't determine datadir from '@mybin_my_print_defaults@ mysqld' output: $defaults" + unless $instances; + my @instances = ($instances =~ m/^--(\w+)-/mg); + die "No -i 'instance_name' specified to select among known instances: @instances.\n" +@@ -51,7 +51,7 @@ + die "Instance '$opt{i}' is unknown (known instances: @instances)\n" + unless grep { $_ eq $opt{i} } @instances; + $datadir = ($instances =~ m/--$opt{i}-datadir=(.*)/)[0] +- or die "Can't determine --$opt{i}-datadir from 'my_print_defaults instances' output: $instances"; ++ or die "Can't determine --$opt{i}-datadir from '@mybin_my_print_defaults@ instances' output: $instances"; + warn "datadir=$datadir\n" if $opt{v}; + } + +diff -Naur -Naur mysqlold/scripts/mysql_fix_privilege_tables.sh mysql/scripts/mysql_fix_privilege_tables.sh +--- mysqlold/scripts/mysql_fix_privilege_tables.sh 2006-12-11 22:21:18.000000000 +0000 ++++ mysql/scripts/mysql_fix_privilege_tables.sh 2006-12-11 22:27:58.000000000 +0000 +@@ -77,17 +77,17 @@ + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments + +-print_defaults=my_print_defaults ++print_defaults=@mybin_my_print_defaults@ + for dir in ./bin @bindir@ @bindir@ extra $print_defaults_bindir/../bin $print_defaults_bindir/../extra + do +- if test -x $dir/my_print_defaults ++ if test -x $dir/@mybin_my_print_defaults@ + then +- print_defaults="$dir/my_print_defaults" ++ print_defaults="$dir/@mybin_my_print_defaults@" + break + fi + done + +-parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables` ++parse_arguments `$print_defaults $defaults @mybin_mysql_install_db@ @mybin_mysql_fix_privilege_tables@` + parse_arguments PICK-ARGS-FROM-ARGV "$@" + + if test -z "$password" +@@ -118,7 +118,7 @@ + exit 1 + fi + +-cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" ++cmd="$bindir/@mybin_mysql@ --no-defaults --force --user=$user --host=$host" + if test ! -z "$port"; then + cmd="$cmd --port=$port" + fi +@@ -133,7 +133,7 @@ + fi + + # Find where first mysql_fix_privilege_tables.sql is located +-for i in $basedir/support-files $basedir/share $basedir/share/mysql \ ++for i in @sharedstatedir@ $basedir/support-files $basedir/share $basedir/share/mysql \ + $basedir/scripts $pkgdatadir . "$dirname" + do + if test -f $i/$file +diff -Naur -Naur mysqlold/scripts/mysql_install_db.sh mysql/scripts/mysql_install_db.sh +--- mysqlold/scripts/mysql_install_db.sh 2006-12-11 22:21:18.000000000 +0000 ++++ mysql/scripts/mysql_install_db.sh 2006-12-11 22:30:43.000000000 +0000 +@@ -58,20 +58,20 @@ + + # Get first arguments from the my.cfg file, groups [mysqld] and + # [mysql_install_db], and then merge with the command line arguments +-if test -x ./bin/my_print_defaults ++if test -x "./bin/@mybin_my_print_defaults@" + then +- print_defaults="./bin/my_print_defaults" +-elif test -x ./extra/my_print_defaults ++ print_defaults="./bin/@mybin_my_print_defaults@" ++elif test -x "./extra/@mybin_my_print_defaults@" + then +- print_defaults="./extra/my_print_defaults" +-elif test -x @bindir@/my_print_defaults ++ print_defaults="./extra/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/my_print_defaults" +-elif test -x @bindir@/mysql_print_defaults ++ print_defaults="@bindir@/@mybin_my_print_defaults@" ++elif test -x "@bindir@/@mybin_my_print_defaults@" + then +- print_defaults="@bindir@/mysql_print_defaults" ++ print_defaults="@bindir@/@mybin_my_print_defaults@" + else +- print_defaults="my_print_defaults" ++ print_defaults="@mybin_my_print_defaults@" + fi + + args= +@@ -96,10 +96,10 @@ + pkgdatadir=@pkgdatadir@ + else + bindir="$basedir/bin" +- if test -x "$basedir/libexec/mysqld" ++ if test -x "$basedir/libexec/@mybin_mysqld@" + then + execdir="$basedir/libexec" +- elif test -x "$basedir/sbin/mysqld" ++ elif test -x "$basedir/sbin/@mybin_mysqld@" + then + execdir="$basedir/sbin" + else +@@ -112,7 +112,8 @@ + then + fill_help_tables=$srcdir/scripts/fill_help_tables.sql + else +- for i in $basedir/support-files $basedir/share $basedir/share/mysql \ ++ for i in @sharedstatedir@ \ ++ $basedir/support-files $basedir/share $basedir/share/mysql \ + $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ + do + if test -f $i/fill_help_tables.sql +@@ -131,13 +132,13 @@ + fi + + mdata=$ldata/mysql +-mysqld=$execdir/mysqld ++mysqld=$execdir/@mybin_mysqld@ + mysqld_opt="" + scriptdir=$bindir + + if test "$windows" = 1 + then +- mysqld="./sql/mysqld" ++ mysqld="./sql/@mybin_mysqld@" + if test -n "$srcdir" -a -f $srcdir/sql/share/english/errmsg.sys + then + langdir=$srcdir/sql/share/english +@@ -167,14 +168,14 @@ + # Check if hostname is valid + if test "$windows" = 0 -a "$in_rpm" = 0 -a $force = 0 + then +- resolved=`$bindir/resolveip $hostname 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ $hostname 2>&1` + if [ $? -ne 0 ] + then +- resolved=`$bindir/resolveip localhost 2>&1` ++ resolved=`$bindir/@mybin_resolveip@ localhost 2>&1` + if [ $? -ne 0 ] + then + echo "Neither host '$hostname' nor 'localhost' could be looked up with" +- echo "$bindir/resolveip" ++ echo "$bindir/@mybin_resolveip@" + echo "Please configure the 'hostname' command to return a correct hostname." + echo "If you want to solve this at a later stage, restart this script with" + echo "the --force option" +@@ -182,7 +183,7 @@ + fi + echo "WARNING: The host '$hostname' could not be looked up with resolveip." + echo "This probably means that your libc libraries are not 100 % compatible" +- echo "with this binary MySQL version. The MySQL daemon, mysqld, should work" ++ echo "with this binary MySQL version. The MySQL daemon, @mybin_mysqld@, should work" + echo "normally with the exception that host name resolving will not work." + echo "This means that you should use IP addresses instead of hostnames" + echo "when specifying MySQL privileges !" +@@ -227,7 +228,7 @@ + mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ + --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ + --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" +-if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ ++if $scriptdir/@mybin_mysql_create_system_tables@ $create_option $mdata $hostname $windows \ + | eval "$mysqld_install_cmd_line" + then + if test -n "$fill_help_tables" +@@ -257,8 +258,8 @@ + then + echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" + echo "To do so, start the server, then issue the following commands:" +- echo "$bindir/mysqladmin -u root password 'new-password'" +- echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root password 'new-password'" ++ echo "$bindir/@mybin_mysqladmin@ -u root -h $hostname password 'new-password'" + echo "See the manual for more instructions." + # + # Print message about upgrading unless we have created a new db table. +@@ -266,14 +267,14 @@ + then + echo + echo "NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run" +- echo "the $bindir/mysql_fix_privilege_tables. Otherwise you will not be" ++ echo "the $bindir/@mybin_mysql_fix_privilege_tables@. Otherwise you will not be" + echo "able to use the new GRANT command!" + fi + echo + if test "$in_rpm" = "0" + then + echo "You can start the MySQL daemon with:" +- echo "cd @prefix@ ; $bindir/mysqld_safe &" ++ echo "cd @prefix@ ; $bindir/@mybin_mysqld_safe@ &" + echo + fi + echo "Please report any problems with the @scriptdir@/mysqlbug script!" +@@ -290,13 +291,13 @@ + echo "You can also try to start the mysqld daemon with:" + echo "$mysqld --skip-grant &" + echo "You can use the command line tool" +- echo "$bindir/mysql to connect to the mysql" ++ echo "$bindir/@mybin_mysql@ to connect to the mysql" + echo "database and look at the grant tables:" + echo +- echo "shell> $bindir/mysql -u root mysql" ++ echo "shell> $bindir/@mybin_mysql@ -u root mysql" + echo "mysql> show tables" + echo +- echo "Try 'mysqld --help' if you have problems with paths. Using --log" ++ echo "Try '@mybin_mysqld@ --help' if you have problems with paths. Using --log" + echo "gives you a log in $ldata that may be helpful." + echo + echo "The latest information about MySQL is available on the web at" +@@ -305,6 +306,6 @@ + echo "and the manual section that describes problems on your OS." + echo "Another information source is the MySQL email archive." + echo "Please check all of the above before mailing us!" +- echo "And if you do mail us, you MUST use the @scriptdir@/mysqlbug script!" ++ echo "And if you do mail us, you MUST use the @scriptdir@/@mybin_mysqlbug@ script!" + exit 1 + fi +diff -Naur -Naur mysqlold/scripts/mysql_secure_installation.sh mysql/scripts/mysql_secure_installation.sh +--- mysqlold/scripts/mysql_secure_installation.sh 2006-12-11 22:21:18.000000000 +0000 ++++ mysql/scripts/mysql_secure_installation.sh 2006-12-11 22:25:49.000000000 +0000 +@@ -30,7 +30,7 @@ + + do_query() { + echo $1 >$command +- mysql --defaults-file=$config <$command ++ @mybin_mysql@ --defaults-file=$config <$command + return $? + } + diff --git a/081_all_slot_manager-5.0.19.patch b/081_all_slot_manager-5.0.19.patch new file mode 100644 index 0000000..a55175e --- /dev/null +++ b/081_all_slot_manager-5.0.19.patch @@ -0,0 +1,20 @@ +--- mysql-5.0.19.orig/server-tools/instance-manager/Makefile.am 2006-03-04 20:34:51.000000000 +0000 ++++ mysql-5.0.19.new/server-tools/instance-manager/Makefile.am 2006-03-24 17:54:43.000000000 +0000 +@@ -28,12 +28,12 @@ + noinst_LIBRARIES= libnet.a + + liboptions_la_CXXFLAGS= $(CXXFLAGS) \ +- -DDEFAULT_PID_FILE_NAME="$(localstatedir)/mysqlmanager.pid" \ +- -DDEFAULT_LOG_FILE_NAME="$(localstatedir)/mysqlmanager.log" \ +- -DDEFAULT_SOCKET_FILE_NAME="/tmp/mysqlmanager.sock" \ +- -DDEFAULT_PASSWORD_FILE_NAME="/etc/mysqlmanager.passwd" \ ++ -DDEFAULT_PID_FILE_NAME="$(localstatedir)/mysqlmanager@GENTOO_EXT@.pid" \ ++ -DDEFAULT_LOG_FILE_NAME="$(localstatedir)/mysqlmanager@GENTOO_EXT@.log" \ ++ -DDEFAULT_SOCKET_FILE_NAME="/@GENTOO_SOCK_PATH@/mysqlmanager@GENTOO_EXT@.sock" \ ++ -DDEFAULT_PASSWORD_FILE_NAME="/$(sysconfdir)/mysqlmanager.passwd" \ + -DDEFAULT_MYSQLD_PATH="$(libexecdir)/mysqld$(EXEEXT)" \ +- -DDEFAULT_CONFIG_FILE="/etc/my.cnf" \ ++ -DDEFAULT_CONFIG_FILE="/$(sysconfdir)/my.cnf" \ + -DPROTOCOL_VERSION=@PROTOCOL_VERSION@ + + liboptions_la_SOURCES= options.h options.cc priv.h priv.cc diff --git a/081_all_slot_manager-5.1.10.patch b/081_all_slot_manager-5.1.10.patch new file mode 100644 index 0000000..756252b --- /dev/null +++ b/081_all_slot_manager-5.1.10.patch @@ -0,0 +1,21 @@ +diff -Naur mysql-5.1.10-beta-nightly-20060410.a/server-tools/instance-manager/Makefile.am mysql-5.1.10-beta-nightly-20060410.b/server-tools/instance-manager/Makefile.am +--- mysql-5.1.10-beta-nightly-20060410.a/server-tools/instance-manager/Makefile.am 2006-04-10 04:27:45.000000000 +0000 ++++ mysql-5.1.10-beta-nightly-20060410.b/server-tools/instance-manager/Makefile.am 2006-04-12 17:21:28.000000000 +0000 +@@ -28,12 +28,12 @@ + noinst_LIBRARIES= libnet.a + + liboptions_la_CXXFLAGS= $(CXXFLAGS) \ +- -DDEFAULT_PID_FILE_NAME="$(localstatedir)/mysqlmanager.pid" \ +- -DDEFAULT_LOG_FILE_NAME="$(localstatedir)/mysqlmanager.log" \ +- -DDEFAULT_SOCKET_FILE_NAME="/tmp/mysqlmanager.sock" \ ++ -DDEFAULT_PID_FILE_NAME="$(localstatedir)/mysqlmanager@GENTOO_EXT@.pid" \ ++ -DDEFAULT_LOG_FILE_NAME="$(localstatedir)/mysqlmanager@GENTOO_EXT@.log" \ ++ -DDEFAULT_SOCKET_FILE_NAME="/@GENTOO_SOCK_PATH@/mysqlmanager@GENTOO_EXT@.sock" \ + -DDEFAULT_PASSWORD_FILE_NAME="/etc/mysqlmanager.passwd" \ +- -DDEFAULT_MYSQLD_PATH="$(libexecdir)/mysqld$(EXEEXT)" \ +- -DDEFAULT_CONFIG_FILE="/etc/my.cnf" \ ++ -DDEFAULT_MYSQLD_PATH="$(libexecdir)/mysqld@GENTOO_EXT@$(EXEEXT)" \ ++ -DDEFAULT_CONFIG_FILE="/etc/mysql@GENTOO_EXT@/my.cnf" \ + -DPROTOCOL_VERSION=@PROTOCOL_VERSION@ + + liboptions_la_SOURCES= options.h options.cc priv.h priv.cc diff --git a/081_all_slot_manager-5.1.7.patch b/081_all_slot_manager-5.1.7.patch new file mode 100644 index 0000000..9cf3dec --- /dev/null +++ b/081_all_slot_manager-5.1.7.patch @@ -0,0 +1,21 @@ +--- mysql-5.1.7-beta.orig/server-tools/instance-manager/Makefile.am 2006-02-27 21:24:53.000000000 +0000 ++++ mysql-5.1.7-beta.new/server-tools/instance-manager/Makefile.am 2006-03-24 17:45:15.000000000 +0000 +@@ -27,12 +27,12 @@ + noinst_LIBRARIES= liboptions.a libnet.a + + liboptions_a_CXXFLAGS= $(CXXFLAGS) \ +- -DDEFAULT_PID_FILE_NAME="$(localstatedir)/mysqlmanager.pid" \ +- -DDEFAULT_LOG_FILE_NAME="$(localstatedir)/mysqlmanager.log" \ +- -DDEFAULT_SOCKET_FILE_NAME="/tmp/mysqlmanager.sock" \ +- -DDEFAULT_PASSWORD_FILE_NAME="/etc/mysqlmanager.passwd" \ +- -DDEFAULT_MYSQLD_PATH="$(libexecdir)/mysqld$(EXEEXT)" \ +- -DDEFAULT_CONFIG_FILE="/etc/my.cnf" \ ++ -DDEFAULT_PID_FILE_NAME="$(localstatedir)/mysqlmanager@GENTOO_EXT@.pid" \ ++ -DDEFAULT_LOG_FILE_NAME="$(localstatedir)/mysqlmanager@GENTOO_EXT@.log" \ ++ -DDEFAULT_SOCKET_FILE_NAME="/@GENTOO_SOCK_PATH@/mysqlmanager@GENTOO_EXT@.sock" \ ++ -DDEFAULT_PASSWORD_FILE_NAME="/$(sysconfdir)/mysqlmanager.passwd" \ ++ -DDEFAULT_MYSQLD_PATH="$(libexecdir)/mysqld@GENTOO_EXT@$(EXEEXT)" \ ++ -DDEFAULT_CONFIG_FILE="/$(sysconfdir)/my.cnf" \ + -DPROTOCOL_VERSION=@PROTOCOL_VERSION@ + + liboptions_a_SOURCES= options.h options.cc priv.h priv.cc diff --git a/100_all_bug23427-abi-breakage-5.0.26.patch b/100_all_bug23427-abi-breakage-5.0.26.patch new file mode 100644 index 0000000..26d6eed --- /dev/null +++ b/100_all_bug23427-abi-breakage-5.0.26.patch @@ -0,0 +1,43 @@ +From: Chad MILLERDate: October 20 2006 11:17pm +Subject: bk commit into 5.0 tree (cmiller:1.2292) BUG#23427 + +ChangeSet@stripped, 2006-10-20 17:17:24-04:00, cmiller@stripped +2 -0 + Bug #23427: incompatible ABI change in 5.0.26? + + Revert 1 June change enough to restore ABI compatibility with previous + versions. + + include/mysql.h@stripped, 2006-10-20 17:17:22-04:00, cmiller@stripped +0 -6 + Revert patch that breaks ABI compatibility + + libmysqld/lib_sql.cc@stripped, 2006-10-20 17:17:22-04:00, cmiller@stripped +0 -1 + Remove useless assignment. + +Thanks to Sean Finney for discovering this (Debian MySQL maintainer). + +--- 1.162/include/mysql.h 2006-10-20 17:17:28 -04:00 ++++ 1.163/include/mysql.h 2006-10-20 17:17:28 -04:00 +@@ -293,12 +293,6 @@ typedef struct st_mysql + /* needed for embedded server - no net buffer to store the 'info' */ + char *info_buffer; + #endif +- /* +- In embedded server it points to the statement that is processed +- in the current query. We store some results directly in statement +- fields then. +- */ +- struct st_mysql_stmt *current_stmt; + } MYSQL; + + typedef struct st_mysql_res { + +--- 1.114/libmysqld/lib_sql.cc 2006-10-20 17:17:28 -04:00 ++++ 1.115/libmysqld/lib_sql.cc 2006-10-20 17:17:28 -04:00 +@@ -100,7 +100,6 @@ emb_advanced_command(MYSQL *mysql, enum + mysql->affected_rows= ~(my_ulonglong) 0; + mysql->field_count= 0; + net->last_errno= 0; +- mysql->current_stmt= stmt; + + thd->store_globals(); // Fix if more than one connect + /* diff --git a/101_all_bootstrap_no_plugin.patch b/101_all_bootstrap_no_plugin.patch new file mode 100644 index 0000000..de9258c --- /dev/null +++ b/101_all_bootstrap_no_plugin.patch @@ -0,0 +1,39 @@ +From: antony at mysql dot com +Date: December 6 2006 8:27pm +Subject: bk commit into 5.1 tree (antony:1.2325) BUG#24270 + +Below is the list of changes that have just been committed into a local +5.1 repository of antony. When antony 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, 2006-12-06 11:27:13-08:00, antony@stripped +1 -0 + Bug#24270 + "mysql_install_db doesn't work properly on 5.1" + force default sql mode when in bootstrap. prevents entries in my.cnf + from breaking the 'install' + + sql/mysqld.cc@stripped, 2006-12-06 11:27:10-08:00, antony@stripped +2 -0 + force default sql mode when in bootstrap. prevents entries in my.cnf + from breaking the 'install' + +# 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: antony +# Host: ppcg5.local +# Root: /Users/antony/Work/p2-bug24270.1 + +--- 1.583/sql/mysqld.cc 2006-12-06 11:27:21 -08:00 ++++ 1.584/sql/mysqld.cc 2006-12-06 11:27:21 -08:00 +@@ -3640,6 +3640,8 @@ + + if (opt_bootstrap) + { ++ global_system_variables.tx_isolation= ISO_REPEATABLE_READ; ++ global_system_variables.sql_mode= fix_sql_mode(0); + select_thread_in_use= 0; // Allow 'kill' to work + bootstrap(stdin); + end_thr_alarm(1); // Don't allow alarms diff --git a/200_all_query-logging-bypass-4.1.19.patch b/200_all_query-logging-bypass-4.1.19.patch new file mode 100644 index 0000000..efd7864 --- /dev/null +++ b/200_all_query-logging-bypass-4.1.19.patch @@ -0,0 +1,203 @@ +diff -Nru mysql-4.1.18/sql/sql_lex.cc mysql-4.1.18-logsec/sql/sql_lex.cc +--- mysql-4.1.18/sql/sql_lex.cc 2006-01-27 17:26:42.000000000 +0100 ++++ mysql-4.1.18-logsec/sql/sql_lex.cc 2006-04-07 22:32:51.000000000 +0200 +@@ -912,6 +912,9 @@ + while (lex->ptr != lex->end_of_query && + ((c=yyGet()) != '*' || yyPeek() != '/')) + { ++ if (c == '\0') ++ return(ABORT_SYM); // NULLs illegal even in comments ++ + if (c == '\n') + lex->yylineno++; + } +diff -Naur -Naur mysql-4.1.14.orig/include/my_sys.h mysql-4.1.14.new/include/my_sys.h +--- mysql-4.1.14.orig/include/my_sys.h 2005-08-17 17:06:34.000000000 +0000 ++++ mysql-4.1.14.new/include/my_sys.h 2006-04-09 15:59:54.000000000 +0000 +@@ -573,6 +573,11 @@ + const char *sFile, uint uLine, + myf MyFlag); + ++/* implemented in my_memmem.c */ ++extern void *my_memmem(const void *haystack, size_t haystacklen, ++ const void *needle, size_t needlelen); ++ ++ + #ifdef __WIN__ + extern int my_access(const char *path, int amode); + #else +diff -Naur -Naur mysql-4.1.14.orig/mysys/Makefile.am mysql-4.1.14.new/mysys/Makefile.am +--- mysql-4.1.14.orig/mysys/Makefile.am 2005-08-17 17:06:33.000000000 +0000 ++++ mysql-4.1.14.new/mysys/Makefile.am 2006-04-09 15:59:54.000000000 +0000 +@@ -54,7 +54,8 @@ + my_net.c my_semaphore.c my_port.c my_sleep.c \ + charset.c charset-def.c my_bitmap.c my_bit.c md5.c \ + my_gethostbyname.c rijndael.c my_aes.c sha1.c \ +- my_handler.c my_netware.c my_windac.c my_access.c ++ my_handler.c my_netware.c \ ++ my_memmem.c my_windac.c my_access.c + EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \ + thr_mutex.c thr_rwlock.c + libmysys_a_LIBADD = @THREAD_LOBJECTS@ +diff -Naur -Naur mysql-4.1.14.orig/mysys/mf_iocache2.c mysql-4.1.14.new/mysys/mf_iocache2.c +--- mysql-4.1.14.orig/mysys/mf_iocache2.c 2005-08-17 17:06:28.000000000 +0000 ++++ mysql-4.1.14.new/mysys/mf_iocache2.c 2006-04-09 15:59:54.000000000 +0000 +@@ -245,6 +245,10 @@ + uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args) + { + uint out_length=0; ++ uint minimum_width; /* as yet unimplemented */ ++ uint minimum_width_sign; ++ uint precision; /* as yet unimplemented for anything but %b */ ++ const char* backtrack; + + for (; *fmt ; fmt++) + { +@@ -265,17 +269,53 @@ + fmt++; + /* Found one '%' */ + } ++ backtrack= fmt; ++ ++ minimum_width= 0; ++ precision= 0; ++ minimum_width_sign= 1; + /* Skip if max size is used (to be compatible with printf) */ +- while (my_isdigit(&my_charset_latin1, *fmt) || *fmt == '.' || *fmt == '-') ++ while (*fmt == '-') { fmt++; minimum_width_sign= -1; } ++ if (*fmt == '*') { ++ precision= (int) va_arg(args, int); ++ fmt++; ++ } else { ++ while (my_isdigit(&my_charset_latin1, *fmt)) { ++ minimum_width=(minimum_width * 10) + (*fmt - '0'); ++ fmt++; ++ } ++ } ++ minimum_width*= minimum_width_sign; ++ ++ if (*fmt == '.') { + fmt++; ++ if (*fmt == '*') { ++ precision= (int) va_arg(args, int); ++ fmt++; ++ } else { ++ while (my_isdigit(&my_charset_latin1, *fmt)) { ++ precision=(precision * 10) + (*fmt - '0'); ++ fmt++; ++ } ++ } ++ } ++ + if (*fmt == 's') /* String parameter */ + { + reg2 char *par = va_arg(args, char *); + uint length = (uint) strlen(par); ++ /* TODO: implement minimum width and precision */ + out_length+=length; + if (my_b_write(info, par, length)) + goto err; + } ++ else if (*fmt == 'b') /* Sized buffer parameter, only precision makes sense */ ++ { ++ reg2 char *par = va_arg(args, char *); ++ out_length+=precision; ++ if (my_b_write(info, par, precision)) ++ goto err; ++ } + else if (*fmt == 'd' || *fmt == 'u') /* Integer parameter */ + { + register int iarg; +@@ -313,6 +353,9 @@ + if (my_b_write(info, "%", 1)) + goto err; + out_length++; ++ if (my_b_write(info, backtrack, fmt-backtrack)) ++ goto err; ++ out_length+= fmt-backtrack; + } + } + return out_length; +diff -Naur -Naur mysql-4.1.14.orig/mysys/my_memmem.c mysql-4.1.14.new/mysys/my_memmem.c +--- mysql-4.1.14.orig/mysys/my_memmem.c 1970-01-01 00:00:00.000000000 +0000 ++++ mysql-4.1.14.new/mysys/my_memmem.c 2006-04-09 15:59:54.000000000 +0000 +@@ -0,0 +1,23 @@ ++#include "my_base.h" ++ ++/* ++ my_memmem, port of a GNU extension. ++ ++ Returns a pointer to the beginning of the substring, needle, or NULL if the ++ substring is not found in haystack. ++*/ ++void *my_memmem(const void *haystack, size_t haystacklen, ++ const void *needle, size_t needlelen) ++{ ++ const void *cursor; ++ const void *end_of_search_beginning = haystack + haystacklen - needlelen; ++ ++ for (cursor = haystack; cursor <= end_of_search_beginning; cursor++) { ++ if (memcmp(needle, cursor, needlelen) == 0) { ++ return((void *) cursor); ++ } ++ } ++ return(NULL); ++} ++ ++ +diff -Naur -Naur mysql-4.1.14.orig/sql/sql_parse.cc mysql-4.1.14.new/sql/sql_parse.cc +--- mysql-4.1.14.orig/sql/sql_parse.cc 2005-08-17 17:06:28.000000000 +0000 ++++ mysql-4.1.14.new/sql/sql_parse.cc 2006-04-09 15:59:54.000000000 +0000 +@@ -1495,7 +1495,7 @@ + if (alloc_query(thd, packet, packet_length)) + break; // fatal error is set + char *packet_end= thd->query + thd->query_length; +- mysql_log.write(thd,command,"%s",thd->query); ++ mysql_log.write(thd,command, "%.*b", thd->query_length, thd->query); + DBUG_PRINT("query",("%-.4096s",thd->query)); + mysql_parse(thd,thd->query, thd->query_length); + +diff -Naur -Naur mysql-4.1.14.orig/strings/my_vsnprintf.c mysql-4.1.14.new/strings/my_vsnprintf.c +--- mysql-4.1.14.orig/strings/my_vsnprintf.c 2005-08-17 17:06:28.000000000 +0000 ++++ mysql-4.1.14.new/strings/my_vsnprintf.c 2006-04-09 15:59:54.000000000 +0000 +@@ -27,6 +27,7 @@ + %#[l]d + %#[l]u + %#[l]x ++ %#.#b Local format; note first # is ignored and second is REQUIRED + %#.#s Note first # is ignored + + RETURN +@@ -38,9 +39,18 @@ + char *start=to, *end=to+n-1; + uint length, width, pre_zero, have_long; + ++ const char *backtrack; ++ /* ++ For the special case when we discover that we shouldn't have been ++ interpreting a percent-format. ++ ++ This is here so we can be forgiving about our special local formats. ++ */ ++ + for (; *fmt ; fmt++) + { +- if (fmt[0] != '%') ++ backtrack = fmt; ++ if (*fmt != '%') + { + if (to == end) /* End of buffer */ + break; +@@ -80,6 +90,12 @@ + to=strnmov(to,par,plen); + continue; + } ++ else if (*fmt == 'b') /* Buffer parameter */ ++ { ++ reg2 char *par = va_arg(ap, char *); ++ to=memmove(to, par, abs(width)); ++ continue; ++ } + else if (*fmt == 'd' || *fmt == 'u'|| *fmt== 'x') /* Integer parameter */ + { + register long larg; diff --git a/200_all_query-logging-bypass-5.0.21.patch b/200_all_query-logging-bypass-5.0.21.patch new file mode 100644 index 0000000..1af6175 --- /dev/null +++ b/200_all_query-logging-bypass-5.0.21.patch @@ -0,0 +1,208 @@ +diff -Nru mysql-5.0.19/sql/sql_lex.cc mysql-5.0.19-logsec/sql/sql_lex.cc +--- mysql-5.0.19/sql/sql_lex.cc 2006-03-04 21:35:19.000000000 +0100 ++++ mysql-5.0.19-logsec/sql/sql_lex.cc 2006-04-07 22:33:16.000000000 +0200 +@@ -958,6 +958,9 @@ + while (lex->ptr != lex->end_of_query && + ((c=yyGet()) != '*' || yyPeek() != '/')) + { ++ if (c == '\0') ++ return(ABORT_SYM); // NULLs illegal even in comments ++ + if (c == '\n') + lex->yylineno++; + } +diff -Naur -Naur mysql-5.0.19.orig/include/my_sys.h mysql-5.0.19.new/include/my_sys.h +--- mysql-5.0.19.orig/include/my_sys.h 2006-03-04 20:35:12.000000000 +0000 ++++ mysql-5.0.19.new/include/my_sys.h 2006-04-09 17:55:53.000000000 +0000 +@@ -599,6 +599,11 @@ + const char *sFile, uint uLine, + myf MyFlag); + ++/* implemented in my_memmem.c */ ++extern void *my_memmem(const void *haystack, size_t haystacklen, ++ const void *needle, size_t needlelen); ++ ++ + #ifdef __WIN__ + extern int my_access(const char *path, int amode); + extern File my_sopen(const char *path, int oflag, int shflag, int pmode); +diff -Naur -Naur mysql-5.0.19.orig/mysys/mf_iocache2.c mysql-5.0.19.new/mysys/mf_iocache2.c +--- mysql-5.0.19.orig/mysys/mf_iocache2.c 2006-03-04 20:34:51.000000000 +0000 ++++ mysql-5.0.19.new/mysys/mf_iocache2.c 2006-04-09 17:55:53.000000000 +0000 +@@ -252,6 +252,10 @@ + uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args) + { + uint out_length=0; ++ uint minimum_width; /* as yet unimplemented */ ++ uint minimum_width_sign; ++ uint precision; /* as yet unimplemented for anything but %b */ ++ const char* backtrack; + + for (; *fmt ; fmt++) + { +@@ -272,17 +276,53 @@ + fmt++; + /* Found one '%' */ + } ++ backtrack= fmt; ++ ++ minimum_width= 0; ++ precision= 0; ++ minimum_width_sign= 1; + /* Skip if max size is used (to be compatible with printf) */ +- while (my_isdigit(&my_charset_latin1, *fmt) || *fmt == '.' || *fmt == '-') ++ while (*fmt == '-') { fmt++; minimum_width_sign= -1; } ++ if (*fmt == '*') { ++ precision= (int) va_arg(args, int); ++ fmt++; ++ } else { ++ while (my_isdigit(&my_charset_latin1, *fmt)) { ++ minimum_width=(minimum_width * 10) + (*fmt - '0'); ++ fmt++; ++ } ++ } ++ minimum_width*= minimum_width_sign; ++ ++ if (*fmt == '.') { + fmt++; ++ if (*fmt == '*') { ++ precision= (int) va_arg(args, int); ++ fmt++; ++ } else { ++ while (my_isdigit(&my_charset_latin1, *fmt)) { ++ precision=(precision * 10) + (*fmt - '0'); ++ fmt++; ++ } ++ } ++ } ++ + if (*fmt == 's') /* String parameter */ + { + reg2 char *par = va_arg(args, char *); + uint length = (uint) strlen(par); ++ /* TODO: implement minimum width and precision */ + out_length+=length; + if (my_b_write(info, par, length)) + goto err; + } ++ else if (*fmt == 'b') /* Sized buffer parameter, only precision makes sense */ ++ { ++ reg2 char *par = va_arg(args, char *); ++ out_length+=precision; ++ if (my_b_write(info, par, precision)) ++ goto err; ++ } + else if (*fmt == 'd' || *fmt == 'u') /* Integer parameter */ + { + register int iarg; +@@ -320,6 +360,9 @@ + if (my_b_write(info, "%", 1)) + goto err; + out_length++; ++ if (my_b_write(info, backtrack, fmt-backtrack)) ++ goto err; ++ out_length+= fmt-backtrack; + } + } + return out_length; +diff -Naur -Naur mysql-5.0.19.orig/mysys/my_memmem.c mysql-5.0.19.new/mysys/my_memmem.c +--- mysql-5.0.19.orig/mysys/my_memmem.c 1970-01-01 00:00:00.000000000 +0000 ++++ mysql-5.0.19.new/mysys/my_memmem.c 2006-04-09 17:56:16.000000000 +0000 +@@ -0,0 +1,21 @@ ++#include "my_base.h" ++ ++/* ++ * my_memmem, port of a GNU extension. ++ * ++ * Returns a pointer to the beginning of the substring, needle, or NULL if the ++ * substring is not found in haystack. ++ * */ ++void *my_memmem(const void *haystack, size_t haystacklen, ++ const void *needle, size_t needlelen) ++{ ++ const void *cursor; ++ const void *end_of_search_beginning = haystack + haystacklen - needlelen; ++ ++ for (cursor = haystack; cursor <= end_of_search_beginning; cursor++) { ++ if (memcmp(needle, cursor, needlelen) == 0) { ++ return((void *) cursor); ++ } ++ } ++ return(NULL); ++} +diff -Naur -Naur mysql-5.0.19.orig/sql/sql_parse.cc mysql-5.0.19.new/sql/sql_parse.cc +--- mysql-5.0.19.orig/sql/sql_parse.cc 2006-03-04 20:34:48.000000000 +0000 ++++ mysql-5.0.19.new/sql/sql_parse.cc 2006-04-09 17:55:53.000000000 +0000 +@@ -1710,7 +1710,7 @@ + if (alloc_query(thd, packet, packet_length)) + break; // fatal error is set + char *packet_end= thd->query + thd->query_length; +- mysql_log.write(thd,command,"%s",thd->query); ++ mysql_log.write(thd,command, "%.*b", thd->query_length, thd->query); + DBUG_PRINT("query",("%-.4096s",thd->query)); + + if (!(specialflag & SPECIAL_NO_PRIOR)) +diff -Naur -Naur mysql-5.0.19.orig/strings/my_vsnprintf.c mysql-5.0.19.new/strings/my_vsnprintf.c +--- mysql-5.0.19.orig/strings/my_vsnprintf.c 2006-03-04 20:34:49.000000000 +0000 ++++ mysql-5.0.19.new/strings/my_vsnprintf.c 2006-04-09 17:55:53.000000000 +0000 +@@ -27,6 +27,7 @@ + %#[l]d + %#[l]u + %#[l]x ++ %#.#b Local format; note first # is ignored and second is REQUIRED + %#.#s Note first # is ignored + + RETURN +@@ -38,9 +39,18 @@ + char *start=to, *end=to+n-1; + uint length, width, pre_zero, have_long; + ++ const char *backtrack; ++ /* ++ For the special case when we discover that we shouldn't have been ++ interpreting a percent-format. ++ ++ This is here so we can be forgiving about our special local formats. ++ */ ++ + for (; *fmt ; fmt++) + { +- if (fmt[0] != '%') ++ backtrack = fmt; ++ if (*fmt != '%') + { + if (to == end) /* End of buffer */ + break; +@@ -95,6 +105,12 @@ + to=strnmov(to,par,plen); + continue; + } ++ else if (*fmt == 'b') /* Buffer parameter */ ++ { ++ reg2 char *par = va_arg(ap, char *); ++ to=memmove(to, par, abs(width)); ++ continue; ++ } + else if (*fmt == 'd' || *fmt == 'u'|| *fmt== 'x') /* Integer parameter */ + { + register long larg; +--- mysql-5.0.19.orig/mysys/Makefile.am 2006-04-17 21:33:44.000000000 +0200 ++++ mysql-5.0.19.new/mysys/Makefile.am 2006-04-17 21:36:16.000000000 +0200 +@@ -55,6 +55,7 @@ + charset.c charset-def.c my_bitmap.c my_bit.c md5.c \ + my_gethostbyname.c rijndael.c my_aes.c sha1.c \ + my_handler.c my_netware.c my_largepage.c \ ++ my_memmem.c \ + my_windac.c my_access.c base64.c + EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \ + thr_mutex.c thr_rwlock.c +--- mysql-5.0.19.orig/mysys/Makefile.in 2006-04-17 21:36:59.000000000 +0200 ++++ mysql-5.0.19.new/mysys/Makefile.in 2006-04-17 21:37:52.000000000 +0200 +@@ -514,6 +514,7 @@ + charset.c charset-def.c my_bitmap.c my_bit.c md5.c \ + my_gethostbyname.c rijndael.c my_aes.c sha1.c \ + my_handler.c my_netware.c my_largepage.c \ ++ my_memmem.c \ + my_windac.c my_access.c base64.c + + EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \ diff --git a/201_all_query-logging-bypass-5.1.7.patch b/201_all_query-logging-bypass-5.1.7.patch new file mode 100644 index 0000000..c706da7 --- /dev/null +++ b/201_all_query-logging-bypass-5.1.7.patch @@ -0,0 +1,214 @@ +diff -Naur mysql-5.1.7-beta.a/include/my_sys.h mysql-5.1.7-beta.b/include/my_sys.h +--- mysql-5.1.7-beta.a/include/my_sys.h 2006-02-27 21:25:08.000000000 +0000 ++++ mysql-5.1.7-beta.b/include/my_sys.h 2006-04-12 16:43:44.000000000 +0000 +@@ -601,6 +601,11 @@ + const char *sFile, uint uLine, + myf MyFlag); + ++/* implemented in my_memmem.c */ ++extern void *my_memmem(const void *haystack, size_t haystacklen, ++ const void *needle, size_t needlelen); ++ ++ + #ifdef __WIN__ + extern int my_access(const char *path, int amode); + extern File my_sopen(const char *path, int oflag, int shflag, int pmode); +diff -Naur mysql-5.1.7-beta.a/mysql-test/t/mysql_client_test.opt mysql-5.1.7-beta.b/mysql-test/t/mysql_client_test.opt +--- mysql-5.1.7-beta.a/mysql-test/t/mysql_client_test.opt 1970-01-01 00:00:00.000000000 +0000 ++++ mysql-5.1.7-beta.b/mysql-test/t/mysql_client_test.opt 2006-04-12 16:43:44.000000000 +0000 +@@ -0,0 +1 @@ ++--log +diff -Naur mysql-5.1.7-beta.a/mysys/Makefile.am mysql-5.1.7-beta.b/mysys/Makefile.am +--- mysql-5.1.7-beta.a/mysys/Makefile.am 2006-02-27 21:25:08.000000000 +0000 ++++ mysql-5.1.7-beta.b/mysys/Makefile.am 2006-04-12 16:43:44.000000000 +0000 +@@ -56,6 +56,7 @@ + charset.c charset-def.c my_bitmap.c my_bit.c md5.c \ + my_gethostbyname.c rijndael.c my_aes.c sha1.c \ + my_handler.c my_netware.c my_largepage.c \ ++ my_memmem.c \ + my_windac.c my_access.c base64.c + EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \ + thr_mutex.c thr_rwlock.c +diff -Naur mysql-5.1.7-beta.a/mysys/Makefile.in mysql-5.1.7-beta.b/mysys/Makefile.in +--- mysql-5.1.7-beta.a/mysys/Makefile.in 2006-02-27 21:26:51.000000000 +0000 ++++ mysql-5.1.7-beta.b/mysys/Makefile.in 2006-04-12 16:43:44.000000000 +0000 +@@ -515,6 +515,7 @@ + charset.c charset-def.c my_bitmap.c my_bit.c md5.c \ + my_gethostbyname.c rijndael.c my_aes.c sha1.c \ + my_handler.c my_netware.c my_largepage.c \ ++ my_memmem.c \ + my_windac.c my_access.c base64.c + + EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \ +diff -Naur mysql-5.1.7-beta.a/mysys/mf_iocache2.c mysql-5.1.7-beta.b/mysys/mf_iocache2.c +--- mysql-5.1.7-beta.a/mysys/mf_iocache2.c 2006-02-27 21:24:53.000000000 +0000 ++++ mysql-5.1.7-beta.b/mysys/mf_iocache2.c 2006-04-12 16:43:44.000000000 +0000 +@@ -252,6 +252,10 @@ + uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args) + { + uint out_length=0; ++ uint minimum_width; /* as yet unimplemented */ ++ uint minimum_width_sign; ++ uint precision; /* as yet unimplemented for anything but %b */ ++ const char* backtrack; + + for (; *fmt ; fmt++) + { +@@ -272,17 +276,53 @@ + fmt++; + /* Found one '%' */ + } ++ backtrack= fmt; ++ ++ minimum_width= 0; ++ precision= 0; ++ minimum_width_sign= 1; + /* Skip if max size is used (to be compatible with printf) */ +- while (my_isdigit(&my_charset_latin1, *fmt) || *fmt == '.' || *fmt == '-') ++ while (*fmt == '-') { fmt++; minimum_width_sign= -1; } ++ if (*fmt == '*') { ++ precision= (int) va_arg(args, int); ++ fmt++; ++ } else { ++ while (my_isdigit(&my_charset_latin1, *fmt)) { ++ minimum_width=(minimum_width * 10) + (*fmt - '0'); ++ fmt++; ++ } ++ } ++ minimum_width*= minimum_width_sign; ++ ++ if (*fmt == '.') { + fmt++; ++ if (*fmt == '*') { ++ precision= (int) va_arg(args, int); ++ fmt++; ++ } else { ++ while (my_isdigit(&my_charset_latin1, *fmt)) { ++ precision=(precision * 10) + (*fmt - '0'); ++ fmt++; ++ } ++ } ++ } ++ + if (*fmt == 's') /* String parameter */ + { + reg2 char *par = va_arg(args, char *); + uint length = (uint) strlen(par); ++ /* TODO: implement minimum width and precision */ + out_length+=length; + if (my_b_write(info, par, length)) + goto err; + } ++ else if (*fmt == 'b') /* Sized buffer parameter, only precision makes sense */ ++ { ++ reg2 char *par = va_arg(args, char *); ++ out_length+=precision; ++ if (my_b_write(info, par, precision)) ++ goto err; ++ } + else if (*fmt == 'd' || *fmt == 'u') /* Integer parameter */ + { + register int iarg; +@@ -320,6 +360,9 @@ + if (my_b_write(info, "%", 1)) + goto err; + out_length++; ++ if (my_b_write(info, backtrack, fmt-backtrack)) ++ goto err; ++ out_length+= fmt-backtrack; + } + } + return out_length; +diff -Naur mysql-5.1.7-beta.a/mysys/my_memmem.c mysql-5.1.7-beta.b/mysys/my_memmem.c +--- mysql-5.1.7-beta.a/mysys/my_memmem.c 1970-01-01 00:00:00.000000000 +0000 ++++ mysql-5.1.7-beta.b/mysys/my_memmem.c 2006-04-12 16:43:44.000000000 +0000 +@@ -0,0 +1,21 @@ ++#include "my_base.h" ++ ++/* ++ * my_memmem, port of a GNU extension. ++ * ++ * Returns a pointer to the beginning of the substring, needle, or NULL if the ++ * substring is not found in haystack. ++ * */ ++void *my_memmem(const void *haystack, size_t haystacklen, ++ const void *needle, size_t needlelen) ++{ ++ const void *cursor; ++ const void *end_of_search_beginning = haystack + haystacklen - needlelen; ++ ++ for (cursor = haystack; cursor <= end_of_search_beginning; cursor++) { ++ if (memcmp(needle, cursor, needlelen) == 0) { ++ return((void *) cursor); ++ } ++ } ++ return(NULL); ++} +diff -Naur mysql-5.1.7-beta.a/strings/my_vsnprintf.c mysql-5.1.7-beta.b/strings/my_vsnprintf.c +--- mysql-5.1.7-beta.a/strings/my_vsnprintf.c 2006-02-27 21:24:52.000000000 +0000 ++++ mysql-5.1.7-beta.b/strings/my_vsnprintf.c 2006-04-12 16:43:44.000000000 +0000 +@@ -27,6 +27,7 @@ + %#[l]d + %#[l]u + %#[l]x ++ %#.#b Local format; note first # is ignored and second is REQUIRED + %#.#s Note first # is ignored + + RETURN +@@ -38,9 +39,18 @@ + char *start=to, *end=to+n-1; + uint length, width, pre_zero, have_long; + ++ const char *backtrack; ++ /* ++ For the special case when we discover that we shouldn't have been ++ interpreting a percent-format. ++ ++ This is here so we can be forgiving about our special local formats. ++ */ ++ + for (; *fmt ; fmt++) + { +- if (fmt[0] != '%') ++ backtrack = fmt; ++ if (*fmt != '%') + { + if (to == end) /* End of buffer */ + break; +@@ -95,6 +105,12 @@ + to=strnmov(to,par,plen); + continue; + } ++ else if (*fmt == 'b') /* Buffer parameter */ ++ { ++ reg2 char *par = va_arg(ap, char *); ++ to=memmove(to, par, abs(width)); ++ continue; ++ } + else if (*fmt == 'd' || *fmt == 'u'|| *fmt== 'x') /* Integer parameter */ + { + register long larg; +diff -Naur mysql-5.1.7-beta.a/tests/Makefile.am mysql-5.1.7-beta.b/tests/Makefile.am +--- mysql-5.1.7-beta.a/tests/Makefile.am 2006-02-27 21:24:57.000000000 +0000 ++++ mysql-5.1.7-beta.b/tests/Makefile.am 2006-04-12 16:43:44.000000000 +0000 +@@ -42,7 +42,7 @@ + LIBS = @CLIENT_LIBS@ + LDADD = @CLIENT_EXTRA_LDFLAGS@ \ + $(top_builddir)/libmysql/libmysqlclient.la +-mysql_client_test_LDADD= $(LDADD) $(CXXLDFLAGS) ++mysql_client_test_LDADD= $(LDADD) $(CXXLDFLAGS) -lmysys -L../mysys + mysql_client_test_SOURCES= mysql_client_test.c $(yassl_dummy_link_fix) + insert_test_SOURCES= insert_test.c $(yassl_dummy_link_fix) + select_test_SOURCES= select_test.c $(yassl_dummy_link_fix) +diff -Naur mysql-5.1.7-beta.a/tests/Makefile.in mysql-5.1.7-beta.b/tests/Makefile.in +--- mysql-5.1.7-beta.a/tests/Makefile.in 2006-02-27 21:27:19.000000000 +0000 ++++ mysql-5.1.7-beta.b/tests/Makefile.in 2006-04-12 16:43:44.000000000 +0000 +@@ -420,7 +420,7 @@ + LDADD = @CLIENT_EXTRA_LDFLAGS@ \ + $(top_builddir)/libmysql/libmysqlclient.la + +-mysql_client_test_LDADD = $(LDADD) $(CXXLDFLAGS) ++mysql_client_test_LDADD = $(LDADD) $(CXXLDFLAGS) -lmysys -L../mysys + mysql_client_test_SOURCES = mysql_client_test.c $(yassl_dummy_link_fix) + insert_test_SOURCES = insert_test.c $(yassl_dummy_link_fix) + select_test_SOURCES = select_test.c $(yassl_dummy_link_fix) diff --git a/mysql-4.0.18-mysqld-safe-sh.diff b/400_all_mysqld-safe-sh-4.0.27.patch index 18d4f1c..1933254 100644 --- a/mysql-4.0.18-mysqld-safe-sh.diff +++ b/400_all_mysqld-safe-sh-4.0.27.patch @@ -1,4 +1,4 @@ ---- mysql-4.0.18/scripts/mysqld_safe.sh.orig 2004-02-10 10:15:48.000000000 -0800 +--- mysql-4.0.18/scripts/mysqld_safe.sh 2004-02-10 10:15:48.000000000 -0800 +++ mysql-4.0.18/scripts/mysqld_safe.sh 2004-03-04 13:45:27.000000000 -0800 @@ -89,42 +89,14 @@ done diff --git a/mysql-4.0.23-install-db-sh.diff b/401_all_install-db-sh-4.0.27.patch index fe3d8d3..0dd6b0d 100644 --- a/mysql-4.0.23-install-db-sh.diff +++ b/401_all_install-db-sh-4.0.27.patch @@ -1,4 +1,4 @@ ---- mysql-4.0.23/scripts/mysql_install_db.sh.orig 2004-12-23 02:28:09.755109232 -0800 +--- mysql-4.0.23/scripts/mysql_install_db.sh 2004-12-23 02:28:09.755109232 -0800 +++ mysql-4.0.23/scripts/mysql_install_db.sh 2004-12-23 02:31:32.204332272 -0800 @@ -368,10 +368,13 @@ echo diff --git a/700_all_mysqldump-missing-cfgfile-fix-4.1.21.patch b/700_all_mysqldump-missing-cfgfile-fix-4.1.21.patch new file mode 100644 index 0000000..e9d8ffa --- /dev/null +++ b/700_all_mysqldump-missing-cfgfile-fix-4.1.21.patch @@ -0,0 +1,5 @@ +--- mysql-test/std_data/bug15328.cnf 1970-01-01 01:00:00.000000000 +0100 ++++ mysql-test/std_data/bug15328.cnf 2006-08-02 02:22:46.000000000 +0200 +@@ -0,0 +1,2 @@ ++[mysqldump] ++fields-optionally-enclosed-by=" diff --git a/701_all_rpl000015-portsobst-fix-4.1.21.patch b/701_all_rpl000015-portsobst-fix-4.1.21.patch new file mode 100644 index 0000000..d3a88b6 --- /dev/null +++ b/701_all_rpl000015-portsobst-fix-4.1.21.patch @@ -0,0 +1,11 @@ +--- mysql-old/mysql-test/t/rpl000015.test 2006-04-18 23:11:26.000000000 +0200 ++++ mysql-new/mysql-test/t/rpl000015.test 2006-04-18 23:11:44.000000000 +0200 +@@ -12,7 +12,7 @@ + + change master to master_host='127.0.0.1'; + # The following needs to be cleaned up when change master is fixed +---replace_result $MASTER_MYPORT MASTER_PORT $MYSQL_TCP_PORT MASTER_PORT ++--replace_result $MASTER_MYPORT MASTER_PORT $MYSQL_TCP_PORT MASTER_PORT 3306 MASTER_PORT + --replace_column 1 # 33 # + show slave status; + --replace_result $MASTER_MYPORT MASTER_PORT diff --git a/701_all_rpl000015-portsobst-fix-4.1.23.patch b/701_all_rpl000015-portsobst-fix-4.1.23.patch new file mode 100644 index 0000000..38321ab --- /dev/null +++ b/701_all_rpl000015-portsobst-fix-4.1.23.patch @@ -0,0 +1,11 @@ +--- mysql/mysql-test/t/rpl000015.test 2007-01-01 20:44:14.000000000 +0100 ++++ mysql.new/mysql-test/t/rpl000015.test 2007-01-02 10:58:38.000000000 +0100 +@@ -12,7 +12,7 @@ + + change master to master_host='127.0.0.1'; + # The following needs to be cleaned up when change master is fixed +---replace_result $MASTER_MYPORT MASTER_PORT $MYSQL_TCP_PORT MASTER_PORT ++--replace_result $MASTER_MYPORT MASTER_PORT $MYSQL_TCP_PORT MASTER_PORT 3306 MASTER_PORT + --replace_column 1 # 8 # 9 # 23 # 33 # + show slave status; + --replace_result $MASTER_MYPORT MASTER_PORT diff --git a/701_all_rpl000015-portsobst-fix-5.0.26.patch b/701_all_rpl000015-portsobst-fix-5.0.26.patch new file mode 100644 index 0000000..fc19897 --- /dev/null +++ b/701_all_rpl000015-portsobst-fix-5.0.26.patch @@ -0,0 +1,11 @@ +--- mysql-old/mysql-test/t/rpl000015.test 2006-04-18 23:11:26.000000000 +0200 ++++ mysql-new/mysql-test/t/rpl000015.test 2006-04-18 23:11:44.000000000 +0200 +@@ -12,7 +12,7 @@ + + change master to master_host='127.0.0.1'; + # The following needs to be cleaned up when change master is fixed +---replace_result $MYSQL_TCP_PORT MASTER_PORT ++--replace_result $MYSQL_TCP_PORT MASTER_PORT 3306 MASTER_PORT + --replace_column 1 # 8 # 9 # 23 # 33 # + show slave status; + --replace_result $MASTER_MYPORT MASTER_PORT diff --git a/701_all_test-myisam-geometry.patch b/701_all_test-myisam-geometry.patch deleted file mode 100644 index 536c92a..0000000 --- a/701_all_test-myisam-geometry.patch +++ /dev/null @@ -1,26 +0,0 @@ -###MY_VER_RANGE [4.1.3_alpha,4.1.14_alpha20050808) - -# MySQL Bugs: #11083: myisam.test fail w/ --without-geometry - ---- mysql.orig/mysql-test/t/myisam.test 2005-05-26 16:55:48.000000000 +0200 -+++ mysql.fix/mysql-test/t/myisam.test 2005-06-03 21:26:28.000000000 +0200 -@@ -479,7 +479,7 @@ - # - # Test RTREE index - # ----error 1235 -+--error 1235,1289 - CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM; - # INSERT INTO t1 VALUES (1,1),(1,1); - # DELETE FROM rt WHERE a<1; ---- mysql.orig/mysql-test/r/myisam.result 2005-05-26 16:55:48.000000000 +0200 -+++ mysql.fix/mysql-test/r/myisam.result 2005-06-03 21:27:20.000000000 +0200 -@@ -506,7 +506,7 @@ - 1 SIMPLE t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct - drop table t1,t2; - CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM; --ERROR 42000: This version of MySQL doesn't yet support 'RTREE INDEX' -+Got one of the listed errors - create table t1 (a int, b varchar(200), c text not null) checksum=1; - create table t2 (a int, b varchar(200), c text not null) checksum=0; - insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, ""); diff --git a/702_all_trigger-rename-fail-as-root-5.0.26.patch b/702_all_trigger-rename-fail-as-root-5.0.26.patch new file mode 100644 index 0000000..10fce8b --- /dev/null +++ b/702_all_trigger-rename-fail-as-root-5.0.26.patch @@ -0,0 +1,35 @@ +diff -ur mysql-5.0.orig/mysql-test/r/trigger.result mysql-5.0/mysql-test/r/trigger.result +--- mysql-5.0.orig/mysql-test/r/trigger.result Mon Oct 9 15:22:07 2006 ++++ mysql-5.0/mysql-test/r/trigger.result Tue Oct 10 11:59:22 2006 +@@ -969,7 +969,7 @@ + test t1_bi test t1 set @a:=new.id + test t1_ai test t1 set @b:=new.id + rename table t1 to t2; +-ERROR HY000: Can't create/write to file './test/t1_ai.TRN~' (Errcode: 13) ++ERROR HY000: Can't create/write to file './test/t1_ai.TRN~' (Errcode: 21) + insert into t1 values (102); + select @a, @b; + @a @b +diff -ur mysql-5.0.orig/mysql-test/t/trigger.test mysql-5.0/mysql-test/t/trigger.test +--- mysql-5.0.orig/mysql-test/t/trigger.test Mon Oct 9 15:22:07 2006 ++++ mysql-5.0/mysql-test/t/trigger.test Tue Oct 10 11:58:55 2006 +@@ -1138,8 +1138,7 @@ + event_object_table, action_statement from information_schema.triggers + where event_object_schema = 'test'; + # Trick which makes update of second .TRN file impossible +-system echo dummy >$MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~; +-system chmod 000 $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~; ++system mkdir $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~; + --error 1 + rename table t1 to t2; + # 't1' should be still there and triggers should work correctly +@@ -1148,8 +1147,7 @@ + select trigger_schema, trigger_name, event_object_schema, + event_object_table, action_statement from information_schema.triggers + where event_object_schema = 'test'; +-system chmod 600 $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~; +-system rm $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~; ++system rmdir $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~; + # Let us check that updates to .TRN files were rolled back too + drop trigger t1_bi; + drop trigger t1_ai; diff --git a/703_all_test-rpl_rotate_logs-5.0.21.patch b/703_all_test-rpl_rotate_logs-5.0.21.patch new file mode 100644 index 0000000..4fa1458 --- /dev/null +++ b/703_all_test-rpl_rotate_logs-5.0.21.patch @@ -0,0 +1,11 @@ +--- mysql.orig/mysql-test/t/rpl_rotate_logs.test 2006-03-04 21:45:38.000000000 +0100 ++++ mysql.fix/mysql-test/t/rpl_rotate_logs.test 2006-04-17 21:33:57.000000000 +0200 +@@ -24,7 +24,7 @@ + # START SLAVE will fail because it can't read the file (mode 000) + # (system error 13) + --replace_result $MYSQL_TEST_DIR TESTDIR +---error 1105,1105,29 ++--error 1201,1105,29 + start slave; + system chmod 600 $MYSQLTEST_VARDIR/slave-data/master.info; + # It will fail again because the file is empty so the slave cannot get valuable diff --git a/703_all_test-rpl_rotate_logs.patch b/703_all_test-rpl_rotate_logs.patch deleted file mode 100644 index 9fd3079..0000000 --- a/703_all_test-rpl_rotate_logs.patch +++ /dev/null @@ -1,18 +0,0 @@ -###MY_VER_RANGE [5.0.6_beta,5.1.0_alpha) [5.1.0_alpha,) - -# MySQL Bugs: #9763: Test rpl_rotate_logs fails in default mode and with --force -# Error: 1201 SQLSTATE: HY000 (ER_MASTER_INFO) -# Message: Could not initialize master info structure; more error messages can be found in the MySQL -# error log - ---- mysql.orig/mysql-test/t/rpl_rotate_logs.test 2005-05-26 16:55:48.000000000 +0200 -+++ mysql.fix/mysql-test/t/rpl_rotate_logs.test 2005-06-03 20:21:51.000000000 +0200 -@@ -24,7 +24,7 @@ - # START SLAVE will fail because it can't read the file (mode 000) - # (system error 13) - --replace_result $MYSQL_TEST_DIR TESTDIR ----error 1105,1105,29 -+--error 1201,1105,29 - start slave; - system chmod 600 var/slave-data/master.info; - # It will fail again because the file is empty so the slave cannot get valuable diff --git a/704_all_disable_mybug_9735_test.patch b/704_all_disable_mybug_9735_test.patch new file mode 100644 index 0000000..b195e16 --- /dev/null +++ b/704_all_disable_mybug_9735_test.patch @@ -0,0 +1,30 @@ +--- mysql-5.0.30/tests/mysql_client_test.c 2006-11-23 21:13:06.000000000 +0100 ++++ mysql/tests/mysql_client_test.c 2006-12-28 18:57:40.000000000 +0100 +@@ -737,8 +737,8 @@ + fprintf(stdout, "\n org_table:`%s`\t(expected: `%s`)", + field->org_table, org_table); + fprintf(stdout, "\n database :`%s`\t(expected: `%s`)", field->db, db); +- fprintf(stdout, "\n length :`%lu`\t(expected: `%lu`)", +- field->length, length * cs->mbmaxlen); ++ fprintf(stdout, "\n length :`%lu`\t(expected: `%lu * %lu = %lu`)", ++ field->length, length, cs->mbmaxlen, length * cs->mbmaxlen); + fprintf(stdout, "\n maxlength:`%ld`", field->max_length); + fprintf(stdout, "\n charsetnr:`%d`", field->charsetnr); + fprintf(stdout, "\n default :`%s`\t(expected: `%s`)", +@@ -13798,7 +13798,7 @@ + } + + /* Test correct max length for MEDIUMTEXT and LONGTEXT columns */ +- ++/* TODO: re-enable me */ + static void test_bug9735() + { + MYSQL_RES *res; +@@ -15554,7 +15554,6 @@ + { "test_bug11172", test_bug11172 }, + { "test_bug11656", test_bug11656 }, + { "test_bug10214", test_bug10214 }, +- { "test_bug9735", test_bug9735 }, + { "test_bug11183", test_bug11183 }, + { "test_bug11037", test_bug11037 }, + { "test_bug10760", test_bug10760 }, diff --git a/705_all_view_geometry.patch b/705_all_view_geometry.patch deleted file mode 100644 index 53c2367..0000000 --- a/705_all_view_geometry.patch +++ /dev/null @@ -1,71 +0,0 @@ -###MY_VER_RANGE [5.0.11_beta,5.0.12_beta] [5.1,) -diff -Naur mysql.orig/mysql-test/r/view.result mysql.new/mysql-test/r/view.result ---- mysql.orig/mysql-test/r/view.result 2005-08-13 04:20:59.000000000 +0200 -+++ mysql.new/mysql-test/r/view.result 2005-08-13 04:29:43.000000000 +0200 -@@ -2021,17 +2021,6 @@ - DROP PROCEDURE p1; - DROP VIEW v1; - DROP TABLE t1; --create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime); --create view v1 as select * from t1; --desc v1; --Field Type Null Key Default Extra --f1 tinyint(1) YES NULL --f2 char(1) YES NULL --f3 varchar(1) YES NULL --f4 geometry YES NULL --f5 datetime YES NULL --drop view v1; --drop table t1; - create table t1(f1 datetime); - insert into t1 values('2005.01.01 12:0:0'); - create view v1 as select f1, subtime(f1, '1:1:1') as sb from t1; -diff -Naur mysql.orig/mysql-test/t/gis-view.test mysql.new/mysql-test/t/gis-view.test ---- mysql.orig/mysql-test/t/gis-view.test 1970-01-01 01:00:00.000000000 +0100 -+++ mysql.new/mysql-test/t/gis-view.test 2005-08-13 04:27:30.000000000 +0200 -@@ -0,0 +1,11 @@ -+-- source include/have_geometry.inc -+ -+# -+# Bug #11335 View redefines column types -+# -+create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime); -+create view v1 as select * from t1; -+desc v1; -+drop view v1; -+drop table t1; -+ -diff -Naur mysql.orig/mysql-test/t/view.test mysql.new/mysql-test/t/view.test ---- mysql.orig/mysql-test/t/view.test 2005-08-13 04:20:44.000000000 +0200 -+++ mysql.new/mysql-test/t/view.test 2005-08-13 04:28:53.000000000 +0200 -@@ -1856,15 +1856,6 @@ - DROP TABLE t1; - - # --# Bug #11335 View redefines column types --# --create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime); --create view v1 as select * from t1; --desc v1; --drop view v1; --drop table t1; -- --# - # Bug #11760 Typo in Item_func_add_time::print() results in NULLs returned - # subtime() in view - create table t1(f1 datetime); -diff -Naur mysql.orig/mysql-test/r/gis-view.result mysql.new/mysql-test/r/gis-view.result ---- mysql.orig/mysql-test/r/gis-view.result 1970-01-01 01:00:00.000000000 +0100 -+++ mysql.new/mysql-test/r/gis-view.result 2005-08-15 19:11:19.000000000 +0200 -@@ -0,0 +1,11 @@ -+create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime); -+create view v1 as select * from t1; -+desc v1; -+Field Type Null Key Default Extra -+f1 tinyint(1) YES NULL -+f2 char(1) YES NULL -+f3 varchar(1) YES NULL -+f4 geometry YES NULL -+f5 datetime YES NULL -+drop view v1; -+drop table t1; diff --git a/705_all_we-are-in-2007-now.patch b/705_all_we-are-in-2007-now.patch new file mode 100644 index 0000000..129ef12 --- /dev/null +++ b/705_all_we-are-in-2007-now.patch @@ -0,0 +1,19 @@ +--- mysql.old/mysql-test/r/view.result 2007-01-02 23:27:19.000000000 +0100 ++++ mysql/mysql-test/r/view.result 2007-01-02 23:27:58.000000000 +0100 +@@ -2686,12 +2686,12 @@ + v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (year(now()) - year(`t1`.`DOB`)) AS `Age` from `t1` having (`Age` < 75) + SELECT (year(now())-year(DOB)) AS Age FROM t1 HAVING Age < 75; + Age +-42 +-38 ++43 ++39 + SELECT * FROM v1; + Age +-42 +-38 ++43 ++39 + DROP VIEW v1; + DROP TABLE t1; + CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a char(6) DEFAULT 'xxx'); diff --git a/mysql-3.23-my-print-defaults.diff b/mysql-3.23-my-print-defaults.diff deleted file mode 100644 index dbdf14d..0000000 --- a/mysql-3.23-my-print-defaults.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- orig/mysys/default.c Sun May 13 16:40:06 2001 -+++ mysql-patched/mysys/default.c Sun May 13 16:40:17 2001 -@@ -48,7 +48,7 @@ - #ifdef __WIN__ - "C:/", - #else --"/etc/", -+"/etc/mysql/", - #endif - #ifdef DATADIR - DATADIR, diff --git a/mysql-3.23-nisam.h.diff b/mysql-3.23-nisam.h.diff deleted file mode 100644 index 8b44504..0000000 --- a/mysql-3.23-nisam.h.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- include/nisam.h~ Tue Mar 27 10:11:02 2001 -+++ include/nisam.h Fri Apr 13 16:26:02 2001 -@@ -31,7 +31,7 @@ - - #define N_MAXKEY 16 /* Max allowed keys */ - #define N_MAXKEY_SEG 16 /* Max segments for key */ --#define N_MAX_KEY_LENGTH 256 /* May be increased up to 500 */ -+#define N_MAX_KEY_LENGTH 500 /* May be increased up to 500 */ - #define N_MAX_KEY_BUFF (N_MAX_KEY_LENGTH+N_MAXKEY_SEG+sizeof(double)-1) - #define N_MAX_POSSIBLE_KEY_BUFF 500+9 - diff --git a/mysql-3.23-safe-mysqld-sh.diff b/mysql-3.23-safe-mysqld-sh.diff deleted file mode 100644 index d47ef58..0000000 --- a/mysql-3.23-safe-mysqld-sh.diff +++ /dev/null @@ -1,50 +0,0 @@ -diff -ur mysql-3.23.47.orig/scripts/safe_mysqld.sh mysql-3.23.47/scripts/safe_mysqld.sh ---- mysql-3.23.47.orig/scripts/safe_mysqld.sh Thu Dec 27 07:23:28 2001 -+++ mysql-3.23.47/scripts/safe_mysqld.sh Fri Jan 4 05:08:08 2002 -@@ -68,42 +68,14 @@ - done - } - --MY_PWD=`pwd` --# Check if we are starting this relative (for the binary release) --if test -d $MY_PWD/data/mysql -a -f ./share/mysql/english/errmsg.sys -a \ -- -x ./bin/mysqld --then -- MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are -- ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is -- DATADIR=$MY_BASEDIR_VERSION/data -- if test -z "$defaults" -- then -- defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf" -- fi --# Check if this is a 'moved install directory' --elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ -- -x ./libexec/mysqld --then -- MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are -- ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is -- DATADIR=$MY_BASEDIR_VERSION/var --else -- MY_BASEDIR_VERSION=@prefix@ -- DATADIR=@localstatedir@ -- ledir=@libexecdir@ --fi -+MY_BASEDIR_VERSION=@prefix@ -+DATADIR=@localstatedir@ -+ledir=@libexecdir@ - - MYSQL_UNIX_PORT=${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@} - MYSQL_TCP_PORT=${MYSQL_TCP_PORT:-@MYSQL_TCP_PORT@} - user=@MYSQLD_USER@ -- --# Use the mysqld-max binary by default if the user doesn't specify a binary --if test -x $ledir/mysqld-max --then -- MYSQLD=mysqld-max --else -- MYSQLD=mysqld --fi -+MYSQLD=mysqld - - # these rely on $DATADIR by default, so we'll set them later on - pid_file= diff --git a/mysql-3.23.52-install-db-sh.diff b/mysql-3.23.52-install-db-sh.diff deleted file mode 100644 index 6cbbaf1..0000000 --- a/mysql-3.23.52-install-db-sh.diff +++ /dev/null @@ -1,35 +0,0 @@ -diff -uNr mysql-3.23.52.orig/scripts/mysql_install_db.sh mysql-3.23.52/scripts/mysql_install_db.sh ---- mysql-3.23.52.orig/scripts/mysql_install_db.sh Tue Aug 13 22:08:16 2002 -+++ mysql-3.23.52/scripts/mysql_install_db.sh Sun Aug 25 04:11:09 2002 -@@ -309,14 +309,10 @@ - END_OF_DATA - then - echo "" -- if test "$IN_RPM" -eq 0 -- then -- echo "To start mysqld at boot time you have to copy support-files/mysql.server" -- echo "to the right place for your system" -- echo - fi - echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" - echo "This is done with:" -+ echo "/etc/init.d/mysql start (you have to start the server first!)" - echo "$bindir/mysqladmin -u root password 'new-password'" - echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" - echo "See the manual for more instructions." -@@ -330,15 +326,6 @@ - echo "able to use the new GRANT command!" - fi - echo -- if test "$IN_RPM" -eq 0 -- then -- echo "You can start the MySQL daemon with:" -- echo "cd @prefix@ ; $bindir/safe_mysqld &" -- echo -- echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:" -- echo "cd sql-bench ; run-all-tests" -- echo -- fi - echo "Please report any problems with the @scriptdir@/mysqlbug script!" - echo - echo "The latest information about MySQL is available on the web at" diff --git a/mysql-4.0-mysqlhotcopy-security.patch b/mysql-4.0-mysqlhotcopy-security.patch deleted file mode 100644 index f2f2e74..0000000 --- a/mysql-4.0-mysqlhotcopy-security.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- 1.42/scripts/mysqlhotcopy.sh Tue May 25 21:00:12 2004 -+++ 1.43/scripts/mysqlhotcopy.sh Fri Jul 9 14:30:48 2004 -@@ -8,5 +8,7 @@ - use DBI; - use Sys::Hostname; -+use File::Copy; -+use File::Temp; - - =head1 NAME - -@@ -626,7 +628,6 @@ - sub copy_index - { - my ($method, $files, $source, $target) = @_; -- my $tmpfile="$opt_tmpdir/mysqlhotcopy$$"; - - print "Copying indices for ".@$files." files...\n" unless $opt{quiet}; - foreach my $file (@$files) -@@ -652,21 +653,21 @@ - } - close OUTPUT || die "Error on close of $to: $!\n"; - } -- elsif ($opt{method} eq 'scp') -+ elsif ($opt{method} =~ /^scp\b/) - { -- my $tmp=$tmpfile; -- open(OUTPUT,">$tmp") || die "Can\'t create file $tmp: $!\n"; -- if (syswrite(OUTPUT,$buff) != length($buff)) -+ my ($fh, $tmp)=tempfile('mysqlhotcopy-XXXXXX', DIR => $opt_tmpdir); -+ die "Can\'t create/open file in $opt_tmpdir\n"; -+ if (syswrite($fh,$buff) != length($buff)) - { - die "Error when writing data to $tmp: $!\n"; - } -- close OUTPUT || die "Error on close of $tmp: $!\n"; -- safe_system("scp $tmp $to"); -+ close $fh || die "Error on close of $tmp: $!\n"; -+ safe_system("$opt{method} $tmp $to"); -+ unlink $tmp; - } - else - { - die "Can't use unsupported method '$opt{method}'\n"; - } - } -- unlink "$tmpfile" if ($opt{method} eq 'scp'); - } - diff --git a/mysql-4.0.14-r1-tcpd-vars-fix.diff b/mysql-4.0.14-r1-tcpd-vars-fix.diff deleted file mode 100644 index 18fd9c8..0000000 --- a/mysql-4.0.14-r1-tcpd-vars-fix.diff +++ /dev/null @@ -1,14 +0,0 @@ -diff -Naur orig/sql/mysqld.cc new/sql/mysqld.cc ---- orig/sql/mysqld.cc 2003-06-10 22:22:10.000000000 +0200 -+++ new/sql/mysqld.cc 2003-06-10 22:21:38.000000000 +0200 -@@ -101,8 +101,8 @@ - #ifdef NEED_SYS_SYSLOG_H - #include <sys/syslog.h> - #endif /* NEED_SYS_SYSLOG_H */ --int allow_severity = LOG_INFO; --int deny_severity = LOG_WARNING; -+//int allow_severity = LOG_INFO; -+//int deny_severity = LOG_WARNING; - - #ifdef __STDC__ - #define my_fromhost(A) fromhost(A) diff --git a/mysql-4.0.15.rc6 b/mysql-4.0.15.rc6 deleted file mode 100644 index be157f2..0000000 --- a/mysql-4.0.15.rc6 +++ /dev/null @@ -1,43 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/files/mysql-4.0.15.rc6,v 1.5 2004/09/07 04:03:24 robbat2 Exp $ - -depend() { - use dns net -} - -checkconfig() { - if [ ! -f /etc/mysql/my.cnf ]; then - eerror "No /etc/mysql/my.cnf file exists!" - fi - - #dir=`my_print_defaults mysqld | grep -- '^--datadir' | tail -n1 | sed -e 's|^--datadir=||'` - dir=`my_print_defaults mysqld | sed -ne '/datadir/s|^--datadir=||p' | tail -n1` - - if [ -z "$dir" ]; then - eerror "Your mysql doesn't have any datadir setting, default or specific" - eerror "Please check your my.cnf" - return 1 - fi - - if [ ! -d "$dir/mysql" ]; then - eerror "You don't appear to have the mysql database installed yet." - eerror "Please run /usr/bin/mysql_install_db to have this done..." - return 1 - fi -} - -start() { - checkconfig || return 1 - ebegin "Starting mysqld" - start-stop-daemon --start --quiet --exec /usr/bin/mysqld_safe \ - --background -- >/dev/null 2>&1 - eend $? -} - -stop () { - ebegin "Stopping mysqld" - start-stop-daemon --stop --retry 5 --quiet --pidfile=/var/run/mysqld/mysqld.pid - eend $? -} diff --git a/mysql-4.0.18-gentoo-nptl.diff b/mysql-4.0.18-gentoo-nptl.diff deleted file mode 100644 index d5815b7..0000000 --- a/mysql-4.0.18-gentoo-nptl.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- mysql-4.0.18/configure.in.orig 2004-03-04 13:53:36.000000000 -0800 -+++ mysql-4.0.18/configure.in 2004-03-04 13:53:37.000000000 -0800 -@@ -1191,7 +1191,10 @@ - then - # Look for LinuxThreads. - AC_MSG_CHECKING("LinuxThreads") -- res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` -+ # res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` -+ # All gentoo systems support this stuff, and this is an improper detection -+ # for LinuxThreads anyhow, always set the result to 1 -+ res=1 - if test "$res" -gt 0 - then - AC_MSG_RESULT("Found") diff --git a/mysql-4.0.21-install-db-sh.diff b/mysql-4.0.21-install-db-sh.diff deleted file mode 100644 index 8940e99..0000000 --- a/mysql-4.0.21-install-db-sh.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- mysql-4.0.21/scripts/mysql_install_db.sh.orig -+++ mysql-4.0.21/scripts/mysql_install_db.sh -@@ -371,6 +371,7 @@ - echo "To do so, start the server, then issue the following commands:" -- echo "$bindir/mysqladmin -u root password 'new-password'" -+ echo "/etc/init.d/mysql start (you have to start the server first!)" - echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" -+ echo "$bindir/mysqladmin -u root password 'new-password'" - echo "See the manual for more instructions." - # - # Print message about upgrading unless we have created a new db table. diff --git a/mysql-4.0.24-manual.texi.patch b/mysql-4.0.24-manual.texi.patch deleted file mode 100644 index 2789efb..0000000 --- a/mysql-4.0.24-manual.texi.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- mysql-4.0.24.bbb/Docs/manual.texi 2005-03-11 22:49:27.000000000 +0100 -+++ mysql-4.0.24/Docs/manual.texi 2005-03-11 22:57:56.000000000 +0100 -@@ -91349,7 +91349,7 @@ - - @c NOTE: To regenerate this list, run the make-errmsg-table.pl script. - --@include errmsg-table.texi -+failed to include errmsg-table.texi - - Client error information comes from the following files: - -@@ -91370,7 +91370,7 @@ - - @c NOTE: To regenerate this list, run the make-cl-errmsg-table.pl script. - --@include cl-errmsg-table.texi -+failed to include cl-errmsg-table.texi - - - @node Extending MySQL, Problems, Error-handling, Top diff --git a/mysql-4.0.24-r1.rc6 b/mysql-4.0.24-r1.rc6 deleted file mode 100644 index 4873370..0000000 --- a/mysql-4.0.24-r1.rc6 +++ /dev/null @@ -1,59 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/files/mysql-4.0.24-r1.rc6,v 1.2 2005/03/13 20:10:08 robbat2 Exp $ - -depend() { - use dns net -} - - -getconfig() { - MY_CNF=${MY_CNF=/etc/mysql/my.cnf} - if [ ! -f ${MY_CNF} ]; then - eerror "No ${MY_CNF} file exists! Using automatic defaults!" - fi - - #dir=`my_print_defaults mysqld | grep -- '^--datadir' | tail -n1 | sed -e 's|^--datadir=||'` - #dir=`my_print_defaults mysqld | sed -ne '/datadir/s|^--datadir=||p' | tail -n1` - local mysqld_cnf="`my_print_defaults --config-file=${MY_CNF} mysqld`" - datadir=`echo "${mysqld_cnf}" | sed -ne '/datadir/s|^--datadir=||p' | tail -n1` - pidfile=`echo "${mysqld_cnf}" | sed -ne '/pid-file/s|^--pid-file=||p' | tail -n1` - - # push these out to the script - export MY_CNF - export pidfile - export datadir -} - -checkconfig() { - getconfig - if [ -z "${datadir}" ]; then - eerror "Your mysql doesn't have any datadir setting, default or specific" - eerror "Please check your my.cnf : ${MY_CNF}" - return 1 - fi - - if [ ! -d "$datadir/mysql" ]; then - eerror "You don't appear to have the mysql database installed yet." - eerror "Please run /usr/bin/mysql_install_db to have this done..." - return 1 - fi -} - -start() { - getconfig - checkconfig || return 1 - ebegin "Starting mysqld (${MY_CNF})" - start-stop-daemon --start --quiet --background \ - --exec /usr/bin/mysqld_safe \ - -- --defaults-file=${MY_CNF} >/dev/null 2>&1 - eend $? -} - -stop () { - getconfig - ebegin "Stopping mysqld (${MY_CNF})" - start-stop-daemon --stop --retry 5 --quiet --pidfile=${pidfile} - eend $? -} diff --git a/mysql-4.0.24-r2.rc6 b/mysql-4.0.24-r2.rc6 deleted file mode 100644 index ec22177..0000000 --- a/mysql-4.0.24-r2.rc6 +++ /dev/null @@ -1,71 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/files/mysql-4.0.24-r2.rc6,v 1.1 2005/05/17 09:08:46 robbat2 Exp $ - -depend() { - use dns net -} - -getconfig() { - MY_CNF=${MY_CNF=/etc/mysql/my.cnf} - if [ ! -f ${MY_CNF} ]; then - eerror "No ${MY_CNF} file exists! Using automatic defaults!" - fi - - #dir=`my_print_defaults mysqld | grep -- '^--datadir' | tail -n1 | sed -e 's|^--datadir=||'` - #dir=`my_print_defaults mysqld | sed -ne '/datadir/s|^--datadir=||p' | tail -n1` - local mysqld_cnf="`my_print_defaults --config-file=${MY_CNF} mysqld`" - datadir=`echo "${mysqld_cnf}" | sed -ne '/datadir/s|^--datadir=||p' | tail -n1` - pidfile=`echo "${mysqld_cnf}" | sed -ne '/pid-file/s|^--pid-file=||p' | tail -n1` - basedir=`echo "${mysqld_cnf}" | sed -ne '/basedir/s|^--basedir=||p' | tail -n1` - socket=`echo "${mysqld_cnf}" | sed -ne '/socket/s|^--socket=||p' | tail -n1` - - # push these out to the script - export MY_CNF - export pidfile - export datadir - export basedir - export socket -} - -checkconfig() { - getconfig - if [ -z "${datadir}" ]; then - eerror "Your mysql doesn't have any datadir setting, default or specific" - eerror "Please check your my.cnf : ${MY_CNF}" - return 1 - fi - - if [ ! -d "$datadir/mysql" ]; then - eerror "You don't appear to have the mysql database installed yet." - eerror "Please run /usr/bin/mysql_install_db to have this done..." - return 1 - fi -} - -start() { - local retstatus=1 - local maxtry=5 - getconfig - checkconfig || return 1 - ebegin "Starting mysqld (${MY_CNF})" - start-stop-daemon --start --quiet --background \ - --exec "${basedir}/bin/mysqld_safe" \ - -- --defaults-file=${MY_CNF} >/dev/null 2>&1 - retstatus=$? - while ! [[ -S "${socket}" || "${maxtry}" -lt "1" || "${retstatus}" -gt "0" ]] ; do - maxtry=$(($maxtry-1)) - echo -n "." - sleep 1 - done - ! [[ -S "${socket}" ]] && eerror "MySQL NOT started, proceding anyway" - eend $retstatus -} - -stop () { - getconfig - ebegin "Stopping mysqld (${MY_CNF})" - start-stop-daemon --stop --retry 5 --quiet --pidfile=${pidfile} - eend $? -} diff --git a/mysql-4.1.9-thrssl.patch b/mysql-4.1.9-thrssl.patch deleted file mode 100644 index d50325e..0000000 --- a/mysql-4.1.9-thrssl.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- mysql-4.1.10.orig/libmysql_r/Makefile.in 2005-02-12 21:38:04.000000000 +0100 -+++ mysql-4.1.10/libmysql_r/Makefile.in 2005-02-19 01:41:11.000000000 +0100 -@@ -242,7 +242,7 @@ - LIBDL = @LIBDL@ - LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@ - LIBOBJS = @LIBOBJS@ --LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@ -+LIBS = @CLIENT_LIBS@ @ZLIB_LIBS@ @openssl_libs@ @LIBS@ - LIBTOOL = @LIBTOOL@ - LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@ - LM_CFLAGS = @LM_CFLAGS@ ---- mysql-4.1.10.orig/libmysql_r/Makefile.am 2005-02-12 21:37:33.000000000 +0100 -+++ mysql-4.1.10/libmysql_r/Makefile.am 2005-02-19 01:43:49.000000000 +0100 -@@ -22,7 +22,7 @@ - - target = libmysqlclient_r.la - target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@ --LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@ -+LIBS = @CLIENT_LIBS@ @ZLIB_LIBS@ @openssl_libs@ @LIBS@ - - INCLUDES = @MT_INCLUDES@ \ - -I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@ diff --git a/mysql-accesstmp.patch b/mysql-accesstmp.patch deleted file mode 100644 index 700084e..0000000 --- a/mysql-accesstmp.patch +++ /dev/null @@ -1,90 +0,0 @@ ---- mysql-4.1.8/scripts/mysqlaccess.sh 2004-12-14 13:40:36.000000000 +0100 -+++ mysql-4.1.8.bug77805/scripts/mysqlaccess.sh 2005-01-18 00:48:07.692271624 +0100 -@@ -2,7 +2,7 @@ - # **************************** - package MySQLaccess; - #use strict; --use POSIX qw(tmpnam); -+use File::Temp qw(tempfile tmpnam); - use Fcntl; - - BEGIN { -@@ -32,7 +32,6 @@ - $ACCESS_U_BCK = 'user_backup'; - $ACCESS_D_BCK = 'db_backup'; - $DIFF = '/usr/bin/diff'; -- $TMP_PATH = '/tmp'; #path to writable tmp-directory - $MYSQLDUMP = '@bindir@/mysqldump'; - #path to mysqldump executable - -@@ -431,7 +430,7 @@ - # no caching on STDOUT - $|=1; - -- $MYSQL_CNF = POSIX::tmpnam(); -+ $MYSQL_CNF = tmpnam(); - %MYSQL_CNF = (client => { }, - mysql => { }, - mysqldump => { }, -@@ -576,8 +575,6 @@ - push(@MySQLaccess::Grant::Error,'not_found_mysql') if !(-x $MYSQL); - push(@MySQLaccess::Grant::Error,'not_found_diff') if !(-x $DIFF); - push(@MySQLaccess::Grant::Error,'not_found_mysqldump') if !(-x $MYSQLDUMP); --push(@MySQLaccess::Grant::Error,'not_found_tmp') if !(-d $TMP_PATH); --push(@MySQLaccess::Grant::Error,'write_err_tmp') if !(-w $TMP_PATH); - if (@MySQLaccess::Grant::Error) { - MySQLaccess::Report::Print_Error_Messages() ; - exit 0; -@@ -1776,17 +1773,15 @@ - @before = sort(@before); - @after = sort(@after); - -- $before = "$MySQLaccess::TMP_PATH/$MySQLaccess::script.before.$$"; -- $after = "$MySQLaccess::TMP_PATH/$MySQLaccess::script.after.$$"; -- #$after = "/tmp/t0"; -- open(BEFORE,"> $before") || -- push(@MySQLaccess::Report::Errors,"Can't open temporary file $before for writing"); -- open(AFTER,"> $after") || -- push(@MySQLaccess::Report::Errors,"Can't open temporary file $after for writing"); -- print BEFORE join("\n",@before); -- print AFTER join("\n",@after); -- close(BEFORE); -- close(AFTER); -+ ($hb, $before) = tempfile("$MySQLaccess::script.XXXXXX") or -+ push(@MySQLaccess::Report::Errors,"Can't create temporary file: $!"); -+ ($ha, $after) = tempfile("$MySQLaccess::script.XXXXXX") or -+ push(@MySQLaccess::Report::Errors,"Can't create temporary file: $!"); -+ -+ print $hb join("\n",@before); -+ print $ha join("\n",@after); -+ close $hb; -+ close $ha; - - # ---------------------------------- - # compute difference -@@ -1799,8 +1794,8 @@ - - # ---------------------------------- - # cleanup temp. files -- unlink(BEFORE); -- unlink(AFTER); -+ unlink($before); -+ unlink($after); - - return \@diffs; - } -@@ -2315,14 +2310,6 @@ - => "The diff program <$MySQLaccess::DIFF> could not be found.\n" - ."+ Check your path, or\n" - ."+ edit the source of this script to point \$DIFF to the diff program.\n" -- ,'not_found_tmp' -- => "The temporary directory <$MySQLaccess::TMP_PATH> could not be found.\n" -- ."+ create this directory (writeable!), or\n" -- ."+ edit the source of this script to point \$TMP_PATH to the right directory.\n" -- ,'write_err_tmp' -- => "The temporary directory <$MySQLaccess::TMP_PATH> is not writable.\n" -- ."+ make this directory writeable!, or\n" -- ."+ edit the source of this script to point \$TMP_PATH to another directory.\n" - ,'Unrecognized_option' - => "Sorry,\n" - ."You are using an old version of the mysql-program,\n" diff --git a/mysql-test-myisam-geometry.patch b/mysql-test-myisam-geometry.patch deleted file mode 100644 index 54a4a93..0000000 --- a/mysql-test-myisam-geometry.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- mysql.orig/mysql-test/t/myisam.test 2005-03-27 16:07:37.000000000 +0200 -+++ mysql/mysql-test/t/myisam.test 2005-03-27 16:17:33.000000000 +0200 -@@ -476,7 +476,7 @@ - # - # Test RTREE index - # ----error 1235 -+--error 1289 - CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM; - # INSERT INTO t1 VALUES (1,1),(1,1); - # DELETE FROM rt WHERE a<1; ---- mysql.orig/mysql-test/r/myisam.result 2005-03-27 16:08:20.000000000 +0200 -+++ mysql/mysql-test/r/myisam.result 2005-03-27 16:12:18.000000000 +0200 -@@ -499,7 +499,7 @@ - 1 SIMPLE t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct - drop table t1,t2; - CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM; --ERROR 42000: This version of MySQL doesn't yet support 'RTREE INDEX' -+ERROR HY000: The 'RTree keys' feature is disabled; you need MySQL built with 'HAVE_RTREE_KEYS' to have it working - create table t1 (a int, b varchar(200), c text not null) checksum=1; - create table t2 (a int, b varchar(200), c text not null) checksum=0; - insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, ""); diff --git a/zlib/Makefile.am b/zlib/Makefile.am new file mode 100644 index 0000000..cc3777b --- /dev/null +++ b/zlib/Makefile.am @@ -0,0 +1,32 @@ +# Copyright (C) 2004 MySQL AB & MySQL Finland AB & TCX DataKonsult 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 + +# Process this file with automake to create Makefile.in + +INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include + +pkglib_LTLIBRARIES=libz.la + +libz_la_LDFLAGS= -version-info 3:3:2 + +noinst_HEADERS= crc32.h deflate.h inffast.h inffixed.h inflate.h \ + inftrees.h trees.h zconf.h zlib.h zutil.h + +libz_la_SOURCES= adler32.c compress.c crc32.c deflate.c gzio.c \ + infback.c inffast.c inflate.c inftrees.c trees.c \ + uncompr.c zutil.c + +EXTRA_DIST= README FAQ INDEX ChangeLog algorithm.txt zlib.3 cmakelists.txt diff --git a/zlib/Makefile.in b/zlib/Makefile.in new file mode 100644 index 0000000..367bc56 --- /dev/null +++ b/zlib/Makefile.in @@ -0,0 +1,669 @@ +# Makefile.in generated by automake 1.8.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Copyright (C) 2004 MySQL AB & MySQL Finland AB & TCX DataKonsult 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 + +# Process this file with automake to create Makefile.in + + +SOURCES = $(libz_la_SOURCES) + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = zlib +DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in ChangeLog +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/ac-macros/alloca.m4 \ + $(top_srcdir)/config/ac-macros/check_cpu.m4 \ + $(top_srcdir)/config/ac-macros/character_sets.m4 \ + $(top_srcdir)/config/ac-macros/compiler_flag.m4 \ + $(top_srcdir)/config/ac-macros/storage.m4 \ + $(top_srcdir)/config/ac-macros/ha_berkeley.m4 \ + $(top_srcdir)/config/ac-macros/ha_ndbcluster.m4 \ + $(top_srcdir)/config/ac-macros/large_file.m4 \ + $(top_srcdir)/config/ac-macros/misc.m4 \ + $(top_srcdir)/config/ac-macros/openssl.m4 \ + $(top_srcdir)/config/ac-macros/readline.m4 \ + $(top_srcdir)/config/ac-macros/replication.m4 \ + $(top_srcdir)/config/ac-macros/yassl.m4 \ + $(top_srcdir)/config/ac-macros/zlib.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(mkdir_p) +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +libz_la_LIBADD = +am_libz_la_OBJECTS = adler32.lo compress.lo crc32.lo deflate.lo \ + gzio.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo \ + uncompr.lo zutil.lo +libz_la_OBJECTS = $(am_libz_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/adler32.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/compress.Plo ./$(DEPDIR)/crc32.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/deflate.Plo ./$(DEPDIR)/gzio.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/infback.Plo ./$(DEPDIR)/inffast.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/inflate.Plo ./$(DEPDIR)/inftrees.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/trees.Plo ./$(DEPDIR)/uncompr.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/zutil.Plo +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libz_la_SOURCES) +DIST_SOURCES = $(libz_la_SOURCES) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +AS = @AS@ +ASSEMBLER_FALSE = @ASSEMBLER_FALSE@ +ASSEMBLER_TRUE = @ASSEMBLER_TRUE@ +ASSEMBLER_sparc32_FALSE = @ASSEMBLER_sparc32_FALSE@ +ASSEMBLER_sparc32_TRUE = @ASSEMBLER_sparc32_TRUE@ +ASSEMBLER_sparc64_FALSE = @ASSEMBLER_sparc64_FALSE@ +ASSEMBLER_sparc64_TRUE = @ASSEMBLER_sparc64_TRUE@ +ASSEMBLER_x86_FALSE = @ASSEMBLER_x86_FALSE@ +ASSEMBLER_x86_TRUE = @ASSEMBLER_x86_TRUE@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVAILABLE_LANGUAGES = @AVAILABLE_LANGUAGES@ +AWK = @AWK@ +CC = @CC@ +CCAS = @CCAS@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CC_VERSION = @CC_VERSION@ +CFLAGS = @CFLAGS@ +CHECK_PID = @CHECK_PID@ +CHMOD = @CHMOD@ +CLIENT_EXTRA_LDFLAGS = @CLIENT_EXTRA_LDFLAGS@ +CLIENT_LIBS = @CLIENT_LIBS@ +CLIENT_THREAD_LIBS = @CLIENT_THREAD_LIBS@ +CMP = @CMP@ +COMPILATION_COMMENT = @COMPILATION_COMMENT@ +COMPILE_PSTACK_FALSE = @COMPILE_PSTACK_FALSE@ +COMPILE_PSTACK_TRUE = @COMPILE_PSTACK_TRUE@ +CONF_COMMAND = @CONF_COMMAND@ +CP = @CP@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXLDFLAGS = @CXXLDFLAGS@ +CXX_VERSION = @CXX_VERSION@ +CYGPATH_W = @CYGPATH_W@ +DARWIN_MWCC_FALSE = @DARWIN_MWCC_FALSE@ +DARWIN_MWCC_TRUE = @DARWIN_MWCC_TRUE@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOT_FRM_VERSION = @DOT_FRM_VERSION@ +DOXYGEN = @DOXYGEN@ +DVIS = @DVIS@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FIND_PROC = @FIND_PROC@ +GETCONF = @GETCONF@ +GXX = @GXX@ +HAVE_NETWARE_FALSE = @HAVE_NETWARE_FALSE@ +HAVE_NETWARE_TRUE = @HAVE_NETWARE_TRUE@ +HAVE_YASSL_FALSE = @HAVE_YASSL_FALSE@ +HAVE_YASSL_TRUE = @HAVE_YASSL_TRUE@ +HOSTNAME = @HOSTNAME@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KILL = @KILL@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LD_VERSION_SCRIPT = @LD_VERSION_SCRIPT@ +LIBDL = @LIBDL@ +LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@ +LM_CFLAGS = @LM_CFLAGS@ +LN = @LN@ +LN_CP_F = @LN_CP_F@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MACHINE_TYPE = @MACHINE_TYPE@ +MAKEINDEX = @MAKEINDEX@ +MAKEINFO = @MAKEINFO@ +MAKE_BINARY_DISTRIBUTION_OPTIONS = @MAKE_BINARY_DISTRIBUTION_OPTIONS@ +MAKE_SHELL = @MAKE_SHELL@ +MV = @MV@ +MYSQLD_DEFAULT_SWITCHES = @MYSQLD_DEFAULT_SWITCHES@ +MYSQLD_EXTRA_LDFLAGS = @MYSQLD_EXTRA_LDFLAGS@ +MYSQLD_USER = @MYSQLD_USER@ +MYSQL_BASE_VERSION = @MYSQL_BASE_VERSION@ +MYSQL_NO_DASH_VERSION = @MYSQL_NO_DASH_VERSION@ +MYSQL_SERVER_SUFFIX = @MYSQL_SERVER_SUFFIX@ +MYSQL_TCP_PORT = @MYSQL_TCP_PORT@ +MYSQL_TCP_PORT_DEFAULT = @MYSQL_TCP_PORT_DEFAULT@ +MYSQL_UNIX_ADDR = @MYSQL_UNIX_ADDR@ +MYSQL_VERSION_ID = @MYSQL_VERSION_ID@ +NDB_DEFS = @NDB_DEFS@ +NDB_SCI_INCLUDES = @NDB_SCI_INCLUDES@ +NDB_SCI_LIBS = @NDB_SCI_LIBS@ +NDB_VERSION_BUILD = @NDB_VERSION_BUILD@ +NDB_VERSION_MAJOR = @NDB_VERSION_MAJOR@ +NDB_VERSION_MINOR = @NDB_VERSION_MINOR@ +NDB_VERSION_STATUS = @NDB_VERSION_STATUS@ +NOINST_LDFLAGS = @NOINST_LDFLAGS@ +NON_THREADED_LIBS = @NON_THREADED_LIBS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PDFLATEX = @PDFLATEX@ +PDFMANUAL = @PDFMANUAL@ +PERL = @PERL@ +PERL5 = @PERL5@ +PROTOCOL_VERSION = @PROTOCOL_VERSION@ +PS = @PS@ +RANLIB = @RANLIB@ +RM = @RM@ +SAVE_ASFLAGS = @SAVE_ASFLAGS@ +SAVE_CFLAGS = @SAVE_CFLAGS@ +SAVE_CXXFLAGS = @SAVE_CXXFLAGS@ +SAVE_CXXLDFLAGS = @SAVE_CXXLDFLAGS@ +SAVE_LDFLAGS = @SAVE_LDFLAGS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHARED_LIB_MAJOR_VERSION = @SHARED_LIB_MAJOR_VERSION@ +SHARED_LIB_VERSION = @SHARED_LIB_VERSION@ +SHELL = @SHELL@ +STATIC_NSS_FLAGS = @STATIC_NSS_FLAGS@ +STRIP = @STRIP@ +SYSTEM_TYPE = @SYSTEM_TYPE@ +TAR = @TAR@ +TARGET_LINUX = @TARGET_LINUX@ +TERMCAP_LIB = @TERMCAP_LIB@ +TEST_NDBCLUSTER = @TEST_NDBCLUSTER@ +THREAD_LOBJECTS = @THREAD_LOBJECTS@ +THREAD_SAFE_CLIENT_FALSE = @THREAD_SAFE_CLIENT_FALSE@ +THREAD_SAFE_CLIENT_TRUE = @THREAD_SAFE_CLIENT_TRUE@ +VERSION = @VERSION@ +WRAPLIBS = @WRAPLIBS@ +YACC = @YACC@ +ZLIB_DEPS = @ZLIB_DEPS@ +ZLIB_INCLUDES = @ZLIB_INCLUDES@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_GETCONF = @ac_ct_GETCONF@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bdb_includes = @bdb_includes@ +bdb_libs = @bdb_libs@ +bdb_libs_with_path = @bdb_libs_with_path@ +bench_dirs = @bench_dirs@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +docs_dirs = @docs_dirs@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +innodb_includes = @innodb_includes@ +innodb_libs = @innodb_libs@ +innodb_system_libs = @innodb_system_libs@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libmysqld_dirs = @libmysqld_dirs@ +linked_client_targets = @linked_client_targets@ +linked_libmysqld_targets = @linked_libmysqld_targets@ +linked_netware_sources = @linked_netware_sources@ +localstatedir = @localstatedir@ +man1_files = @man1_files@ +man_dirs = @man_dirs@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +mysql_se_decls = @mysql_se_decls@ +mysql_se_dirs = @mysql_se_dirs@ +mysql_se_htons = @mysql_se_htons@ +mysql_se_libs = @mysql_se_libs@ +mysql_se_objs = @mysql_se_objs@ +mysql_se_plugins = @mysql_se_plugins@ +ndb_bin_am_ldflags = @ndb_bin_am_ldflags@ +ndb_cxxflags_fix = @ndb_cxxflags_fix@ +ndb_mgmclient_libs = @ndb_mgmclient_libs@ +ndb_opt_subdirs = @ndb_opt_subdirs@ +ndb_port = @ndb_port@ +ndb_transporter_opt_objs = @ndb_transporter_opt_objs@ +ndbcluster_includes = @ndbcluster_includes@ +ndbcluster_libs = @ndbcluster_libs@ +ndbcluster_system_libs = @ndbcluster_system_libs@ +netware_dir = @netware_dir@ +oldincludedir = @oldincludedir@ +openssl_includes = @openssl_includes@ +openssl_libs = @openssl_libs@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +pstack_dirs = @pstack_dirs@ +pstack_libs = @pstack_libs@ +readline_basedir = @readline_basedir@ +readline_dir = @readline_dir@ +readline_h_ln_cmd = @readline_h_ln_cmd@ +readline_link = @readline_link@ +readline_topdir = @readline_topdir@ +sbindir = @sbindir@ +server_scripts = @server_scripts@ +sharedstatedir = @sharedstatedir@ +sql_client_dirs = @sql_client_dirs@ +sql_server = @sql_server@ +sql_server_dirs = @sql_server_dirs@ +sql_union_dirs = @sql_union_dirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +thread_dirs = @thread_dirs@ +tools_dirs = @tools_dirs@ +uname_prog = @uname_prog@ +yassl_dir = @yassl_dir@ +yassl_h_ln_cmd = @yassl_h_ln_cmd@ +yassl_includes = @yassl_includes@ +yassl_libs = @yassl_libs@ +yassl_taocrypt_extra_cxxflags = @yassl_taocrypt_extra_cxxflags@ +zlib_dir = @zlib_dir@ +INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include +pkglib_LTLIBRARIES = libz.la +libz_la_LDFLAGS = -version-info 3:3:2 +noinst_HEADERS = crc32.h deflate.h inffast.h inffixed.h inflate.h \ + inftrees.h trees.h zconf.h zlib.h zutil.h + +libz_la_SOURCES = adler32.c compress.c crc32.c deflate.c gzio.c \ + infback.c inffast.c inflate.c inftrees.c trees.c \ + uncompr.c zutil.c + +EXTRA_DIST = README FAQ INDEX ChangeLog algorithm.txt zlib.3 cmakelists.txt +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu zlib/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu zlib/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" = "$$p" && dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libz.la: $(libz_la_OBJECTS) $(libz_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(libz_la_LDFLAGS) $(libz_la_OBJECTS) $(libz_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adler32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compress.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deflate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infback.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inffast.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inflate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inftrees.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trees.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uncompr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zutil.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-pkglibLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: |