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
8ec4aa4b
Commit
8ec4aa4b
authored
Jul 19, 2019
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV#20107: rocksdb.check_ignore_unknown_options fails on OS X again
Rewrite the unportable sed/shell code in Perl.
parent
53a3594b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
6 deletions
+34
-6
storage/rocksdb/mysql-test/rocksdb/t/check_ignore_unknown_options.test
...db/mysql-test/rocksdb/t/check_ignore_unknown_options.test
+34
-6
No files found.
storage/rocksdb/mysql-test/rocksdb/t/check_ignore_unknown_options.test
View file @
8ec4aa4b
# MariaDB: "xargs" is not present on windows builders.
# we could work around this but this is not a priority.
--
source
include
/
not_windows
.
inc
--
disable_warnings
let
$MYSQLD_DATADIR
=
`select @@datadir`
;
let
$restart_file
=
$MYSQLTEST_VARDIR
/
tmp
/
mysqld
.
1.
expect
;
let
$error_log
=
$MYSQLTEST_VARDIR
/
log
/
my_restart
.
err
;
select
variable_name
,
variable_value
from
information_schema
.
global_variables
where
variable_name
=
"rocksdb_ignore_unknown_options"
;
--
exec
find
$MYSQLD_DATADIR
/
#rocksdb/OPTIONS* | sort -t- -k 2 -n | tail -1 | xargs -0 -I {} -t sh -c "sed -i 's/rocksdb_version=.*/rocksdb_version=99.9.9/' {}"
--
exec
find
$MYSQLD_DATADIR
/
#rocksdb/OPTIONS* | sort -t- -k 2 -n | tail -1 | xargs -0 -I {} -t sh -c "echo hello=world>>{}"
#
# MariaDB: The following shell commands are not portable so we are
# using perl instead:
#--exec find $MYSQLD_DATADIR/#rocksdb/OPTIONS* | sort -t- -k 2 -n | tail -1 | xargs -0 -I {} -t sh -c "sed -i 's/rocksdb_version=.*/rocksdb_version=99.9.9/' {}"
#--exec find $MYSQLD_DATADIR/#rocksdb/OPTIONS* | sort -t- -k 2 -n | tail -1 | xargs -0 -I {} -t sh -c "echo hello=world>>{}"
perl
;
my
$path
=
$ENV
{
MYSQLTEST_VARDIR
}
.
"/mysqld.1/data/\#rocksdb"
;
opendir
(
my
$dh
,
$path
)
||
die
"Can't opendir
$some_dir
: $!"
;
my
@
files
=
grep
{
/^
OPTIONS
/
}
readdir
(
$dh
);
closedir
(
$dh
);
sub
compare_second_as_number
{
local
$aa
=
shift
;
local
$bb
=
shift
;
$aa
=~
s
/
OPTIONS
-//
;
$bb
=~
s
/
OPTIONS
-//
;
return
$aa
<=>
$bb
;
}
@
sorted_files
=
sort
{
compare_second_as_number
(
$a
,
$b
);
}
@
files
;
my
$last_file
=
$sorted_files
[
-
1
];
my
$contents
=
""
;
open
(
my
$fh
,
"<"
,
"
$path
/
$last_file
"
)
||
die
(
"Couldn't open
$path
/
$last_file
"
);
while
(
<
$fh
>
)
{
$_
=~
s
/
rocksdb_version
=.*/
rocksdb_version
=
99.9
.
9
/
;
$contents
.=
$_
;
}
close
(
$fh
);
$contents
.=
"hello=world
\n
"
;
open
(
my
$fh
,
">"
,
"
$path
/
$last_file
"
)
||
die
(
"Can't open
$path
/
$file
for writing"
);
print
$fh
$contents
;
close
(
$fh
);
EOF
--
exec
echo
"wait"
>
$MYSQLTEST_VARDIR
/
tmp
/
mysqld
.
1.
expect
--
shutdown_server
10
...
...
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