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
c6318e47
Commit
c6318e47
authored
Jul 28, 2001
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
merge
Docs/manual.texi: merge (need to fix with emacs to get everthing right)
parents
29ef9455
e7eb7437
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 @
c6318e47
...
...
@@ -223,18 +223,27 @@ foreach my $rdb ( @db_desc ) {
my
$db
=
$rdb
->
{
src
}
;
eval
{
$dbh
->do
(
"use
$db
"
)
;
}
;
die
"Database '
$db
' not accessible:
$@
"
if
(
$@
)
;
my @dbh_tables
=
$dbh
->
func
(
'_ListTables'
)
;
my @dbh_tables
=
$dbh
->
tables
(
)
;
## generate regex for tables/files
my
$t_regex
=
$rdb
->
{
t_regex
}
;
## assign temporary regex
my
$negated
=
$t_regex
=
~
tr
/~//d
;
## remove and count negation operator: we don't allow ~ in table names
$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
)
;
my
$t_regex
;
my
$negated
;
if
(
$rdb
->
{
t_regex
})
{
$t_regex
=
$rdb
->
{
t_regex
}
;
## assign temporary regex
$negated
=
$t_regex
=
~
tr
/~//d
;
## remove and count
## negation operator: we
## don't allow ~ in table
## names
$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
my
$db_dir
=
"
$datadir
/
$db
"
;
...
...
@@ -249,10 +258,18 @@ foreach my $rdb ( @db_desc ) {
closedir
(
DBDIR
)
;
## filter (out) files specified in t_regex
my @db_files
=
(
$negated
?
grep
{
$db_files
{
$_
}
!
~
$t_regex
}
keys %db_files
:
grep
{
$db_files
{
$_
}
=
~
$t_regex
}
keys %db_files
)
;
my @db_files
;
if
(
$rdb
->
{
t_regex
})
{
@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
;
my @index_files
=()
;
## 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.
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