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
40bfd201
Commit
40bfd201
authored
Jul 09, 2014
by
Nirbhay Choubey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV#6411 - Setting set @@global_wsrep_sst_auth=NULL
causes crash Fixed by properly handling the NULL values.
parent
04db5aeb
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
79 additions
and
24 deletions
+79
-24
mysql-test/suite/wsrep/r/variables.result
mysql-test/suite/wsrep/r/variables.result
+18
-0
mysql-test/suite/wsrep/t/variables.test
mysql-test/suite/wsrep/t/variables.test
+18
-0
sql/mysqld.cc
sql/mysqld.cc
+2
-2
sql/wsrep_mysqld.cc
sql/wsrep_mysqld.cc
+6
-1
sql/wsrep_mysqld.h
sql/wsrep_mysqld.h
+1
-1
sql/wsrep_sst.cc
sql/wsrep_sst.cc
+32
-19
sql/wsrep_sst.h
sql/wsrep_sst.h
+1
-0
sql/wsrep_var.cc
sql/wsrep_var.cc
+1
-1
No files found.
mysql-test/suite/wsrep/r/variables.result
View file @
40bfd201
...
...
@@ -11,6 +11,7 @@ SET SESSION wsrep_replicate_myisam= ON;
ERROR HY000: Variable 'wsrep_replicate_myisam' is a GLOBAL variable and should be set with SET GLOBAL
SET GLOBAL wsrep_replicate_myisam= ON;
SET GLOBAL wsrep_replicate_myisam= OFF;
SET GLOBAL wsrep_provider=none;
#
# MDEV#6206: wsrep_slave_threads subtracts from max_connections
...
...
@@ -76,4 +77,21 @@ SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved;
SET GLOBAL wsrep_provider= none;
SET GLOBAL wsrep_cluster_address= '';
SET GLOBAL wsrep_provider_options= '';
#
# MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash
#
SET @wsrep_sst_auth_saved= @@global.wsrep_sst_auth;
SET @@global.wsrep_sst_auth= 'user:pass';
SELECT @@global.wsrep_sst_auth;
@@global.wsrep_sst_auth
********
SET @@global.wsrep_sst_auth= '';
SELECT @@global.wsrep_sst_auth;
@@global.wsrep_sst_auth
SET @@global.wsrep_sst_auth= NULL;
SELECT @@global.wsrep_sst_auth;
@@global.wsrep_sst_auth
NULL
SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved;
# End of test.
mysql-test/suite/wsrep/t/variables.test
View file @
40bfd201
...
...
@@ -19,6 +19,7 @@ SET GLOBAL wsrep_replicate_myisam= ON;
# Reset it back.
SET
GLOBAL
wsrep_replicate_myisam
=
OFF
;
SET
GLOBAL
wsrep_provider
=
none
;
--
echo
--
echo
#
...
...
@@ -26,6 +27,11 @@ SET GLOBAL wsrep_replicate_myisam= OFF;
--
echo
#
call
mtr
.
add_suppression
(
"safe_mutex: Found wrong usage of mutex 'LOCK_wsrep_slave_threads' and 'LOCK_global_system_variables'"
);
call
mtr
.
add_suppression
(
"WSREP: Failed to get provider options"
);
--
disable_query_log
eval
SET
GLOBAL
wsrep_provider
=
'$WSREP_PROVIDER'
;
--
enable_query_log
--
replace_regex
/.*
libgalera_smm
.*/
libgalera_smm
.
so
/
SELECT
@@
global
.
wsrep_provider
;
SELECT
@@
global
.
wsrep_slave_threads
;
...
...
@@ -71,5 +77,17 @@ SET GLOBAL wsrep_provider= none;
SET
GLOBAL
wsrep_cluster_address
=
''
;
SET
GLOBAL
wsrep_provider_options
=
''
;
--
echo
#
--
echo
# MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash
--
echo
#
SET
@
wsrep_sst_auth_saved
=
@@
global
.
wsrep_sst_auth
;
SET
@@
global
.
wsrep_sst_auth
=
'user:pass'
;
SELECT
@@
global
.
wsrep_sst_auth
;
SET
@@
global
.
wsrep_sst_auth
=
''
;
SELECT
@@
global
.
wsrep_sst_auth
;
SET
@@
global
.
wsrep_sst_auth
=
NULL
;
SELECT
@@
global
.
wsrep_sst_auth
;
SET
@@
global
.
wsrep_sst_auth
=
@
wsrep_sst_auth_saved
;
--
echo
# End of test.
sql/mysqld.cc
View file @
40bfd201
...
...
@@ -1759,7 +1759,7 @@ static void __cdecl kill_server(int sig_ptr)
close_connections
();
#ifdef WITH_WSREP
if
(
wsrep_inited
==
1
)
wsrep_deinit
();
wsrep_deinit
(
true
);
#endif
if
(
sig
!=
MYSQL_KILL_SIGNAL
&&
sig
!=
0
)
...
...
@@ -1871,7 +1871,7 @@ extern "C" void unireg_abort(int exit_code)
/* In bootstrap mode we deinitialize wsrep here. */
if
(
opt_bootstrap
&&
wsrep_inited
)
wsrep_deinit
();
wsrep_deinit
(
true
);
}
#endif // WITH_WSREP
...
...
sql/wsrep_mysqld.cc
View file @
40bfd201
...
...
@@ -696,7 +696,7 @@ void wsrep_init_startup (bool first)
}
void
wsrep_deinit
()
void
wsrep_deinit
(
bool
free_options
)
{
DBUG_ASSERT
(
wsrep_inited
==
1
);
wsrep_unload
(
wsrep
);
...
...
@@ -708,6 +708,11 @@ void wsrep_deinit()
delete
wsrep_format_desc
;
wsrep_format_desc
=
NULL
;
wsrep_inited
=
0
;
if
(
free_options
)
{
wsrep_sst_auth_free
();
}
}
void
wsrep_recover
()
...
...
sql/wsrep_mysqld.h
View file @
40bfd201
...
...
@@ -124,7 +124,7 @@ void wsrep_free_status(THD *thd);
void
wsrep_filter_new_cluster
(
int
*
argc
,
char
*
argv
[]);
int
wsrep_init
();
void
wsrep_deinit
();
void
wsrep_deinit
(
bool
free_options
);
void
wsrep_recover
();
bool
wsrep_before_SE
();
// initialize wsrep before storage
// engines (true) or after (false)
...
...
sql/wsrep_sst.cc
View file @
40bfd201
...
...
@@ -120,31 +120,44 @@ bool wsrep_sst_auth_check (sys_var *self, THD* thd, set_var* var)
{
return
0
;
}
static
bool
sst_auth_real_set
(
const
char
*
value
)
{
const
char
*
v
=
strdup
(
value
)
;
const
char
*
v
=
NULL
;
if
(
v
)
{
if
(
sst_auth_real
)
free
(
const_cast
<
char
*>
(
sst_auth_real
));
sst_auth_real
=
v
;
if
(
value
)
{
v
=
my_strdup
(
value
,
MYF
(
0
));
}
else
// its NULL
{
wsrep_sst_auth_free
();
return
0
;
}
if
(
strlen
(
sst_auth_real
))
{
if
(
wsrep_sst_auth
)
{
my_free
((
void
*
)
wsrep_sst_auth
);
wsrep_sst_auth
=
my_strdup
(
WSREP_SST_AUTH_MASK
,
MYF
(
0
));
//strncpy (wsrep_sst_auth, WSREP_SST_AUTH_MASK,
// sizeof(wsrep_sst_auth) - 1);
}
else
wsrep_sst_auth
=
my_strdup
(
WSREP_SST_AUTH_MASK
,
MYF
(
0
));
}
return
0
;
if
(
v
)
{
// set sst_auth_real
if
(
sst_auth_real
)
{
my_free
((
void
*
)
sst_auth_real
);
}
sst_auth_real
=
v
;
// mask wsrep_sst_auth
if
(
strlen
(
sst_auth_real
))
{
if
(
wsrep_sst_auth
)
{
my_free
((
void
*
)
wsrep_sst_auth
);
}
wsrep_sst_auth
=
my_strdup
(
WSREP_SST_AUTH_MASK
,
MYF
(
0
));
}
return
0
;
}
return
1
;
}
return
1
;
void
wsrep_sst_auth_free
()
{
if
(
wsrep_sst_auth
)
{
my_free
((
void
*
)
wsrep_sst_auth
);
}
if
(
sst_auth_real
)
{
my_free
((
void
*
)
sst_auth_real
);
}
wsrep_sst_auth
=
NULL
;
sst_auth_real
=
NULL
;
}
bool
wsrep_sst_auth_update
(
sys_var
*
self
,
THD
*
thd
,
enum_var_type
type
)
...
...
sql/wsrep_sst.h
View file @
40bfd201
...
...
@@ -31,6 +31,7 @@ extern void wsrep_sst_grab();
extern
bool
wsrep_sst_wait
();
/*! Signals wsrep that initialization is complete, writesets can be applied */
extern
void
wsrep_sst_continue
();
extern
void
wsrep_sst_auth_free
();
extern
void
wsrep_SE_init_grab
();
/*! grab init critical section */
extern
void
wsrep_SE_init_wait
();
/*! wait for SE init to complete */
...
...
sql/wsrep_var.cc
View file @
40bfd201
...
...
@@ -239,7 +239,7 @@ bool wsrep_provider_update (sys_var *self, THD* thd, enum_var_type type)
mysql_mutex_lock
(
&
LOCK_global_system_variables
);
if
(
wsrep_inited
==
1
)
wsrep_deinit
();
wsrep_deinit
(
false
);
char
*
tmp
=
strdup
(
wsrep_provider
);
// wsrep_init() rewrites provider
//when fails
...
...
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