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
8c25ba62
Commit
8c25ba62
authored
Jan 14, 2014
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#166 add this handler to debug enter and return
parent
c55aadd5
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
201 additions
and
185 deletions
+201
-185
storage/tokudb/ha_tokudb.cc
storage/tokudb/ha_tokudb.cc
+127
-126
storage/tokudb/ha_tokudb_admin.cc
storage/tokudb/ha_tokudb_admin.cc
+6
-6
storage/tokudb/ha_tokudb_alter_56.cc
storage/tokudb/ha_tokudb_alter_56.cc
+4
-4
storage/tokudb/ha_tokudb_update.cc
storage/tokudb/ha_tokudb_update.cc
+4
-4
storage/tokudb/hatoku_defines.h
storage/tokudb/hatoku_defines.h
+23
-8
storage/tokudb/hatoku_hton.cc
storage/tokudb/hatoku_hton.cc
+37
-37
No files found.
storage/tokudb/ha_tokudb.cc
View file @
8c25ba62
This diff is collapsed.
Click to expand it.
storage/tokudb/ha_tokudb_admin.cc
View file @
8c25ba62
...
...
@@ -127,7 +127,7 @@ static int analyze_progress(void *v_extra, uint64_t rows) {
}
int
ha_tokudb
::
analyze
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
)
{
TOKUDB_
DBUG_ENTER
(
"ha_tokudb::analyze
"
);
TOKUDB_
HANDLER_DBUG_ENTER
(
"
"
);
uint64_t
rec_per_key
[
table_share
->
key_parts
];
int
result
=
HA_ADMIN_OK
;
DB_TXN
*
txn
=
transaction
;
...
...
@@ -165,7 +165,7 @@ int ha_tokudb::analyze(THD *thd, HA_CHECK_OPT *check_opt) {
}
if
(
result
==
HA_ADMIN_OK
)
tokudb
::
set_card_in_status
(
share
->
status_block
,
txn
,
table_share
->
key_parts
,
rec_per_key
);
TOKUDB_DBUG_RETURN
(
result
);
TOKUDB_
HANDLER_
DBUG_RETURN
(
result
);
}
static
int
hot_poll_fun
(
void
*
extra
,
float
progress
)
{
...
...
@@ -192,7 +192,7 @@ static int hot_poll_fun(void *extra, float progress) {
// flatten all DB's in this table, to do so, peform hot optimize on each db
int
ha_tokudb
::
optimize
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
)
{
TOKUDB_
DBUG_ENTER
(
"ha_tokudb::optimize
"
);
TOKUDB_
HANDLER_DBUG_ENTER
(
"
"
);
int
error
;
uint
curr_num_DBs
=
table
->
s
->
keys
+
tokudb_test
(
hidden_primary_key
);
...
...
@@ -233,7 +233,7 @@ cleanup:
thd_progress_end
(
thd
);
#endif
TOKUDB_DBUG_RETURN
(
error
);
TOKUDB_
HANDLER_
DBUG_RETURN
(
error
);
}
struct
check_context
{
...
...
@@ -262,7 +262,7 @@ static void ha_tokudb_check_info(THD *thd, TABLE *table, const char *msg) {
}
int
ha_tokudb
::
check
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
)
{
TOKUDB_
DBUG_ENTER
(
"check
"
);
TOKUDB_
HANDLER_DBUG_ENTER
(
"
"
);
const
char
*
old_proc_info
=
thd
->
proc_info
;
thd_proc_info
(
thd
,
"tokudb::check"
);
...
...
@@ -319,5 +319,5 @@ int ha_tokudb::check(THD *thd, HA_CHECK_OPT *check_opt) {
}
}
thd_proc_info
(
thd
,
old_proc_info
);
TOKUDB_DBUG_RETURN
(
result
);
TOKUDB_
HANDLER_
DBUG_RETURN
(
result
);
}
storage/tokudb/ha_tokudb_alter_56.cc
View file @
8c25ba62
...
...
@@ -282,7 +282,7 @@ static bool only_flags(ulong bits, ulong mask) {
// must set WRITE_ALLOW_WRITE lock type in the external lock method to avoid deadlocks
// with the MDL lock and the table lock
enum_alter_inplace_result
ha_tokudb
::
check_if_supported_inplace_alter
(
TABLE
*
altered_table
,
Alter_inplace_info
*
ha_alter_info
)
{
TOKUDB_
DBUG_ENTER
(
"check_if_supported_alter
"
);
TOKUDB_
HANDLER_DBUG_ENTER
(
"
"
);
if
(
tokudb_debug
&
TOKUDB_DEBUG_ALTER_TABLE_INFO
)
{
print_alter_info
(
altered_table
,
ha_alter_info
);
...
...
@@ -437,7 +437,7 @@ enum_alter_inplace_result ha_tokudb::check_if_supported_inplace_alter(TABLE *alt
// Prepare for the alter operations
bool
ha_tokudb
::
prepare_inplace_alter_table
(
TABLE
*
altered_table
,
Alter_inplace_info
*
ha_alter_info
)
{
TOKUDB_
DBUG_ENTER
(
"prepare_inplace_alter_table
"
);
TOKUDB_
HANDLER_DBUG_ENTER
(
"
"
);
tokudb_alter_ctx
*
ctx
=
static_cast
<
tokudb_alter_ctx
*>
(
ha_alter_info
->
handler_ctx
);
assert
(
transaction
);
// transaction must exist after table is locked
ctx
->
alter_txn
=
transaction
;
...
...
@@ -447,7 +447,7 @@ bool ha_tokudb::prepare_inplace_alter_table(TABLE *altered_table, Alter_inplace_
// Execute the alter operations.
bool
ha_tokudb
::
inplace_alter_table
(
TABLE
*
altered_table
,
Alter_inplace_info
*
ha_alter_info
)
{
TOKUDB_
DBUG_ENTER
(
"inplace_alter_table
"
);
TOKUDB_
HANDLER_DBUG_ENTER
(
"
"
);
int
error
=
0
;
tokudb_alter_ctx
*
ctx
=
static_cast
<
tokudb_alter_ctx
*>
(
ha_alter_info
->
handler_ctx
);
...
...
@@ -674,7 +674,7 @@ int ha_tokudb::alter_table_add_or_drop_column(TABLE *altered_table, Alter_inplac
// If commit then write the new frm data to the status using the alter transaction.
// If abort then abort the alter transaction and try to rollback the non-transactional changes.
bool
ha_tokudb
::
commit_inplace_alter_table
(
TABLE
*
altered_table
,
Alter_inplace_info
*
ha_alter_info
,
bool
commit
)
{
TOKUDB_
DBUG_ENTER
(
"commit_inplace_alter_table
"
);
TOKUDB_
HANDLER_DBUG_ENTER
(
"
"
);
tokudb_alter_ctx
*
ctx
=
static_cast
<
tokudb_alter_ctx
*>
(
ha_alter_info
->
handler_ctx
);
bool
result
=
false
;
// success
...
...
storage/tokudb/ha_tokudb_update.cc
View file @
8c25ba62
...
...
@@ -252,7 +252,7 @@ static uint32_t blob_field_index(TABLE *table, KEY_AND_COL_INFO *kc_info, uint i
// of where conditions (conds). The function returns 0 if the update is handled in the storage engine.
// Otherwise, an error is returned.
int
ha_tokudb
::
fast_update
(
THD
*
thd
,
List
<
Item
>
&
update_fields
,
List
<
Item
>
&
update_values
,
Item
*
conds
)
{
TOKUDB_
DBUG_ENTER
(
"ha_tokudb::fast_update
"
);
TOKUDB_
HANDLER_DBUG_ENTER
(
"
"
);
int
error
=
0
;
if
(
tokudb_debug
&
TOKUDB_DEBUG_UPSERT
)
{
...
...
@@ -287,7 +287,7 @@ check_error:
}
return_error:
TOKUDB_DBUG_RETURN
(
error
);
TOKUDB_
HANDLER_
DBUG_RETURN
(
error
);
}
// Return true if an expression is a simple int expression or a simple function of +- int expression.
...
...
@@ -856,7 +856,7 @@ int ha_tokudb::send_update_message(List<Item> &update_fields, List<Item> &update
// An upsert consists of a row and a list of update expressions (update_fields[i] = update_values[i]).
// The function returns 0 if the upsert is handled in the storage engine. Otherwise, an error code is returned.
int
ha_tokudb
::
upsert
(
THD
*
thd
,
List
<
Item
>
&
update_fields
,
List
<
Item
>
&
update_values
)
{
TOKUDB_
DBUG_ENTER
(
"ha_tokudb::upsert
"
);
TOKUDB_
HANDLER_DBUG_ENTER
(
"
"
);
int
error
=
0
;
...
...
@@ -890,7 +890,7 @@ check_error:
}
return_error:
TOKUDB_DBUG_RETURN
(
error
);
TOKUDB_
HANDLER_
DBUG_RETURN
(
error
);
}
// Check if an upsert can be handled by this storage engine. Return trus if it can.
...
...
storage/tokudb/hatoku_defines.h
View file @
8c25ba62
...
...
@@ -241,8 +241,7 @@ extern ulong tokudb_debug;
#define TOKUDB_DEBUG_ANALYZE (1<<15)
#define TOKUDB_TRACE(f, ...) \
fprintf(stderr, "%d:%s:%d:" f, my_tid(), __FILE__, __LINE__, ##__VA_ARGS__);
fprintf(stderr, "%u %s:%u " f "\n", my_tid(), __FILE__, __LINE__, ##__VA_ARGS__);
static
inline
unsigned
int
my_tid
()
{
return
(
unsigned
int
)
toku_os_gettid
();
...
...
@@ -251,17 +250,33 @@ static inline unsigned int my_tid() {
#define TOKUDB_DBUG_ENTER(f, ...) \
{ \
if (tokudb_debug & TOKUDB_DEBUG_ENTER) { \
TOKUDB_TRACE(
f "\n", ##__VA_ARGS__);
\
TOKUDB_TRACE(
"%s " f, __FUNCTION__, ##__VA_ARGS__);
\
} \
} \
DBUG_ENTER(__FUNCTION__);
#define TOKUDB_DBUG_RETURN(r) \
{ \
int rr = (r); \
if ((tokudb_debug & TOKUDB_DEBUG_RETURN) || (rr != 0 && (tokudb_debug & TOKUDB_DEBUG_ERROR))) { \
TOKUDB_TRACE("%s:return %d\n", __FUNCTION__, rr); \
TOKUDB_TRACE("%s return %d", __FUNCTION__, rr); \
} \
DBUG_RETURN(rr); \
}
#define TOKUDB_HANDLER_DBUG_ENTER(f, ...) \
{ \
if (tokudb_debug & TOKUDB_DEBUG_ENTER) { \
fprintf(stderr, "%u %p %s:%u ha_tokudb::%s " f "\n", my_tid(), this, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__); \
} \
} \
DBUG_ENTER(__FUNCTION__);
#define TOKUDB_HANDLER_DBUG_RETURN(r) \
{ \
int rr = (r); \
if ((tokudb_debug & TOKUDB_DEBUG_RETURN) || (rr != 0 && (tokudb_debug & TOKUDB_DEBUG_ERROR))) { \
fprintf(stderr, "%u %p %s:%u ha_tokudb::%s return %d" "\n", my_tid(), this, __FILE__, __LINE__, __FUNCTION__, rr); \
} \
DBUG_RETURN(rr); \
}
...
...
@@ -353,14 +368,14 @@ static inline int txn_begin(DB_ENV *env, DB_TXN *parent, DB_TXN **txn, uint32_t
this_txn
->
set_client_id
(
this_txn
,
thd_get_thread_id
(
thd
));
}
if
((
tokudb_debug
&
TOKUDB_DEBUG_TXN
))
{
TOKUDB_TRACE
(
"begin txn %p %p %u r=%d
\n
"
,
parent
,
*
txn
,
flags
,
r
);
TOKUDB_TRACE
(
"begin txn %p %p %u r=%d"
,
parent
,
*
txn
,
flags
,
r
);
}
return
r
;
}
static
inline
void
commit_txn
(
DB_TXN
*
txn
,
uint32_t
flags
)
{
if
(
tokudb_debug
&
TOKUDB_DEBUG_TXN
)
TOKUDB_TRACE
(
"commit txn %p
\n
"
,
txn
);
TOKUDB_TRACE
(
"commit txn %p"
,
txn
);
int
r
=
txn
->
commit
(
txn
,
flags
);
if
(
r
!=
0
)
{
sql_print_error
(
"tried committing transaction %p and got error code %d"
,
txn
,
r
);
...
...
@@ -370,7 +385,7 @@ static inline void commit_txn(DB_TXN* txn, uint32_t flags) {
static
inline
void
abort_txn
(
DB_TXN
*
txn
)
{
if
(
tokudb_debug
&
TOKUDB_DEBUG_TXN
)
TOKUDB_TRACE
(
"abort txn %p
\n
"
,
txn
);
TOKUDB_TRACE
(
"abort txn %p"
,
txn
);
int
r
=
txn
->
abort
(
txn
);
if
(
r
!=
0
)
{
sql_print_error
(
"tried aborting transaction %p and got error code %d"
,
txn
,
r
);
...
...
storage/tokudb/hatoku_hton.cc
View file @
8c25ba62
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