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
15988a37
Commit
15988a37
authored
Oct 22, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Applied a patch from Travis Wheeler to mysqlhotcopy that allows
using regexp with tablenames together with databasenames.
parent
033a0382
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
scripts/mysqlhotcopy.sh
scripts/mysqlhotcopy.sh
+15
-2
No files found.
scripts/mysqlhotcopy.sh
View file @
15988a37
...
@@ -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.
19
"
;
my
$VERSION
=
"1.
20
"
;
my
$opt_tmpdir
=
$ENV
{
TMPDIR
}
||
"/tmp"
;
my
$opt_tmpdir
=
$ENV
{
TMPDIR
}
||
"/tmp"
;
...
@@ -235,10 +235,15 @@ else
...
@@ -235,10 +235,15 @@ else
# --- resolve database names from regexp ---
# --- resolve database names from regexp ---
if
(
defined
$opt
{
regexp
}
)
{
if
(
defined
$opt
{
regexp
}
)
{
my
$t_regex
=
'.*'
;
if
(
$opt
{
regexp
}
=
~ s
{
^/
(
.+
)
/
\.
/
(
.+
)
/
$}
{
$1
}
)
{
$t_regex
=
$2
;
}
my
$sth_dbs
=
$dbh
->prepare
(
"show databases"
)
;
my
$sth_dbs
=
$dbh
->prepare
(
"show databases"
)
;
$sth_dbs
->execute
;
$sth_dbs
->execute
;
while
(
my
(
$db_name
)
=
$sth_dbs
->fetchrow_array
)
{
while
(
my
(
$db_name
)
=
$sth_dbs
->fetchrow_array
)
{
push @db_desc,
{
'src'
=>
$db_name
}
if
(
$db_name
=
~ m/
$opt
{
regexp
}
/o
)
;
push @db_desc,
{
'src'
=>
$db_name
,
't_regex'
=>
$t_regex
}
if
(
$db_name
=
~ m/
$opt
{
regexp
}
/o
)
;
}
}
}
}
...
@@ -938,6 +943,14 @@ server in a mutual replication setup.
...
@@ -938,6 +943,14 @@ server in a mutual replication setup.
Copy all databases with names matching the pattern
Copy all databases with names matching the pattern
=
item
--regexp
/pattern1/./pattern2/
Copy all tables with names matching pattern2 from all databases with
names matching pattern1. For example, to
select
all tables which
names begin with
'bar'
from all databases which names end with
'foo'
:
mysqlhotcopy
--indices
--method
=
cp
--regexp
/foo
$/
./^bar/
=
item db_name./pattern/
=
item db_name./pattern/
Copy only tables matching pattern. Shell metacharacters
(
(
,
)
, |,
!
,
Copy only tables matching pattern. Shell metacharacters
(
(
,
)
, |,
!
,
...
...
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