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
1d5f6a00
Commit
1d5f6a00
authored
Nov 22, 2019
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-21049 Segfault in create federatedx table with empty hostname
Use my_localhost instead of NULL for share->hostname.
parent
0076dce2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
4 deletions
+40
-4
mysql-test/suite/federated/federatedx.result
mysql-test/suite/federated/federatedx.result
+16
-0
mysql-test/suite/federated/federatedx.test
mysql-test/suite/federated/federatedx.test
+21
-0
storage/federatedx/ha_federatedx.cc
storage/federatedx/ha_federatedx.cc
+3
-4
No files found.
mysql-test/suite/federated/federatedx.result
View file @
1d5f6a00
...
...
@@ -2283,6 +2283,22 @@ connection default;
connection master;
CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='mysql://@127.0.0.1:SLAVE_PORT/federated/t1';
ERROR HY000: Can't create federated table. Foreign data src error: database: 'federated' username: '' hostname: '127.0.0.1'
#
# MDEV-21049 Segfault in create federatedx table with empty hostname
#
connection master;
CREATE TABLE federated.t1 (x int) ENGINE=FEDERATED
CONNECTION='mysql://root@:SLAVE_PORT/federated/t1';
ERROR HY000: Can't create federated table. Foreign data src error: database: 'federated' username: 'root' hostname: 'localhost'
connection slave;
CREATE TABLE federated.t1(x int);
connection master;
CREATE TABLE federated.t1 (x int) ENGINE=FEDERATED
CONNECTION='mysql://root@:SLAVE_PORT/federated/t1';
DROP TABLE federated.t1;
connection slave;
DROP TABLE federated.t1;
connection default;
connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
...
...
mysql-test/suite/federated/federatedx.test
View file @
1d5f6a00
...
...
@@ -2010,4 +2010,25 @@ connection master;
--
error
ER_CANT_CREATE_FEDERATED_TABLE
eval
CREATE
TABLE
t1
(
a
INT
)
ENGINE
=
FEDERATED
CONNECTION
=
'mysql://@127.0.0.1:$SLAVE_MYPORT/federated/t1'
;
--
echo
#
--
echo
# MDEV-21049 Segfault in create federatedx table with empty hostname
--
echo
#
connection
master
;
--
replace_result
$SLAVE_MYPORT
SLAVE_PORT
--
error
ER_CANT_CREATE_FEDERATED_TABLE
eval
CREATE
TABLE
federated
.
t1
(
x
int
)
ENGINE
=
FEDERATED
CONNECTION
=
'mysql://root@:$SLAVE_MYPORT/federated/t1'
;
connection
slave
;
CREATE
TABLE
federated
.
t1
(
x
int
);
connection
master
;
--
replace_result
$SLAVE_MYPORT
SLAVE_PORT
eval
CREATE
TABLE
federated
.
t1
(
x
int
)
ENGINE
=
FEDERATED
CONNECTION
=
'mysql://root@:$SLAVE_MYPORT/federated/t1'
;
DROP
TABLE
federated
.
t1
;
connection
slave
;
DROP
TABLE
federated
.
t1
;
connection
default
;
source
include
/
federated_cleanup
.
inc
;
storage/federatedx/ha_federatedx.cc
View file @
1d5f6a00
...
...
@@ -798,12 +798,12 @@ static int parse_url(MEM_ROOT *mem_root, FEDERATEDX_SHARE *share,
goto
error
;
if
(
share
->
hostname
[
0
]
==
'\0'
)
share
->
hostname
=
NULL
;
share
->
hostname
=
strdup_root
(
mem_root
,
my_localhost
)
;
}
if
(
!
share
->
port
)
{
if
(
!
share
->
hostname
||
strcmp
(
share
->
hostname
,
my_localhost
)
==
0
)
if
(
0
==
strcmp
(
share
->
hostname
,
my_localhost
)
)
share
->
socket
=
(
char
*
)
MYSQL_UNIX_ADDR
;
else
share
->
port
=
MYSQL_PORT
;
...
...
@@ -3385,8 +3385,7 @@ int ha_federatedx::create(const char *name, TABLE *table_arg,
goto
error
;
/* loopback socket connections hang due to LOCK_open mutex */
if
((
!
tmp_share
.
hostname
||
!
strcmp
(
tmp_share
.
hostname
,
my_localhost
))
&&
!
tmp_share
.
port
)
if
(
0
==
strcmp
(
tmp_share
.
hostname
,
my_localhost
)
&&
!
tmp_share
.
port
)
goto
error
;
/*
...
...
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