Skip to content

Commit 6d390ba

Browse files
committed
Merge 10.2 into bb-10.2-ext
2 parents 8317ce7 + 446b3d3 commit 6d390ba

24 files changed

+86
-83
lines changed

extra/mariabackup/xtrabackup.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5070,7 +5070,7 @@ handle_options(int argc, char **argv, char ***argv_client, char ***argv_server)
50705070
setup_error_messages();
50715071
sys_var_init();
50725072
plugin_mutex_init();
5073-
mysql_rwlock_init(key_rwlock_LOCK_system_variables_hash, &LOCK_system_variables_hash);
5073+
mysql_prlock_init(key_rwlock_LOCK_system_variables_hash, &LOCK_system_variables_hash);
50745074
opt_stack_trace = 1;
50755075
test_flags |= TEST_SIGINT;
50765076
init_signals();

mysql-test/suite/galera/r/galera_gtid_slave_sst_rsync.result

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
12
#Connection 2
3+
connection node_2;
24
START SLAVE;
35
#Connection 1
6+
connection node_1;
47
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 int unique) ENGINE=InnoDB;
58
INSERT INTO t2 VALUES(1,11);
69
INSERT INTO t2 VALUES(2,22);
@@ -10,6 +13,7 @@ SELECT @@global.gtid_binlog_state;
1013
1-1-4
1114
include/save_master_gtid.inc
1215
#Connection 2
16+
connection node_2;
1317
include/sync_with_master_gtid.inc
1418
SELECT @@global.gtid_binlog_state;
1519
@@global.gtid_binlog_state
@@ -21,12 +25,14 @@ SELECT @@global.gtid_binlog_state;
2125
@@global.gtid_binlog_state
2226
1-1-4,2-2-3
2327
#Connection 3
28+
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
2429
INSERT INTO t2 VALUES(7,77);
2530
INSERT INTO t2 VALUES(8,88);
2631
SELECT @@global.gtid_binlog_state;
2732
@@global.gtid_binlog_state
2833
1-1-4,2-2-3,2-3-5
2934
#Connection 1
35+
connection node_1;
3036
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
3137
SET AUTOCOMMIT=OFF;
3238
START TRANSACTION;
@@ -35,28 +41,35 @@ INSERT INTO t1 VALUES ('node1_committed_before');
3541
COMMIT;
3642
include/save_master_gtid.inc
3743
#Connection 2
44+
connection node_2;
3845
include/sync_with_master_gtid.inc
3946
SET AUTOCOMMIT=OFF;
4047
START TRANSACTION;
4148
INSERT INTO t1 VALUES ('node2_committed_before');
4249
INSERT INTO t1 VALUES ('node2_committed_before');
4350
COMMIT;
4451
#Connection 3
52+
connection node_3;
53+
connection node_2;
54+
connection node_3;
4555
Shutting down server ...
4656
#Connection 2
57+
connection node_2;
4758
SET AUTOCOMMIT=OFF;
4859
START TRANSACTION;
4960
INSERT INTO t1 VALUES ('node1_committed_during');
5061
INSERT INTO t1 VALUES ('node1_committed_during');
5162
COMMIT;
5263
#Connection 3
64+
connection node_3;
5365
Starting server ...
5466
SET AUTOCOMMIT=OFF;
5567
START TRANSACTION;
5668
INSERT INTO t1 VALUES ('node3_committed_after');
5769
INSERT INTO t1 VALUES ('node3_committed_after');
5870
COMMIT;
5971
#Connection 2
72+
connection node_2;
6073
Select * from t1 order by f1;
6174
f1
6275
node1_committed_before
@@ -68,6 +81,7 @@ node2_committed_before
6881
node3_committed_after
6982
node3_committed_after
7083
#Connection 3
84+
connection node_3;
7185
Select * from t1 order by f1;
7286
f1
7387
node1_committed_before
@@ -79,26 +93,34 @@ node2_committed_before
7993
node3_committed_after
8094
node3_committed_after
8195
#Connection 2
96+
connection node_2;
8297
SELECT @@global.gtid_binlog_state;
8398
@@global.gtid_binlog_state
8499
1-1-6,2-2-7,2-3-8
85100
#Connection 3
101+
connection node_3;
86102
SELECT @@global.gtid_binlog_state;
87103
@@global.gtid_binlog_state
88104
1-1-6,2-2-7,2-3-8
89105
#Connection 1
106+
connection node_1;
90107
SET AUTOCOMMIT=ON;
91108
#Connection 2
109+
connection node_2;
92110
SET AUTOCOMMIT=ON;
93111
#Connection 3
112+
connection node_3;
94113
SET AUTOCOMMIT=ON;
95114
#Connection 2
115+
connection node_2;
96116
STOP slave;
97117
INSERT INTO t1 VALUES ('node2_slave_stoped');
98118
#Connection 1
119+
connection node_1;
99120
INSERT INTO t1 VALUES ('node1_normal_entry');
100121
include/save_master_gtid.inc
101122
#Connection 2
123+
connection node_2;
102124
INSERT INTO t1 VALUES ('node2_slave_stoped_inserted');
103125
start slave;
104126
include/sync_with_master_gtid.inc
@@ -110,21 +132,28 @@ SELECT @@global.gtid_binlog_state;
110132
@@global.gtid_binlog_state
111133
1-1-7,2-3-8,2-2-11
112134
#Connection 3
135+
connection node_3;
113136
SELECT count(*) from t1;
114137
count(*)
115138
12
116139
SELECT @@global.gtid_binlog_state;
117140
@@global.gtid_binlog_state
118141
1-1-7,2-3-8,2-2-11
119142
#Connection 1
143+
connection node_1;
120144
DROP TABLE t2,t1;
121145
#Connection 2
146+
connection node_2;
122147
#Connection 3
148+
connection node_3;
123149
#Connection 2
150+
connection node_2;
124151
STOP SLAVE;
125152
RESET SLAVE ALL;
126153
reset master;
127154
#Connection 3
155+
connection node_3;
128156
reset master;
129157
#Connection 1
158+
connection node_1;
130159
reset master;

mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ COUNT(DISTINCT f1)
2222
SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE
2323
USER = 'system user' AND STATE NOT LIKE 'InnoDB%';
2424
COUNT(*)
25-
5
25+
3
2626
connection default;
2727
DROP TABLE t1;
2828
DROP TABLE ten;

mysql-test/suite/innodb_gis/r/rtree_debug.result

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,11 @@ t1 CREATE TABLE `t1` (
3838
`c2` geometry NOT NULL,
3939
SPATIAL KEY `idx` (`c2`)
4040
) ENGINE=InnoDB DEFAULT CHARSET=latin1
41-
SET DEBUG='+d,row_merge_ins_spatial_fail';
42-
Warnings:
43-
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
41+
SET @save_dbug = @@SESSION.debug_dbug;
42+
SET debug_dbug='+d,row_merge_ins_spatial_fail';
4443
create spatial index idx2 on t1(c2);
4544
ERROR HY000: Got error 1000 "Unknown error 1000" from storage engine InnoDB
46-
SET DEBUG='-d,row_merge_ins_spatial_fail';
47-
Warnings:
48-
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
45+
SET debug_dbug = @save_dbug;
4946
show create table t1;
5047
Table Create Table
5148
t1 CREATE TABLE `t1` (

mysql-test/suite/innodb_gis/t/rtree_debug.test

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ create spatial index idx on t1(c2);
4949

5050
show create table t1;
5151

52-
SET DEBUG='+d,row_merge_ins_spatial_fail';
52+
SET @save_dbug = @@SESSION.debug_dbug;
53+
SET debug_dbug='+d,row_merge_ins_spatial_fail';
5354
--error ER_GET_ERRNO
5455
create spatial index idx2 on t1(c2);
55-
SET DEBUG='-d,row_merge_ins_spatial_fail';
56+
SET debug_dbug = @save_dbug;
5657
show create table t1;
5758

5859
# Check table.

mysql-test/suite/innodb_gis/t/rtree_search.test

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ select count(*) from t1 where MBRWithin(t1.c2, @g1);
3838
set @g1 = ST_GeomFromText('Polygon((100 100,100 800,800 800,800 100,100 100))');
3939
select count(*) from t1 where MBRWithin(t1.c2, @g1);
4040

41-
#SET DEBUG='+d, rtr_pessimistic_position';
41+
#SET @save_dbug= @@session.debug_dbug;
42+
#SET debug_dbug = '+d,rtr_pessimistic_position';
4243
#select count(*) from t1 where MBRWithin(t1.c2, @g1);
43-
#SET DEBUG='-d, rtr_pessimistic_position';
44+
#SET debug_dbug = @save_dbug;
4445

4546
# Equality search
4647
set @g1 = ST_GeomFromText('Point(1 1)');

sql/mysqld.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ mysql_mutex_t LOCK_prepared_stmt_count;
772772
mysql_mutex_t LOCK_des_key_file;
773773
#endif
774774
mysql_rwlock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave;
775-
mysql_rwlock_t LOCK_system_variables_hash;
775+
mysql_prlock_t LOCK_system_variables_hash;
776776
mysql_cond_t COND_thread_count, COND_start_thread;
777777
pthread_t signal_thread;
778778
pthread_attr_t connection_attrib;
@@ -2352,7 +2352,7 @@ static void clean_up_mutexes()
23522352
mysql_rwlock_destroy(&LOCK_sys_init_connect);
23532353
mysql_rwlock_destroy(&LOCK_sys_init_slave);
23542354
mysql_mutex_destroy(&LOCK_global_system_variables);
2355-
mysql_rwlock_destroy(&LOCK_system_variables_hash);
2355+
mysql_prlock_destroy(&LOCK_system_variables_hash);
23562356
mysql_mutex_destroy(&LOCK_short_uuid_generator);
23572357
mysql_mutex_destroy(&LOCK_prepared_stmt_count);
23582358
mysql_mutex_destroy(&LOCK_error_messages);
@@ -4690,7 +4690,7 @@ static int init_thread_environment()
46904690
&LOCK_global_system_variables, MY_MUTEX_INIT_FAST);
46914691
mysql_mutex_record_order(&LOCK_active_mi, &LOCK_global_system_variables);
46924692
mysql_mutex_record_order(&LOCK_status, &LOCK_thread_count);
4693-
mysql_rwlock_init(key_rwlock_LOCK_system_variables_hash,
4693+
mysql_prlock_init(key_rwlock_LOCK_system_variables_hash,
46944694
&LOCK_system_variables_hash);
46954695
mysql_mutex_init(key_LOCK_prepared_stmt_count,
46964696
&LOCK_prepared_stmt_count, MY_MUTEX_INIT_FAST);

sql/mysqld.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ extern mysql_mutex_t LOCK_des_key_file;
585585
extern mysql_mutex_t LOCK_server_started;
586586
extern mysql_cond_t COND_server_started;
587587
extern mysql_rwlock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave;
588-
extern mysql_rwlock_t LOCK_system_variables_hash;
588+
extern mysql_prlock_t LOCK_system_variables_hash;
589589
extern mysql_cond_t COND_thread_count, COND_start_thread;
590590
extern mysql_cond_t COND_manager;
591591
extern mysql_cond_t COND_slave_background;

sql/set_var.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,10 +597,10 @@ int mysql_del_sys_var_chain(sys_var *first)
597597
{
598598
int result= 0;
599599

600-
mysql_rwlock_wrlock(&LOCK_system_variables_hash);
600+
mysql_prlock_wrlock(&LOCK_system_variables_hash);
601601
for (sys_var *var= first; var; var= var->next)
602602
result|= my_hash_delete(&system_variable_hash, (uchar*) var);
603-
mysql_rwlock_unlock(&LOCK_system_variables_hash);
603+
mysql_prlock_unlock(&LOCK_system_variables_hash);
604604

605605
return result;
606606
}
@@ -1082,7 +1082,7 @@ int fill_sysvars(THD *thd, TABLE_LIST *tables, COND *cond)
10821082

10831083
cond= make_cond_for_info_schema(thd, cond, tables);
10841084
thd->count_cuted_fields= CHECK_FIELD_WARN;
1085-
mysql_rwlock_rdlock(&LOCK_system_variables_hash);
1085+
mysql_prlock_rdlock(&LOCK_system_variables_hash);
10861086

10871087
for (uint i= 0; i < system_variable_hash.records; i++)
10881088
{
@@ -1244,7 +1244,7 @@ int fill_sysvars(THD *thd, TABLE_LIST *tables, COND *cond)
12441244
}
12451245
res= 0;
12461246
end:
1247-
mysql_rwlock_unlock(&LOCK_system_variables_hash);
1247+
mysql_prlock_unlock(&LOCK_system_variables_hash);
12481248
thd->count_cuted_fields= save_count_cuted_fields;
12491249
return res;
12501250
}

sql/sql_plugin.cc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,10 +1397,10 @@ static int plugin_initialize(MEM_ROOT *tmp_root, struct st_plugin_int *plugin,
13971397

13981398
mysql_mutex_unlock(&LOCK_plugin);
13991399

1400-
mysql_rwlock_wrlock(&LOCK_system_variables_hash);
1400+
mysql_prlock_wrlock(&LOCK_system_variables_hash);
14011401
if (test_plugin_options(tmp_root, plugin, argc, argv))
14021402
state= PLUGIN_IS_DISABLED;
1403-
mysql_rwlock_unlock(&LOCK_system_variables_hash);
1403+
mysql_prlock_unlock(&LOCK_system_variables_hash);
14041404

14051405
if (options_only || state == PLUGIN_IS_DISABLED)
14061406
{
@@ -2803,11 +2803,11 @@ sys_var *find_sys_var_ex(THD *thd, const char *str, size_t length,
28032803

28042804
if (!locked)
28052805
mysql_mutex_lock(&LOCK_plugin);
2806-
mysql_rwlock_rdlock(&LOCK_system_variables_hash);
2806+
mysql_prlock_rdlock(&LOCK_system_variables_hash);
28072807
if ((var= intern_find_sys_var(str, length)) &&
28082808
(pi= var->cast_pluginvar()))
28092809
{
2810-
mysql_rwlock_unlock(&LOCK_system_variables_hash);
2810+
mysql_prlock_unlock(&LOCK_system_variables_hash);
28112811
LEX *lex= thd ? thd->lex : 0;
28122812
if (!(plugin= intern_plugin_lock(lex, plugin_int_to_ref(pi->plugin))))
28132813
var= NULL; /* failed to lock it, it must be uninstalling */
@@ -2820,7 +2820,7 @@ sys_var *find_sys_var_ex(THD *thd, const char *str, size_t length,
28202820
}
28212821
}
28222822
else
2823-
mysql_rwlock_unlock(&LOCK_system_variables_hash);
2823+
mysql_prlock_unlock(&LOCK_system_variables_hash);
28242824
if (!locked)
28252825
mysql_mutex_unlock(&LOCK_plugin);
28262826

@@ -3049,9 +3049,9 @@ static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock)
30493049
if (!thd->variables.dynamic_variables_ptr ||
30503050
(uint)offset > thd->variables.dynamic_variables_head)
30513051
{
3052-
mysql_rwlock_rdlock(&LOCK_system_variables_hash);
3052+
mysql_prlock_rdlock(&LOCK_system_variables_hash);
30533053
sync_dynamic_session_variables(thd, global_lock);
3054-
mysql_rwlock_unlock(&LOCK_system_variables_hash);
3054+
mysql_prlock_unlock(&LOCK_system_variables_hash);
30553055
}
30563056
DBUG_RETURN((uchar*)thd->variables.dynamic_variables_ptr + offset);
30573057
}
@@ -3166,7 +3166,7 @@ static void cleanup_variables(struct system_variables *vars)
31663166
st_bookmark *v;
31673167
uint idx;
31683168

3169-
mysql_rwlock_rdlock(&LOCK_system_variables_hash);
3169+
mysql_prlock_rdlock(&LOCK_system_variables_hash);
31703170
for (idx= 0; idx < bookmark_hash.records; idx++)
31713171
{
31723172
v= (st_bookmark*) my_hash_element(&bookmark_hash, idx);
@@ -3185,7 +3185,7 @@ static void cleanup_variables(struct system_variables *vars)
31853185
*ptr= NULL;
31863186
}
31873187
}
3188-
mysql_rwlock_unlock(&LOCK_system_variables_hash);
3188+
mysql_prlock_unlock(&LOCK_system_variables_hash);
31893189

31903190
DBUG_ASSERT(vars->table_plugin == NULL);
31913191
DBUG_ASSERT(vars->tmp_table_plugin == NULL);
@@ -4240,10 +4240,10 @@ int thd_key_create(MYSQL_THD_KEY_T *key)
42404240
PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_NOCMDOPT;
42414241
char namebuf[256];
42424242
snprintf(namebuf, sizeof(namebuf), "%u", thd_key_no++);
4243-
mysql_rwlock_wrlock(&LOCK_system_variables_hash);
4243+
mysql_prlock_wrlock(&LOCK_system_variables_hash);
42444244
// non-letters in the name as an extra safety
42454245
st_bookmark *bookmark= register_var("\a\v\a\t\a\r", namebuf, flags);
4246-
mysql_rwlock_unlock(&LOCK_system_variables_hash);
4246+
mysql_prlock_unlock(&LOCK_system_variables_hash);
42474247
if (bookmark)
42484248
{
42494249
*key= bookmark->offset;

0 commit comments

Comments
 (0)