Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
1bfbbaaa
Commit
1bfbbaaa
authored
Jun 29, 2011
by
Marc Alff
Browse files
Options
Browse Files
Download
Plain Diff
local merge
parents
6f1decbf
1b686f2a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
64 deletions
+68
-64
storage/innobase/include/row0row.h
storage/innobase/include/row0row.h
+9
-19
storage/innobase/include/row0row.ic
storage/innobase/include/row0row.ic
+11
-14
storage/innobase/include/row0upd.ic
storage/innobase/include/row0upd.ic
+2
-2
storage/innobase/include/trx0sys.h
storage/innobase/include/trx0sys.h
+10
-1
storage/innobase/include/trx0sys.ic
storage/innobase/include/trx0sys.ic
+23
-1
storage/innobase/row/row0row.c
storage/innobase/row/row0row.c
+13
-27
No files found.
storage/innobase/include/row0row.h
View file @
1bfbbaaa
/*****************************************************************************
Copyright (c) 1996, 201
0, Innobase Oy
. All Rights Reserved.
Copyright (c) 1996, 201
1, Oracle and/or its affiliates
. All Rights Reserved.
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 the Free Software
...
...
@@ -38,27 +38,16 @@ Created 4/20/1996 Heikki Tuuri
#include "btr0types.h"
/*********************************************************************//**
Gets the offset of the
trx id
field, in bytes relative to the origin of
Gets the offset of the
DB_TRX_ID
field, in bytes relative to the origin of
a clustered index record.
@return offset of DATA_TRX_ID */
UNIV_INLINE
ulint
row_get_trx_id_offset_func
(
/*=======================*/
#ifdef UNIV_DEBUG
const
rec_t
*
rec
,
/*!< in: record */
#endif
/* UNIV_DEBUG */
row_get_trx_id_offset
(
/*==================*/
const
dict_index_t
*
index
,
/*!< in: clustered index */
const
ulint
*
offsets
)
/*!< in: rec
_get_offsets(rec, index)
*/
const
ulint
*
offsets
)
/*!< in: rec
ord offsets
*/
__attribute__
((
nonnull
,
warn_unused_result
));
#ifdef UNIV_DEBUG
# define row_get_trx_id_offset(rec, index, offsets) \
row_get_trx_id_offset_func(rec, index, offsets)
#else
/* UNIV_DEBUG */
# define row_get_trx_id_offset(rec, index, offsets) \
row_get_trx_id_offset_func(index, offsets)
#endif
/* UNIV_DEBUG */
/*********************************************************************//**
Reads the trx id field from a clustered index record.
@return value of the field */
...
...
@@ -78,8 +67,9 @@ roll_ptr_t
row_get_rec_roll_ptr
(
/*=================*/
const
rec_t
*
rec
,
/*!< in: record */
dict_index_t
*
index
,
/*!< in: clustered index */
const
ulint
*
offsets
);
/*!< in: rec_get_offsets(rec, index) */
const
dict_index_t
*
index
,
/*!< in: clustered index */
const
ulint
*
offsets
)
/*!< in: rec_get_offsets(rec, index) */
__attribute__
((
nonnull
,
warn_unused_result
));
/*****************************************************************//**
When an insert or purge to a table is performed, this function builds
the entry to be inserted into or purged from an index on the table.
...
...
storage/innobase/include/row0row.ic
View file @
1bfbbaaa
/*****************************************************************************
Copyright (c) 1996, 20
09, Innobase Oy
. All Rights Reserved.
Copyright (c) 1996, 20
11, Oracle and/or its affiliates
. All Rights Reserved.
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 the Free Software
...
...
@@ -28,25 +28,22 @@ Created 4/20/1996 Heikki Tuuri
#include "trx0undo.h"
/*********************************************************************//**
Gets the offset of t
rx id
field, in bytes relative to the origin of
Gets the offset of t
he DB_TRX_ID
field, in bytes relative to the origin of
a clustered index record.
@return offset of DATA_TRX_ID */
UNIV_INLINE
ulint
row_get_trx_id_offset_func(
/*=======================*/
#ifdef UNIV_DEBUG
const rec_t* rec, /*!< in: record */
#endif /* UNIV_DEBUG */
row_get_trx_id_offset(
/*==================*/
const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: rec
_get_offsets(rec, index)
*/
const ulint* offsets)/*!< in: rec
ord offsets
*/
{
ulint pos;
ulint offset;
ulint len;
ut_ad(dict_index_is_clust(index));
ut_ad(rec_offs_validate(
rec
, index, offsets));
ut_ad(rec_offs_validate(
NULL
, index, offsets));
pos = dict_index_get_sys_col_pos(index, DATA_TRX_ID);
...
...
@@ -76,7 +73,7 @@ row_get_rec_trx_id(
offset = index->trx_id_offset;
if (!offset) {
offset = row_get_trx_id_offset(
rec,
index, offsets);
offset = row_get_trx_id_offset(index, offsets);
}
return(trx_read_trx_id(rec + offset));
...
...
@@ -90,7 +87,7 @@ roll_ptr_t
row_get_rec_roll_ptr(
/*=================*/
const rec_t* rec, /*!< in: record */
dict_index_t* index, /*!< in: clustered index */
const
dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
{
ulint offset;
...
...
@@ -101,7 +98,7 @@ row_get_rec_roll_ptr(
offset = index->trx_id_offset;
if (!offset) {
offset = row_get_trx_id_offset(
rec,
index, offsets);
offset = row_get_trx_id_offset(index, offsets);
}
return(trx_read_roll_ptr(rec + offset + DATA_TRX_ID_LEN));
...
...
storage/innobase/include/row0upd.ic
View file @
1bfbbaaa
/*****************************************************************************
Copyright (c) 1996, 20
09, Innobase Oy
. All Rights Reserved.
Copyright (c) 1996, 20
11, Oracle and/or its affiliates
. All Rights Reserved.
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 the Free Software
...
...
@@ -171,7 +171,7 @@ row_upd_rec_sys_fields(
ulint offset = index->trx_id_offset;
if (!offset) {
offset = row_get_trx_id_offset(
rec,
index, offsets);
offset = row_get_trx_id_offset(index, offsets);
}
#if DATA_TRX_ID + 1 != DATA_ROLL_PTR
...
...
storage/innobase/include/trx0sys.h
View file @
1bfbbaaa
/*****************************************************************************
Copyright (c) 1996, 2011,
Innobase Oy
. All Rights Reserved.
Copyright (c) 1996, 2011,
Oracle and/or its affiliates
. All Rights Reserved.
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 the Free Software
...
...
@@ -278,6 +278,15 @@ ibool
trx_in_trx_list
(
/*============*/
trx_t
*
in_trx
);
/*!< in: trx */
/***********************************************************//**
Assert that a transaction has been recovered.
@return TRUE */
UNIV_INLINE
ibool
trx_assert_recovered
(
/*=================*/
trx_id_t
trx_id
)
/*!< in: transaction identifier */
__attribute__
((
warn_unused_result
));
/*****************************************************************//**
Updates the offset information about the end of the MySQL binlog entry
which corresponds to the transaction just being committed. In a MySQL
...
...
storage/innobase/include/trx0sys.ic
View file @
1bfbbaaa
/*****************************************************************************
Copyright (c) 1996, 20
09, Innobase Oy
. All Rights Reserved.
Copyright (c) 1996, 20
11, Oracle and/or its affiliates
. All Rights Reserved.
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 the Free Software
...
...
@@ -277,6 +277,28 @@ trx_get_on_id(
return(NULL);
}
#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
/***********************************************************//**
Assert that a transaction has been recovered.
@return TRUE */
UNIV_INLINE
ibool
trx_assert_recovered(
/*=================*/
trx_id_t trx_id) /*!< in: transaction identifier */
{
trx_t* trx;
mutex_enter(&kernel_mutex);
trx = trx_get_on_id(trx_id);
ut_a(trx);
ut_a(trx->is_recovered);
mutex_exit(&kernel_mutex);
return(TRUE);
}
#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
/****************************************************************//**
Returns the minumum trx id in trx list. This is the smallest id for which
the trx can possibly be active. (But, you must look at the trx->conc_state to
...
...
storage/innobase/row/row0row.c
View file @
1bfbbaaa
...
...
@@ -202,7 +202,6 @@ row_build(
}
#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
if
(
UNIV_LIKELY_NULL
(
rec_offs_any_null_extern
(
rec
,
offsets
)))
{
/* This condition can occur during crash recovery before
trx_rollback_active() has completed execution.
...
...
@@ -211,24 +210,11 @@ row_build(
btr_store_big_rec_extern_fields() did mtr_commit() all
BLOB pointers to the clustered index record.
Look up the transaction that holds the implicit lock
on this record, and assert that it was recovered (and
will soon be rolled back). */
ulint
trx_id_pos
=
dict_index_get_sys_col_pos
(
index
,
DATA_TRX_ID
);
ulint
len
;
trx_id_t
trx_id
=
trx_read_trx_id
(
rec_get_nth_field
(
rec
,
offsets
,
trx_id_pos
,
&
len
));
trx_t
*
trx
;
ut_a
(
len
==
6
);
mutex_enter
(
&
kernel_mutex
);
trx
=
trx_get_on_id
(
trx_id
);
ut_a
(
trx
);
ut_a
(
trx
->
is_recovered
);
mutex_exit
(
&
kernel_mutex
);
}
If the record contains a null BLOB pointer, look up the
transaction that holds the implicit lock on this record, and
assert that it was recovered (and will soon be rolled back). */
ut_a
(
!
rec_offs_any_null_extern
(
rec
,
offsets
)
||
trx_assert_recovered
(
row_get_rec_trx_id
(
rec
,
index
,
offsets
)));
#endif
/* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
if
(
type
!=
ROW_COPY_POINTERS
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment