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
4bd9f82a
Commit
4bd9f82a
authored
Apr 15, 2020
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slave_open_temp_tables to Atomic_counter
parent
10cdf523
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
31 deletions
+12
-31
include/my_pthread.h
include/my_pthread.h
+0
-10
sql/mysqld.cc
sql/mysqld.cc
+3
-15
sql/mysqld.h
sql/mysqld.h
+1
-1
sql/sql_plugin.h
sql/sql_plugin.h
+1
-1
sql/sql_show.cc
sql/sql_show.cc
+5
-0
sql/temporary_tables.cc
sql/temporary_tables.cc
+2
-4
No files found.
include/my_pthread.h
View file @
4bd9f82a
...
...
@@ -817,16 +817,6 @@ extern uint thd_lib_detected;
#define statistic_sub(V,C,L) (V)-=(C)
#endif
/* SAFE_STATISTICS */
static
inline
void
thread_safe_increment32
(
int32
*
value
)
{
(
void
)
my_atomic_add32_explicit
(
value
,
1
,
MY_MEMORY_ORDER_RELAXED
);
}
static
inline
void
thread_safe_decrement32
(
int32
*
value
)
{
(
void
)
my_atomic_add32_explicit
(
value
,
-
1
,
MY_MEMORY_ORDER_RELAXED
);
}
/*
No locking needed, the counter is owned by the thread
*/
...
...
sql/mysqld.cc
View file @
4bd9f82a
...
...
@@ -459,7 +459,7 @@ uint lower_case_table_names;
ulong
tc_heuristic_recover
=
0
;
Atomic_counter
<
uint32_t
>
thread_count
;
bool
shutdown_wait_for_slaves
;
int32
slave_open_temp_tables
;
Atomic_counter
<
uint32_t
>
slave_open_temp_tables
;
ulong
thread_created
;
ulong
back_log
,
connect_timeout
,
concurrency
,
server_id
;
ulong
what_to_log
;
...
...
@@ -7198,18 +7198,6 @@ static int show_slave_running(THD *thd, SHOW_VAR *var, char *buff,
}
/* How many slaves are connected to this master */
static
int
show_slaves_connected
(
THD
*
thd
,
SHOW_VAR
*
var
,
char
*
buff
)
{
var
->
type
=
SHOW_LONGLONG
;
var
->
value
=
buff
;
*
((
longlong
*
)
buff
)
=
uint32_t
(
binlog_dump_thread_count
);
return
0
;
}
/* How many masters this slave is connected to */
...
...
@@ -7785,9 +7773,9 @@ SHOW_VAR status_vars[]= {
{
"Select_range"
,
(
char
*
)
offsetof
(
STATUS_VAR
,
select_range_count_
),
SHOW_LONG_STATUS
},
{
"Select_range_check"
,
(
char
*
)
offsetof
(
STATUS_VAR
,
select_range_check_count_
),
SHOW_LONG_STATUS
},
{
"Select_scan"
,
(
char
*
)
offsetof
(
STATUS_VAR
,
select_scan_count_
),
SHOW_LONG_STATUS
},
{
"Slave_open_temp_tables"
,
(
char
*
)
&
slave_open_temp_tables
,
SHOW_
IN
T
},
{
"Slave_open_temp_tables"
,
(
char
*
)
&
slave_open_temp_tables
,
SHOW_
ATOMIC_COUNTER_UINT32_
T
},
#ifdef HAVE_REPLICATION
{
"Slaves_connected"
,
(
char
*
)
&
show_slaves_connected
,
SHOW_SIMPLE_FUNC
},
{
"Slaves_connected"
,
(
char
*
)
&
binlog_dump_thread_count
,
SHOW_ATOMIC_COUNTER_UINT32_T
},
{
"Slaves_running"
,
(
char
*
)
&
show_slaves_running
,
SHOW_SIMPLE_FUNC
},
{
"Slave_connections"
,
(
char
*
)
offsetof
(
STATUS_VAR
,
com_register_slave
),
SHOW_LONG_STATUS
},
{
"Slave_heartbeat_period"
,
(
char
*
)
&
show_heartbeat_period
,
SHOW_SIMPLE_FUNC
},
...
...
sql/mysqld.h
View file @
4bd9f82a
...
...
@@ -221,7 +221,7 @@ extern ulong delayed_insert_timeout;
extern
ulong
delayed_insert_limit
,
delayed_queue_size
;
extern
ulong
delayed_insert_threads
,
delayed_insert_writes
;
extern
ulong
delayed_rows_in_use
,
delayed_insert_errors
;
extern
int32
slave_open_temp_tables
;
extern
Atomic_counter
<
uint32_t
>
slave_open_temp_tables
;
extern
ulonglong
query_cache_size
;
extern
ulong
query_cache_limit
;
extern
ulong
query_cache_min_res_unit
;
...
...
sql/sql_plugin.h
View file @
4bd9f82a
...
...
@@ -25,7 +25,7 @@
SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, \
SHOW_HAVE, SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, \
SHOW_LONG_NOFLUSH, SHOW_LONGLONG_STATUS, SHOW_UINT32_STATUS, \
SHOW_LEX_STRING
SHOW_LEX_STRING
, SHOW_ATOMIC_COUNTER_UINT32_T
#include "mariadb.h"
#undef SHOW_always_last
...
...
sql/sql_show.cc
View file @
4bd9f82a
...
...
@@ -3692,6 +3692,11 @@ const char* get_one_variable(THD *thd,
end
=
pos
+
ls
->
length
;
break
;
}
case
SHOW_ATOMIC_COUNTER_UINT32_T
:
end
=
int10_to_str
(
static_cast
<
long
>
(
*
static_cast
<
Atomic_counter
<
uint32_t
>*>
(
value
)),
buff
,
10
);
break
;
case
SHOW_UNDEF
:
break
;
// Return empty string
case
SHOW_SYS
:
// Cannot happen
...
...
sql/temporary_tables.cc
View file @
4bd9f82a
...
...
@@ -1137,9 +1137,7 @@ TABLE *THD::open_temporary_table(TMP_TABLE_SHARE *share,
/* Increment Slave_open_temp_table_definitions status variable count. */
if
(
rgi_slave
)
{
thread_safe_increment32
(
&
slave_open_temp_tables
);
}
slave_open_temp_tables
++
;
DBUG_PRINT
(
"tmptable"
,
(
"Opened table: '%s'.'%s table: %p"
,
table
->
s
->
db
.
str
,
...
...
@@ -1245,7 +1243,7 @@ void THD::close_temporary_table(TABLE *table)
/* Natural invariant of temporary_tables */
DBUG_ASSERT
(
slave_open_temp_tables
||
!
temporary_tables
);
/* Decrement Slave_open_temp_table_definitions status variable count. */
thread_safe_decrement32
(
&
slave_open_temp_tables
)
;
slave_open_temp_tables
--
;
}
DBUG_VOID_RETURN
;
...
...
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