2811 Alexey Botchkov 2009-06-26 [merge]
merging
modified:
mysql-test/r/select.result
mysql-test/r/select_jcl6.result
mysql-test/t/select.test
sql/sql_base.cc
sql/sql_select.cc
sql/structs.h
=== modified file 'client/mysql_upgrade.c'
--- a/client/mysql_upgrade.c 2009-06-03 11:19:42 +0000
+++ b/client/mysql_upgrade.c 2009-06-26 09:10:20 +0000
@@ -34,7 +34,8 @@
static char mysql_path[FN_REFLEN];
static char mysqlcheck_path[FN_REFLEN];
-static my_bool opt_force, opt_verbose, debug_info_flag, debug_check_flag;
+static my_bool opt_force, opt_verbose, debug_info_flag, debug_check_flag,
+ opt_systables_only;
static uint my_end_arg= 0;
static char *opt_user= (char*)"root";
@@ -119,6 +120,10 @@ static struct my_option my_long_options[
#include <sslopt-longopts.h>
{"tmpdir", 't', "Directory for temporary files",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"upgrade-system-tables", 's', "Only upgrade the system tables "
+ "do not try to upgrade the data.",
+ (uchar**)&opt_systables_only, (uchar**)&opt_systables_only, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"user", 'u', "User for login if not current user.", (uchar**) &opt_user,
(uchar**) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Display more output about the process",
@@ -806,8 +811,15 @@ int main(int argc, char **argv)
/* Find mysql */
find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"), self_name);
- /* Find mysqlcheck */
- find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"), self_name);
+ if (!opt_systables_only)
+ {
+ /* Find mysqlcheck */
+ find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"), self_name);
+ }
+ else
+ {
+ printf("The --upgrade-system-tables option was used, databases won't be touched.\n");
+ }
/*
Read the mysql_upgrade_info file to check if mysql_upgrade
@@ -824,8 +836,8 @@ int main(int argc, char **argv)
/*
Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
*/
- if (run_mysqlcheck_fixnames() ||
- run_mysqlcheck_upgrade() ||
+ if ((!opt_systables_only &&
+ (run_mysqlcheck_fixnames() || run_mysqlcheck_upgrade())) ||
run_sql_fix_privilege_tables())
{
/*
=== modified file 'mysql-test/r/mysql_upgrade.result'
--- a/mysql-test/r/mysql_upgrade.result 2009-01-27 14:53:22 +0000
+++ b/mysql-test/r/mysql_upgrade.result 2009-06-26 09:10:20 +0000
@@ -151,3 +151,47 @@ mysql.time_zone_transition
mysql.time_zone_transition_type OK
mysql.user OK
set GLOBAL sql_mode=default;
+copy 'old' table image to the datadirectory
+then run mysql_upgrade with and without the --upgrade-system-table option
+The --upgrade-system-tables option was used, databases won't be touched.
+mtr.global_suppressions OK
+mtr.test_suppressions OK
+mysql.backup_history
+Error : You can't use locks with log tables.
+status : OK
+mysql.backup_progress
+Error : You can't use locks with log tables.
+status : OK
+mysql.columns_priv OK
+mysql.db OK
+mysql.event OK
+mysql.func OK
+mysql.general_log
+Error : You can't use locks with log tables.
+status : OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.host OK
+mysql.ndb_binlog_index OK
+mysql.plugin OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.servers OK
+mysql.slow_log
+Error : You can't use locks with log tables.
+status : OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.user OK
+test.t1
+error : Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
+
+Repairing tables
+test.t1 OK
+drop table t1;
=== modified file 'mysql-test/t/mysql_upgrade.test'
--- a/mysql-test/t/mysql_upgrade.test 2008-10-14 09:48:04 +0000
+++ b/mysql-test/t/mysql_upgrade.test 2009-06-26 09:10:20 +0000
@@ -69,3 +69,18 @@ DROP USER mysqltest1@'%';
set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE';
--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
eval set GLOBAL sql_mode=default;
+
+#
+# Test the --upgrade-system-tables option
+#
+--echo copy 'old' table image to the datadirectory
+--echo then run mysql_upgrade with and without the --upgrade-system-table option
+
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+copy_file std_data/bug37631.frm $MYSQLD_DATADIR/test/t1.frm;
+copy_file std_data/bug37631.MYD $MYSQLD_DATADIR/test/t1.MYD;
+copy_file std_data/bug37631.MYI $MYSQLD_DATADIR/test/t1.MYI;
+
+--exec $MYSQL_UPGRADE --upgrade-system-tables --skip-verbose
+--exec $MYSQL_UPGRADE --force --skip-verbose
+drop table t1;
Attachment: [text/bzr-bundle] bzr/holyfoot@mysql.com-20090626134731-v8ihjcbytkyxhm7k.bundle
| Thread |
|---|
| • bzr push into mysql-5.4 branch (holyfoot:2811) | Alexey Botchkov | 26 Jun |