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
87850330
Commit
87850330
authored
May 31, 2013
by
Kentoku SHIBA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change variable import
parent
30d25a6f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
20 deletions
+49
-20
sql/mysqld.h
sql/mysqld.h
+1
-1
sql/sql_class.h
sql/sql_class.h
+2
-2
storage/spider/spd_conn.cc
storage/spider/spd_conn.cc
+6
-4
storage/spider/spd_table.cc
storage/spider/spd_table.cc
+24
-0
storage/spider/spd_trx.cc
storage/spider/spd_trx.cc
+16
-13
No files found.
sql/mysqld.h
View file @
87850330
...
...
@@ -146,7 +146,7 @@ extern char log_error_file[FN_REFLEN], *opt_tc_log_file;
extern
const
double
log_10
[
309
];
extern
ulonglong
keybuff_size
;
extern
ulonglong
thd_startup_options
;
extern
MYSQL_PLUGIN_IMPORT
ulong
thread_id
;
extern
ulong
thread_id
;
extern
ulong
binlog_cache_use
,
binlog_cache_disk_use
;
extern
ulong
binlog_stmt_cache_use
,
binlog_stmt_cache_disk_use
;
extern
ulong
aborted_threads
,
aborted_connects
;
...
...
sql/sql_class.h
View file @
87850330
...
...
@@ -1028,8 +1028,8 @@ typedef struct st_xid_state {
uint
rm_error
;
}
XID_STATE
;
extern
MYSQL_PLUGIN_IMPORT
mysql_mutex_t
LOCK_xid_cache
;
extern
MYSQL_PLUGIN_IMPORT
HASH
xid_cache
;
extern
mysql_mutex_t
LOCK_xid_cache
;
extern
HASH
xid_cache
;
bool
xid_cache_init
(
void
);
void
xid_cache_free
(
void
);
XID_STATE
*
xid_cache_search
(
XID
*
xid
);
...
...
storage/spider/spd_conn.cc
View file @
87850330
...
...
@@ -37,6 +37,8 @@
#include "spd_ping_table.h"
#include "spd_malloc.h"
extern
ulong
*
spd_db_att_thread_id
;
extern
handlerton
*
spider_hton_ptr
;
extern
SPIDER_DBTON
spider_dbton
[
SPIDER_DBTON_SIZE
];
pthread_mutex_t
spider_conn_id_mutex
;
...
...
@@ -2118,7 +2120,7 @@ void *spider_bg_conn_action(
DBUG_RETURN
(
NULL
);
}
pthread_mutex_lock
(
&
LOCK_thread_count
);
thd
->
thread_id
=
thread_id
++
;
thd
->
thread_id
=
(
*
spd_db_att_thread_id
)
++
;
pthread_mutex_unlock
(
&
LOCK_thread_count
);
#ifdef HAVE_PSI_INTERFACE
mysql_thread_set_psi_id
(
thd
->
thread_id
);
...
...
@@ -2648,7 +2650,7 @@ void *spider_bg_sts_action(
DBUG_RETURN
(
NULL
);
}
pthread_mutex_lock
(
&
LOCK_thread_count
);
thd
->
thread_id
=
thread_id
++
;
thd
->
thread_id
=
(
*
spd_db_att_thread_id
)
++
;
pthread_mutex_unlock
(
&
LOCK_thread_count
);
#ifdef HAVE_PSI_INTERFACE
mysql_thread_set_psi_id
(
thd
->
thread_id
);
...
...
@@ -3026,7 +3028,7 @@ void *spider_bg_crd_action(
DBUG_RETURN
(
NULL
);
}
pthread_mutex_lock
(
&
LOCK_thread_count
);
thd
->
thread_id
=
thread_id
++
;
thd
->
thread_id
=
(
*
spd_db_att_thread_id
)
++
;
pthread_mutex_unlock
(
&
LOCK_thread_count
);
#ifdef HAVE_PSI_INTERFACE
mysql_thread_set_psi_id
(
thd
->
thread_id
);
...
...
@@ -3474,7 +3476,7 @@ void *spider_bg_mon_action(
DBUG_RETURN
(
NULL
);
}
pthread_mutex_lock
(
&
LOCK_thread_count
);
thd
->
thread_id
=
thread_id
++
;
thd
->
thread_id
=
(
*
spd_db_att_thread_id
)
++
;
pthread_mutex_unlock
(
&
LOCK_thread_count
);
#ifdef HAVE_PSI_INTERFACE
mysql_thread_set_psi_id
(
thd
->
thread_id
);
...
...
storage/spider/spd_table.cc
View file @
87850330
...
...
@@ -38,6 +38,10 @@
#include "spd_ping_table.h"
#include "spd_malloc.h"
ulong
*
spd_db_att_thread_id
;
pthread_mutex_t
*
spd_db_att_LOCK_xid_cache
;
HASH
*
spd_db_att_xid_cache
;
handlerton
*
spider_hton_ptr
;
SPIDER_DBTON
spider_dbton
[
SPIDER_DBTON_SIZE
];
extern
SPIDER_DBTON
spider_dbton_mysql
;
...
...
@@ -5955,6 +5959,26 @@ int spider_db_init(
memset
(
&
spider_alloc_mem_count
,
0
,
sizeof
(
spider_alloc_mem_count
));
memset
(
&
spider_free_mem_count
,
0
,
sizeof
(
spider_free_mem_count
));
#ifdef _WIN32
HMODULE
current_module
=
GetModuleHandle
(
NULL
);
spd_db_att_thread_id
=
(
ulong
*
)
GetProcAddress
(
current_module
,
"?thread_id@@3KA"
);
spd_db_att_LOCK_xid_cache
=
(
pthread_mutex_t
*
)
#if MYSQL_VERSION_ID < 50500
GetProcAddress
(
current_module
,
"?LOCK_xid_cache@@3U_RTL_CRITICAL_SECTION@@A"
);
#else
GetProcAddress
(
current_module
,
"?LOCK_xid_cache@@3Ust_mysql_mutex@@A"
);
#endif
spd_db_att_xid_cache
=
(
HASH
*
)
GetProcAddress
(
current_module
,
"?xid_cache@@3Ust_hash@@A"
);
#else
spd_db_att_thread_id
=
&
thread_id
;
spd_db_att_LOCK_xid_cache
=
&
LOCK_xid_cache
;
spd_db_att_xid_cache
=
&
xid_cache
;
#endif
#ifdef HAVE_PSI_INTERFACE
init_spider_psi_keys
();
#endif
...
...
storage/spider/spd_trx.cc
View file @
87850330
...
...
@@ -38,6 +38,9 @@
#include "spd_ping_table.h"
#include "spd_malloc.h"
extern
pthread_mutex_t
*
spd_db_att_LOCK_xid_cache
;
extern
HASH
*
spd_db_att_xid_cache
;
extern
handlerton
*
spider_hton_ptr
;
pthread_mutex_t
spider_thread_id_mutex
;
ulonglong
spider_thread_id
=
1
;
...
...
@@ -1499,15 +1502,15 @@ int spider_xa_lock(
int
error_num
;
DBUG_ENTER
(
"spider_xa_lock"
);
#ifdef SPIDER_HAS_HASH_VALUE_TYPE
my_hash_value_type
hash_value
=
my_calc_hash
(
&
xid_cache
,
my_hash_value_type
hash_value
=
my_calc_hash
(
spd_db_att_
xid_cache
,
(
uchar
*
)
xid_state
->
xid
.
key
(),
xid_state
->
xid
.
key_length
());
#endif
pthread_mutex_lock
(
&
LOCK_xid_cache
);
pthread_mutex_lock
(
spd_db_att_
LOCK_xid_cache
);
#ifdef SPIDER_HAS_HASH_VALUE_TYPE
if
(
my_hash_search_using_hash_value
(
&
xid_cache
,
hash_value
,
if
(
my_hash_search_using_hash_value
(
spd_db_att_
xid_cache
,
hash_value
,
xid_state
->
xid
.
key
(),
xid_state
->
xid
.
key_length
()))
#else
if
(
my_hash_search
(
&
xid_cache
,
if
(
my_hash_search
(
spd_db_att_
xid_cache
,
xid_state
->
xid
.
key
(),
xid_state
->
xid
.
key_length
()))
#endif
{
...
...
@@ -1515,20 +1518,20 @@ int spider_xa_lock(
goto
error
;
}
#ifdef HASH_UPDATE_WITH_HASH_VALUE
if
(
my_hash_insert_with_hash_value
(
&
xid_cache
,
hash_value
,
if
(
my_hash_insert_with_hash_value
(
spd_db_att_
xid_cache
,
hash_value
,
(
uchar
*
)
xid_state
))
#else
if
(
my_hash_insert
(
&
xid_cache
,
(
uchar
*
)
xid_state
))
if
(
my_hash_insert
(
spd_db_att_
xid_cache
,
(
uchar
*
)
xid_state
))
#endif
{
error_num
=
HA_ERR_OUT_OF_MEM
;
goto
error
;
}
pthread_mutex_unlock
(
&
LOCK_xid_cache
);
pthread_mutex_unlock
(
spd_db_att_
LOCK_xid_cache
);
DBUG_RETURN
(
0
);
error:
pthread_mutex_unlock
(
&
LOCK_xid_cache
);
pthread_mutex_unlock
(
spd_db_att_
LOCK_xid_cache
);
DBUG_RETURN
(
error_num
);
}
...
...
@@ -1537,16 +1540,16 @@ int spider_xa_unlock(
)
{
DBUG_ENTER
(
"spider_xa_unlock"
);
#if defined(SPIDER_HAS_HASH_VALUE_TYPE) && defined(HASH_UPDATE_WITH_HASH_VALUE)
my_hash_value_type
hash_value
=
my_calc_hash
(
&
xid_cache
,
my_hash_value_type
hash_value
=
my_calc_hash
(
spd_db_att_
xid_cache
,
(
uchar
*
)
xid_state
->
xid
.
key
(),
xid_state
->
xid
.
key_length
());
#endif
pthread_mutex_lock
(
&
LOCK_xid_cache
);
pthread_mutex_lock
(
spd_db_att_
LOCK_xid_cache
);
#if defined(SPIDER_HAS_HASH_VALUE_TYPE) && defined(HASH_UPDATE_WITH_HASH_VALUE)
my_hash_delete_with_hash_value
(
&
xid_cache
,
hash_value
,
(
uchar
*
)
xid_state
);
my_hash_delete_with_hash_value
(
spd_db_att_
xid_cache
,
hash_value
,
(
uchar
*
)
xid_state
);
#else
my_hash_delete
(
&
xid_cache
,
(
uchar
*
)
xid_state
);
my_hash_delete
(
spd_db_att_
xid_cache
,
(
uchar
*
)
xid_state
);
#endif
pthread_mutex_unlock
(
&
LOCK_xid_cache
);
pthread_mutex_unlock
(
spd_db_att_
LOCK_xid_cache
);
DBUG_RETURN
(
0
);
}
...
...
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