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
bb27133c
Commit
bb27133c
authored
Feb 24, 2003
by
jani@rhols221.adsl.netsonic.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge work:/home/bk/mysql-4.0
into rhols221.adsl.netsonic.fi:/home/my/bk/mysql-4.0
parents
c9cb735f
7dc6d7bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
scripts/mysqlhotcopy.sh
scripts/mysqlhotcopy.sh
+16
-3
No files found.
scripts/mysqlhotcopy.sh
View file @
bb27133c
...
@@ -37,7 +37,7 @@ WARNING: THIS PROGRAM IS STILL IN BETA. Comments/patches welcome.
...
@@ -37,7 +37,7 @@ WARNING: THIS PROGRAM IS STILL IN BETA. Comments/patches welcome.
# Documentation continued at end of file
# Documentation continued at end of file
my
$VERSION
=
"1.1
7
"
;
my
$VERSION
=
"1.1
8
"
;
my
$opt_tmpdir
=
$ENV
{
TMPDIR
}
||
"/tmp"
;
my
$opt_tmpdir
=
$ENV
{
TMPDIR
}
||
"/tmp"
;
...
@@ -173,6 +173,7 @@ my $dbh = DBI->connect("dbi:mysql:$dsn;mysql_read_default_group=mysqlhotcopy",
...
@@ -173,6 +173,7 @@ my $dbh = DBI->connect("dbi:mysql:$dsn;mysql_read_default_group=mysqlhotcopy",
# --- check that checkpoint table exists if specified ---
# --- check that checkpoint table exists if specified ---
if
(
$opt
{
checkpoint
}
)
{
if
(
$opt
{
checkpoint
}
)
{
$opt
{
checkpoint
}
=
quote_names
(
$opt
{
checkpoint
}
)
;
eval
{
$dbh
->do
(
qq
{
select
time_stamp, src, dest, msg
eval
{
$dbh
->do
(
qq
{
select
time_stamp, src, dest, msg
from
$opt
{
checkpoint
}
where 1
!=
1
}
)
;
from
$opt
{
checkpoint
}
where 1
!=
1
}
)
;
}
;
}
;
...
@@ -183,6 +184,8 @@ if ( $opt{checkpoint} ) {
...
@@ -183,6 +184,8 @@ if ( $opt{checkpoint} ) {
# --- check that log_pos table exists if specified ---
# --- check that log_pos table exists if specified ---
if
(
$opt
{
record_log_pos
}
)
{
if
(
$opt
{
record_log_pos
}
)
{
$opt
{
record_log_pos
}
=
quote_names
(
$opt
{
record_log_pos
}
)
;
eval
{
$dbh
->do
(
qq
{
select
host, time_stamp, log_file, log_pos, master_host, master_log_file, master_log_pos
eval
{
$dbh
->do
(
qq
{
select
host, time_stamp, log_file, log_pos, master_host, master_log_file, master_log_pos
from
$opt
{
record_log_pos
}
where 1
!=
1
}
)
;
from
$opt
{
record_log_pos
}
where 1
!=
1
}
)
;
}
;
}
;
...
@@ -309,7 +312,7 @@ foreach my $rdb ( @db_desc ) {
...
@@ -309,7 +312,7 @@ foreach my $rdb ( @db_desc ) {
$rdb
->
{
files
}
=
[
@db_files
]
;
$rdb
->
{
files
}
=
[
@db_files
]
;
$rdb
->
{
index
}
=
[
@index_files
]
;
$rdb
->
{
index
}
=
[
@index_files
]
;
my @hc_tables
=
map
{
"
`
$db
`
.
`
$_
`
"
}
@dbh_tables
;
my @hc_tables
=
map
{
quote_names
(
"
$db
.
$_
"
)
}
@dbh_tables
;
$rdb
->
{
tables
}
=
[
@hc_tables
]
;
$rdb
->
{
tables
}
=
[
@hc_tables
]
;
$rdb
->
{
raid_dirs
}
=
[
get_raid_dirs
(
$rdb
->
{
files
}
)
]
;
$rdb
->
{
raid_dirs
}
=
[
get_raid_dirs
(
$rdb
->
{
files
}
)
]
;
...
@@ -569,7 +572,7 @@ sub copy_files {
...
@@ -569,7 +572,7 @@ sub copy_files {
my @non_raid
=
map
{
"'
$_
'"
}
grep
{
!
m:/
\d
{
2
}
/[^/]+
$:
}
@
$files
;
my @non_raid
=
map
{
"'
$_
'"
}
grep
{
!
m:/
\d
{
2
}
/[^/]+
$:
}
@
$files
;
# add files to copy and the destination directory
# add files to copy and the destination directory
safe_system
(
@cp, @non_raid,
"'
$target
'"
)
;
safe_system
(
@cp, @non_raid,
"'
$target
'"
)
if
(
@non_raid
)
;
foreach my
$rd
(
@
$raid_dirs
)
{
foreach my
$rd
(
@
$raid_dirs
)
{
my @raid
=
map
{
"'
$_
'"
}
grep
{
m:
$rd
/:
}
@
$files
;
my @raid
=
map
{
"'
$_
'"
}
grep
{
m:
$rd
/:
}
@
$files
;
...
@@ -758,6 +761,16 @@ sub get_list_of_tables {
...
@@ -758,6 +761,16 @@ sub get_list_of_tables {
return
@dbh_tables
;
return
@dbh_tables
;
}
}
sub quote_names
{
my
(
$name
)
=
@_
;
# given a db.table name, add quotes
my
(
$db
,
$table
, @cruft
)
=
split
(
/
\.
/,
$name
)
;
die
"Invalid db.table name '
$name
'"
if
(
@cruft
||
!
defined
$db
||
!
defined
$table
)
;
return
"
`
$db
`
.
`
$table
`
"
;
}
__END__
__END__
=
head1 DESCRIPTION
=
head1 DESCRIPTION
...
...
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