mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Creation of mysql-trunk = {summit + "Innodb plugin replacing the builtin"}:
bzr branch mysql-5.1-performance-version mysql-trunk # Summit cd mysql-trunk bzr merge mysql-5.1-innodb_plugin # which is 5.1 + Innodb plugin bzr rm innobase # remove the builtin Next step: build, test fixes.
This commit is contained in:
@ -1074,6 +1074,13 @@ int ha_commit_trans(THD *thd, bool all)
|
||||
user, or an implicit commit issued by a DDL.
|
||||
*/
|
||||
THD_TRANS *trans= all ? &thd->transaction.all : &thd->transaction.stmt;
|
||||
/*
|
||||
"real" is a nick name for a transaction for which a commit will
|
||||
make persistent changes. E.g. a 'stmt' transaction inside a 'all'
|
||||
transation is not 'real': even though it's possible to commit it,
|
||||
the changes are not durable as they might be rolled back if the
|
||||
enclosing 'all' transaction is rolled back.
|
||||
*/
|
||||
bool is_real_trans= all || thd->transaction.all.ha_list == 0;
|
||||
Ha_trx_info *ha_info= trans->ha_list;
|
||||
my_xid xid= thd->transaction.xid_state.xid.get_my_xid();
|
||||
@ -1185,16 +1192,9 @@ end:
|
||||
if (rw_trans)
|
||||
start_waiting_global_read_lock(thd);
|
||||
}
|
||||
else if (all)
|
||||
{
|
||||
/*
|
||||
A COMMIT of an empty transaction. There may be savepoints.
|
||||
Destroy them. If the transaction is not empty
|
||||
savepoints are cleared in ha_commit_one_phase()
|
||||
or ha_rollback_trans().
|
||||
*/
|
||||
/* Free resources and perform other cleanup even for 'empty' transactions. */
|
||||
else if (is_real_trans)
|
||||
thd->transaction.cleanup();
|
||||
}
|
||||
#endif /* USING_TRANSACTIONS */
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
@ -1207,6 +1207,13 @@ int ha_commit_one_phase(THD *thd, bool all)
|
||||
{
|
||||
int error=0;
|
||||
THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt;
|
||||
/*
|
||||
"real" is a nick name for a transaction for which a commit will
|
||||
make persistent changes. E.g. a 'stmt' transaction inside a 'all'
|
||||
transation is not 'real': even though it's possible to commit it,
|
||||
the changes are not durable as they might be rolled back if the
|
||||
enclosing 'all' transaction is rolled back.
|
||||
*/
|
||||
bool is_real_trans=all || thd->transaction.all.ha_list == 0;
|
||||
Ha_trx_info *ha_info= trans->ha_list, *ha_info_next;
|
||||
DBUG_ENTER("ha_commit_one_phase");
|
||||
@ -1228,8 +1235,6 @@ int ha_commit_one_phase(THD *thd, bool all)
|
||||
}
|
||||
trans->ha_list= 0;
|
||||
trans->no_2pc=0;
|
||||
if (is_real_trans)
|
||||
thd->transaction.xid_state.xid.null();
|
||||
if (all)
|
||||
{
|
||||
#ifdef HAVE_QUERY_CACHE
|
||||
@ -1237,9 +1242,11 @@ int ha_commit_one_phase(THD *thd, bool all)
|
||||
query_cache.invalidate(thd->transaction.changed_tables);
|
||||
#endif
|
||||
thd->variables.tx_isolation=thd->session_tx_isolation;
|
||||
thd->transaction.cleanup();
|
||||
}
|
||||
}
|
||||
/* Free resources and perform other cleanup even for 'empty' transactions. */
|
||||
if (is_real_trans)
|
||||
thd->transaction.cleanup();
|
||||
#endif /* USING_TRANSACTIONS */
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
@ -1250,6 +1257,13 @@ int ha_rollback_trans(THD *thd, bool all)
|
||||
int error=0;
|
||||
THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt;
|
||||
Ha_trx_info *ha_info= trans->ha_list, *ha_info_next;
|
||||
/*
|
||||
"real" is a nick name for a transaction for which a commit will
|
||||
make persistent changes. E.g. a 'stmt' transaction inside a 'all'
|
||||
transation is not 'real': even though it's possible to commit it,
|
||||
the changes are not durable as they might be rolled back if the
|
||||
enclosing 'all' transaction is rolled back.
|
||||
*/
|
||||
bool is_real_trans=all || thd->transaction.all.ha_list == 0;
|
||||
DBUG_ENTER("ha_rollback_trans");
|
||||
|
||||
@ -1295,18 +1309,13 @@ int ha_rollback_trans(THD *thd, bool all)
|
||||
}
|
||||
trans->ha_list= 0;
|
||||
trans->no_2pc=0;
|
||||
if (is_real_trans)
|
||||
{
|
||||
if (thd->transaction_rollback_request)
|
||||
thd->transaction.xid_state.rm_error= thd->main_da.sql_errno();
|
||||
else
|
||||
thd->transaction.xid_state.xid.null();
|
||||
}
|
||||
if (is_real_trans && thd->transaction_rollback_request)
|
||||
thd->transaction.xid_state.rm_error= thd->main_da.sql_errno();
|
||||
if (all)
|
||||
thd->variables.tx_isolation=thd->session_tx_isolation;
|
||||
}
|
||||
/* Always cleanup. Even if there nht==0. There may be savepoints. */
|
||||
if (all)
|
||||
if (is_real_trans)
|
||||
thd->transaction.cleanup();
|
||||
#endif /* USING_TRANSACTIONS */
|
||||
if (all)
|
||||
@ -2284,8 +2293,8 @@ int handler::update_auto_increment()
|
||||
DBUG_ASSERT(next_insert_id >= auto_inc_interval_for_cur_row.minimum());
|
||||
|
||||
if ((nr= table->next_number_field->val_int()) != 0 ||
|
||||
table->auto_increment_field_not_null &&
|
||||
thd->variables.sql_mode & MODE_NO_AUTO_VALUE_ON_ZERO)
|
||||
(table->auto_increment_field_not_null &&
|
||||
thd->variables.sql_mode & MODE_NO_AUTO_VALUE_ON_ZERO))
|
||||
{
|
||||
/*
|
||||
Update next_insert_id if we had already generated a value in this
|
||||
@ -3575,7 +3584,7 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name)
|
||||
int error;
|
||||
uchar *frmblob;
|
||||
size_t frmlen;
|
||||
char path[FN_REFLEN];
|
||||
char path[FN_REFLEN + 1];
|
||||
HA_CREATE_INFO create_info;
|
||||
TABLE table;
|
||||
TABLE_SHARE share;
|
||||
@ -3594,7 +3603,7 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name)
|
||||
frmblob and frmlen are set, write the frm to disk
|
||||
*/
|
||||
|
||||
build_table_filename(path, FN_REFLEN-1, db, name, "", 0);
|
||||
build_table_filename(path, sizeof(path) - 1, db, name, "", 0);
|
||||
// Save the frm file
|
||||
error= writefrm(path, frmblob, frmlen);
|
||||
my_free(frmblob, MYF(0));
|
||||
@ -4821,7 +4830,7 @@ fl_log_iterator_buffer_init(struct handler_iterator *iterator)
|
||||
if ((ptr= (uchar*)my_malloc(ALIGN_SIZE(sizeof(fl_buff)) +
|
||||
((ALIGN_SIZE(sizeof(LEX_STRING)) +
|
||||
sizeof(enum log_status) +
|
||||
+ FN_REFLEN) *
|
||||
+ FN_REFLEN + 1) *
|
||||
(uint) dirp->number_off_files),
|
||||
MYF(0))) == 0)
|
||||
{
|
||||
@ -4849,7 +4858,7 @@ fl_log_iterator_buffer_init(struct handler_iterator *iterator)
|
||||
name_ptr= strxnmov(buff->names[buff->entries].str= name_ptr,
|
||||
FN_REFLEN, fl_dir, file->name, NullS);
|
||||
buff->names[buff->entries].length= (name_ptr -
|
||||
buff->names[buff->entries].str) - 1;
|
||||
buff->names[buff->entries].str);
|
||||
buff->statuses[buff->entries]= st;
|
||||
buff->entries++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user