From: kevin.lewis Date: February 6 2012 2:36pm Subject: bzr push into mysql-trunk branch (kevin.lewis:3821) List-Archive: http://lists.mysql.com/commits/142770 Message-Id: <20120206143643.051691DD2576@dhcp-adc-twvpn-2-vpnpool-10-154-53-208.vpn.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3821 kevin.lewis@stripped 2012-02-06 [merge] Merge from mysql-trunk added: mysql-test/suite/innodb/r/innodb_bug11754376.result mysql-test/suite/innodb/t/innodb_bug11754376.test modified: mysql-test/collections/default.experimental mysql-test/include/have_64bit.inc mysql-test/r/group_by.result mysql-test/r/join_outer.result mysql-test/r/join_outer_bka.result mysql-test/r/join_outer_bka_nixbnl.result mysql-test/suite/rpl/r/rpl_change_master.result mysql-test/suite/rpl/t/rpl_change_master.test mysql-test/t/join_outer.test sql/item.h sql/sql_optimizer.cc sql/sql_yacc.yy storage/innobase/handler/ha_innodb.cc === modified file 'mysql-test/r/partition_windows.result' --- a/mysql-test/r/partition_windows.result revid:norvald.ryeng@stripped +++ b/mysql-test/r/partition_windows.result revid:kevin.lewis@stripped @@ -26,5 +26,9 @@ ALTER TABLE t1 ADD PARTITION (PARTITION Warnings: Warning 1618 option ignored Warning 1618 option ignored +Warning 1618 option ignored +Warning 1618 option ignored +Warning 1618 option ignored +Warning 1618 option ignored INSERT INTO t1 VALUES (NULL, "last", 4); DROP TABLE t1; === modified file 'sql/log_event.cc' --- a/sql/log_event.cc revid:norvald.ryeng@stripped +++ b/sql/log_event.cc revid:kevin.lewis@stripped @@ -4316,11 +4316,11 @@ int Query_log_event::do_apply_event(Rela nothing to do. */ /* - We do not replicate IGNORE_DIR_IN_CREATE. That is, if the master is a - slave which runs with SQL_MODE=IGNORE_DIR_IN_CREATE, this should not + We do not replicate MODE_NO_DIR_IN_CREATE. That is, if the master is a + slave which runs with SQL_MODE=MODE_NO_DIR_IN_CREATE, this should not force us to ignore the dir too. Imagine you are a ring of machines, and one has a disk problem so that you temporarily need - IGNORE_DIR_IN_CREATE on this machine; you don't want it to propagate + MODE_NO_DIR_IN_CREATE on this machine; you don't want it to propagate elsewhere (you don't want all slaves to start ignoring the dirs). */ if (sql_mode_inited) === modified file 'sql/partition_info.cc' --- a/sql/partition_info.cc revid:norvald.ryeng@stripped +++ b/sql/partition_info.cc revid:kevin.lewis@stripped @@ -1233,9 +1233,7 @@ end: */ static void warn_if_dir_in_part_elem(THD *thd, partition_element *part_elem) { -#ifdef HAVE_READLINK - if (!my_use_symdir || (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE)) -#endif + if (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE) { if (part_elem->data_file_name) push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, === modified file 'sql/sql_parse.cc' --- a/sql/sql_parse.cc revid:norvald.ryeng@stripped +++ b/sql/sql_parse.cc revid:kevin.lewis@stripped @@ -2603,14 +2603,13 @@ case SQLCOM_PREPARE: /* Might have been updated in create_table_precheck */ create_info.alias= create_table->alias; -#ifdef HAVE_READLINK - /* Fix names if symlinked tables */ + /* Fix names if symlinked or relocated tables */ if (append_file_to_dir(thd, &create_info.data_file_name, create_table->table_name) || append_file_to_dir(thd, &create_info.index_file_name, create_table->table_name)) goto end_with_restore_list; -#endif + /* If no engine type was given, work out the default now rather than at parse-time. === modified file 'sql/sql_table.cc' --- a/sql/sql_table.cc revid:norvald.ryeng@stripped +++ b/sql/sql_table.cc revid:kevin.lewis@stripped @@ -4431,7 +4431,6 @@ bool mysql_create_table_no_lock(THD *thd THD_STAGE_INFO(thd, stage_creating_table); -#ifdef HAVE_READLINK { size_t dirlen; char dirpath[FN_REFLEN]; @@ -4478,8 +4477,7 @@ bool mysql_create_table_no_lock(THD *thd } #endif /* WITH_PARTITION_STORAGE_ENGINE */ - if (!my_use_symdir || (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE)) -#endif /* HAVE_READLINK */ + if (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE) { if (create_info->data_file_name) push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, === modified file 'storage/archive/ha_archive.cc' --- a/storage/archive/ha_archive.cc revid:norvald.ryeng@stripped +++ b/storage/archive/ha_archive.cc revid:kevin.lewis@stripped @@ -737,12 +737,12 @@ void ha_archive::frm_load(const char *na { if (!mysql_file_fstat(frm_file, &file_stat, MYF(MY_WME))) { - frm_ptr= (uchar *) my_malloc(sizeof(uchar) * file_stat.st_size, MYF(0)); + frm_ptr= (uchar *) my_malloc(sizeof(uchar) * (size_t) file_stat.st_size, MYF(0)); if (frm_ptr) { - if (my_read(frm_file, frm_ptr, file_stat.st_size, MYF(0)) == + if (my_read(frm_file, frm_ptr, (size_t) file_stat.st_size, MYF(0)) == (size_t) file_stat.st_size) - azwrite_frm(dst, (char *) frm_ptr, file_stat.st_size); + azwrite_frm(dst, (char *) frm_ptr, (size_t) file_stat.st_size); my_free(frm_ptr); } } @@ -831,7 +831,10 @@ int ha_archive::create(const char *name, /* We reuse name_buff since it is available. */ - if (create_info->data_file_name && create_info->data_file_name[0] != '#') +#ifdef HAVE_READLINK + if (my_use_symdir && + create_info->data_file_name && + create_info->data_file_name[0] != '#') { DBUG_PRINT("ha_archive", ("archive will create stream file %s", create_info->data_file_name)); @@ -842,12 +845,29 @@ int ha_archive::create(const char *name, MY_REPLACE_EXT | MY_UNPACK_FILENAME); } else +#endif /* HAVE_READLINK */ { + if (create_info->data_file_name) + { + push_warning_printf(table_arg->in_use, Sql_condition::WARN_LEVEL_WARN, + WARN_OPTION_IGNORED, + ER_DEFAULT(WARN_OPTION_IGNORED), + "DATA DIRECTORY"); + } fn_format(name_buff, name, "", ARZ, MY_REPLACE_EXT | MY_UNPACK_FILENAME); linkname[0]= 0; } + /* Archive engine never uses INDEX DIRECTORY. */ + if (create_info->index_file_name) + { + push_warning_printf(table_arg->in_use, Sql_condition::WARN_LEVEL_WARN, + WARN_OPTION_IGNORED, + ER_DEFAULT(WARN_OPTION_IGNORED), + "INDEX DIRECTORY"); + } + /* There is a chance that the file was "discovered". In this case just use whatever file is there. === modified file 'storage/myisam/ha_myisam.cc' --- a/storage/myisam/ha_myisam.cc revid:norvald.ryeng@stripped +++ b/storage/myisam/ha_myisam.cc revid:kevin.lewis@stripped @@ -1942,10 +1942,27 @@ int ha_myisam::create(const char *name, (ulonglong) 0); create_info.data_file_length= ((ulonglong) share->max_rows * share->avg_row_length); - create_info.data_file_name= ha_create_info->data_file_name; - create_info.index_file_name= ha_create_info->index_file_name; create_info.language= share->table_charset->number; +#ifdef HAVE_READLINK + if (my_use_symdir) + { + create_info.data_file_name= ha_create_info->data_file_name; + create_info.index_file_name= ha_create_info->index_file_name; + } + else +#endif /* HAVE_READLINK */ + { + if (ha_create_info->data_file_name) + push_warning_printf(table_arg->in_use, Sql_condition::WARN_LEVEL_WARN, + WARN_OPTION_IGNORED, ER(WARN_OPTION_IGNORED), + "DATA DIRECTORY"); + if (ha_create_info->index_file_name) + push_warning_printf(table_arg->in_use, Sql_condition::WARN_LEVEL_WARN, + WARN_OPTION_IGNORED, ER(WARN_OPTION_IGNORED), + "INDEX DIRECTORY"); + } + if (ha_create_info->options & HA_LEX_CREATE_TMP_TABLE) create_flags|= HA_CREATE_TMP_TABLE; if (ha_create_info->options & HA_CREATE_KEEP_FILES) No bundle (reason: useless for push emails).