Merge mysql-5.1 to mysql-5.5.
Also, add debug check for trx_id sanity to row_upd_rec_sys_fields().
This commit is contained in:
commit
52a4ef95e8
@ -2017,7 +2017,6 @@ dict_index_build_internal_clust(
|
||||
{
|
||||
dict_index_t* new_index;
|
||||
dict_field_t* field;
|
||||
ulint fixed_size;
|
||||
ulint trx_id_pos;
|
||||
ulint i;
|
||||
ibool* indexed;
|
||||
@ -2094,7 +2093,7 @@ dict_index_build_internal_clust(
|
||||
|
||||
for (i = 0; i < trx_id_pos; i++) {
|
||||
|
||||
fixed_size = dict_col_get_fixed_size(
|
||||
ulint fixed_size = dict_col_get_fixed_size(
|
||||
dict_index_get_nth_col(new_index, i),
|
||||
dict_table_is_comp(table));
|
||||
|
||||
@ -2111,7 +2110,20 @@ dict_index_build_internal_clust(
|
||||
break;
|
||||
}
|
||||
|
||||
new_index->trx_id_offset += (unsigned int) fixed_size;
|
||||
/* Add fixed_size to new_index->trx_id_offset.
|
||||
Because the latter is a bit-field, an overflow
|
||||
can theoretically occur. Check for it. */
|
||||
fixed_size += new_index->trx_id_offset;
|
||||
|
||||
new_index->trx_id_offset = fixed_size;
|
||||
|
||||
if (new_index->trx_id_offset != fixed_size) {
|
||||
/* Overflow. Pretend that this is a
|
||||
variable-length PRIMARY KEY. */
|
||||
ut_ad(0);
|
||||
new_index->trx_id_offset = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -377,10 +377,15 @@ struct dict_index_struct{
|
||||
unsigned type:DICT_IT_BITS;
|
||||
/*!< index type (DICT_CLUSTERED, DICT_UNIQUE,
|
||||
DICT_UNIVERSAL, DICT_IBUF, DICT_CORRUPT) */
|
||||
unsigned trx_id_offset:10;/*!< position of the trx id column
|
||||
#define MAX_KEY_LENGTH_BITS 12
|
||||
unsigned trx_id_offset:MAX_KEY_LENGTH_BITS;
|
||||
/*!< position of the trx id column
|
||||
in a clustered index record, if the fields
|
||||
before it are known to be of a fixed size,
|
||||
0 otherwise */
|
||||
#if (1<<MAX_KEY_LENGTH_BITS) < MAX_KEY_LENGTH
|
||||
# error (1<<MAX_KEY_LENGTH_BITS) < MAX_KEY_LENGTH
|
||||
#endif
|
||||
unsigned n_user_defined_cols:10;
|
||||
/*!< number of columns the user defined to
|
||||
be in the index: in the internal
|
||||
|
@ -28,6 +28,7 @@ Created 12/27/1996 Heikki Tuuri
|
||||
# include "trx0trx.h"
|
||||
# include "trx0undo.h"
|
||||
# include "row0row.h"
|
||||
# include "lock0lock.h"
|
||||
#endif /* !UNIV_HOTBACKUP */
|
||||
#include "page0zip.h"
|
||||
|
||||
@ -171,6 +172,8 @@ row_upd_rec_sys_fields(
|
||||
#if DATA_TRX_ID + 1 != DATA_ROLL_PTR
|
||||
# error "DATA_TRX_ID + 1 != DATA_ROLL_PTR"
|
||||
#endif
|
||||
ut_ad(lock_check_trx_id_sanity(trx_read_trx_id(rec + offset),
|
||||
rec, index, offsets, FALSE));
|
||||
trx_write_trx_id(rec + offset, trx->id);
|
||||
trx_write_roll_ptr(rec + offset + DATA_TRX_ID_LEN, roll_ptr);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user