3295 Marko Mäkelä 2011-01-27 [merge]
Merge mysql-5.1-innodb to mysql-5.5-innodb.
modified:
storage/innobase/include/trx0trx.h
storage/innobase/trx/trx0trx.c
3294 Marko Mäkelä 2011-01-27
ibuf_contract_ext(): Remove an #if 0 section of code
that refers to trx_sys_set_ibuf_format().
Change buffer format tagging was never implemented.
modified:
storage/innobase/ibuf/ibuf0ibuf.c
3293 Marko Mäkelä 2011-01-26 [merge]
Merge mysql-5.1-innodb to mysql-5.5-innodb.
modified:
storage/innobase/row/row0upd.c
=== modified file 'storage/innobase/ibuf/ibuf0ibuf.c'
--- a/storage/innobase/ibuf/ibuf0ibuf.c revid:marko.makela@stripped
+++ b/storage/innobase/ibuf/ibuf0ibuf.c revid:marko.makela@oracle.com-20110127113059-g5s3u7pdce5ps6g1
@@ -2585,23 +2585,6 @@ ibuf_contract_ext(
if (UNIV_UNLIKELY(ibuf->empty)
&& UNIV_LIKELY(!srv_shutdown_state)) {
-ibuf_is_empty:
-
-#if 0 /* TODO */
- if (srv_shutdown_state) {
- /* If the insert buffer becomes empty during
- shutdown, note it in the system tablespace. */
-
- trx_sys_set_ibuf_format(TRX_SYS_IBUF_EMPTY);
- }
-
- /* TO DO: call trx_sys_set_ibuf_format() at startup
- and whenever ibuf_use is changed to allow buffered
- delete-marking or deleting. Never downgrade the
- stamped format except when the insert buffer becomes
- empty. */
-#endif
-
return(0);
}
@@ -2631,7 +2614,7 @@ ibuf_is_empty:
mtr_commit(&mtr);
btr_pcur_close(&pcur);
- goto ibuf_is_empty;
+ return(0);
}
sum_sizes = ibuf_get_merge_page_nos(TRUE, btr_pcur_get_rec(&pcur),
=== modified file 'storage/innobase/include/trx0trx.h'
--- a/storage/innobase/include/trx0trx.h revid:marko.makela@stripped110126080252-vlp173hj98x1orek
+++ b/storage/innobase/include/trx0trx.h revid:marko.makela@stripped9-g5s3u7pdce5ps6g1
@@ -214,12 +214,12 @@ trx_recover_for_mysql(
/*******************************************************************//**
This function is used to find one X/Open XA distributed transaction
which is in the prepared state
-@return trx or NULL */
+@return trx or NULL; on match, the trx->xid will be invalidated */
UNIV_INTERN
trx_t *
trx_get_trx_by_xid(
/*===============*/
- XID* xid); /*!< in: X/Open XA transaction identification */
+ const XID* xid); /*!< in: X/Open XA transaction identifier */
/**********************************************************************//**
If required, flushes the log to disk if we called trx_commit_for_mysql()
with trx->flush_log_later == TRUE.
=== modified file 'storage/innobase/trx/trx0trx.c'
--- a/storage/innobase/trx/trx0trx.c revid:marko.makela@strippedrek
+++ b/storage/innobase/trx/trx0trx.c revid:marko.makela@stripped
@@ -2004,18 +2004,18 @@ trx_recover_for_mysql(
/*******************************************************************//**
This function is used to find one X/Open XA distributed transaction
which is in the prepared state
-@return trx or NULL */
+@return trx or NULL; on match, the trx->xid will be invalidated */
UNIV_INTERN
trx_t*
trx_get_trx_by_xid(
/*===============*/
- XID* xid) /*!< in: X/Open XA transaction identification */
+ const XID* xid) /*!< in: X/Open XA transaction identifier */
{
trx_t* trx;
if (xid == NULL) {
- return (NULL);
+ return(NULL);
}
mutex_enter(&kernel_mutex);
@@ -2028,10 +2028,16 @@ trx_get_trx_by_xid(
of gtrid_length+bqual_length bytes should be
the same */
- if (xid->gtrid_length == trx->xid.gtrid_length
+ if (trx->conc_state == TRX_PREPARED
+ && xid->gtrid_length == trx->xid.gtrid_length
&& xid->bqual_length == trx->xid.bqual_length
&& memcmp(xid->data, trx->xid.data,
xid->gtrid_length + xid->bqual_length) == 0) {
+
+ /* Invalidate the XID, so that subsequent calls
+ will not find it. */
+ memset(&trx->xid, 0, sizeof(trx->xid));
+ trx->xid.formatID = -1;
break;
}
@@ -2040,14 +2046,5 @@ trx_get_trx_by_xid(
mutex_exit(&kernel_mutex);
- if (trx) {
- if (trx->conc_state != TRX_PREPARED) {
-
- return(NULL);
- }
-
- return(trx);
- } else {
- return(NULL);
- }
+ return(trx);
}
Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20110127113059-g5s3u7pdce5ps6g1.bundle
| Thread |
|---|
| • bzr push into mysql-5.5-innodb branch (marko.makela:3293 to 3295) | marko.makela | 27 Jan |