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
1ebd29ac
Commit
1ebd29ac
authored
Jul 28, 2001
by
monty@tik.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
79e467f0
768deddc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
13 deletions
+34
-13
scripts/mysqlhotcopy.sh
scripts/mysqlhotcopy.sh
+34
-13
No files found.
scripts/mysqlhotcopy.sh
View file @
1ebd29ac
...
@@ -223,18 +223,27 @@ foreach my $rdb ( @db_desc ) {
...
@@ -223,18 +223,27 @@ foreach my $rdb ( @db_desc ) {
my
$db
=
$rdb
->
{
src
}
;
my
$db
=
$rdb
->
{
src
}
;
eval
{
$dbh
->do
(
"use
$db
"
)
;
}
;
eval
{
$dbh
->do
(
"use
$db
"
)
;
}
;
die
"Database '
$db
' not accessible:
$@
"
if
(
$@
)
;
die
"Database '
$db
' not accessible:
$@
"
if
(
$@
)
;
my @dbh_tables
=
$dbh
->
func
(
'_ListTables'
)
;
my @dbh_tables
=
$dbh
->
tables
(
)
;
## generate regex for tables/files
## generate regex for tables/files
my
$t_regex
=
$rdb
->
{
t_regex
}
;
## assign temporary regex
my
$t_regex
;
my
$negated
=
$t_regex
=
~
tr
/~//d
;
## remove and count negation operator: we don't allow ~ in table names
my
$negated
;
$t_regex
=
qr/
$t_regex
/
;
## make regex string from user regex
if
(
$rdb
->
{
t_regex
})
{
$t_regex
=
$rdb
->
{
t_regex
}
;
## assign temporary regex
## filter (out) tables specified in t_regex
$negated
=
$t_regex
=
~
tr
/~//d
;
## remove and count
print
"Filtering tables with '
$t_regex
'
\n
"
if
$opt
{
debug
}
;
## negation operator: we
@dbh_tables
=
(
$negated
## don't allow ~ in table
?
grep
{
$_
!
~
$t_regex
}
@dbh_tables
## names
:
grep
{
$_
=
~
$t_regex
}
@dbh_tables
)
;
$t_regex
=
qr/
$t_regex
/
;
## make regex string from
## user regex
## filter (out) tables specified in t_regex
print
"Filtering tables with '
$t_regex
'
\n
"
if
$opt
{
debug
}
;
@dbh_tables
=
(
$negated
?
grep
{
$_
!
~
$t_regex
}
@dbh_tables
:
grep
{
$_
=
~
$t_regex
}
@dbh_tables
)
;
}
## get list of files to copy
## get list of files to copy
my
$db_dir
=
"
$datadir
/
$db
"
;
my
$db_dir
=
"
$datadir
/
$db
"
;
...
@@ -249,10 +258,18 @@ foreach my $rdb ( @db_desc ) {
...
@@ -249,10 +258,18 @@ foreach my $rdb ( @db_desc ) {
closedir
(
DBDIR
)
;
closedir
(
DBDIR
)
;
## filter (out) files specified in t_regex
## filter (out) files specified in t_regex
my @db_files
=
(
$negated
my @db_files
;
?
grep
{
$db_files
{
$_
}
!
~
$t_regex
}
keys %db_files
if
(
$rdb
->
{
t_regex
})
{
:
grep
{
$db_files
{
$_
}
=
~
$t_regex
}
keys %db_files
)
;
@db_files
=
(
$negated
?
grep
{
$db_files
{
$_
}
!
~
$t_regex
}
keys %db_files
:
grep
{
$db_files
{
$_
}
=
~
$t_regex
}
keys %db_files
)
;
}
else
{
@db_files
=
keys %db_files
;
}
@db_files
=
sort
@db_files
;
@db_files
=
sort
@db_files
;
my @index_files
=()
;
my @index_files
=()
;
## remove indices unless we're told to keep them
## remove indices unless we're told to keep them
...
@@ -809,3 +826,7 @@ Ask Bjoern Hansen - Cleanup code to fix a few bugs and enable -w again.
...
@@ -809,3 +826,7 @@ Ask Bjoern Hansen - Cleanup code to fix a few bugs and enable -w again.
Emil S. Hansen - Added resetslave and resetmaster.
Emil S. Hansen - Added resetslave and resetmaster.
Jeremy D. Zawodny - Removed depricated DBI calls. Fixed bug which
resulted
in
nothing being copied when a regexp was specified but no
database name
(
s
)
.
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