From 2606cb9321d7d3179506587043a2a24782ee802e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Aug 2006 01:42:57 +0200 Subject: [PATCH 1/7] Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Fixes the following bugs: - Bug #19834: Using cursors when running in READ-COMMITTED can cause InnoDB to crash - Bug #20213: DBT2 testing cause mysqld to core using Innodb - Bug #20493: on partition tables, select and show command casue server crash - Bug #21113: Duplicate printout in SHOW INNODB STATUS - Bug #21313: rsql_..._recover_innodb_tmp_table is redundant and broken - Bug #21467: Manual URL wrong in InnoDB "page corrupted" error report mysql-test/r/innodb.result: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. innodb.result: Adjust Innodb_rows_inserted and Innodb_rows_updated to reflect the deleted statements in r420, which somehow reappeared in the MySQL tree. mysql-test/t/innodb.test: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. sql/ha_innodb.cc: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. ha_innobase::start_stmt(): patch from Heikki: Do not call read_view_close_for_mysql(). (Bug #19834) Fix Bug#20213 and its duplicates: stress test crashes of InnoDB-5.1 Fix Bug #20493 : we must prepare prebuilt->trx to point to the trx of this thd before using it Add update_thd() to several places in ha_innodb.cc to make sure prebuilt->trx points to the right trx object; in other functions add assertions that prebuilt->trx is for this thd; when 5.1 stabilizes, we can change these assertions to ut_ad() debug version assertions Remove redundant check_trx_exists() and ut_a() from r701, as suggested by Marko Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/btr/btr0btr.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/buf/buf0buf.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/dict/dict0dict.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/fil/fil0fil.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Make the tablespace cache hash size 100 or 1000 times bigger. Fixes bug #21112. After ut_print_timestamp(), always display " InnoDB:" (note two spaces). Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/fsp/fsp0fsp.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/ibuf/ibuf0ibuf.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. ibuf_print(): Don't print redundant information. Fixes bug #21113. Remove non-varying variable ibuf->meter and related constant IBUF_THRESHOLD. storage/innobase/include/btr0cur.ic: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. btr_cur_get_page(): Remove buggy assertion. storage/innobase/include/buf0buf.ic: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/include/ibuf0ibuf.ic: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Remove non-varying variable ibuf->meter and related constant IBUF_THRESHOLD. storage/innobase/log/log0log.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/log/log0recv.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/os/os0file.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/row/row0mysql.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Remove the special treatment of tables rsql_IDENTIFIER_recover_innodb_tmp_table, which is redundant and was broken with the introduction of the "safe" file name encoding of identifiers. (Bug #21313) ChangeSet@1.2181.173.1 2006-08-02 17:57:06+02:00 ingo@local Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Changed back the encoded temp file prefix to #sql. After ut_print_timestamp(), always display " InnoDB:" (note two spaces). Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/row/row0sel.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/row/row0vers.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. row_vers_build_for_semi_consistent_read(): rec_trx_id was uninitialized in a comparison. Initialize it. storage/innobase/srv/srv0start.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/ut/ut0dbg.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. ut_dbg_assertion_failed(): Print space between timestamp and start of error message. After ut_print_timestamp(), always display " InnoDB:" (note two spaces). Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/Makefile.am: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. --- mysql-test/r/innodb.result | 16 +--- mysql-test/t/innodb.test | 8 -- sql/ha_innodb.cc | 129 +++++++++++++------------ storage/innobase/Makefile.am | 3 +- storage/innobase/btr/btr0btr.c | 2 +- storage/innobase/buf/buf0buf.c | 5 +- storage/innobase/dict/dict0dict.c | 11 +-- storage/innobase/fil/fil0fil.c | 26 ++--- storage/innobase/fsp/fsp0fsp.c | 2 +- storage/innobase/ibuf/ibuf0ibuf.c | 17 +--- storage/innobase/include/btr0cur.ic | 5 +- storage/innobase/include/buf0buf.ic | 8 +- storage/innobase/include/ibuf0ibuf.ic | 11 +-- storage/innobase/log/log0log.c | 2 +- storage/innobase/log/log0recv.c | 4 +- storage/innobase/os/os0file.c | 12 +-- storage/innobase/row/row0mysql.c | 133 ++++---------------------- storage/innobase/row/row0sel.c | 2 +- storage/innobase/row/row0vers.c | 2 +- storage/innobase/srv/srv0start.c | 2 +- storage/innobase/ut/ut0dbg.c | 4 +- 21 files changed, 138 insertions(+), 266 deletions(-) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 3034fc2035e..e26e6fb271a 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1295,24 +1295,16 @@ insert into t2 (a) select b from t1; insert into t1 (a) select b from t2; insert into t2 (a) select b from t1; insert into t1 (a) select b from t2; -insert into t2 (a) select b from t1; -insert into t1 (a) select b from t2; -insert into t2 (a) select b from t1; -insert into t1 (a) select b from t2; -insert into t2 (a) select b from t1; -insert into t1 (a) select b from t2; -insert into t2 (a) select b from t1; -insert into t1 (a) select b from t2; select count(*) from t1; count(*) -29267 +623 explain select * from t1 where c between 1 and 2500; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range c c 5 NULL # Using where update t1 set c=a; explain select * from t1 where c between 1 and 2500; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c c 5 NULL # Using where +1 SIMPLE t1 ALL c NULL NULL NULL # Using where drop table t1,t2; create table t1 (id int primary key auto_increment, fk int, index index_fk (fk)) engine=innodb; insert into t1 (id) values (null),(null),(null),(null),(null); @@ -1786,10 +1778,10 @@ Variable_name Value Innodb_rows_deleted 2070 show status like "Innodb_rows_inserted"; Variable_name Value -Innodb_rows_inserted 31727 +Innodb_rows_inserted 3083 show status like "Innodb_rows_updated"; Variable_name Value -Innodb_rows_updated 29530 +Innodb_rows_updated 886 show status like "Innodb_row_lock_waits"; Variable_name Value Innodb_row_lock_waits 0 diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index d00c5499ef9..1a2afad3b44 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -904,14 +904,6 @@ insert into t2 (a) select b from t1; insert into t1 (a) select b from t2; insert into t2 (a) select b from t1; insert into t1 (a) select b from t2; -insert into t2 (a) select b from t1; -insert into t1 (a) select b from t2; -insert into t2 (a) select b from t1; -insert into t1 (a) select b from t2; -insert into t2 (a) select b from t1; -insert into t1 (a) select b from t2; -insert into t2 (a) select b from t1; -insert into t1 (a) select b from t2; select count(*) from t1; --replace_column 9 # explain select * from t1 where c between 1 and 2500; diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 00a92e05ffb..6b19ea228e5 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -208,6 +208,7 @@ static handler *innobase_create_handler(TABLE_SHARE *table, MEM_ROOT *mem_root); static const char innobase_hton_name[]= "InnoDB"; + handlerton innobase_hton; static handler *innobase_create_handler(TABLE_SHARE *table, MEM_ROOT *mem_root) @@ -2364,8 +2365,7 @@ ha_innobase::open( "have forgotten\nto delete the corresponding " ".frm files of InnoDB tables, or you\n" "have moved .frm files to another database?\n" - "Look from section 15.1 of " - "http://www.innodb.com/ibman.html\n" + "See http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n" "how you can resolve the problem.\n", norm_name); free_share(share); @@ -2382,8 +2382,7 @@ ha_innobase::open( "Have you deleted the .ibd file from the " "database directory under\nthe MySQL datadir, " "or have you used DISCARD TABLESPACE?\n" - "Look from section 15.1 of " - "http://www.innodb.com/ibman.html\n" + "See http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n" "how you can resolve the problem.\n", norm_name); free_share(share); @@ -3664,7 +3663,7 @@ ha_innobase::update_row( DBUG_ENTER("ha_innobase::update_row"); - ut_ad(prebuilt->trx == + ut_a(prebuilt->trx == (trx_t*) current_thd->ha_data[innobase_hton.slot]); if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) @@ -3725,7 +3724,7 @@ ha_innobase::delete_row( DBUG_ENTER("ha_innobase::delete_row"); - ut_ad(prebuilt->trx == + ut_a(prebuilt->trx == (trx_t*) current_thd->ha_data[innobase_hton.slot]); if (last_query_id != user_thd->query_id) { @@ -3823,6 +3822,9 @@ ha_innobase::try_semi_consistent_read(bool yes) { row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; + ut_a(prebuilt->trx == + (trx_t*) current_thd->ha_data[innobase_hton.slot]); + /* Row read type is set to semi consistent read if this was requested by the MySQL and either innodb_locks_unsafe_for_binlog option is used or this session is using READ COMMITTED isolation @@ -3987,7 +3989,7 @@ ha_innobase::index_read( DBUG_ENTER("index_read"); - ut_ad(prebuilt->trx == + ut_a(prebuilt->trx == (trx_t*) current_thd->ha_data[innobase_hton.slot]); statistic_increment(current_thd->status_var.ha_read_key_count, @@ -4102,7 +4104,7 @@ ha_innobase::change_active_index( DBUG_ENTER("change_active_index"); ut_ad(user_thd == current_thd); - ut_ad(prebuilt->trx == + ut_a(prebuilt->trx == (trx_t*) current_thd->ha_data[innobase_hton.slot]); active_index = keynr; @@ -4192,7 +4194,7 @@ ha_innobase::general_fetch( DBUG_ENTER("general_fetch"); - ut_ad(prebuilt->trx == + ut_a(prebuilt->trx == (trx_t*) current_thd->ha_data[innobase_hton.slot]); innodb_srv_conc_enter_innodb(prebuilt->trx); @@ -4428,7 +4430,7 @@ ha_innobase::rnd_pos( statistic_increment(current_thd->status_var.ha_read_rnd_count, &LOCK_status); - ut_ad(prebuilt->trx == + ut_a(prebuilt->trx == (trx_t*) current_thd->ha_data[innobase_hton.slot]); if (prebuilt->clust_index_was_generated) { @@ -4478,7 +4480,7 @@ ha_innobase::position( row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; uint len; - ut_ad(prebuilt->trx == + ut_a(prebuilt->trx == (trx_t*) current_thd->ha_data[innobase_hton.slot]); if (prebuilt->clust_index_was_generated) { @@ -5006,7 +5008,6 @@ ha_innobase::delete_all_rows(void) { row_prebuilt_t* prebuilt = (row_prebuilt_t*)innobase_prebuilt; int error; - trx_t* trx; THD* thd = current_thd; DBUG_ENTER("ha_innobase::delete_all_rows"); @@ -5019,13 +5020,13 @@ ha_innobase::delete_all_rows(void) } /* Get the transaction associated with the current thd, or create one - if not yet created */ + if not yet created, and update prebuilt->trx */ - trx = check_trx_exists(thd); + update_thd(thd); /* Truncate the table in InnoDB */ - error = row_truncate_table_for_mysql(prebuilt->table, trx); + error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx); if (error == DB_ERROR) { /* Cannot truncate; resort to ha_innobase::delete_row() */ goto fallback; @@ -5308,6 +5309,9 @@ ha_innobase::records_in_range( DBUG_ENTER("records_in_range"); + ut_a(prebuilt->trx == + (trx_t*) current_thd->ha_data[innobase_hton.slot]); + prebuilt->trx->op_info = (char*)"estimating records in index range"; /* In case MySQL calls this in the middle of a SELECT query, release @@ -5604,13 +5608,14 @@ ha_innobase::info( for (i = 0; i < table->s->keys; i++) { if (index == NULL) { ut_print_timestamp(stderr); - sql_print_error("Table %s contains less " + sql_print_error("Table %s contains fewer " "indexes inside InnoDB than " "are defined in the MySQL " ".frm file. Have you mixed up " ".frm files from different " - "installations? See section " - "15.1 at http://www.innodb.com/ibman.html", + "installations? See " +"http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n", + ib_table->name); break; } @@ -5619,17 +5624,11 @@ ha_innobase::info( if (j + 1 > index->n_uniq) { ut_print_timestamp(stderr); - sql_print_error("Index %s of %s has " - "%lu columns unique " - "inside InnoDB, but " - "MySQL is asking " - "statistics for %lu " - "columns. Have you " - "mixed up .frm files " - "from different " - "installations? See " - "section 15.1 at " - "http://www.innodb.com/ibman.html", + sql_print_error( +"Index %s of %s has %lu columns unique inside InnoDB, but MySQL is asking " +"statistics for %lu columns. Have you mixed up .frm files from different " +"installations? " +"See http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n", index->name, ib_table->name, (unsigned long) @@ -6035,6 +6034,10 @@ ha_innobase::can_switch_engines(void) bool can_switch; DBUG_ENTER("ha_innobase::can_switch_engines"); + + ut_a(prebuilt->trx == + (trx_t*) current_thd->ha_data[innobase_hton.slot]); + prebuilt->trx->op_info = "determining if there are foreign key constraints"; row_mysql_lock_data_dictionary(prebuilt->trx); @@ -6172,14 +6175,6 @@ ha_innobase::start_stmt( innobase_release_stat_resources(trx); - if (trx->isolation_level <= TRX_ISO_READ_COMMITTED - && trx->global_read_view) { - /* At low transaction isolation levels we let - each consistent read set its own snapshot */ - - read_view_close_for_mysql(trx); - } - prebuilt->sql_stat_start = TRUE; prebuilt->hint_need_to_fetch_extra_cols = 0; prebuilt->read_just_key = 0; @@ -6438,7 +6433,7 @@ ha_innobase::transactional_table_lock( "table %s does not exist.\n" "Have you deleted the .ibd file from the database directory under\n" "the MySQL datadir?" -"Look from section 15.1 of http://www.innodb.com/ibman.html\n" +"See http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n" "how you can resolve the problem.\n", prebuilt->table->name); DBUG_RETURN(HA_ERR_CRASHED); @@ -6792,7 +6787,15 @@ ha_innobase::store_lock( TL_IGNORE */ { row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; - trx_t* trx = prebuilt->trx; + trx_t* trx; + + /* Call update_thd() to update prebuilt->trx to point to the trx + object of thd! Failure to do this caused a serious memory + corruption bug in 5.1.11. */ + + update_thd(thd); + + trx = prebuilt->trx; /* NOTE: MySQL can call this function with lock 'type' TL_IGNORE! Be careful to ignore TL_IGNORE if we are going to do something with @@ -6909,28 +6912,28 @@ ha_innobase::store_lock( stored function call (MySQL does have thd->in_lock_tables TRUE there). */ - if ((lock_type >= TL_WRITE_CONCURRENT_INSERT - && lock_type <= TL_WRITE) - && !(thd->in_lock_tables - && thd->lex->sql_command == SQLCOM_LOCK_TABLES) - && !thd->tablespace_op - && thd->lex->sql_command != SQLCOM_TRUNCATE - && thd->lex->sql_command != SQLCOM_OPTIMIZE + if ((lock_type >= TL_WRITE_CONCURRENT_INSERT + && lock_type <= TL_WRITE) + && !(thd->in_lock_tables + && thd->lex->sql_command == SQLCOM_LOCK_TABLES) + && !thd->tablespace_op + && thd->lex->sql_command != SQLCOM_TRUNCATE + && thd->lex->sql_command != SQLCOM_OPTIMIZE + #ifdef __WIN__ - /* - for alter table on win32 for succesfull operation - completion it is used TL_WRITE(=10) lock instead of - TL_WRITE_ALLOW_READ(=6), however here in innodb handler - TL_WRITE is lifted to TL_WRITE_ALLOW_WRITE, which causes - race condition when several clients do alter table - simultaneously (bug #17264). This fix avoids the problem. - */ - && thd->lex->sql_command != SQLCOM_ALTER_TABLE + /* For alter table on win32 for succesful operation + completion it is used TL_WRITE(=10) lock instead of + TL_WRITE_ALLOW_READ(=6), however here in innodb handler + TL_WRITE is lifted to TL_WRITE_ALLOW_WRITE, which causes + race condition when several clients do alter table + simultaneously (bug #17264). This fix avoids the problem. */ + && thd->lex->sql_command != SQLCOM_ALTER_TABLE #endif - && thd->lex->sql_command != SQLCOM_CREATE_TABLE) { + + && thd->lex->sql_command != SQLCOM_CREATE_TABLE) { lock_type = TL_WRITE_ALLOW_WRITE; - } + } /* In queries of type INSERT INTO t1 SELECT ... FROM t2 ... MySQL would use the lock TL_READ_NO_INSERT on t2, and that @@ -6977,10 +6980,11 @@ ha_innobase::innobase_read_and_init_auto_inc( int error; ut_a(prebuilt); - ut_a(prebuilt->trx == - (trx_t*) current_thd->ha_data[innobase_hton.slot]); ut_a(prebuilt->table); + /* Prepare prebuilt->trx in the table handle */ + update_thd(current_thd); + if (prebuilt->trx->conc_state == TRX_NOT_STARTED) { trx_was_not_started = TRUE; } @@ -7115,6 +7119,9 @@ void ha_innobase::get_auto_increment( longlong nr; int error; + /* Prepare prebuilt->trx in the table handle */ + update_thd(current_thd); + error = innobase_read_and_init_auto_inc(&nr); if (error) { @@ -7143,6 +7150,8 @@ ha_innobase::reset_auto_increment(ulonglong value) row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; int error; + update_thd(current_thd); + error = row_lock_table_autoinc_for_mysql(prebuilt); if (error != DB_SUCCESS) { @@ -7183,7 +7192,7 @@ ha_innobase::cmp_ref( const mysql_byte* ref2) /* in: an (internal) primary key value in the MySQL key value format */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; + row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; enum_field_types mysql_type; Field* field; KEY_PART_INFO* key_part; diff --git a/storage/innobase/Makefile.am b/storage/innobase/Makefile.am index 7884715d839..3f46f059fc0 100644 --- a/storage/innobase/Makefile.am +++ b/storage/innobase/Makefile.am @@ -77,8 +77,7 @@ EXTRA_DIST = include/btr0btr.h include/btr0btr.ic include/btr0cur.h include/btr include/ut0byte.h include/ut0byte.ic include/ut0dbg.h include/ut0lst.h \ include/ut0mem.h include/ut0mem.ic include/ut0rnd.h include/ut0rnd.ic \ include/ut0sort.h include/ut0ut.h include/ut0ut.ic include/ut0vec.h include/ut0vec.ic include/ha_prototypes.h \ - include/ut0list.h include/ut0list.ic \ - include/ut0wqueue.h \ + include/ut0list.h include/ut0list.ic include/ut0wqueue.h \ CMakeLists.txt noinst_LIBRARIES = libinnobase.a diff --git a/storage/innobase/btr/btr0btr.c b/storage/innobase/btr/btr0btr.c index ae3e722b513..57c6289e5f7 100644 --- a/storage/innobase/btr/btr0btr.c +++ b/storage/innobase/btr/btr0btr.c @@ -624,7 +624,7 @@ btr_page_get_father_for_rec( fputs( "InnoDB: You should dump + drop + reimport the table to fix the\n" "InnoDB: corruption. If the crash happens at the database startup, see\n" -"InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html about\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html about\n" "InnoDB: forcing recovery. Then dump + drop + reimport.\n", stderr); } diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c index 5f3e4a9ea50..ad23da4af93 100644 --- a/storage/innobase/buf/buf0buf.c +++ b/storage/innobase/buf/buf0buf.c @@ -323,7 +323,8 @@ buf_page_is_corrupted( "InnoDB: is in the future! Current system log sequence number %lu %lu.\n" "InnoDB: Your database may be corrupt or you may have copied the InnoDB\n" "InnoDB: tablespace but not the InnoDB log files. See\n" -"http://dev.mysql.com/doc/mysql/en/backing-up.html for more information.\n", +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n" +"InnoDB: for more information.\n", (ulong) mach_read_from_4(read_buf + FIL_PAGE_OFFSET), (ulong) ut_dulint_get_high( mach_read_from_8(read_buf + FIL_PAGE_LSN)), @@ -1923,7 +1924,7 @@ buf_page_io_complete( "InnoDB: the corrupt table. You can use CHECK\n" "InnoDB: TABLE to scan your table for corruption.\n" "InnoDB: See also " - "http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n" "InnoDB: about forcing recovery.\n", stderr); if (srv_force_recovery < SRV_FORCE_IGNORE_CORRUPT) { diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index ce075138cb1..3470b19ed71 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -2215,8 +2215,8 @@ dict_foreign_error_report( if (fk->foreign_index) { fputs("The index in the foreign key in table is ", file); ut_print_name(file, NULL, FALSE, fk->foreign_index->name); - fputs( -"\nSee http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html\n" + fputs("\n" +"See http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html\n" "for correct foreign key definition.\n", file); } @@ -3119,7 +3119,7 @@ col_loop1: ut_print_name(ef, NULL, TRUE, name); fprintf(ef, " where the columns appear\n" "as the first columns. Constraint:\n%s\n" -"See http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html\n" +"See http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html\n" "for correct foreign key definition.\n", start_of_latest_foreign); mutex_exit(&dict_foreign_err_mutex); @@ -3387,7 +3387,7 @@ try_find_index: "Note that the internal storage type of ENUM and SET changed in\n" "tables created with >= InnoDB-4.1.12, and such columns in old tables\n" "cannot be referenced by such columns in new tables.\n" -"See http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html\n" +"See http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html\n" "for correct foreign key definition.\n", start_of_latest_foreign); mutex_exit(&dict_foreign_err_mutex); @@ -3941,8 +3941,7 @@ dict_update_statistics_low( fprintf(stderr, " InnoDB: cannot calculate statistics for table %s\n" "InnoDB: because the .ibd file is missing. For help, please refer to\n" -"InnoDB: " -"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n", +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n", table->name); return; diff --git a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c index b2935a119a5..722ffc12743 100644 --- a/storage/innobase/fil/fil0fil.c +++ b/storage/innobase/fil/fil0fil.c @@ -251,9 +251,6 @@ struct fil_system_struct { initialized. */ fil_system_t* fil_system = NULL; -/* The tablespace memory cache hash table size */ -#define FIL_SYSTEM_HASH_SIZE 50 /* TODO: make bigger! */ - /************************************************************************ NOTE: you must call fil_mutex_enter_and_prepare_for_io() first! @@ -1323,11 +1320,17 @@ fil_init( /*=====*/ ulint max_n_open) /* in: max number of open files */ { + ulint hash_size; + ut_a(fil_system == NULL); - /*printf("Initializing the tablespace cache with max %lu open files\n", - max_n_open); */ - fil_system = fil_system_create(FIL_SYSTEM_HASH_SIZE, max_n_open); + if (srv_file_per_table) { + hash_size = 50000; + } else { + hash_size = 5000; + } + + fil_system = fil_system_create(hash_size, max_n_open); } /*********************************************************************** @@ -2560,7 +2563,7 @@ fil_reset_too_high_lsns( ut_print_timestamp(stderr); fprintf(stderr, -" InnoDB: Flush lsn in the tablespace file %lu to be imported\n" +" InnoDB: Flush lsn in the tablespace file %lu to be imported\n" "InnoDB: is %lu %lu, which exceeds current system lsn %lu %lu.\n" "InnoDB: We reset the lsn's in the file ", (ulong) space_id, @@ -2685,8 +2688,7 @@ fil_open_single_table_tablespace( "InnoDB: It is also possible that this is a temporary table #sql...,\n" "InnoDB: and MySQL removed the .ibd file for this.\n" "InnoDB: Please refer to\n" -"InnoDB:" -" http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n" "InnoDB: for how to resolve the issue.\n", stderr); mem_free(filepath); @@ -2725,8 +2727,7 @@ fil_open_single_table_tablespace( "InnoDB: Have you moved InnoDB .ibd files around without using the\n" "InnoDB: commands DISCARD TABLESPACE and IMPORT TABLESPACE?\n" "InnoDB: Please refer to\n" -"InnoDB:" -" http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n" "InnoDB: for how to resolve the issue.\n", (ulong) space_id, (ulong) id); ret = FALSE; @@ -3373,8 +3374,7 @@ fil_space_for_table_exists_in_mem( error_exit: fputs( "InnoDB: Please refer to\n" -"InnoDB:" -" http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n" "InnoDB: for how to resolve the issue.\n", stderr); mem_free(path); diff --git a/storage/innobase/fsp/fsp0fsp.c b/storage/innobase/fsp/fsp0fsp.c index 43c7ba005cb..9b0406a1c26 100644 --- a/storage/innobase/fsp/fsp0fsp.c +++ b/storage/innobase/fsp/fsp0fsp.c @@ -2988,7 +2988,7 @@ fseg_free_page_low( crash: fputs( "InnoDB: Please refer to\n" -"InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n" "InnoDB: about forcing recovery.\n", stderr); ut_error; } diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c index f1ae43033bd..4e38e1f0353 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.c +++ b/storage/innobase/ibuf/ibuf0ibuf.c @@ -373,7 +373,6 @@ ibuf_init_at_db_start(void) ibuf->max_size = buf_pool_get_curr_size() / UNIV_PAGE_SIZE / IBUF_POOL_SIZE_PER_MAX_SIZE; - ibuf->meter = IBUF_THRESHOLD + 1; UT_LIST_INIT(ibuf->data_list); @@ -3517,21 +3516,9 @@ ibuf_print( data = UT_LIST_GET_FIRST(ibuf->data_list); while (data) { - fprintf(file, - "Ibuf for space %lu: size %lu, free list len %lu, seg size %lu,", - (ulong) data->space, (ulong) data->size, - (ulong) data->free_list_len, - (ulong) data->seg_size); - - if (data->empty) { - fputs(" is empty\n", file); - } else { - fputs(" is not empty\n", file); - } fprintf(file, - "Ibuf for space %lu: size %lu, free list len %lu, seg size %lu,\n" - "%lu inserts, %lu merged recs, %lu merges\n", - (ulong) data->space, + "Ibuf: size %lu, free list len %lu, seg size %lu,\n" + "%lu inserts, %lu merged recs, %lu merges\n", (ulong) data->size, (ulong) data->free_list_len, (ulong) data->seg_size, diff --git a/storage/innobase/include/btr0cur.ic b/storage/innobase/include/btr0cur.ic index a199c3d4d32..7fbdf6035b0 100644 --- a/storage/innobase/include/btr0cur.ic +++ b/storage/innobase/include/btr0cur.ic @@ -52,10 +52,7 @@ btr_cur_get_page( /* out: pointer to page */ btr_cur_t* cursor) /* in: tree cursor */ { - page_t* page = buf_frame_align(page_cur_get_rec(&(cursor->page_cur))); - ut_ad(!!page_is_comp(page) - == dict_table_is_comp(cursor->index->table)); - return(page); + return(buf_frame_align(page_cur_get_rec(&(cursor->page_cur)))); } /************************************************************* diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic index 15187c03636..3c7a64cbcb0 100644 --- a/storage/innobase/include/buf0buf.ic +++ b/storage/innobase/include/buf0buf.ic @@ -216,8 +216,8 @@ buf_block_align( "InnoDB: Error: trying to access a stray pointer %p\n" "InnoDB: buf pool start is at %p, end at %p\n" "InnoDB: Probable reason is database corruption or memory\n" -"InnoDB: corruption. If this happens in an InnoDB database recovery,\n" -"InnoDB: you can look from section 6.1 at http://www.innodb.com/ibman.html\n" +"InnoDB: corruption. If this happens in an InnoDB database recovery, see\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n" "InnoDB: how to force recovery.\n", ptr, frame_zero, buf_pool->high_end); @@ -252,8 +252,8 @@ buf_frame_align( "InnoDB: Error: trying to access a stray pointer %p\n" "InnoDB: buf pool start is at %p, end at %p\n" "InnoDB: Probable reason is database corruption or memory\n" -"InnoDB: corruption. If this happens in an InnoDB database recovery,\n" -"InnoDB: you can look from section 6.1 at http://www.innodb.com/ibman.html\n" +"InnoDB: corruption. If this happens in an InnoDB database recovery, see\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n" "InnoDB: how to force recovery.\n", ptr, buf_pool->frame_zero, buf_pool->high_end); diff --git a/storage/innobase/include/ibuf0ibuf.ic b/storage/innobase/include/ibuf0ibuf.ic index 4eea8f41e32..7e75fccc160 100644 --- a/storage/innobase/include/ibuf0ibuf.ic +++ b/storage/innobase/include/ibuf0ibuf.ic @@ -39,19 +39,11 @@ struct ibuf_data_struct{ ulint n_merged_recs;/* number of records merged */ }; -/* If the ibuf meter exceeds this value, then the suitable inserts are made to -the insert buffer instead of directly to the disk page */ -#define IBUF_THRESHOLD 50 - struct ibuf_struct{ ulint size; /* current size of the ibuf index trees in pages */ ulint max_size; /* recommended maximum size in pages for the ibuf index tree */ - ulint meter; /* heuristic meter which measures - desirability of doing inserts to the - insert buffer instead of directly to - the disk page */ UT_LIST_BASE_NODE_T(ibuf_data_t) data_list; /* list of ibuf data structs for each tablespace */ @@ -88,8 +80,7 @@ ibuf_should_try( decide */ { if (!(index->type & DICT_CLUSTERED) - && (ignore_sec_unique || !(index->type & DICT_UNIQUE)) - && ibuf->meter > IBUF_THRESHOLD) { + && (ignore_sec_unique || !(index->type & DICT_UNIQUE))) { ibuf_flush_count++; diff --git a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c index db6b8fabf6f..2351c6055de 100644 --- a/storage/innobase/log/log0log.c +++ b/storage/innobase/log/log0log.c @@ -720,7 +720,7 @@ failure: "InnoDB: To get mysqld to start up, set innodb_thread_concurrency in my.cnf\n" "InnoDB: to a lower value, for example, to 8. After an ERROR-FREE shutdown\n" "InnoDB: of mysqld you can adjust the size of ib_logfiles, as explained in\n" -"InnoDB: http://dev.mysql.com/doc/mysql/en/Adding_and_removing.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/adding-and-removing.html\n" "InnoDB: Cannot continue operation. Calling exit(1).\n", (ulong)srv_thread_concurrency); diff --git a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c index 63a90f05212..8150dba165c 100644 --- a/storage/innobase/log/log0recv.c +++ b/storage/innobase/log/log0recv.c @@ -542,7 +542,7 @@ recv_find_max_checkpoint( "InnoDB: the problem may be that during an earlier attempt you managed\n" "InnoDB: to create the InnoDB data files, but log file creation failed.\n" "InnoDB: If that is the case, please refer to\n" -"InnoDB: http://dev.mysql.com/doc/mysql/en/Error_creating_InnoDB.html\n"); +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/error-creating-innodb.html\n"); return(DB_ERROR); } @@ -1962,7 +1962,7 @@ recv_report_corrupt_log( "InnoDB: far enough in recovery! Please run CHECK TABLE\n" "InnoDB: on your InnoDB tables to check that they are ok!\n" "InnoDB: If mysqld crashes after this recovery, look at\n" - "InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html\n" + "InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n" "InnoDB: about forcing recovery.\n", stderr); fflush(stderr); diff --git a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c index 74905ce06dd..6cd44a5ad08 100644 --- a/storage/innobase/os/os0file.c +++ b/storage/innobase/os/os0file.c @@ -248,7 +248,7 @@ os_file_get_last_error( fprintf(stderr, "InnoDB: Some operating system error numbers are described at\n" "InnoDB: " - "http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n"); + "http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html\n"); } } @@ -295,7 +295,7 @@ os_file_get_last_error( fprintf(stderr, "InnoDB: Some operating system error numbers are described at\n" "InnoDB: " - "http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n"); + "http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html\n"); } } @@ -688,7 +688,7 @@ next_file: /* TODO: test Windows symlinks */ /* TODO: MySQL has apparently its own symlink implementation in Windows, dbname.sym can redirect a database directory: -http://www.mysql.com/doc/en/Windows_symbolic_links.html */ +http://dev.mysql.com/doc/refman/5.1/en/windows-symbolic-links.html */ info->type = OS_FILE_TYPE_LINK; } else if (lpFindFileData->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { @@ -2343,7 +2343,7 @@ retry: "InnoDB: offset %lu %lu. Operating system error number %lu.\n" "InnoDB: Some operating system error numbers are described at\n" "InnoDB: " -"http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n", +"http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html\n", name, (ulong) offset_high, (ulong) offset, (ulong) GetLastError()); @@ -2408,7 +2408,7 @@ retry: fprintf(stderr, "InnoDB: Some operating system error numbers are described at\n" "InnoDB: " -"http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n"); +"http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html\n"); os_has_said_disk_full = TRUE; } @@ -2444,7 +2444,7 @@ retry: fprintf(stderr, "InnoDB: Some operating system error numbers are described at\n" "InnoDB: " -"http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n"); +"http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html\n"); os_has_said_disk_full = TRUE; } diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c index 5f4a882f4a8..f2d501e0ba7 100644 --- a/storage/innobase/row/row0mysql.c +++ b/storage/innobase/row/row0mysql.c @@ -54,27 +54,6 @@ static const char S_innodb_tablespace_monitor[] = "innodb_tablespace_monitor"; static const char S_innodb_table_monitor[] = "innodb_table_monitor"; static const char S_innodb_mem_validate[] = "innodb_mem_validate"; -/* Name suffix for recovered orphaned temporary tables */ -static const char S_recover_innodb_tmp_table[] = "_recover_innodb_tmp_table"; -/*********************************************************************** -Determine if the given name ends in the suffix reserved for recovered -orphaned temporary tables. */ -static -ibool -row_mysql_is_recovered_tmp_table( -/*=============================*/ - /* out: TRUE if table name ends in - the reserved suffix */ - const char* name) -{ - ulint namelen = strlen(name) + 1; - return(namelen >= sizeof S_recover_innodb_tmp_table - && !memcmp(name + namelen - - sizeof S_recover_innodb_tmp_table, - S_recover_innodb_tmp_table, - sizeof S_recover_innodb_tmp_table)); -} - /*********************************************************************** Determine if the given name is a name reserved for MySQL system tables. */ static @@ -550,7 +529,7 @@ handle_new_error: "InnoDB: tables and recreate the whole InnoDB tablespace.\n" "InnoDB: If the mysqld server crashes after the startup or when\n" "InnoDB: you dump the tables, look at\n" - "InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html" + "InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html" " for help.\n", stderr); } else { @@ -1083,7 +1062,7 @@ row_insert_for_mysql( "InnoDB: Have you deleted the .ibd file from the database directory under\n" "InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n" "InnoDB: Look from\n" -"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n" "InnoDB: how you can resolve the problem.\n", prebuilt->table->name); return(DB_ERROR); @@ -1319,7 +1298,7 @@ row_update_for_mysql( "InnoDB: Have you deleted the .ibd file from the database directory under\n" "InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n" "InnoDB: Look from\n" -"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n" "InnoDB: how you can resolve the problem.\n", prebuilt->table->name); return(DB_ERROR); @@ -1659,48 +1638,6 @@ row_get_mysql_key_number_for_index( return(i); } -/************************************************************************* -Recovers an orphaned tmp table inside InnoDB by renaming it. In the table -name #sql becomes rsql, and "_recover_innodb_tmp_table" is catenated to -the end of name. table->name should be of the form -"dbname/rsql..._recover_innodb_tmp_table". This renames a table whose -name is "#sql..." */ -static -int -row_mysql_recover_tmp_table( -/*========================*/ - /* out: error code or DB_SUCCESS */ - dict_table_t* table, /* in: table definition */ - trx_t* trx) /* in: transaction handle */ -{ - const char* ptr = strstr(table->name, "/rsql"); - - if (!ptr) { - /* table name does not begin with "/rsql" */ - dict_mem_table_free(table); - trx_commit_for_mysql(trx); - - return(DB_ERROR); - } - else { - int status; - int namelen = (int) strlen(table->name); - char* old_name = mem_strdupl(table->name, namelen); - /* replace "rsql" with "#sql" */ - old_name[ptr - table->name + 1] = '#'; - /* remove "_recover_innodb_tmp_table" suffix */ - ut_ad(namelen > (int) sizeof S_recover_innodb_tmp_table); - ut_ad(!strcmp(old_name + namelen + 1 - - sizeof S_recover_innodb_tmp_table, - S_recover_innodb_tmp_table)); - old_name[namelen + 1 - sizeof S_recover_innodb_tmp_table] = 0; - status = row_rename_table_for_mysql(old_name, - table->name, trx); - mem_free(old_name); - return(status); - } -} - /************************************************************************* Locks the data dictionary in shared mode from modifications, for performing foreign key check, rollback, or other operation invisible to MySQL. */ @@ -1845,18 +1782,6 @@ row_create_table_for_mysql( trx_start_if_not_started(trx); - if (row_mysql_is_recovered_tmp_table(table->name)) { - - /* MySQL prevents accessing of tables whose name begins - with #sql, that is temporary tables. If mysqld crashes in - the middle of an ALTER TABLE, we may get an orphaned - #sql-table in the tablespace. We have here a special - mechanism to recover such tables by renaming them to - rsql... */ - - return(row_mysql_recover_tmp_table(table, trx)); - } - /* The table name is prefixed with the database name and a '/'. Certain table names starting with 'innodb_' have their special meaning regardless of the database name. Thus, we need to @@ -1968,8 +1893,8 @@ row_create_table_for_mysql( "InnoDB: Then MySQL thinks the table exists, and DROP TABLE will\n" "InnoDB: succeed.\n" "InnoDB: You can look for further help from\n" - "InnoDB: http://dev.mysql.com/doc/mysql/en/" - "InnoDB_troubleshooting_datadict.html\n", stderr); +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n", + stderr); } /* We may also get err == DB_ERROR if the .ibd file for the @@ -2063,11 +1988,6 @@ row_create_index_for_mysql( } } - if (row_mysql_is_recovered_tmp_table(index->table_name)) { - - return(DB_SUCCESS); - } - heap = mem_heap_create(512); trx->dict_operation = TRUE; @@ -2142,11 +2062,6 @@ row_table_add_foreign_constraints( trx_start_if_not_started(trx); - if (row_mysql_is_recovered_tmp_table(name)) { - - return(DB_SUCCESS); - } - trx->dict_operation = TRUE; err = dict_create_foreign_constraints(trx, sql_string, name, @@ -3054,8 +2969,8 @@ row_drop_table_for_mysql( "InnoDB: Have you copied the .frm file of the table to the\n" "InnoDB: MySQL database directory from another database?\n" "InnoDB: You can look for further help from\n" - "InnoDB: http://dev.mysql.com/doc/mysql/en/" - "InnoDB_troubleshooting_datadict.html\n", stderr); +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n", + stderr); goto funct_exit; } @@ -3495,7 +3410,6 @@ row_rename_table_for_mysql( mem_heap_t* heap = NULL; const char** constraints_to_drop = NULL; ulint n_constraints_to_drop = 0; - ibool recovering_temp_table = FALSE; ibool old_is_tmp, new_is_tmp; pars_info_t* info = NULL; @@ -3533,15 +3447,10 @@ row_rename_table_for_mysql( old_is_tmp = row_is_mysql_tmp_table_name(old_name); new_is_tmp = row_is_mysql_tmp_table_name(new_name); - if (row_mysql_is_recovered_tmp_table(new_name)) { + /* Serialize data dictionary operations with dictionary mutex: + no deadlocks can occur then in these operations */ - recovering_temp_table = TRUE; - } else { - /* Serialize data dictionary operations with dictionary mutex: - no deadlocks can occur then in these operations */ - - row_mysql_lock_data_dictionary(trx); - } + row_mysql_lock_data_dictionary(trx); table = dict_table_get_low(old_name); @@ -3556,8 +3465,8 @@ row_rename_table_for_mysql( "InnoDB: Have you copied the .frm file of the table to the\n" "InnoDB: MySQL database directory from another database?\n" "InnoDB: You can look for further help from\n" - "InnoDB: http://dev.mysql.com/doc/mysql/en/" - "InnoDB_troubleshooting_datadict.html\n", stderr); +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n", + stderr); goto funct_exit; } @@ -3570,8 +3479,8 @@ row_rename_table_for_mysql( fputs( " does not have an .ibd file in the database directory.\n" "InnoDB: You can look for further help from\n" - "InnoDB: http://dev.mysql.com/doc/mysql/en/" - "InnoDB_troubleshooting_datadict.html\n", stderr); +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n", + stderr); goto funct_exit; } @@ -3719,8 +3628,7 @@ end: fputs(" to it.\n" "InnoDB: Have you deleted the .frm file and not used DROP TABLE?\n" "InnoDB: You can look for further help from\n" - "InnoDB: http://dev.mysql.com/doc/mysql/en/" - "InnoDB_troubleshooting_datadict.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n" "InnoDB: If table ", stderr); ut_print_name(stderr, trx, TRUE, new_name); fputs( @@ -3748,8 +3656,8 @@ end: trx_general_rollback_for_mysql(trx, FALSE, NULL); trx->error_state = DB_SUCCESS; ut_print_timestamp(stderr); - fputs(" InnoDB: Error in table rename, cannot rename ", - stderr); + fputs( +" InnoDB: Error in table rename, cannot rename ", stderr); ut_print_name(stderr, trx, TRUE, old_name); fputs(" to ", stderr); ut_print_name(stderr, trx, TRUE, new_name); @@ -3797,10 +3705,7 @@ end: funct_exit: trx_commit_for_mysql(trx); - - if (!recovering_temp_table) { - row_mysql_unlock_data_dictionary(trx); - } + row_mysql_unlock_data_dictionary(trx); if (UNIV_LIKELY_NULL(heap)) { mem_heap_free(heap); @@ -3968,7 +3873,7 @@ row_check_table_for_mysql( "InnoDB: Have you deleted the .ibd file from the database directory under\n" "InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n" "InnoDB: Look from\n" -"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n" "InnoDB: how you can resolve the problem.\n", prebuilt->table->name); return(DB_ERROR); diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index f79bda5d6d8..251ee95886f 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -3245,7 +3245,7 @@ row_search_for_mysql( "InnoDB: Have you deleted the .ibd file from the database directory under\n" "InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n" "InnoDB: Look from\n" -"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n" "InnoDB: how you can resolve the problem.\n", prebuilt->table->name); diff --git a/storage/innobase/row/row0vers.c b/storage/innobase/row/row0vers.c index ab3b6385146..07b75a34347 100644 --- a/storage/innobase/row/row0vers.c +++ b/storage/innobase/row/row0vers.c @@ -553,7 +553,7 @@ row_vers_build_for_semi_consistent_read( mem_heap_t* heap = NULL; byte* buf; ulint err; - dulint rec_trx_id; + dulint rec_trx_id = ut_dulint_create(0, 0); ut_ad(index->type & DICT_CLUSTERED); ut_ad(mtr_memo_contains(mtr, buf_block_align(rec), MTR_MEMO_PAGE_X_FIX) diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c index 205b54004ce..8346203f3f7 100644 --- a/storage/innobase/srv/srv0start.c +++ b/storage/innobase/srv/srv0start.c @@ -1691,7 +1691,7 @@ NetWare. */ "InnoDB: You have now successfully upgraded to the multiple tablespaces\n" "InnoDB: format. You should NOT DOWNGRADE to an earlier version of\n" "InnoDB: InnoDB! But if you absolutely need to downgrade, see\n" -"InnoDB: http://dev.mysql.com/doc/mysql/en/Multiple_tablespaces.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/multiple-tablespaces.html\n" "InnoDB: for instructions.\n"); } diff --git a/storage/innobase/ut/ut0dbg.c b/storage/innobase/ut/ut0dbg.c index a9391cd3adc..87960b98556 100644 --- a/storage/innobase/ut/ut0dbg.c +++ b/storage/innobase/ut/ut0dbg.c @@ -42,7 +42,7 @@ ut_dbg_assertion_failed( { ut_print_timestamp(stderr); fprintf(stderr, - "InnoDB: Assertion failure in thread %lu" + " InnoDB: Assertion failure in thread %lu" " in file %s line %lu\n", os_thread_pf(os_thread_get_curr_id()), file, line); if (expr) { @@ -56,7 +56,7 @@ ut_dbg_assertion_failed( "InnoDB: If you get repeated assertion failures or crashes, even\n" "InnoDB: immediately after the mysqld startup, there may be\n" "InnoDB: corruption in the InnoDB tablespace. Please refer to\n" -"InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n" "InnoDB: about forcing recovery.\n", stderr); #if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT) ut_dbg_stop_threads = TRUE; From 60f1320e1ba8e731ffb61bd9c7c26920aee144fc Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Aug 2006 10:30:22 +0200 Subject: [PATCH 2/7] Move initializations of environment variables that are constant during the whole testrun to 'environment_setup' Split out functions that detects if we need master or slave restarts mysql-test/lib/mtr_process.pl: Fix spelling error mysql-test/mysql-test-run.pl: Move initializations of environment variables that are constant during the whole testrun to 'environment_setup' Split out functions 'run_testcase_need_master_restart' and 'run_testcase_need_slave_restart' --- mysql-test/lib/mtr_process.pl | 5 +- mysql-test/mysql-test-run.pl | 531 ++++++++++++++++++++-------------- 2 files changed, 311 insertions(+), 225 deletions(-) diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index e47b0e4287c..a71a1e7d2e4 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -633,7 +633,7 @@ sub mtr_check_stop_servers ($) { } else { - mtr_verbose("All ports where free, continuing"); + mtr_verbose("All ports were free, continuing"); } } } @@ -896,6 +896,7 @@ sub check_expected_crash_and_restart($) sub mtr_record_dead_children () { + my $process_died= 0; my $ret_pid; # Wait without blockinng to see if any processes had died @@ -904,7 +905,9 @@ sub mtr_record_dead_children () { { mtr_warning("mtr_record_dead_children: $ret_pid"); mark_process_dead($ret_pid); + $process_died= 1; } + return $process_died; } sub start_reap_all { diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 5d6f39bc882..be1c72e9582 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -357,7 +357,7 @@ sub initialize_servers (); sub mysql_install_db (); sub install_db ($$); sub run_testcase ($); -sub run_testcase_stop_servers ($); +sub run_testcase_stop_servers ($$$); sub run_testcase_start_servers ($); sub report_failure_and_restart ($); sub do_before_start_master ($$); @@ -1296,9 +1296,19 @@ sub executable_setup () { } +sub generate_cmdline_mysqldump ($) { + my($mysqld) = @_; + return + "$exe_mysqldump --no-defaults -uroot " . + "--port=$mysqld->{'port'} " . + "--socket=$mysqld->{'path_sock'} --password="; +} + + ############################################################################## # -# Set environment to be used by childs of this process +# Set environment to be used by childs of this process for +# things that are constant duting the whole lifetime of mysql-test-run.pl # ############################################################################## @@ -1323,18 +1333,11 @@ sub environment_setup () { ($ENV{'DYLD_LIBRARY_PATH'} ? ":$ENV{'DYLD_LIBRARY_PATH'}" : ""); } - # -------------------------------------------------------------------------- - # Add the path where mysqld will find udf_example.so - # -------------------------------------------------------------------------- - $ENV{'LD_LIBRARY_PATH'}= - ($lib_udf_example ? dirname($lib_udf_example) : "") . - ($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : ""); - - # -------------------------------------------------------------------------- # Also command lines in .opt files may contain env vars # -------------------------------------------------------------------------- + $ENV{'CHARSETSDIR'}= $path_charsetsdir; $ENV{'UMASK'}= "0660"; # The octal *string* $ENV{'UMASK_DIR'}= "0770"; # The octal *string* $ENV{'LC_COLLATE'}= "C"; @@ -1352,10 +1355,30 @@ sub environment_setup () { # $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME $ENV{'MYSQL_TCP_PORT'}= 3306; - $ENV{'NDBCLUSTER_PORT'}= $opt_ndbcluster_port; - $ENV{'NDBCLUSTER_PORT_SLAVE'}=$opt_ndbcluster_port_slave; - $ENV{'NDB_STATUS_OK'}= "YES"; + $ENV{MTR_BUILD_THREAD}= 0 unless $ENV{MTR_BUILD_THREAD}; # Set if not set + # ---------------------------------------------------- + # Setup env for NDB + # ---------------------------------------------------- + $ENV{'NDB_MGM'}= $exe_ndb_mgm; + + $ENV{'NDBCLUSTER_PORT'}= $opt_ndbcluster_port; + $ENV{'NDBCLUSTER_PORT_SLAVE'}= $opt_ndbcluster_port_slave; + + $ENV{'NDB_STATUS_OK'}= $clusters->[0]->{'installed_ok'}; + $ENV{'NDB_SLAVE_STATUS_OK'}= $clusters->[0]->{'installed_ok'};; + $ENV{'NDB_EXTRA_TEST'}= $opt_ndb_extra_test; + + $ENV{'NDB_BACKUP_DIR'}= $clusters->[0]->{'data_dir'}; + $ENV{'NDB_DATA_DIR'}= $clusters->[0]->{'data_dir'}; + $ENV{'NDB_TOOLS_DIR'}= $path_ndb_tools_dir; + $ENV{'NDB_TOOLS_OUTPUT'}= $file_ndb_testrun_log; + $ENV{'NDB_CONNECTSTRING'}= $opt_ndbconnectstring; + + + # ---------------------------------------------------- + # Setup env for IM + # ---------------------------------------------------- $ENV{'IM_EXE'}= $exe_im; $ENV{'IM_PATH_PID'}= $instance_manager->{path_pid}; $ENV{'IM_PATH_ANGEL_PID'}= $instance_manager->{path_angel_pid}; @@ -1370,9 +1393,168 @@ sub environment_setup () { $ENV{'IM_MYSQLD2_PORT'}= $instance_manager->{instances}->[1]->{port}; $ENV{'IM_MYSQLD2_PATH_PID'}=$instance_manager->{instances}->[1]->{path_pid}; - $ENV{MTR_BUILD_THREAD}= 0 unless $ENV{MTR_BUILD_THREAD}; # Set if not set + # ---------------------------------------------------- + # Setup env so childs can execute mysqlcheck + # ---------------------------------------------------- + my $cmdline_mysqlcheck= + "$exe_mysqlcheck --no-defaults -uroot " . + "--port=$master->[0]->{'port'} " . + "--socket=$master->[0]->{'path_sock'} --password="; + if ( $opt_debug ) + { + $cmdline_mysqlcheck .= + " --debug=d:t:A,$opt_vardir_trace/log/mysqlcheck.trace"; + } + $ENV{'MYSQL_CHECK'}= $cmdline_mysqlcheck; + + # ---------------------------------------------------- + # Setup env to childs can execute myqldump + # ---------------------------------------------------- + my $cmdline_mysqldump= generate_cmdline_mysqldump($master->[0]); + my $cmdline_mysqldumpslave= generate_cmdline_mysqldump($slave->[0]); + + if ( $opt_debug ) + { + $cmdline_mysqldump .= + " --debug=d:t:A,$opt_vardir_trace/log/mysqldump-master.trace"; + $cmdline_mysqldumpslave .= + " --debug=d:t:A,$opt_vardir_trace/log/mysqldump-slave.trace"; + } + $ENV{'MYSQL_DUMP'}= $cmdline_mysqldump; + $ENV{'MYSQL_DUMP_SLAVE'}= $cmdline_mysqldumpslave; + + + # ---------------------------------------------------- + # Setup env so childs can execute mysqlslap + # ---------------------------------------------------- + unless ( $glob_win32 ) + { + my $cmdline_mysqlslap= + "$exe_mysqlslap -uroot " . + "--port=$master->[0]->{'port'} " . + "--socket=$master->[0]->{'path_sock'} --password= " . + "--lock-directory=$opt_tmpdir"; + + if ( $opt_debug ) + { + $cmdline_mysqlslap .= + " --debug=d:t:A,$opt_vardir_trace/log/mysqlslap.trace"; + } + $ENV{'MYSQL_SLAP'}= $cmdline_mysqlslap; + } + + # ---------------------------------------------------- + # Setup env so childs can execute mysqlimport + # ---------------------------------------------------- + my $cmdline_mysqlimport= + "$exe_mysqlimport -uroot " . + "--port=$master->[0]->{'port'} " . + "--socket=$master->[0]->{'path_sock'} --password="; + + if ( $opt_debug ) + { + $cmdline_mysqlimport .= + " --debug=d:t:A,$opt_vardir_trace/log/mysqlimport.trace"; + } + $ENV{'MYSQL_IMPORT'}= $cmdline_mysqlimport; + + + # ---------------------------------------------------- + # Setup env so childs can execute mysqlshow + # ---------------------------------------------------- + my $cmdline_mysqlshow= + "$exe_mysqlshow -uroot " . + "--port=$master->[0]->{'port'} " . + "--socket=$master->[0]->{'path_sock'} --password="; + + if ( $opt_debug ) + { + $cmdline_mysqlshow .= + " --debug=d:t:A,$opt_vardir_trace/log/mysqlshow.trace"; + } + $ENV{'MYSQL_SHOW'}= $cmdline_mysqlshow; + + # ---------------------------------------------------- + # Setup env so childs can execute mysqlbinlog + # ---------------------------------------------------- + my $cmdline_mysqlbinlog= + "$exe_mysqlbinlog" . + " --no-defaults --local-load=$opt_tmpdir" . + " --character-sets-dir=$path_charsetsdir"; + + if ( $opt_debug ) + { + $cmdline_mysqlbinlog .= + " --debug=d:t:A,$opt_vardir_trace/log/mysqlbinlog.trace"; + } + $ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog; + + # ---------------------------------------------------- + # Setup env so childs can execute mysql + # ---------------------------------------------------- + my $cmdline_mysql= + "$exe_mysql --no-defaults --host=localhost --user=root --password= " . + "--port=$master->[0]->{'port'} " . + "--socket=$master->[0]->{'path_sock'}"; + + $ENV{'MYSQL'}= $cmdline_mysql; + + # ---------------------------------------------------- + # Setup env so childs can execute mysql_client_test + # ---------------------------------------------------- + my $cmdline_mysql_client_test= + "$exe_mysql_client_test --no-defaults --testcase --user=root --silent " . + "--port=$master->[0]->{'port'} " . + "--vardir=$opt_vardir " . + "--socket=$master->[0]->{'path_sock'}"; + + if ( $opt_debug ) + { + $cmdline_mysql_client_test .= + " --debug=d:t:A,$opt_vardir_trace/log/mysql_client_test.trace"; + } + + if ( $glob_use_embedded_server ) + { + $cmdline_mysql_client_test.= + " -A --language=$path_language" . + " -A --datadir=$slave->[0]->{'path_myddir'}" . + " -A --character-sets-dir=$path_charsetsdir"; + } + $ENV{'MYSQL_CLIENT_TEST'}= $cmdline_mysql_client_test; + + + # ---------------------------------------------------- + # Setup env so childs can execute mysql_fix_system_tables + # ---------------------------------------------------- + my $cmdline_mysql_fix_system_tables= + "$exe_mysql_fix_system_tables --no-defaults --host=localhost --user=root --password= " . + "--basedir=$glob_basedir --bindir=$path_client_bindir --verbose " . + "--port=$master->[0]->{'port'} " . + "--socket=$master->[0]->{'path_sock'}"; + + $ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables; + + # ---------------------------------------------------- + # Setup env so childs can execute my_print_defaults + # ---------------------------------------------------- + $ENV{'MYSQL_MY_PRINT_DEFAULTS'}= $exe_my_print_defaults; + + # ---------------------------------------------------- + # Add the path where mysqld will find udf_example.so + # ---------------------------------------------------- + $ENV{'UDF_EXAMPLE_LIB'}= + ($lib_udf_example ? basename($lib_udf_example) : ""); + + $ENV{'LD_LIBRARY_PATH'}= + ($lib_udf_example ? dirname($lib_udf_example) : "") . + ($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : ""); + + + # ---------------------------------------------------- # We are nice and report a bit about our settings + # ---------------------------------------------------- if (!$opt_extern) { print "Using MTR_BUILD_THREAD = $ENV{MTR_BUILD_THREAD}\n"; @@ -2284,15 +2466,19 @@ sub run_testcase ($) { return; } - run_testcase_stop_servers($tinfo); + my $master_restart= run_testcase_need_master_restart($tinfo); + my $slave_restart= run_testcase_need_slave_restart($tinfo); + + if ($master_restart or $slave_restart) + { + run_testcase_stop_servers($tinfo, $master_restart, $slave_restart); + } # ---------------------------------------------------------------------- # Prepare to start masters. Even if we use embedded, we want to run # the preparation. # ---------------------------------------------------------------------- - $ENV{'TZ'}= $tinfo->{'timezone'}; - mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n"); if ( $master->[1]->{'pid'} ) { @@ -2303,12 +2489,15 @@ sub run_testcase ($) { # If any mysqld servers running died, we have to know # ---------------------------------------------------------------------- - mtr_record_dead_children(); + my $died= mtr_record_dead_children(); # ---------------------------------------------------------------------- # Start masters needed by the testcase # ---------------------------------------------------------------------- - run_testcase_start_servers($tinfo); + if ($died or $master_restart or $slave_restart) + { + run_testcase_start_servers($tinfo); + } # ---------------------------------------------------------------------- # If --start-and-exit or --start-dirty given, stop here to let user manually @@ -2325,8 +2514,6 @@ sub run_testcase ($) { # Run the test case # ---------------------------------------------------------------------- - mtr_report_test_name($tinfo); - { # remove the old reject file if ( $opt_suite eq "main" ) @@ -2340,6 +2527,7 @@ sub run_testcase ($) { unlink($path_timefile); my $res= run_mysqltest($tinfo); + mtr_report_test_name($tinfo); if ( $res == 0 ) { mtr_report_test_passed($tinfo); @@ -2993,24 +3181,9 @@ sub stop_all_servers () { } -# ---------------------------------------------------------------------- -# If not using a running servers we may need to stop and restart. -# We restart in the case we have initiation scripts, server options -# etc to run. But we also restart again after the test first restart -# and test is run, to get back to normal server settings. -# -# To make the code a bit more clean, we actually only stop servers -# here, and mark this to be done. Then a generic "start" part will -# start up the needed servers again. -# ---------------------------------------------------------------------- - -sub run_testcase_stop_servers($) { - my $tinfo= shift; - - if ( $glob_use_running_server || $glob_use_embedded_server ) - { - return; - } +sub run_testcase_need_master_restart($) +{ + my ($tinfo)= @_; # We try to find out if we are to restart the master(s) my $do_restart= 0; # Assumes we don't have to @@ -3067,6 +3240,91 @@ sub run_testcase_stop_servers($) { join(" ", @{$master->[0]->{'start_opts'}}) . "'" ); } + return $do_restart; +} + +sub run_testcase_need_slave_restart($) +{ + my ($tinfo)= @_; + + # We try to find out if we are to restart the slaves + my $do_slave_restart= 0; # Assumes we don't have to + + # FIXME only restart slave when necessary + $do_slave_restart= 1; + +# if ( ! $slave->[0]->{'pid'} ) +# { +# # mtr_verbose("Slave not started, no need to check slave restart"); +# } +# elsif ( $do_restart ) +# { +# $do_slave_restart= 1; # Always restart if master restart +# mtr_verbose("Restart slave because: Master restart"); +# } +# elsif ( $tinfo->{'slave_sh'} ) +# { +# $do_slave_restart= 1; # Always restart if script to run +# mtr_verbose("Restart slave because: Always restart if script to run"); +# } +# elsif ( ! $opt_skip_ndbcluster_slave and +# $tinfo->{'ndb_test'} == 0 and +# $clusters->[1]->{'pid'} != 0 ) +# { +# $do_slave_restart= 1; # Restart without slave cluster +# mtr_verbose("Restart slave because: Test does not need slave cluster"); +# } +# elsif ( ! $opt_with_ndbcluster_slave and +# $tinfo->{'ndb_test'} == 1 and +# $clusters->[1]->{'pid'} == 0 ) +# { +# $do_slave_restart= 1; # Restart with slave cluster +# mtr_verbose("Restart slave because: Test need slave cluster"); +# } +# elsif ( $tinfo->{'slave_restart'} ) +# { +# $do_slave_restart= 1; +# mtr_verbose("Restart slave because: slave_restart"); +# } +# elsif ( $slave->[0]->{'running_slave_is_special'} ) +# { +# $do_slave_restart= 1; +# mtr_verbose("Restart slave because: running_slave_is_special"); +# } +# # Check that running slave was started with same options +# # as the current test requires +# elsif (! mtr_same_opts($slave->[0]->{'start_opts'}, +# $tinfo->{'slave_opt'}) ) +# { +# $do_slave_restart= 1; +# mtr_verbose("Restart slave because: running with different options '" . +# join(" ", @{$tinfo->{'slave_opt'}}) . "' != '" . +# join(" ", @{$slave->[0]->{'start_opts'}}) . "'" ); +# } + + return $do_slave_restart; + +} + +# ---------------------------------------------------------------------- +# If not using a running servers we may need to stop and restart. +# We restart in the case we have initiation scripts, server options +# etc to run. But we also restart again after the test first restart +# and test is run, to get back to normal server settings. +# +# To make the code a bit more clean, we actually only stop servers +# here, and mark this to be done. Then a generic "start" part will +# start up the needed servers again. +# ---------------------------------------------------------------------- + +sub run_testcase_stop_servers($$$) { + my ($tinfo, $do_restart, $do_slave_restart)= @_; + + if ( $glob_use_running_server || $glob_use_embedded_server ) + { + return; + } + my $pid; my %admin_pids; # hash of admin processes that requests shutdown my @kill_pids; # list of processes to shutdown/kill @@ -3124,62 +3382,7 @@ sub run_testcase_stop_servers($) { } } - # We try to find out if we are to restart the slaves - my $do_slave_restart= 0; # Assumes we don't have to - - # FIXME only restaret when necessary - $do_slave_restart= 1; - -# if ( ! $slave->[0]->{'pid'} ) -# { -# # mtr_verbose("Slave not started, no need to check slave restart"); -# } -# elsif ( $do_restart ) -# { -# $do_slave_restart= 1; # Always restart if master restart -# mtr_verbose("Restart slave because: Master restart"); -# } -# elsif ( $tinfo->{'slave_sh'} ) -# { -# $do_slave_restart= 1; # Always restart if script to run -# mtr_verbose("Restart slave because: Always restart if script to run"); -# } -# elsif ( ! $opt_skip_ndbcluster_slave and -# $tinfo->{'ndb_test'} == 0 and -# $clusters->[1]->{'pid'} != 0 ) -# { -# $do_slave_restart= 1; # Restart without slave cluster -# mtr_verbose("Restart slave because: Test does not need slave cluster"); -# } -# elsif ( ! $opt_with_ndbcluster_slave and -# $tinfo->{'ndb_test'} == 1 and -# $clusters->[1]->{'pid'} == 0 ) -# { -# $do_slave_restart= 1; # Restart with slave cluster -# mtr_verbose("Restart slave because: Test need slave cluster"); -# } -# elsif ( $tinfo->{'slave_restart'} ) -# { -# $do_slave_restart= 1; -# mtr_verbose("Restart slave because: slave_restart"); -# } -# elsif ( $slave->[0]->{'running_slave_is_special'} ) -# { -# $do_slave_restart= 1; -# mtr_verbose("Restart slave because: running_slave_is_special"); -# } -# # Check that running slave was started with same options -# # as the current test requires -# elsif (! mtr_same_opts($slave->[0]->{'start_opts'}, -# $tinfo->{'slave_opt'}) ) -# { -# $do_slave_restart= 1; -# mtr_verbose("Restart slave because: running with different options '" . -# join(" ", @{$tinfo->{'slave_opt'}}) . "' != '" . -# join(" ", @{$slave->[0]->{'start_opts'}}) . "'" ); -# } - - if ( $do_slave_restart ) + if ( $do_restart || $do_slave_restart ) { delete $slave->[0]->{'running_slave_is_special'}; # Forget history @@ -3627,135 +3830,9 @@ sub run_check_testcase ($$) { } -sub generate_cmdline_mysqldump ($) { - my($info) = @_; - return - "$exe_mysqldump --no-defaults -uroot " . - "--port=$info->[0]->{'port'} " . - "--socket=$info->[0]->{'path_sock'} --password="; -} sub run_mysqltest ($) { - my $tinfo= shift; - my $cmdline_mysqlcheck= "$exe_mysqlcheck --no-defaults -uroot " . - "--port=$master->[0]->{'port'} " . - "--socket=$master->[0]->{'path_sock'} --password="; - if ( $opt_debug ) - { - $cmdline_mysqlcheck .= - " --debug=d:t:A,$opt_vardir_trace/log/mysqlcheck.trace"; - } - - my $cmdline_mysqldump= generate_cmdline_mysqldump $master; - my $cmdline_mysqldumpslave= generate_cmdline_mysqldump $slave; - - if ( $opt_debug ) - { - $cmdline_mysqldump .= - " --debug=d:t:A,$opt_vardir_trace/log/mysqldump-master.trace"; - $cmdline_mysqldumpslave .= - " --debug=d:t:A,$opt_vardir_trace/log/mysqldump-slave.trace"; - } - - my $cmdline_mysqlslap; - - unless ( $glob_win32 ) - { - $cmdline_mysqlslap= "$exe_mysqlslap -uroot " . - "--port=$master->[0]->{'port'} " . - "--socket=$master->[0]->{'path_sock'} --password= " . - "--lock-directory=$opt_tmpdir"; - if ( $opt_debug ) - { - $cmdline_mysqlslap .= - " --debug=d:t:A,$opt_vardir_trace/log/mysqlslap.trace"; - } - } - - my $cmdline_mysqlimport= "$exe_mysqlimport -uroot " . - "--port=$master->[0]->{'port'} " . - "--socket=$master->[0]->{'path_sock'} --password="; - if ( $opt_debug ) - { - $cmdline_mysqlimport .= - " --debug=d:t:A,$opt_vardir_trace/log/mysqlimport.trace"; - } - - my $cmdline_mysqlshow= "$exe_mysqlshow -uroot " . - "--port=$master->[0]->{'port'} " . - "--socket=$master->[0]->{'path_sock'} --password="; - if ( $opt_debug ) - { - $cmdline_mysqlshow .= - " --debug=d:t:A,$opt_vardir_trace/log/mysqlshow.trace"; - } - - my $cmdline_mysqlbinlog= - "$exe_mysqlbinlog" . - " --no-defaults --local-load=$opt_tmpdir" . - " --character-sets-dir=$path_charsetsdir"; - - if ( $opt_debug ) - { - $cmdline_mysqlbinlog .= - " --debug=d:t:A,$opt_vardir_trace/log/mysqlbinlog.trace"; - } - - my $cmdline_mysql= - "$exe_mysql --no-defaults --host=localhost --user=root --password= " . - "--port=$master->[0]->{'port'} " . - "--socket=$master->[0]->{'path_sock'}"; - - my $cmdline_mysql_client_test= - "$exe_mysql_client_test --no-defaults --testcase --user=root --silent " . - "--port=$master->[0]->{'port'} " . - "--vardir=$opt_vardir " . - "--socket=$master->[0]->{'path_sock'}"; - - if ( $opt_debug ) - { - $cmdline_mysql_client_test .= - " --debug=d:t:A,$opt_vardir_trace/log/mysql_client_test.trace"; - } - - if ( $glob_use_embedded_server ) - { - $cmdline_mysql_client_test.= - " -A --language=$path_language" . - " -A --datadir=$slave->[0]->{'path_myddir'}" . - " -A --character-sets-dir=$path_charsetsdir"; - } - - my $cmdline_mysql_fix_system_tables= - "$exe_mysql_fix_system_tables --no-defaults --host=localhost --user=root --password= " . - "--basedir=$glob_basedir --bindir=$path_client_bindir --verbose " . - "--port=$master->[0]->{'port'} " . - "--socket=$master->[0]->{'path_sock'}"; - - $ENV{'MYSQL'}= $cmdline_mysql; - $ENV{'MYSQL_CHECK'}= $cmdline_mysqlcheck; - $ENV{'MYSQL_DUMP'}= $cmdline_mysqldump; - $ENV{'MYSQL_SLAP'}= $cmdline_mysqlslap unless $glob_win32; - $ENV{'MYSQL_IMPORT'}= $cmdline_mysqlimport; - $ENV{'MYSQL_DUMP_SLAVE'}= $cmdline_mysqldumpslave; - $ENV{'MYSQL_SHOW'}= $cmdline_mysqlshow; - $ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog; - $ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables; - $ENV{'MYSQL_CLIENT_TEST'}= $cmdline_mysql_client_test; - $ENV{'CHARSETSDIR'}= $path_charsetsdir; - $ENV{'MYSQL_MY_PRINT_DEFAULTS'}= $exe_my_print_defaults; - $ENV{'UDF_EXAMPLE_LIB'}= - ($lib_udf_example ? basename($lib_udf_example) : ""); - - $ENV{'NDB_STATUS_OK'}= $clusters->[0]->{'installed_ok'}; - $ENV{'NDB_SLAVE_STATUS_OK'}= $clusters->[0]->{'installed_ok'};; - $ENV{'NDB_EXTRA_TEST'}= $opt_ndb_extra_test; - $ENV{'NDB_MGM'}= $exe_ndb_mgm; - $ENV{'NDB_BACKUP_DIR'}= $clusters->[0]->{'data_dir'}; - $ENV{'NDB_DATA_DIR'}= $clusters->[0]->{'data_dir'}; - $ENV{'NDB_TOOLS_DIR'}= $path_ndb_tools_dir; - $ENV{'NDB_TOOLS_OUTPUT'}= $file_ndb_testrun_log; - $ENV{'NDB_CONNECTSTRING'}= $opt_ndbconnectstring; + my ($tinfo)= @_; my $exe= $exe_mysqltest; my $args; @@ -3834,7 +3911,8 @@ sub run_mysqltest ($) { if ( $opt_debug ) { - mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace", $opt_vardir_trace); + mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace", + $opt_vardir_trace); } if ( $opt_ssl_supported ) @@ -3847,9 +3925,9 @@ sub run_mysqltest ($) { $glob_mysql_test_dir); } - # Turn on SSL for all test cases if ( $opt_ssl ) { + # Turn on SSL for _all_ test cases if option --ssl was used mtr_add_arg($args, "--ssl", $glob_mysql_test_dir); } @@ -3931,6 +4009,11 @@ sub run_mysqltest ($) { } } + # ------------------------------------------------------- + # Init variables that change for each testcase + # ------------------------------------------------------- + $ENV{'TZ'}= $tinfo->{'timezone'}; + my $res = mtr_run_test($exe,$args,"","",$path_timefile,""); if ( $opt_check_testcases ) From b67ff5b8f71ef42d2edfbae91997303ee8e20682 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Aug 2006 13:47:01 +0200 Subject: [PATCH 3/7] Fix indentation --- mysql-test/mysql-test-run.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 890ac3fe407..afac82a2213 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2557,7 +2557,8 @@ sub run_testcase ($) { # Try to get reason from mysqltest.log my $last_line= mtr_lastlinefromfile($path_timefile) if -f $path_timefile; my $reason= mtr_match_prefix($last_line, "reason: "); - $tinfo->{'comment'}= defined $reason ? $reason : "Detected by testcase(reason unknown) "; + $tinfo->{'comment'}= + defined $reason ? $reason : "Detected by testcase(reason unknown) "; mtr_report_test_skipped($tinfo); } elsif ( $res == 63 ) From f5358d906ebe02e2fa1d4483a3d1ff36be2c5130 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Aug 2006 15:25:30 +0200 Subject: [PATCH 4/7] Bug#20219 make bin-dist produces unportable for testing tarball - Setup LD_LIBRARY_PATH to favor local libs mysql-test/mysql-test-run.pl: Setup LD_LIBRARY_PATH so the libraries from this distro/clone are used in favor of the system installed ones --- mysql-test/mysql-test-run.pl | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index c31b35c07d8..afd79e9c887 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1178,28 +1178,33 @@ sub executable_setup () { sub environment_setup () { - # -------------------------------------------------------------------------- - # We might not use a standard installation directory, like /usr/lib. - # Set LD_LIBRARY_PATH to make sure we find our installed libraries. - # -------------------------------------------------------------------------- + my $extra_ld_library_paths; - unless ( $opt_source_dist ) + # -------------------------------------------------------------------------- + # Setup LD_LIBRARY_PATH so the libraries from this distro/clone + # are used in favor of the system installed ones + # -------------------------------------------------------------------------- + if ( $opt_source_dist ) { - $ENV{'LD_LIBRARY_PATH'}= - "$glob_basedir/lib" . - ($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : ""); - $ENV{'DYLD_LIBRARY_PATH'}= - "$glob_basedir/lib" . - ($ENV{'DYLD_LIBRARY_PATH'} ? ":$ENV{'DYLD_LIBRARY_PATH'}" : ""); + $extra_ld_library_paths= "$glob_basedir/libmysql/.libs/"; + } + else + { + $extra_ld_library_paths= "$glob_basedir/lib"; } # -------------------------------------------------------------------------- # Add the path where mysqld will find udf_example.so # -------------------------------------------------------------------------- - $ENV{'LD_LIBRARY_PATH'}= - ($lib_udf_example ? dirname($lib_udf_example) : "") . - ($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : ""); + $extra_ld_library_paths .= ":" . + ($lib_udf_example ? dirname($lib_udf_example) : ""); + $ENV{'LD_LIBRARY_PATH'}= + "$extra_ld_library_paths" . + ($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : ""); + $ENV{'DYLD_LIBRARY_PATH'}= + "$extra_ld_library_paths" . + ($ENV{'DYLD_LIBRARY_PATH'} ? ":$ENV{'DYLD_LIBRARY_PATH'}" : ""); # -------------------------------------------------------------------------- # Also command lines in .opt files may contain env vars From a707d4908ac5dc4e3dc2b5daaebbff5cd685dd5c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Aug 2006 17:03:41 +0200 Subject: [PATCH 5/7] Bug#20328 mysql client: dumb about trailing spaces on 'help' command Fix testcase to also work on windows BitKeeper/deleted/.del-mysql_client.test: Delete: mysql-test/t/mysql_client.test BitKeeper/deleted/.del-mysql_client.result: Delete: mysql-test/r/mysql_client.result mysql-test/r/mysql.result: Update test result mysql-test/t/mysql.test: Move tests from mysql_client to mysql Fix test case for bug#20328 to work on windows by comparing the output from "help" and "help " --- mysql-test/r/mysql.result | 8 +++++ mysql-test/r/mysql_client.result | 56 -------------------------------- mysql-test/t/mysql.test | 48 +++++++++++++++++++++++++-- mysql-test/t/mysql_client.test | 46 -------------------------- 4 files changed, 54 insertions(+), 104 deletions(-) delete mode 100644 mysql-test/r/mysql_client.result delete mode 100644 mysql-test/t/mysql_client.test diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index c133e4eb2cb..ba4e9daf7cb 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -114,4 +114,12 @@ a int(11) YES NULL b varchar(255) YES NULL c int(11) YES NULL drop table t1; +1 +1 +ERROR 1064 (42000) at line 3: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +ERROR at line 1: USE must be followed by a database name +\ +\\ +'; +'; End of 5.0 tests diff --git a/mysql-test/r/mysql_client.result b/mysql-test/r/mysql_client.result deleted file mode 100644 index 01a8c731bc9..00000000000 --- a/mysql-test/r/mysql_client.result +++ /dev/null @@ -1,56 +0,0 @@ -1 -1 -ERROR 1064 (42000) at line 3: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 -ERROR at line 1: USE must be followed by a database name -? (\?) Synonym for `help'. -clear (\c) Clear command. -connect (\r) Reconnect to the server. Optional arguments are db and host. -delimiter (\d) Set statement delimiter. NOTE: Takes the rest of the line as new delimiter. -edit (\e) Edit command with $EDITOR. -ego (\G) Send command to mysql server, display result vertically. -exit (\q) Exit mysql. Same as quit. -go (\g) Send command to mysql server. -help (\h) Display this help. -nopager (\n) Disable pager, print to stdout. -notee (\t) Don't write into outfile. -pager (\P) Set PAGER [to_pager]. Print the query results via PAGER. -print (\p) Print current command. -prompt (\R) Change your mysql prompt. -quit (\q) Quit mysql. -rehash (\#) Rebuild completion hash. -source (\.) Execute an SQL script file. Takes a file name as an argument. -status (\s) Get status information from the server. -system (\!) Execute a system shell command. -tee (\T) Set outfile [to_outfile]. Append everything into given outfile. -use (\u) Use another database. Takes database name as argument. -charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets. -warnings (\W) Show warnings after every statement. -nowarning (\w) Don't show warnings after every statement. -? (\?) Synonym for `help'. -clear (\c) Clear command. -connect (\r) Reconnect to the server. Optional arguments are db and host. -delimiter (\d) Set statement delimiter. NOTE: Takes the rest of the line as new delimiter. -edit (\e) Edit command with $EDITOR. -ego (\G) Send command to mysql server, display result vertically. -exit (\q) Exit mysql. Same as quit. -go (\g) Send command to mysql server. -help (\h) Display this help. -nopager (\n) Disable pager, print to stdout. -notee (\t) Don't write into outfile. -pager (\P) Set PAGER [to_pager]. Print the query results via PAGER. -print (\p) Print current command. -prompt (\R) Change your mysql prompt. -quit (\q) Quit mysql. -rehash (\#) Rebuild completion hash. -source (\.) Execute an SQL script file. Takes a file name as an argument. -status (\s) Get status information from the server. -system (\!) Execute a system shell command. -tee (\T) Set outfile [to_outfile]. Append everything into given outfile. -use (\u) Use another database. Takes database name as argument. -charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets. -warnings (\W) Show warnings after every statement. -nowarning (\w) Don't show warnings after every statement. -\ -\\ -'; -'; diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test index cf6f72570ff..385c59d1503 100644 --- a/mysql-test/t/mysql.test +++ b/mysql-test/t/mysql.test @@ -94,6 +94,50 @@ drop table t1; --exec $MYSQL test -e "connect verylongdatabasenamethatshouldblowthe256byteslongbufferincom_connectfunctionxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxendcccccccdxxxxxxxxxxxxxxxxxkskskskskkskskskskskskskskskskkskskskskkskskskskskskskskskend" 2>&1 --enable_parsing + +# +# Bug #20432: mysql client interprets commands in comments +# + +# if the client sees the 'use' within the comment, we haven't fixed +--exec echo "/*" > $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec echo "use" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec echo "*/" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1 + +# SQL can have embedded comments => workie +--exec echo "select /*" > $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec echo "use" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec echo "*/ 1" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1 + +# client commands on the other hand must be at BOL => error +--exec echo "/*" > $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec echo "xxx" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec echo "*/ use" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql +--error 1 +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1 + +# client comment recognized, but parameter missing => error +--exec echo "use" > $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1 + +# +# Bug #20328: mysql client interprets commands in comments +# +--exec $MYSQL -e 'help' > $MYSQLTEST_VARDIR/tmp/bug20328_1.result +--exec $MYSQL -e 'help ' > $MYSQLTEST_VARDIR/tmp/bug20328_2.result +--exec diff $MYSQLTEST_VARDIR/tmp/bug20328_1.result $MYSQLTEST_VARDIR/tmp/bug20328_2.result + +# +# Bug #20103: Escaping with backslash does not work +# +--exec echo "SET SQL_MODE = 'NO_BACKSLASH_ESCAPES';" > $MYSQLTEST_VARDIR/tmp/bug20103.sql +--exec echo "SELECT '\';" >> $MYSQLTEST_VARDIR/tmp/bug20103.sql +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20103.sql 2>&1 + +--exec echo "SET SQL_MODE = '';" > $MYSQLTEST_VARDIR/tmp/bug20103.sql +--exec echo "SELECT '\';';" >> $MYSQLTEST_VARDIR/tmp/bug20103.sql +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20103.sql 2>&1 + --echo End of 5.0 tests - - diff --git a/mysql-test/t/mysql_client.test b/mysql-test/t/mysql_client.test deleted file mode 100644 index 7953e0b6550..00000000000 --- a/mysql-test/t/mysql_client.test +++ /dev/null @@ -1,46 +0,0 @@ -# This test should work in embedded server after we fix mysqltest --- source include/not_embedded.inc - -# -# Bug #20432: mysql client interprets commands in comments -# - -# if the client sees the 'use' within the comment, we haven't fixed ---exec echo "/*" > $MYSQLTEST_VARDIR/tmp/bug20432.sql ---exec echo "use" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql ---exec echo "*/" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql ---exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1 - -# SQL can have embedded comments => workie ---exec echo "select /*" > $MYSQLTEST_VARDIR/tmp/bug20432.sql ---exec echo "use" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql ---exec echo "*/ 1" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql ---exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1 - -# client commands on the other hand must be at BOL => error ---exec echo "/*" > $MYSQLTEST_VARDIR/tmp/bug20432.sql ---exec echo "xxx" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql ---exec echo "*/ use" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql ---error 1 ---exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1 - -# client comment recognized, but parameter missing => error ---exec echo "use" > $MYSQLTEST_VARDIR/tmp/bug20432.sql ---exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1 - -# -# Bug #20328: mysql client interprets commands in comments -# ---exec echo 'help' | $MYSQL ---exec echo 'help ' | $MYSQL - -# -# Bug #20103: Escaping with backslash does not work -# ---exec echo "SET SQL_MODE = 'NO_BACKSLASH_ESCAPES';" > $MYSQLTEST_VARDIR/tmp/bug20103.sql ---exec echo "SELECT '\';" >> $MYSQLTEST_VARDIR/tmp/bug20103.sql ---exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20103.sql 2>&1 - ---exec echo "SET SQL_MODE = '';" > $MYSQLTEST_VARDIR/tmp/bug20103.sql ---exec echo "SELECT '\';';" >> $MYSQLTEST_VARDIR/tmp/bug20103.sql ---exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20103.sql 2>&1 From 5297d9c1d7419673f3cdaebcc62ced61925e31a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Aug 2006 23:45:01 +0200 Subject: [PATCH 6/7] manual merge --- mysql-test/r/partition.result | 8 ++++---- mysql-test/r/partition_mgm.result | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index e95489864f7..25dc4295d87 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1083,12 +1083,12 @@ partition by range (a) subpartition by hash (a) (partition p0 VALUES LESS THAN (1) DATA DIRECTORY = 'hello/master-data/tmpdata' INDEX DIRECTORY = 'hello/master-data/tmpinx' (SUBPARTITION subpart00, SUBPARTITION subpart01)); +hello/master-data/test/t1.frm +hello/master-data/test/t1.par hello/master-data/test/t1#P#p0#SP#subpart00.MYD hello/master-data/test/t1#P#p0#SP#subpart00.MYI hello/master-data/test/t1#P#p0#SP#subpart01.MYD hello/master-data/test/t1#P#p0#SP#subpart01.MYI -hello/master-data/test/t1.frm -hello/master-data/test/t1.par hello/master-data/tmpdata/t1#P#p0#SP#subpart00.MYD hello/master-data/tmpdata/t1#P#p0#SP#subpart01.MYD hello/master-data/tmpinx/t1#P#p0#SP#subpart00.MYI @@ -1098,6 +1098,8 @@ ALTER TABLE t1 REORGANIZE PARTITION p0 INTO (SUBPARTITION subpart10, SUBPARTITION subpart11), partition p2 VALUES LESS THAN (2) DATA DIRECTORY = 'hello/master-data/tmpdata' INDEX DIRECTORY = 'hello/master-data/tmpinx' (SUBPARTITION subpart20, SUBPARTITION subpart21)); +hello/master-data/test/t1.frm +hello/master-data/test/t1.par hello/master-data/test/t1#P#p1#SP#subpart10.MYD hello/master-data/test/t1#P#p1#SP#subpart10.MYI hello/master-data/test/t1#P#p1#SP#subpart11.MYD @@ -1106,8 +1108,6 @@ hello/master-data/test/t1#P#p2#SP#subpart20.MYD hello/master-data/test/t1#P#p2#SP#subpart20.MYI hello/master-data/test/t1#P#p2#SP#subpart21.MYD hello/master-data/test/t1#P#p2#SP#subpart21.MYI -hello/master-data/test/t1.frm -hello/master-data/test/t1.par hello/master-data/tmpdata/t1#P#p1#SP#subpart10.MYD hello/master-data/tmpdata/t1#P#p1#SP#subpart11.MYD hello/master-data/tmpdata/t1#P#p2#SP#subpart20.MYD diff --git a/mysql-test/r/partition_mgm.result b/mysql-test/r/partition_mgm.result index f64ffaff495..5ee12259312 100644 --- a/mysql-test/r/partition_mgm.result +++ b/mysql-test/r/partition_mgm.result @@ -7,12 +7,12 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2 */ +hello/master-data/test/t1.frm +hello/master-data/test/t1.par hello/master-data/test/t1#P#p0.MYD hello/master-data/test/t1#P#p0.MYI hello/master-data/test/t1#P#p1.MYD hello/master-data/test/t1#P#p1.MYI -hello/master-data/test/t1.frm -hello/master-data/test/t1.par ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table @@ -20,10 +20,10 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 1 */ -hello/master-data/test/t1#P#p0.MYD -hello/master-data/test/t1#P#p0.MYI hello/master-data/test/t1.frm hello/master-data/test/t1.par +hello/master-data/test/t1#P#p0.MYD +hello/master-data/test/t1#P#p0.MYI drop table t1; create table t1 (a int) partition by list (a) From 358e684e608b2d8a1506e77bdbe17e965412bddc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Aug 2006 16:01:33 +0200 Subject: [PATCH 7/7] temporarily disabled partition test, fails w/ PS protocol, filed as Bug#21658 --- mysql-test/t/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 359092b43b3..efbe1f5b32d 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -45,3 +45,4 @@ rpl_truncate_7ndb : BUG#21298 2006-07-27 msvensson crash_commit_before : 2006-08-02 msvensson rpl_ndb_dd_advance : BUG#18679 2006-07-28 jimw (Test fails randomly) federated_transactions : Need to be re-enabled once Patrick's merge is complete +partition : BUG#21658 2006-08-17 azundris fails w/ --ps-protocol