mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-7222: Cluster Node Crash at CREATE DEFINER statement
Check whether the definer host string is not null before appending it to the specified buffer.
This commit is contained in:
7
mysql-test/suite/wsrep/r/view.result
Normal file
7
mysql-test/suite/wsrep/r/view.result
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#
|
||||||
|
# MDEV-7222: Cluster Node Crash at CREATE DEFINER statement
|
||||||
|
#
|
||||||
|
USE test;
|
||||||
|
CREATE DEFINER=CURRENT_USER VIEW v1 AS SELECT 1;
|
||||||
|
DROP VIEW v1;
|
||||||
|
# End of tests
|
11
mysql-test/suite/wsrep/t/view.test
Normal file
11
mysql-test/suite/wsrep/t/view.test
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--source include/galera_cluster.inc
|
||||||
|
--source include/have_innodb.inc
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-7222: Cluster Node Crash at CREATE DEFINER statement
|
||||||
|
--echo #
|
||||||
|
USE test;
|
||||||
|
CREATE DEFINER=CURRENT_USER VIEW v1 AS SELECT 1;
|
||||||
|
DROP VIEW v1;
|
||||||
|
|
||||||
|
--echo # End of tests
|
@ -2191,7 +2191,7 @@ void append_definer(THD *thd, String *buffer, const LEX_STRING *definer_user,
|
|||||||
{
|
{
|
||||||
buffer->append(STRING_WITH_LEN("DEFINER="));
|
buffer->append(STRING_WITH_LEN("DEFINER="));
|
||||||
append_identifier(thd, buffer, definer_user->str, definer_user->length);
|
append_identifier(thd, buffer, definer_user->str, definer_user->length);
|
||||||
if (definer_host->str[0])
|
if (definer_host->str && definer_host->str[0])
|
||||||
{
|
{
|
||||||
buffer->append('@');
|
buffer->append('@');
|
||||||
append_identifier(thd, buffer, definer_host->str, definer_host->length);
|
append_identifier(thd, buffer, definer_host->str, definer_host->length);
|
||||||
|
Reference in New Issue
Block a user