diff --git a/handler/ha_innodb.cc b/handler/ha_innodb.cc index 7d874551600..b4ee78a85a5 100644 --- a/handler/ha_innodb.cc +++ b/handler/ha_innodb.cc @@ -1242,8 +1242,7 @@ innobase_invalidate_query_cache( } /********************************************************************* -Display an SQL identifier. -This definition must match the one in innobase/ut/ut0ut.c! */ +Display an SQL identifier. */ extern "C" void innobase_print_identifier( diff --git a/include/ha_prototypes.h b/include/ha_prototypes.h index e9fca53bb4e..4ac44ed7c47 100644 --- a/include/ha_prototypes.h +++ b/include/ha_prototypes.h @@ -1,6 +1,8 @@ #ifndef HA_INNODB_PROTOTYPES_H #define HA_INNODB_PROTOTYPES_H +#ifndef UNIV_HOTBACKUP + #include "univ.i" /* ulint, uint */ #include "m_ctype.h" /* CHARSET_INFO */ @@ -22,6 +24,19 @@ innobase_convert_string( CHARSET_INFO* from_cs, uint* errors); +/********************************************************************* +Display an SQL identifier. */ + +void +innobase_print_identifier( +/*======================*/ + FILE* f, /* in: output stream */ + trx_t* trx, /* in: transaction */ + ibool table_id,/* in: TRUE=print a table name, + FALSE=print other identifier */ + const char* name, /* in: name to print */ + ulint namelen);/* in: length of name */ + /********************************************************************** Returns true if the thread is the replication thread on the slave server. Used in srv_conc_enter_innodb() to determine if the thread @@ -59,3 +74,4 @@ innobase_mysql_print_thd( uint max_query_len); /* in: max query length to print, or 0 to use the default max length */ #endif +#endif diff --git a/mysql-test/innodb.result b/mysql-test/innodb.result index f80ccf600c5..adb9ef5b21d 100644 --- a/mysql-test/innodb.result +++ b/mysql-test/innodb.result @@ -502,7 +502,7 @@ ERROR 23000: Duplicate entry 'test2' for key 'ggid' select * from t1; id ggid email passwd 1 this will work -4 test2 this will work +3 test2 this will work select * from t1 where id=1; id ggid email passwd 1 this will work diff --git a/plug.in b/plug.in index 6e26a7d3376..b252d471fba 100644 --- a/plug.in +++ b/plug.in @@ -6,10 +6,6 @@ MYSQL_PLUGIN_DYNAMIC(innobase, [ha_innodb.la]) MYSQL_PLUGIN_ACTIONS(innobase, [ AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"]) AC_SUBST(innodb_system_libs) - AC_PROG_CC - AC_PROG_RANLIB - AC_PROG_INSTALL - AC_PROG_LIBTOOL AC_CHECK_HEADERS(aio.h sched.h) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) diff --git a/row/row0mysql.c b/row/row0mysql.c index cba48295e3e..ee92bfcf4e3 100644 --- a/row/row0mysql.c +++ b/row/row0mysql.c @@ -1822,13 +1822,11 @@ row_create_table_for_mysql( ut_ad(trx->dict_operation_lock_mode == RW_X_LATCH); if (srv_created_new_raw) { - fputs("InnoDB: A new raw disk partition was initialized or\n" - "InnoDB: innodb_force_recovery is on: we do not allow\n" - "InnoDB: database modifications by the user. Shut down\n" - "InnoDB: mysqld and edit my.cnf so that newraw" - " is replaced\n" - "InnoDB: with raw, and innodb_force_... is removed.\n", - stderr); + fputs("InnoDB: A new raw disk partition was initialized:\n" + "InnoDB: we do not allow database modifications" + " by the user.\n" + "InnoDB: Shut down mysqld and edit my.cnf so that newraw" + " is replaced with raw.\n", stderr); dict_mem_table_free(table); trx_commit_for_mysql(trx); @@ -2772,13 +2770,11 @@ row_truncate_table_for_mysql( ut_ad(table); if (srv_created_new_raw) { - fputs("InnoDB: A new raw disk partition was initialized or\n" - "InnoDB: innodb_force_recovery is on: we do not allow\n" - "InnoDB: database modifications by the user. Shut down\n" - "InnoDB: mysqld and edit my.cnf so that newraw" - " is replaced\n" - "InnoDB: with raw, and innodb_force_... is removed.\n", - stderr); + fputs("InnoDB: A new raw disk partition was initialized:\n" + "InnoDB: we do not allow database modifications" + " by the user.\n" + "InnoDB: Shut down mysqld and edit my.cnf so that newraw" + " is replaced with raw.\n", stderr); return(DB_ERROR); } @@ -3076,21 +3072,17 @@ row_drop_table_for_mysql_no_commit( ulint err; const char* table_name; ulint namelen; - char* dir_path_of_temp_table = NULL; - ibool success; ibool locked_dictionary = FALSE; pars_info_t* info = NULL; ut_a(name != NULL); if (srv_created_new_raw) { - fputs("InnoDB: A new raw disk partition was initialized or\n" - "InnoDB: innodb_force_recovery is on: we do not allow\n" - "InnoDB: database modifications by the user. Shut down\n" - "InnoDB: mysqld and edit my.cnf so that newraw" - " is replaced\n" - "InnoDB: with raw, and innodb_force_... is removed.\n", - stderr); + fputs("InnoDB: A new raw disk partition was initialized:\n" + "InnoDB: we do not allow database modifications" + " by the user.\n" + "InnoDB: Shut down mysqld and edit my.cnf so that newraw" + " is replaced with raw.\n", stderr); return(DB_ERROR); } @@ -3377,14 +3369,20 @@ check_next_foreign: } else { ibool is_path; const char* name_or_path; + mem_heap_t* heap; + heap = mem_heap_create(200); + + /* Clone the name, in case it has been allocated + from table->heap, which will be freed by + dict_table_remove_from_cache(table) below. */ + name = mem_heap_strdup(heap, name); space_id = table->space; if (table->dir_path_of_temp_table != NULL) { - dir_path_of_temp_table = mem_strdup( - table->dir_path_of_temp_table); is_path = TRUE; - name_or_path = dir_path_of_temp_table; + name_or_path = mem_heap_strdup( + heap, table->dir_path_of_temp_table); } else { is_path = FALSE; name_or_path = name; @@ -3417,13 +3415,7 @@ check_next_foreign: "InnoDB: of table "); ut_print_name(stderr, trx, TRUE, name); fprintf(stderr, ".\n"); - - goto funct_exit; - } - - success = fil_delete_tablespace(space_id); - - if (!success) { + } else if (!fil_delete_tablespace(space_id)) { fprintf(stderr, "InnoDB: We removed now the InnoDB" " internal data dictionary entry\n" @@ -3441,6 +3433,8 @@ check_next_foreign: err = DB_ERROR; } } + + mem_heap_free(heap); } funct_exit: @@ -3448,10 +3442,6 @@ funct_exit: row_mysql_unlock_data_dictionary(trx); } - if (dir_path_of_temp_table) { - mem_free(dir_path_of_temp_table); - } - trx->op_info = ""; #ifndef UNIV_HOTBACKUP diff --git a/ut/ut0ut.c b/ut/ut0ut.c index ed30e65a2e7..f3c6d3c4a4e 100644 --- a/ut/ut0ut.c +++ b/ut/ut0ut.c @@ -17,6 +17,7 @@ Created 5/11/1994 Heikki Tuuri #include #include "trx0trx.h" +#include "ha_prototypes.h" ibool ut_always_false = FALSE; @@ -69,22 +70,6 @@ ut_gettimeofday( #define ut_gettimeofday gettimeofday #endif -#ifndef UNIV_HOTBACKUP -/********************************************************************* -Display an SQL identifier. -This definition must match the one in sql/ha_innodb.cc! */ -extern -void -innobase_print_identifier( -/*======================*/ - FILE* f, /* in: output stream */ - trx_t* trx, /* in: transaction */ - ibool table_id,/* in: TRUE=print a table name, - FALSE=print other identifier */ - const char* name, /* in: name to print */ - ulint namelen);/* in: length of name */ -#endif /* !UNIV_HOTBACKUP */ - /************************************************************ Gets the high 32 bits in a ulint. That is makes a shift >> 32, but since there seem to be compiler bugs in both gcc and Visual C++,