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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
fa79f6ac
Commit
fa79f6ac
authored
7 years ago
by
Eugene Kosov
Committed by
Aleksey Midenkov
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IB: style changes [closes #306]
parent
8972291a
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
82 additions
and
81 deletions
+82
-81
storage/innobase/handler/ha_innodb.h
storage/innobase/handler/ha_innodb.h
+1
-4
storage/innobase/include/dict0load.h
storage/innobase/include/dict0load.h
+10
-7
storage/innobase/include/row0merge.h
storage/innobase/include/row0merge.h
+1
-0
storage/innobase/include/row0mysql.h
storage/innobase/include/row0mysql.h
+6
-6
storage/innobase/include/row0upd.h
storage/innobase/include/row0upd.h
+4
-2
storage/innobase/include/sync0policy.h
storage/innobase/include/sync0policy.h
+1
-5
storage/innobase/include/trx0trx.h
storage/innobase/include/trx0trx.h
+29
-2
storage/innobase/include/trx0vtq.h
storage/innobase/include/trx0vtq.h
+0
-40
storage/innobase/row/row0ins.cc
storage/innobase/row/row0ins.cc
+14
-8
storage/innobase/row/row0merge.cc
storage/innobase/row/row0merge.cc
+1
-0
storage/innobase/row/row0mysql.cc
storage/innobase/row/row0mysql.cc
+1
-0
storage/innobase/vers/vers0vtq.cc
storage/innobase/vers/vers0vtq.cc
+14
-7
No files found.
storage/innobase/handler/ha_innodb.h
View file @
fa79f6ac
...
...
@@ -223,9 +223,6 @@ class ha_innobase: public handler
ha_rows
estimate_rows_upper_bound
();
// JAN: TODO: MySQL 5.7
ha_rows
records_new
();
// FIXME: rename to records(), fix main.bug39022
void
update_create_info
(
HA_CREATE_INFO
*
create_info
);
int
create
(
...
...
@@ -458,7 +455,7 @@ class ha_innobase: public handler
void
reset_template
();
protected:
void
update_thd
(
THD
*
thd
);
inline
void
update_thd
(
THD
*
thd
);
void
update_thd
();
int
general_fetch
(
uchar
*
buf
,
uint
direction
,
uint
match_mode
);
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/include/dict0load.h
View file @
fa79f6ac
...
...
@@ -31,7 +31,6 @@ Created 4/24/1996 Heikki Tuuri
#include "univ.i"
#include "dict0types.h"
#include "trx0types.h"
#include "trx0vtq.h"
#include "ut0byte.h"
#include "mem0mem.h"
#include "btr0types.h"
...
...
@@ -39,6 +38,8 @@ Created 4/24/1996 Heikki Tuuri
#include <deque>
struct
vtq_record_t
;
/** A stack of table names related through foreign key constraints */
typedef
std
::
deque
<
const
char
*
,
ut_allocator
<
const
char
*>
>
dict_names_t
;
...
...
@@ -317,17 +318,19 @@ dict_process_sys_datafiles(
const
rec_t
*
rec
,
/*!< in: current SYS_DATAFILES rec */
ulint
*
space
,
/*!< out: pace id */
const
char
**
path
);
/*!< out: datafile path */
/********************************************************************//**
This function parses a SYS_VTQ record, extracts necessary
/**
This function parses a SYS_VTQ record, extracts necessary
information from the record and returns it to the caller.
@param[in,out] heap Heap memory
@param[in] rec Current record
@param[out] fields Field values
@return error message, or NULL on success */
UNIV_INTERN
const
char
*
dict_process_sys_vtq
(
/*=======================*/
mem_heap_t
*
heap
,
/*!< in/out: heap memory */
const
rec_t
*
rec
,
/*!< in: current rec */
vtq_record_t
&
fields
/*!< out: field values */
mem_heap_t
*
heap
,
/*!< in/out: heap memory */
const
rec_t
*
rec
,
/*!< in: current rec */
vtq_record_t
&
fields
/*!< out: field values */
);
/** Update the record for space_id in SYS_TABLESPACES to this filepath.
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/include/row0merge.h
View file @
fa79f6ac
...
...
@@ -325,6 +325,7 @@ this function and it will be passed to other functions for further accounting.
@param[in] add_v new virtual columns added along with indexes
@param[in] eval_table mysql table used to evaluate virtual column
value, see innobase_get_computed_value().
@param[in] drop_historical whether to drop historical system rows
@return DB_SUCCESS or error code */
dberr_t
row_merge_build_indexes
(
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/include/row0mysql.h
View file @
fa79f6ac
...
...
@@ -235,18 +235,17 @@ row_lock_table_for_mysql(
(ignored if table==NULL) */
MY_ATTRIBUTE
((
nonnull
(
1
)));
/* System Versioning: row_insert_for_mysql() modes */
/*
*
System Versioning: row_insert_for_mysql() modes */
enum
ins_mode_t
{
ROW_INS_NORMAL
=
0
,
// insert versioned row: sys_trx_start = TRX_ID, sys_trx_end = MAX
ROW_INS_VERSIONED
,
// insert historical row: sys_trx_end = TRX_ID
ROW_INS_HISTORICAL
ROW_INS_NORMAL
=
0
,
///< plain row (without versioning)
ROW_INS_VERSIONED
,
///< sys_trx_start = TRX_ID, sys_trx_end = MAX
ROW_INS_HISTORICAL
///< sys_trx_end = TRX_ID
};
/** Does an insert for MySQL.
@param[in] mysql_rec row in the MySQL format
@param[in,out] prebuilt prebuilt struct in MySQL handle
@param[in] ins_mode what row type we're inserting
@return error code or DB_SUCCESS*/
dberr_t
row_insert_for_mysql
(
...
...
@@ -274,6 +273,7 @@ row_get_prebuilt_update_vector(
handle */
/** Does an update or delete of a row for MySQL.
@param[in,out] prebuilt prebuilt struct in MySQL handle
@param[in] vers_set_fields working with system versioned table
@return error code or DB_SUCCESS */
dberr_t
row_update_for_mysql
(
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/include/row0upd.h
View file @
fa79f6ac
...
...
@@ -573,8 +573,10 @@ struct upd_node_t{
compilation; speeds up execution:
UPD_NODE_NO_ORD_CHANGE and
UPD_NODE_NO_SIZE_CHANGE, ORed */
bool
versioned
;
/* update is versioned */
bool
vers_delete
;
/* versioned delete */
/** working with system versioned table */
bool
versioned
;
/** set sys_trx_end = CUR_TRX_ID */
bool
vers_delete
;
/*----------------------*/
/* Local storage for this graph node */
ulint
state
;
/*!< node execution state */
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/include/sync0policy.h
View file @
fa79f6ac
...
...
@@ -59,11 +59,7 @@ class MutexDebug {
@param[in] id ID of the latch to track */
Context
(
latch_id_t
id
)
:
latch_t
(
id
),
m_mutex
(),
m_filename
(),
m_line
(),
m_thread_id
(
os_thread_id_t
(
ULINT_UNDEFINED
))
latch_t
(
id
)
{
ut_ad
(
id
!=
LATCH_ID_NONE
);
}
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/include/trx0trx.h
View file @
fa79f6ac
...
...
@@ -42,7 +42,6 @@ Created 3/26/1996 Heikki Tuuri
#include "que0types.h"
#include "mem0mem.h"
#include "trx0xa.h"
#include "trx0vtq.h"
#include "ut0vec.h"
#include "fts0fts.h"
#include "srv0srv.h"
...
...
@@ -884,6 +883,33 @@ struct TrxVersion {
ulint
m_version
;
};
/** Class which is used to query VTQ and also serves as a cache to VTQ of size 1
*/
class
vtq_query_t
{
public:
/** VTQ used to translate timestamps to nearest trx_id and this is
a timestamp for a row we're caching now */
timeval
prev_query
;
/** We search for nearest trx_id on the left or on the right and
we search forwards or backwards */
bool
backwards
;
/** Cached row from VTQ */
vtq_record_t
result
;
/** Parses record and stores its value in a result field
but disables a cache */
const
char
*
cache_result
(
mem_heap_t
*
heap
,
const
rec_t
*
rec
);
/** Parses record and stores its value in a result field and enables
cache (prev_query, backward) */
const
char
*
cache_result
(
mem_heap_t
*
heap
,
const
rec_t
*
rec
,
const
timeval
&
_ts_query
,
bool
_backwards
);
};
typedef
std
::
list
<
TrxVersion
,
ut_allocator
<
TrxVersion
>
>
hit_list_t
;
struct
trx_t
{
...
...
@@ -1272,7 +1298,8 @@ struct trx_t {
/* System Versioning */
bool
vtq_notify_on_commit
;
/*!< Notify VTQ for System Versioned update */
vtq_query_t
vtq_query
;
vtq_query_t
vtq_query
;
/*!< Structure to query VTQ and store
one row result */
ulint
magic_n
;
/** @return whether any persistent undo log has been generated */
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/include/trx0vtq.h
deleted
100644 → 0
View file @
8972291a
#ifndef trx0vtq_h
#define trx0vtq_h
/* Copyright (c) 2016, MariaDB Corporation.
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 Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#include <vtq.h>
#include "trx0types.h"
#include "mem0mem.h"
#include "rem0types.h"
class
vtq_query_t
{
public:
timeval
prev_query
;
bool
backwards
;
vtq_record_t
result
;
const
char
*
cache_result
(
mem_heap_t
*
heap
,
const
rec_t
*
rec
);
const
char
*
cache_result
(
mem_heap_t
*
heap
,
const
rec_t
*
rec
,
const
timeval
&
_ts_query
,
bool
_backwards
);
};
#endif // trx0vtq_h
This diff is collapsed.
Click to expand it.
storage/innobase/row/row0ins.cc
View file @
fa79f6ac
...
...
@@ -1594,17 +1594,21 @@ row_ins_get_sys_trx_end(
return
(
mach_read_from_8
(
field
));
}
/**
*******************************************************************//**
/**
Performs search at clustered index and returns sys_trx_end if row was found.
@param[in] index secondary index of record
@param[in] rec record in a secondary index
@param[out] end_trx_id value from clustered index
@return DB_SUCCESS, DB_NO_REFERENCED_ROW */
static
dberr_t
row_ins_search_sys_trx_end
(
/*=======================*/
dict_index_t
*
index
,
/*!< in: index of record */
const
rec_t
*
rec
,
/*!< in: record */
trx_id_t
*
end_trx_id
)
/*!< out: end_trx_id */
dict_index_t
*
index
,
const
rec_t
*
rec
,
trx_id_t
*
end_trx_id
)
{
ut_ad
(
!
index
->
is_clust
());
bool
found
=
false
;
mem_heap_t
*
heap
=
mem_heap_create
(
256
);
dict_index_t
*
clust_index
=
NULL
;
...
...
@@ -1629,7 +1633,8 @@ row_ins_search_sys_trx_end(
mtr_commit
(
&
mtr
);
mem_heap_free
(
heap
);
if
(
!
found
)
{
fprintf
(
stderr
,
"InnoDB: foreign constraints: secondary index is out of sync
\n
"
);
ib
::
error
()
<<
"foreign constraints: secondary index is out of "
"sync"
;
ut_ad
(
false
&&
"secondary index is out of sync"
);
return
(
DB_NO_REFERENCED_ROW
);
}
...
...
@@ -4014,7 +4019,7 @@ vers_row_ins_vtq_low(trx_t* trx, mem_heap_t* heap, dtuple_t* tuple)
break
;
case
DB_SUCCESS_LOCKED_REC
:
/* The row had already been copied to the table. */
fprintf
(
stderr
,
"InnoDB: duplicate VTQ record!
\n
"
)
;
ib
::
info
()
<<
"InnoDB: duplicate VTQ record!"
;
return
DB_SUCCESS
;
default:
return
err
;
...
...
@@ -4068,7 +4073,8 @@ void vers_notify_vtq(trx_t* trx)
err
=
vers_row_ins_vtq_low
(
trx
,
heap
,
tuple
);
if
(
DB_SUCCESS
!=
err
)
fprintf
(
stderr
,
"InnoDB: failed to insert VTQ record (error %d)
\n
"
,
err
);
ib
::
error
()
<<
"failed to insert VTQ record (error "
<<
err
<<
")"
;
mem_heap_free
(
heap
);
}
This diff is collapsed.
Click to expand it.
storage/innobase/row/row0merge.cc
View file @
fa79f6ac
...
...
@@ -4603,6 +4603,7 @@ this function and it will be passed to other functions for further accounting.
@param[in] add_v new virtual columns added along with indexes
@param[in] eval_table mysql table used to evaluate virtual column
value, see innobase_get_computed_value().
@param[in] drop_historical whether to drop historical system rows
@return DB_SUCCESS or error code */
dberr_t
row_merge_build_indexes
(
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/row/row0mysql.cc
View file @
fa79f6ac
...
...
@@ -1863,6 +1863,7 @@ class ib_dec_counter {
/** Does an update or delete of a row for MySQL.
@param[in,out] prebuilt prebuilt struct in MySQL handle
@param[in] vers_set_fields working with system versioned table
@return error code or DB_SUCCESS */
dberr_t
row_update_for_mysql
(
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/vers/vers0vtq.cc
View file @
fa79f6ac
...
...
@@ -23,7 +23,6 @@
#include "row0row.h"
#include "trx0trx.h"
#include "trx0types.h"
#include "trx0vtq.h"
/** Field or record selector.
...
...
@@ -145,7 +144,9 @@ vtq_query_trx_id(THD* thd, void *out, ulonglong _in_trx_id, vtq_field_t field)
{
const
char
*
err
=
trx
->
vtq_query
.
cache_result
(
heap
,
rec
);
if
(
err
)
{
fprintf
(
stderr
,
"InnoDB: vtq_query_trx_id: get VTQ field failed: %s
\n
"
,
err
);
ib
::
error
()
<<
"vtq_query_trx_id: get VTQ field failed: "
<<
err
;
ut_ad
(
false
&&
"get VTQ field failed"
);
goto
not_found
;
}
...
...
@@ -378,7 +379,8 @@ vtq_query_commit_ts(
found:
clust_rec
=
row_get_clust_rec
(
BTR_SEARCH_LEAF
,
rec
,
index
,
&
clust_index
,
&
mtr
);
if
(
!
clust_rec
)
{
fprintf
(
stderr
,
"InnoDB: vtq_query_commit_ts: secondary index is out of sync
\n
"
);
ib
::
error
()
<<
"vtq_query_commit_ts: secondary index is out of "
"sync"
;
ut_ad
(
false
&&
"secondary index is out of sync"
);
goto
not_found
;
}
...
...
@@ -391,7 +393,9 @@ vtq_query_commit_ts(
rec_ts
,
backwards
);
if
(
err
)
{
fprintf
(
stderr
,
"InnoDB: vtq_query_commit_ts: get VTQ field failed: %s
\n
"
,
err
);
ib
::
error
()
<<
"vtq_query_commit_ts: get VTQ field failed: "
<<
err
;
ut_ad
(
false
&&
"get VTQ field failed"
);
goto
not_found
;
}
...
...
@@ -438,10 +442,11 @@ vtq_trx_sees(
DBUG_RETURN
(
true
);
}
static
const
char
*
msg_cant_find
=
"InnoDB: vtq_trx_sees: can't find COMMIT_ID%c by TRX_ID: %llu
\n
"
;
if
(
!
commit_id1
)
{
if
(
!
vtq_query_trx_id
(
thd
,
NULL
,
trx_id1
,
VTQ_ALL
))
{
fprintf
(
stderr
,
msg_cant_find
,
'1'
,
trx_id1
);
ib
::
info
()
<<
"vtq_trx_sees: can't find COMMIT_ID0 by "
"TRX_ID: "
<<
trx_id1
;
DBUG_RETURN
(
false
);
}
trx_t
*
trx
=
thd_to_trx
(
thd
);
...
...
@@ -452,7 +457,9 @@ vtq_trx_sees(
if
(
!
commit_id0
)
{
if
(
!
vtq_query_trx_id
(
thd
,
&
commit_id0
,
trx_id0
,
VTQ_COMMIT_ID
))
{
fprintf
(
stderr
,
msg_cant_find
,
'0'
,
trx_id0
);
ib
::
info
()
<<
"vtq_trx_sees: can't find COMMIT_ID1 by "
"TRX_ID: "
<<
trx_id0
;
DBUG_RETURN
(
false
);
}
}
...
...
This diff is collapsed.
Click to expand it.
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