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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
0e50b924
Commit
0e50b924
authored
Jun 16, 2016
by
Alexey Botchkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-9969 mysql_install_db error processing ignore_db_dirs.
Check for same directories in the list added.
parent
732e2694
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
3 deletions
+30
-3
mysql-test/r/mysqld_option_err.result
mysql-test/r/mysqld_option_err.result
+1
-0
mysql-test/t/mysqld_option_err.test
mysql-test/t/mysqld_option_err.test
+8
-0
sql/sql_show.cc
sql/sql_show.cc
+21
-3
No files found.
mysql-test/r/mysqld_option_err.result
View file @
0e50b924
...
...
@@ -5,4 +5,5 @@ Test non-numeric value passed to number option.
Test that bad value for plugin enum option is rejected correctly.
Test that --help --verbose works
Test that --not-known-option --help --verbose gives error
Test that specifying same directory several times handled properly.
Done.
mysql-test/t/mysqld_option_err.test
View file @
0e50b924
...
...
@@ -56,4 +56,12 @@ mkdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;
--
error
2
--
exec
$MYSQLD_BOOTSTRAP_CMD
--
not
-
known
-
option
--
help
--
verbose
>>
$MYSQLTEST_VARDIR
/
tmp
/
mysqld_option_err
/
mysqltest
.
log
2
>&
1
#
# MDEV-9969 mysql_install_db error processing ignore_db_dirs.
#
--
echo
Test
that
specifying
same
directory
several
times
handled
properly
.
--
exec
echo
""
|
$MYSQLD_BOOTSTRAP_CMD
--
skip
-
networking
--
datadir
=
$MYSQLTEST_VARDIR
/
tmp
/
mysqld_option_err
--
skip
-
grant
-
tables
--
ignore
-
db
-
dirs
=
'some_dir'
--
ignore
-
db
-
dirs
=
'some_dir'
>>
$MYSQLTEST_VARDIR
/
tmp
/
mysqld_option_err
/
mysqltest
.
log
2
>&
1
--
echo
Done
.
sql/sql_show.cc
View file @
0e50b924
...
...
@@ -720,12 +720,24 @@ ignore_db_dirs_process_additions()
for
(
i
=
0
;
i
<
ignore_db_dirs_array
.
elements
;
i
++
)
{
get_dynamic
(
&
ignore_db_dirs_array
,
(
uchar
*
)
&
dir
,
i
);
if
(
my_hash_insert
(
&
ignore_db_dirs_hash
,
(
uchar
*
)
dir
))
if
(
my_hash_insert
(
&
ignore_db_dirs_hash
,
(
uchar
*
)
dir
))
{
/* ignore duplicates from the config file */
if
(
my_hash_search
(
&
ignore_db_dirs_hash
,
(
uchar
*
)
dir
->
str
,
dir
->
length
))
{
sql_print_warning
(
"Duplicate ignore-db-dir directory name '%.*s' "
"found in the config file(s). Ignoring the duplicate."
,
(
int
)
dir
->
length
,
dir
->
str
);
my_free
(
dir
);
goto
continue_loop
;
}
return
true
;
}
ptr
=
strnmov
(
ptr
,
dir
->
str
,
dir
->
length
);
if
(
i
+
1
<
ignore_db_dirs_array
.
elements
)
ptr
=
strmov
(
ptr
,
","
);
*
(
ptr
++
)
=
','
;
continue_loop:
/*
Set the transferred array element to NULL to avoid double free
in case of error.
...
...
@@ -734,6 +746,12 @@ ignore_db_dirs_process_additions()
set_dynamic
(
&
ignore_db_dirs_array
,
(
uchar
*
)
&
dir
,
i
);
}
if
(
ptr
>
opt_ignore_db_dirs
)
{
ptr
--
;
DBUG_ASSERT
(
*
ptr
==
','
);
}
/* make sure the string is terminated */
DBUG_ASSERT
(
ptr
-
opt_ignore_db_dirs
<=
(
ptrdiff_t
)
len
);
*
ptr
=
0
;
...
...
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