Commit f3009f3f authored by unknown's avatar unknown

Applied innodb-5.1-ss1381 snapshot

Bug #27381: InnoDB exits when attempting to rename table to non-existant database
  Fix Bug#27381 by calling os_file_handle_error_no_exit() instead of
  os_file_handle_error().


mysql-test/t/innodb.test:
  Applied innodb-5.1-ss1381 snapshot
  
  Revision r1373:
  Port r1372 from branches/5.0: Merge a change from MySQL AB, and remove
  the innodb_gis test case.
  
  ChangeSet
    2007/02/19 13:57:06+03:00 kaa@polly.local
    Bug#18743: Several test cases fails if "classic" configuration in 5.0
    The problem happened because those tests were using "cp932" and "ucs2"
    without checking whether these character sets are available.
    This fix moves test parts to make character set specific parts be
    tested only if they are:
    - some parts were moved to "ctype_ucs.test" and "ctype_cp932.test"
    - some parts were moved to the newly added tests "innodb-ucs2.test",
    "mysqlbinglog-cp932.test" and "sp-ucs2.test"
  
  mysql-test/t/innodb.test
    2007/02/19 13:57:02+03:00 kaa@polly.local +0 -222
    Moved ucs2-specific test cases to innodb-ucs2.test
storage/innobase/Makefile.am:
  Applied innodb-5.1-ss1381 snapshot
  
  Revision r1353:
  Makefile.am: EXTRA_DIST: Add the grammar source files to the
  source distribution of MySQL.
storage/innobase/dict/dict0dict.c:
  Applied innodb-5.1-ss1381 snapshot
  
  Revision r1350:
  Lock the data dictionary during rollback.  This removes the rare
  debug assertion failure ut_ad(mutex_own(&(dict_sys->mutex))) in
  dict_table_get_on_id() after the rollback following crash recovery.
storage/innobase/handler/ha_innodb.cc:
  Applied innodb-5.1-ss1381 snapshot
  
  Revision r1377:
  Add static qualifiers to some symbols in ha_innodb.cc that are not
  referenced from other modules.
  
  
  Revision r1380:
  Remove ha_innobase::last_query_id and references to thd->query_id.
  
  MySQL calls external_lock at the beginning and end of a statement
  when it is not calling start_stmt or commit or rollback.  Thus,
  statement boundaries can be (and are already) detected without
  monitoring thd->query_id.
  
  The function innobase_commit() seemingly lacks the call to
  innobase_release_stat_resources(), which should be called at
  the end of every SQL statement.  The call was replaced by
  equivalent statements by Vadim Tkachenko when he implemented
  innodb_commit_concurrency in MySQL 5.0:
  
  http://mysql.bkbits.net:8080/mysql-5.0/?PAGE=patch&REV=1.1886.70.1
  
  
  Revision r1355:
  class ha_innobase: Replace statistic_increment() with ha_statistic_increment().
  
  ha_innobase::change_active_index(): Do not call current_thd unless
  UNIV_DEBUG is defined.
  
  
  Revision r1369:
  Merge a change from MySQL AB:
  
  ChangeSet@1.2409.1.83  2007-03-06 10:36:15-07:00  tsmith@hindu.god
  Bug #26598: Create variable to allow turning off of statistic gathering
  on metadata commands
  
  Add innodb_stats_on_metadata option, which enables gathering
  index statistics when processing metadata commands such as
  SHOW TABLE STATUS.  Default behavior of the server does not
  change (this option is enabled by default).
  
  
  Revision r1342:
  Minor cleanup in ha_innodb.cc.
  
  Remove the unused constants HA_INNOBASE_ROWS_IN_TABLE and
  HA_INNOBASE_RANGE_COUNT.  Declare innobase_active_counter static.
  
  
  Revision r1381:
  innobase_commit(): Correct the comments and formatting that were broken when
  innodb_commit_concurrency was implemented.
  
  
  Revision r1360:
  Minor cleanup.
  
  innobase_query_caching_of_table_permitted(): Make static.
  
  ha_innobase::register_query_cache_table(): Move the function
  definition from ha_innodb.h to ha_innodb.cc.  Add comments.
storage/innobase/handler/ha_innodb.h:
  Applied innodb-5.1-ss1381 snapshot
  
  Revision r1377:
  Add static qualifiers to some symbols in ha_innodb.cc that are not
  referenced from other modules.
  
  
  Revision r1380:
  Remove ha_innobase::last_query_id and references to thd->query_id.
  
  MySQL calls external_lock at the beginning and end of a statement
  when it is not calling start_stmt or commit or rollback.  Thus,
  statement boundaries can be (and are already) detected without
  monitoring thd->query_id.
  
  The function innobase_commit() seemingly lacks the call to
  innobase_release_stat_resources(), which should be called at
  the end of every SQL statement.  The call was replaced by
  equivalent statements by Vadim Tkachenko when he implemented
  innodb_commit_concurrency in MySQL 5.0:
  
  http://mysql.bkbits.net:8080/mysql-5.0/?PAGE=patch&REV=1.1886.70.1
  
  
  Revision r1369:
  Merge a change from MySQL AB:
  
  ChangeSet@1.2409.1.83  2007-03-06 10:36:15-07:00  tsmith@hindu.god
  Bug #26598: Create variable to allow turning off of statistic gathering
  on metadata commands
  
  Add innodb_stats_on_metadata option, which enables gathering
  index statistics when processing metadata commands such as
  SHOW TABLE STATUS.  Default behavior of the server does not
  change (this option is enabled by default).
  
  
  Revision r1360:
  Minor cleanup.
  
  innobase_query_caching_of_table_permitted(): Make static.
  
  ha_innobase::register_query_cache_table(): Move the function
  definition from ha_innodb.h to ha_innodb.cc.  Add comments.
storage/innobase/include/trx0trx.h:
  Applied innodb-5.1-ss1381 snapshot
  
  Revision r1344:
  Rename the Boolean field trx->type to trx->is_purge
  and remove the constants TRX_USER and TRX_PURGE.
  
  
  Revision r1343:
  trx_sig_struct: Remove state.  It is always assigned to TRX_SIG_WAITING
  and never tested.
storage/innobase/os/os0file.c:
  Applied innodb-5.1-ss1381 snapshot
  
  Revision r1352:
  Fix typo in comment in os/os0file.c
  
  Approved by:	heikki
  
  
  
  Revision r1366:
  Fix Bug#27381 by calling os_file_handle_error_no_exit() instead of
  os_file_handle_error().
  
  Approved by:	Heikki
storage/innobase/row/row0undo.c:
  Applied innodb-5.1-ss1381 snapshot
  
  Revision r1350:
  Lock the data dictionary during rollback.  This removes the rare
  debug assertion failure ut_ad(mutex_own(&(dict_sys->mutex))) in
  dict_table_get_on_id() after the rollback following crash recovery.
storage/innobase/trx/trx0purge.c:
  Applied innodb-5.1-ss1381 snapshot
  
  Revision r1344:
  Rename the Boolean field trx->type to trx->is_purge
  and remove the constants TRX_USER and TRX_PURGE.
storage/innobase/trx/trx0trx.c:
  Applied innodb-5.1-ss1381 snapshot
  
  Revision r1344:
  Rename the Boolean field trx->type to trx->is_purge
  and remove the constants TRX_USER and TRX_PURGE.
  
  
  Revision r1343:
  trx_sig_struct: Remove state.  It is always assigned to TRX_SIG_WAITING
  and never tested.
parent c8fde97f
......@@ -1810,7 +1810,6 @@ select a,hex(s1) from t1;
select hex(s1) from t2;
drop table t2,t1;
# Ensure that <tablename>_ibfk_0 is not mistreated as a
# generated foreign key identifier. (Bug #16387)
......
......@@ -89,6 +89,8 @@ EXTRA_DIST = include/btr0btr.h include/btr0btr.ic include/btr0cur.h include/btr
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 \
pars/make_bison.sh pars/make_flex.sh \
pars/pars0grm.y pars/pars0lex.l
CMakeLists.txt plug.in
noinst_LIBRARIES = libinnobase.a
......
......@@ -689,7 +689,8 @@ dict_table_get_on_id(
if we are doing a rollback to handle an error in TABLE
CREATE, for example, we already have the mutex! */
ut_ad(mutex_own(&(dict_sys->mutex)));
ut_ad(mutex_own(&(dict_sys->mutex))
|| trx->dict_operation_lock_mode == RW_X_LATCH);
return(dict_table_get_on_id_low(table_id));
}
......
This diff is collapsed.
......@@ -35,10 +35,6 @@ typedef struct st_innobase_share {
struct row_prebuilt_struct;
typedef struct row_prebuilt_struct row_prebuilt_t;
my_bool innobase_query_caching_of_table_permitted(THD* thd, char* full_name,
uint full_name_len,
ulonglong *unused);
/* The class defining a handle to an Innodb table */
class ha_innobase: public handler
{
......@@ -48,8 +44,6 @@ class ha_innobase: public handler
THD* user_thd; /* the thread handle of the user
currently using the handle; this is
set in external_lock function */
query_id_t last_query_id; /* the latest query id where the
handle was used */
THR_LOCK_DATA lock;
INNOBASE_SHARE *share;
......@@ -186,14 +180,7 @@ class ha_innobase: public handler
my_bool register_query_cache_table(THD *thd, char *table_key,
uint key_length,
qc_engine_callback *call_back,
ulonglong *engine_data)
{
*call_back= innobase_query_caching_of_table_permitted;
*engine_data= 0;
return innobase_query_caching_of_table_permitted(thd, table_key,
key_length,
engine_data);
}
ulonglong *engine_data);
static char *get_mysql_bin_log_name();
static ulonglong get_mysql_bin_log_pos();
bool primary_key_is_clustered() { return true; }
......@@ -202,7 +189,6 @@ class ha_innobase: public handler
uint table_changes);
};
extern SHOW_VAR innodb_status_variables[];
extern ulong innobase_fast_shutdown;
extern ulong innobase_large_page_size;
extern long innobase_mirrored_log_groups, innobase_log_files_in_group;
......
......@@ -375,8 +375,6 @@ trx_is_interrupted(
/* Signal to a transaction */
struct trx_sig_struct{
ulint type; /* signal type */
ulint state; /* TRX_SIG_WAITING or
TRX_SIG_BEING_HANDLED */
ulint sender; /* TRX_SIG_SELF or
TRX_SIG_OTHER_SESS */
que_thr_t* receiver; /* non-NULL if the sender of the signal
......@@ -404,7 +402,7 @@ struct trx_struct{
const char* op_info; /* English text describing the
current operation, or an empty
string */
ulint type; /* TRX_USER, TRX_PURGE */
unsigned is_purge:1; /* 0=user transaction, 1=purge */
ulint conc_state; /* state of the trx from the point
of view of concurrency control:
TRX_ACTIVE, TRX_COMMITTED_IN_MEMORY,
......@@ -675,12 +673,6 @@ struct trx_struct{
single operation of a
transaction, e.g., a parallel
query */
/* Transaction types */
#define TRX_USER 1 /* normal user transaction */
#define TRX_PURGE 2 /* purge transaction: this is not
inserted to the trx list of trx_sys
and no rollback segment is assigned to
this */
/* Transaction concurrency states */
#define TRX_NOT_STARTED 1
#define TRX_ACTIVE 2
......@@ -742,9 +734,6 @@ struct trx_struct{
session */
#define TRX_SIG_OTHER_SESS 2 /* sent by another session (which
must hold rights to this) */
/* Signal states */
#define TRX_SIG_WAITING 1
#define TRX_SIG_BEING_HANDLED 2
/* Commit command node in a query graph */
struct commit_node_struct{
......
......@@ -930,7 +930,7 @@ os_file_create_simple(
file = CreateFile((LPCTSTR) name,
access,
FILE_SHARE_READ | FILE_SHARE_WRITE,
/* file can be read ansd written also
/* file can be read and written also
by other processes */
NULL, /* default security attributes */
create_flag,
......@@ -1509,7 +1509,7 @@ os_file_rename(
return(TRUE);
}
os_file_handle_error(oldpath, "rename");
os_file_handle_error_no_exit(oldpath, "rename");
return(FALSE);
#else
......@@ -1518,7 +1518,7 @@ os_file_rename(
ret = rename((const char*)oldpath, (const char*)newpath);
if (ret != 0) {
os_file_handle_error(oldpath, "rename");
os_file_handle_error_no_exit(oldpath, "rename");
return(FALSE);
}
......
......@@ -213,7 +213,7 @@ row_undo(
ulint err;
trx_t* trx;
dulint roll_ptr;
ibool froze_data_dict = FALSE;
ibool locked_data_dict;
ut_ad(node && thr);
......@@ -266,13 +266,13 @@ row_undo(
/* Prevent DROP TABLE etc. while we are rolling back this row.
If we are doing a TABLE CREATE or some other dictionary operation,
then we already have dict_operation_lock locked in x-mode. Do not
try to lock again in s-mode, because that would cause a hang. */
try to lock again, because that would cause a hang. */
if (trx->dict_operation_lock_mode == 0) {
locked_data_dict = (trx->dict_operation_lock_mode == 0);
row_mysql_freeze_data_dictionary(trx);
if (locked_data_dict) {
froze_data_dict = TRUE;
row_mysql_lock_data_dictionary(trx);
}
if (node->state == UNDO_NODE_INSERT) {
......@@ -285,9 +285,9 @@ row_undo(
err = row_undo_mod(node, thr);
}
if (froze_data_dict) {
if (locked_data_dict) {
row_mysql_unfreeze_data_dictionary(trx);
row_mysql_unlock_data_dictionary(trx);
}
/* Do some cleanup */
......
......@@ -221,7 +221,7 @@ trx_purge_sys_create(void)
purge_sys->trx = purge_sys->sess->trx;
purge_sys->trx->type = TRX_PURGE;
purge_sys->trx->is_purge = 1;
ut_a(trx_start_low(purge_sys->trx, ULINT_UNDEFINED));
......
......@@ -109,7 +109,7 @@ trx_create(
trx->op_info = "";
trx->type = TRX_USER;
trx->is_purge = 0;
trx->conc_state = TRX_NOT_STARTED;
trx->start_time = time(NULL);
......@@ -667,7 +667,7 @@ trx_start_low(
ut_ad(mutex_own(&kernel_mutex));
ut_ad(trx->rseg == NULL);
if (trx->type == TRX_PURGE) {
if (trx->is_purge) {
trx->id = ut_dulint_zero;
trx->conc_state = TRX_ACTIVE;
trx->start_time = time(NULL);
......@@ -1262,7 +1262,6 @@ trx_sig_send(
UT_LIST_ADD_LAST(signals, trx->signals, sig);
sig->type = type;
sig->state = TRX_SIG_WAITING;
sig->sender = sender;
sig->receiver = receiver_thr;
......@@ -1709,7 +1708,7 @@ trx_print(
fputs(trx->op_info, f);
}
if (trx->type != TRX_USER) {
if (trx->is_purge) {
fputs(" purge trx", f);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment