ha_innodb.cc:
Correct indentation + some small style corrections sql/ha_innodb.cc: Correct indentation + some small style corrections
This commit is contained in:
parent
af529fd14c
commit
67457597b8
161
sql/ha_innodb.cc
161
sql/ha_innodb.cc
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2000 MySQL AB & Innobase Oy
|
/* Copyright (C) 2000-2005 MySQL AB & Innobase Oy
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -336,14 +336,18 @@ innobase_release_temporary_latches(
|
|||||||
/*===============================*/
|
/*===============================*/
|
||||||
THD *thd)
|
THD *thd)
|
||||||
{
|
{
|
||||||
|
trx_t* trx;
|
||||||
|
|
||||||
if (!innodb_inited) {
|
if (!innodb_inited) {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
trx_t *trx= (trx_t*) thd->ha_data[innobase_hton.slot];
|
trx = (trx_t*) thd->ha_data[innobase_hton.slot];
|
||||||
if (trx)
|
|
||||||
|
if (trx) {
|
||||||
innobase_release_stat_resources(trx);
|
innobase_release_stat_resources(trx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
@ -743,14 +747,15 @@ transaction internally. */
|
|||||||
static
|
static
|
||||||
void
|
void
|
||||||
register_trans(
|
register_trans(
|
||||||
/*============*/
|
/*===========*/
|
||||||
THD* thd) /* in: thd to use the handle */
|
THD* thd) /* in: thd to use the handle */
|
||||||
{
|
{
|
||||||
/* register the start of the statement */
|
/* Register the start of the statement */
|
||||||
trans_register_ha(thd, FALSE, &innobase_hton);
|
trans_register_ha(thd, FALSE, &innobase_hton);
|
||||||
|
|
||||||
if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
|
if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
|
||||||
|
|
||||||
/* no autocommit mode, register for a transaction */
|
/* No autocommit mode, register for a transaction */
|
||||||
trans_register_ha(thd, TRUE, &innobase_hton);
|
trans_register_ha(thd, TRUE, &innobase_hton);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1051,7 +1056,7 @@ ha_innobase::init_table_handle_for_HANDLER(void)
|
|||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Opens an InnoDB database. */
|
Opens an InnoDB database. */
|
||||||
|
|
||||||
handlerton *
|
handlerton*
|
||||||
innobase_init(void)
|
innobase_init(void)
|
||||||
/*===============*/
|
/*===============*/
|
||||||
/* out: TRUE if error */
|
/* out: TRUE if error */
|
||||||
@ -1346,13 +1351,15 @@ innobase_commit_low(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The following will be enabled later when we put the 4.1 functionality back
|
||||||
|
to 5.0. */
|
||||||
#ifdef DISABLE_HAVE_REPLICATION
|
#ifdef DISABLE_HAVE_REPLICATION
|
||||||
if (current_thd->slave_thread) {
|
if (current_thd->slave_thread) {
|
||||||
/* Update the replication position info inside InnoDB */
|
/* Update the replication position info inside InnoDB */
|
||||||
|
|
||||||
trx->mysql_master_log_file_name
|
trx->mysql_master_log_file_name
|
||||||
= active_mi->rli.group_master_log_name;
|
= active_mi->rli.group_master_log_name;
|
||||||
trx->mysql_master_log_pos= ((ib_longlong)
|
trx->mysql_master_log_pos = ((ib_longlong)
|
||||||
active_mi->rli.future_group_master_log_pos);
|
active_mi->rli.future_group_master_log_pos);
|
||||||
}
|
}
|
||||||
#endif /* HAVE_REPLICATION */
|
#endif /* HAVE_REPLICATION */
|
||||||
@ -1456,7 +1463,8 @@ innobase_commit(
|
|||||||
"InnoDB: but trx->conc_state != TRX_NOT_STARTED\n");
|
"InnoDB: but trx->conc_state != TRX_NOT_STARTED\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (all || (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) {
|
if (all
|
||||||
|
|| (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) {
|
||||||
|
|
||||||
/* We were instructed to commit the whole transaction, or
|
/* We were instructed to commit the whole transaction, or
|
||||||
this is an SQL statement end and autocommit is on */
|
this is an SQL statement end and autocommit is on */
|
||||||
@ -1489,10 +1497,9 @@ innobase_commit(
|
|||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* The following defined-out code will be enabled later when we put the
|
||||||
don't delete it - it may be re-enabled later
|
MySQL-4.1 functionality back to 5.0. This is needed to get InnoDB Hot Backup
|
||||||
as an optimization for the most common case InnoDB+binlog
|
to work. */
|
||||||
*/
|
|
||||||
#if 0
|
#if 0
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
This is called when MySQL writes the binlog entry for the current
|
This is called when MySQL writes the binlog entry for the current
|
||||||
@ -1627,7 +1634,8 @@ innobase_rollback(
|
|||||||
row_unlock_table_autoinc_for_mysql(trx);
|
row_unlock_table_autoinc_for_mysql(trx);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (all || (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) {
|
if (all
|
||||||
|
|| (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) {
|
||||||
|
|
||||||
error = trx_rollback_for_mysql(trx);
|
error = trx_rollback_for_mysql(trx);
|
||||||
trx->active_trans = 0;
|
trx->active_trans = 0;
|
||||||
@ -1686,6 +1694,7 @@ innobase_rollback_to_savepoint(
|
|||||||
ib_longlong mysql_binlog_cache_pos;
|
ib_longlong mysql_binlog_cache_pos;
|
||||||
int error = 0;
|
int error = 0;
|
||||||
trx_t* trx;
|
trx_t* trx;
|
||||||
|
char name[64];
|
||||||
|
|
||||||
DBUG_ENTER("innobase_rollback_to_savepoint");
|
DBUG_ENTER("innobase_rollback_to_savepoint");
|
||||||
|
|
||||||
@ -1698,8 +1707,8 @@ innobase_rollback_to_savepoint(
|
|||||||
innobase_release_stat_resources(trx);
|
innobase_release_stat_resources(trx);
|
||||||
|
|
||||||
/* TODO: use provided savepoint data area to store savepoint data */
|
/* TODO: use provided savepoint data area to store savepoint data */
|
||||||
char name[64];
|
|
||||||
longlong2str((ulonglong)savepoint,name,36);
|
longlong2str((ulonglong)savepoint, name, 36);
|
||||||
|
|
||||||
error = trx_rollback_to_savepoint_for_mysql(trx, name,
|
error = trx_rollback_to_savepoint_for_mysql(trx, name,
|
||||||
&mysql_binlog_cache_pos);
|
&mysql_binlog_cache_pos);
|
||||||
@ -1708,26 +1717,27 @@ innobase_rollback_to_savepoint(
|
|||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
Release transaction savepoint name. */
|
Release transaction savepoint name. */
|
||||||
|
static
|
||||||
static int
|
int
|
||||||
innobase_release_savepoint(
|
innobase_release_savepoint(
|
||||||
/*===========================*/
|
/*=======================*/
|
||||||
/* out: 0 if success, HA_ERR_NO_SAVEPOINT if
|
/* out: 0 if success, HA_ERR_NO_SAVEPOINT if
|
||||||
no savepoint with the given name */
|
no savepoint with the given name */
|
||||||
THD* thd, /* in: handle to the MySQL thread of the user
|
THD* thd, /* in: handle to the MySQL thread of the user
|
||||||
whose transaction should be rolled back */
|
whose transaction should be rolled back */
|
||||||
void *savepoint) /* in: savepoint data */
|
void* savepoint) /* in: savepoint data */
|
||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
trx_t* trx;
|
trx_t* trx;
|
||||||
|
char name[64];
|
||||||
|
|
||||||
DBUG_ENTER("innobase_release_savepoint");
|
DBUG_ENTER("innobase_release_savepoint");
|
||||||
|
|
||||||
trx = check_trx_exists(thd);
|
trx = check_trx_exists(thd);
|
||||||
|
|
||||||
/* TODO: use provided savepoint data area to store savepoint data */
|
/* TODO: use provided savepoint data area to store savepoint data */
|
||||||
char name[64];
|
|
||||||
longlong2str((ulonglong)savepoint,name,36);
|
longlong2str((ulonglong)savepoint, name, 36);
|
||||||
|
|
||||||
error = trx_release_savepoint_for_mysql(trx, name);
|
error = trx_release_savepoint_for_mysql(trx, name);
|
||||||
|
|
||||||
@ -1736,13 +1746,13 @@ innobase_release_savepoint(
|
|||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
Sets a transaction savepoint. */
|
Sets a transaction savepoint. */
|
||||||
|
static
|
||||||
static int
|
int
|
||||||
innobase_savepoint(
|
innobase_savepoint(
|
||||||
/*===============*/
|
/*===============*/
|
||||||
/* out: always 0, that is, always succeeds */
|
/* out: always 0, that is, always succeeds */
|
||||||
THD* thd, /* in: handle to the MySQL thread */
|
THD* thd, /* in: handle to the MySQL thread */
|
||||||
void *savepoint) /* in: savepoint data */
|
void* savepoint) /* in: savepoint data */
|
||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
trx_t* trx;
|
trx_t* trx;
|
||||||
@ -1911,7 +1921,8 @@ ha_innobase::open(
|
|||||||
fields when packed actually became 1 byte longer, when we also
|
fields when packed actually became 1 byte longer, when we also
|
||||||
stored the string length as the first byte. */
|
stored the string length as the first byte. */
|
||||||
|
|
||||||
upd_and_key_val_buff_len = table->s->reclength + table->s->max_key_length
|
upd_and_key_val_buff_len =
|
||||||
|
table->s->reclength + table->s->max_key_length
|
||||||
+ MAX_REF_PARTS * 3;
|
+ MAX_REF_PARTS * 3;
|
||||||
if (!(mysql_byte*) my_multi_malloc(MYF(MY_WME),
|
if (!(mysql_byte*) my_multi_malloc(MYF(MY_WME),
|
||||||
&upd_buff, upd_and_key_val_buff_len,
|
&upd_buff, upd_and_key_val_buff_len,
|
||||||
@ -1963,7 +1974,8 @@ ha_innobase::open(
|
|||||||
|
|
||||||
innobase_prebuilt = row_create_prebuilt(ib_table);
|
innobase_prebuilt = row_create_prebuilt(ib_table);
|
||||||
|
|
||||||
((row_prebuilt_t*)innobase_prebuilt)->mysql_row_len = table->s->reclength;
|
((row_prebuilt_t*)innobase_prebuilt)->mysql_row_len =
|
||||||
|
table->s->reclength;
|
||||||
|
|
||||||
/* Looks like MySQL-3.23 sometimes has primary key number != 0 */
|
/* Looks like MySQL-3.23 sometimes has primary key number != 0 */
|
||||||
|
|
||||||
@ -1985,13 +1997,11 @@ ha_innobase::open(
|
|||||||
|
|
||||||
((row_prebuilt_t*)innobase_prebuilt)
|
((row_prebuilt_t*)innobase_prebuilt)
|
||||||
->clust_index_was_generated = FALSE;
|
->clust_index_was_generated = FALSE;
|
||||||
/*
|
/* MySQL allocates the buffer for ref. key_info->key_length
|
||||||
MySQL allocates the buffer for ref. key_info->key_length
|
|
||||||
includes space for all key columns + one byte for each column
|
includes space for all key columns + one byte for each column
|
||||||
that may be NULL. ref_length must be as exact as possible to
|
that may be NULL. ref_length must be as exact as possible to
|
||||||
save space, because all row reference buffers are allocated
|
save space, because all row reference buffers are allocated
|
||||||
based on ref_length.
|
based on ref_length. */
|
||||||
*/
|
|
||||||
|
|
||||||
ref_length = table->key_info[primary_key].key_length;
|
ref_length = table->key_info[primary_key].key_length;
|
||||||
} else {
|
} else {
|
||||||
@ -2013,15 +2023,13 @@ ha_innobase::open(
|
|||||||
|
|
||||||
ref_length = DATA_ROW_ID_LEN;
|
ref_length = DATA_ROW_ID_LEN;
|
||||||
|
|
||||||
/*
|
/* If we automatically created the clustered index, then
|
||||||
If we automatically created the clustered index, then
|
|
||||||
MySQL does not know about it, and MySQL must NOT be aware
|
MySQL does not know about it, and MySQL must NOT be aware
|
||||||
of the index used on scan, to make it avoid checking if we
|
of the index used on scan, to make it avoid checking if we
|
||||||
update the column of the index. That is why we assert below
|
update the column of the index. That is why we assert below
|
||||||
that key_used_on_scan is the undefined value MAX_KEY.
|
that key_used_on_scan is the undefined value MAX_KEY.
|
||||||
The column is the row id in the automatical generation case,
|
The column is the row id in the automatical generation case,
|
||||||
and it will never be updated anyway.
|
and it will never be updated anyway. */
|
||||||
*/
|
|
||||||
|
|
||||||
if (key_used_on_scan != MAX_KEY) {
|
if (key_used_on_scan != MAX_KEY) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
@ -2611,7 +2619,8 @@ ha_innobase::write_row(
|
|||||||
"InnoDB: Dump of 200 bytes around transaction.all: ",
|
"InnoDB: Dump of 200 bytes around transaction.all: ",
|
||||||
stderr);
|
stderr);
|
||||||
ut_print_buf(stderr,
|
ut_print_buf(stderr,
|
||||||
((byte*)(&(current_thd->ha_data[innobase_hton.slot]))) - 100, 200);
|
((byte*)(&(current_thd->ha_data[innobase_hton.slot]))) - 100,
|
||||||
|
200);
|
||||||
putc('\n', stderr);
|
putc('\n', stderr);
|
||||||
ut_error;
|
ut_error;
|
||||||
}
|
}
|
||||||
@ -2646,7 +2655,7 @@ ha_innobase::write_row(
|
|||||||
src_table = lock_get_src_table(
|
src_table = lock_get_src_table(
|
||||||
prebuilt->trx, prebuilt->table, &mode);
|
prebuilt->trx, prebuilt->table, &mode);
|
||||||
if (!src_table) {
|
if (!src_table) {
|
||||||
no_commit:
|
no_commit:
|
||||||
/* Unknown situation: do not commit */
|
/* Unknown situation: do not commit */
|
||||||
/*
|
/*
|
||||||
ut_print_timestamp(stderr);
|
ut_print_timestamp(stderr);
|
||||||
@ -2669,6 +2678,7 @@ ha_innobase::write_row(
|
|||||||
} else {
|
} else {
|
||||||
/* Ensure that there are no other table locks than
|
/* Ensure that there are no other table locks than
|
||||||
LOCK_IX and LOCK_AUTO_INC on the destination table. */
|
LOCK_IX and LOCK_AUTO_INC on the destination table. */
|
||||||
|
|
||||||
if (!lock_is_table_exclusive(prebuilt->table,
|
if (!lock_is_table_exclusive(prebuilt->table,
|
||||||
prebuilt->trx)) {
|
prebuilt->trx)) {
|
||||||
goto no_commit;
|
goto no_commit;
|
||||||
@ -2765,8 +2775,8 @@ ha_innobase::write_row(
|
|||||||
error = row_lock_table_autoinc_for_mysql(prebuilt);
|
error = row_lock_table_autoinc_for_mysql(prebuilt);
|
||||||
|
|
||||||
if (error != DB_SUCCESS) {
|
if (error != DB_SUCCESS) {
|
||||||
|
error = convert_error_code_to_mysql(error,
|
||||||
error = convert_error_code_to_mysql(error, user_thd);
|
user_thd);
|
||||||
goto func_exit;
|
goto func_exit;
|
||||||
}
|
}
|
||||||
dict_table_autoinc_update(prebuilt->table, auto_inc);
|
dict_table_autoinc_update(prebuilt->table, auto_inc);
|
||||||
@ -2785,7 +2795,6 @@ func_exit:
|
|||||||
DBUG_RETURN(error);
|
DBUG_RETURN(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
Converts field data for storage in an InnoDB update vector. */
|
Converts field data for storage in an InnoDB update vector. */
|
||||||
inline
|
inline
|
||||||
@ -4674,21 +4683,27 @@ ha_innobase::read_time(
|
|||||||
ha_rows total_rows;
|
ha_rows total_rows;
|
||||||
double time_for_scan;
|
double time_for_scan;
|
||||||
|
|
||||||
if (index != table->s->primary_key)
|
if (index != table->s->primary_key) {
|
||||||
return handler::read_time(index, ranges, rows); // Not clustered
|
/* Not clustered */
|
||||||
|
return(handler::read_time(index, ranges, rows));
|
||||||
|
}
|
||||||
|
|
||||||
if (rows <= 2)
|
if (rows <= 2) {
|
||||||
return (double) rows;
|
|
||||||
|
return((double) rows);
|
||||||
|
}
|
||||||
|
|
||||||
/* Assume that the read time is proportional to the scan time for all
|
/* Assume that the read time is proportional to the scan time for all
|
||||||
rows + at most one seek per range. */
|
rows + at most one seek per range. */
|
||||||
|
|
||||||
time_for_scan = scan_time();
|
time_for_scan = scan_time();
|
||||||
|
|
||||||
if ((total_rows = estimate_rows_upper_bound()) < rows)
|
if ((total_rows = estimate_rows_upper_bound()) < rows) {
|
||||||
return time_for_scan;
|
|
||||||
|
|
||||||
return (ranges + (double) rows / (double) total_rows * time_for_scan);
|
return(time_for_scan);
|
||||||
|
}
|
||||||
|
|
||||||
|
return(ranges + (double) rows / (double) total_rows * time_for_scan);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@ -5624,7 +5639,6 @@ innodb_export_status(void)
|
|||||||
srv_export_innodb_status();
|
srv_export_innodb_status();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
Implements the SHOW INNODB STATUS command. Sends the output of the InnoDB
|
Implements the SHOW INNODB STATUS command. Sends the output of the InnoDB
|
||||||
Monitor to the client. */
|
Monitor to the client. */
|
||||||
@ -5636,6 +5650,8 @@ innodb_show_status(
|
|||||||
{
|
{
|
||||||
Protocol *protocol= thd->protocol;
|
Protocol *protocol= thd->protocol;
|
||||||
trx_t* trx;
|
trx_t* trx;
|
||||||
|
long flen;
|
||||||
|
char* str;
|
||||||
|
|
||||||
DBUG_ENTER("innodb_show_status");
|
DBUG_ENTER("innodb_show_status");
|
||||||
|
|
||||||
@ -5652,14 +5668,13 @@ innodb_show_status(
|
|||||||
|
|
||||||
/* We let the InnoDB Monitor to output at most 64000 bytes of text. */
|
/* We let the InnoDB Monitor to output at most 64000 bytes of text. */
|
||||||
|
|
||||||
long flen;
|
|
||||||
char* str;
|
|
||||||
|
|
||||||
mutex_enter_noninline(&srv_monitor_file_mutex);
|
mutex_enter_noninline(&srv_monitor_file_mutex);
|
||||||
rewind(srv_monitor_file);
|
rewind(srv_monitor_file);
|
||||||
|
|
||||||
srv_printf_innodb_monitor(srv_monitor_file);
|
srv_printf_innodb_monitor(srv_monitor_file);
|
||||||
flen = ftell(srv_monitor_file);
|
flen = ftell(srv_monitor_file);
|
||||||
os_file_set_eof(srv_monitor_file);
|
os_file_set_eof(srv_monitor_file);
|
||||||
|
|
||||||
if (flen < 0) {
|
if (flen < 0) {
|
||||||
flen = 0;
|
flen = 0;
|
||||||
} else if (flen > 64000 - 1) {
|
} else if (flen > 64000 - 1) {
|
||||||
@ -5669,9 +5684,9 @@ innodb_show_status(
|
|||||||
/* allocate buffer for the string, and
|
/* allocate buffer for the string, and
|
||||||
read the contents of the temporary file */
|
read the contents of the temporary file */
|
||||||
|
|
||||||
if (!(str = my_malloc(flen + 1, MYF(0))))
|
if (!(str = my_malloc(flen + 1, MYF(0)))) {
|
||||||
{
|
|
||||||
mutex_exit_noninline(&srv_monitor_file_mutex);
|
mutex_exit_noninline(&srv_monitor_file_mutex);
|
||||||
|
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5686,7 +5701,6 @@ innodb_show_status(
|
|||||||
|
|
||||||
if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS |
|
if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS |
|
||||||
Protocol::SEND_EOF)) {
|
Protocol::SEND_EOF)) {
|
||||||
|
|
||||||
my_free(str, MYF(0));
|
my_free(str, MYF(0));
|
||||||
|
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
@ -5696,10 +5710,12 @@ innodb_show_status(
|
|||||||
protocol->store(str, flen, system_charset_info);
|
protocol->store(str, flen, system_charset_info);
|
||||||
my_free(str, MYF(0));
|
my_free(str, MYF(0));
|
||||||
|
|
||||||
if (protocol->write())
|
if (protocol->write()) {
|
||||||
DBUG_RETURN(TRUE);
|
|
||||||
|
|
||||||
|
DBUG_RETURN(TRUE);
|
||||||
|
}
|
||||||
send_eof(thd);
|
send_eof(thd);
|
||||||
|
|
||||||
DBUG_RETURN(FALSE);
|
DBUG_RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6115,7 +6131,8 @@ ha_innobase::cmp_ref(
|
|||||||
|
|
||||||
/* Do type-aware comparison of Primary Key members. PK members
|
/* Do type-aware comparison of Primary Key members. PK members
|
||||||
are always NOT NULL, so no checks for NULL are performed */
|
are always NOT NULL, so no checks for NULL are performed */
|
||||||
KEY_PART_INFO *key_part= table->key_info[table->s->primary_key].key_part;
|
KEY_PART_INFO *key_part=
|
||||||
|
table->key_info[table->s->primary_key].key_part;
|
||||||
KEY_PART_INFO *key_part_end=
|
KEY_PART_INFO *key_part_end=
|
||||||
key_part + table->key_info[table->s->primary_key].key_parts;
|
key_part + table->key_info[table->s->primary_key].key_parts;
|
||||||
for (; key_part != key_part_end; ++key_part) {
|
for (; key_part != key_part_end; ++key_part) {
|
||||||
@ -6260,19 +6277,21 @@ innobase_query_is_update(void)
|
|||||||
|
|
||||||
thd = (THD *)innobase_current_thd();
|
thd = (THD *)innobase_current_thd();
|
||||||
|
|
||||||
if ( thd->lex->sql_command == SQLCOM_REPLACE ||
|
if (thd->lex->sql_command == SQLCOM_REPLACE ||
|
||||||
thd->lex->sql_command == SQLCOM_REPLACE_SELECT ||
|
thd->lex->sql_command == SQLCOM_REPLACE_SELECT ||
|
||||||
( thd->lex->sql_command == SQLCOM_LOAD &&
|
(thd->lex->sql_command == SQLCOM_LOAD &&
|
||||||
thd->lex->duplicates == DUP_REPLACE )) {
|
thd->lex->duplicates == DUP_REPLACE)) {
|
||||||
return true;
|
|
||||||
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( thd->lex->sql_command == SQLCOM_INSERT &&
|
if (thd->lex->sql_command == SQLCOM_INSERT &&
|
||||||
thd->lex->duplicates == DUP_UPDATE ) {
|
thd->lex->duplicates == DUP_UPDATE) {
|
||||||
return true;
|
|
||||||
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6308,7 +6327,8 @@ innobase_xa_prepare(
|
|||||||
"InnoDB: but trx->conc_state != TRX_NOT_STARTED\n");
|
"InnoDB: but trx->conc_state != TRX_NOT_STARTED\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (all || (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) {
|
if (all
|
||||||
|
|| (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) {
|
||||||
|
|
||||||
/* We were instructed to prepare the whole transaction, or
|
/* We were instructed to prepare the whole transaction, or
|
||||||
this is an SQL statement end and autocommit is on */
|
this is an SQL statement end and autocommit is on */
|
||||||
@ -6359,10 +6379,11 @@ innobase_xa_recover(
|
|||||||
uint len) /* in: number of slots in xid_list */
|
uint len) /* in: number of slots in xid_list */
|
||||||
{
|
{
|
||||||
if (len == 0 || xid_list == NULL) {
|
if (len == 0 || xid_list == NULL) {
|
||||||
return 0;
|
|
||||||
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (trx_recover_for_mysql(xid_list, len));
|
return(trx_recover_for_mysql(xid_list, len));
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
@ -6373,7 +6394,7 @@ int
|
|||||||
innobase_commit_by_xid(
|
innobase_commit_by_xid(
|
||||||
/*===================*/
|
/*===================*/
|
||||||
/* out: 0 or error number */
|
/* out: 0 or error number */
|
||||||
XID* xid) /* in: X/Open XA Transaction Identification */
|
XID* xid) /* in: X/Open XA transaction identification */
|
||||||
{
|
{
|
||||||
trx_t* trx;
|
trx_t* trx;
|
||||||
|
|
||||||
@ -6396,7 +6417,7 @@ int
|
|||||||
innobase_rollback_by_xid(
|
innobase_rollback_by_xid(
|
||||||
/*=====================*/
|
/*=====================*/
|
||||||
/* out: 0 or error number */
|
/* out: 0 or error number */
|
||||||
XID *xid) /* in : X/Open XA Transaction Idenfification */
|
XID *xid) /* in: X/Open XA transaction idenfification */
|
||||||
{
|
{
|
||||||
trx_t* trx;
|
trx_t* trx;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user