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
bc09de6f
Commit
bc09de6f
authored
Sep 06, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.0-maint
parents
dcb66590
f60c6b1e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
25 deletions
+29
-25
mysys/my_read.c
mysys/my_read.c
+25
-22
scripts/mysqlhotcopy.sh
scripts/mysqlhotcopy.sh
+4
-3
No files found.
mysys/my_read.c
View file @
bc09de6f
...
@@ -36,48 +36,51 @@
...
@@ -36,48 +36,51 @@
uint
my_read
(
File
Filedes
,
byte
*
Buffer
,
uint
Count
,
myf
MyFlags
)
uint
my_read
(
File
Filedes
,
byte
*
Buffer
,
uint
Count
,
myf
MyFlags
)
{
{
uint
readbytes
,
save_count
;
uint
readbytes
,
save_count
;
DBUG_ENTER
(
"my_read"
);
DBUG_ENTER
(
"my_read"
);
DBUG_PRINT
(
"my"
,(
"Fd: %d Buffer: %lx Count: %u MyFlags: %d"
,
DBUG_PRINT
(
"my"
,(
"Fd: %d Buffer: %lx Count: %u MyFlags: %d"
,
Filedes
,
Buffer
,
Count
,
MyFlags
));
Filedes
,
Buffer
,
Count
,
MyFlags
));
save_count
=
Count
;
save_count
=
Count
;
for
(;;)
for
(;;)
{
{
errno
=
0
;
/* Linux doesn't reset this */
errno
=
0
;
/* Linux doesn't reset this */
if
((
readbytes
=
(
uint
)
read
(
Filedes
,
Buffer
,
Count
))
!=
Count
)
if
((
readbytes
=
(
uint
)
read
(
Filedes
,
Buffer
,
Count
))
!=
Count
)
{
{
my_errno
=
errno
?
errno
:
-
1
;
my_errno
=
errno
?
errno
:
-
1
;
DBUG_PRINT
(
"warning"
,(
"Read only %ld bytes off %ld from %d, errno: %d"
,
DBUG_PRINT
(
"warning"
,(
"Read only %ld bytes off %ld from %d, errno: %d"
,
readbytes
,
Count
,
Filedes
,
my_errno
));
readbytes
,
Count
,
Filedes
,
my_errno
));
#ifdef THREAD
#ifdef THREAD
if
(
readbytes
==
0
&&
errno
==
EINTR
)
if
((
int
)
readbytes
<=
0
&&
errno
==
EINTR
)
continue
;
/* Interrupted */
{
DBUG_PRINT
(
"debug"
,
(
"my_read() was interrupted and returned %d"
,
(
int
)
readbytes
));
continue
;
/* Interrupted */
}
#endif
#endif
if
(
MyFlags
&
(
MY_WME
|
MY_FAE
|
MY_FNABP
))
if
(
MyFlags
&
(
MY_WME
|
MY_FAE
|
MY_FNABP
))
{
{
if
((
int
)
readbytes
==
-
1
)
if
((
int
)
readbytes
==
-
1
)
my_error
(
EE_READ
,
MYF
(
ME_BELL
+
ME_WAITTANG
),
my_error
(
EE_READ
,
MYF
(
ME_BELL
+
ME_WAITTANG
),
my_filename
(
Filedes
),
my_errno
);
my_filename
(
Filedes
),
my_errno
);
else
if
(
MyFlags
&
(
MY_NABP
|
MY_FNABP
))
else
if
(
MyFlags
&
(
MY_NABP
|
MY_FNABP
))
my_error
(
EE_EOFERR
,
MYF
(
ME_BELL
+
ME_WAITTANG
),
my_error
(
EE_EOFERR
,
MYF
(
ME_BELL
+
ME_WAITTANG
),
my_filename
(
Filedes
),
my_errno
);
my_filename
(
Filedes
),
my_errno
);
}
}
if
((
int
)
readbytes
==
-
1
||
if
((
int
)
readbytes
==
-
1
||
((
MyFlags
&
(
MY_FNABP
|
MY_NABP
))
&&
!
(
MyFlags
&
MY_FULL_IO
)))
((
MyFlags
&
(
MY_FNABP
|
MY_NABP
))
&&
!
(
MyFlags
&
MY_FULL_IO
)))
DBUG_RETURN
(
MY_FILE_ERROR
);
/* Return with error */
DBUG_RETURN
(
MY_FILE_ERROR
);
/* Return with error */
if
(
readbytes
>
0
&&
(
MyFlags
&
MY_FULL_IO
))
if
(
readbytes
>
0
&&
(
MyFlags
&
MY_FULL_IO
))
{
{
Buffer
+=
readbytes
;
Buffer
+=
readbytes
;
Count
-=
readbytes
;
Count
-=
readbytes
;
continue
;
continue
;
}
}
}
}
if
(
MyFlags
&
(
MY_NABP
|
MY_FNABP
))
if
(
MyFlags
&
(
MY_NABP
|
MY_FNABP
))
readbytes
=
0
;
/* Ok on read */
readbytes
=
0
;
/* Ok on read */
else
if
(
MyFlags
&
MY_FULL_IO
)
else
if
(
MyFlags
&
MY_FULL_IO
)
readbytes
=
save_count
;
readbytes
=
save_count
;
break
;
break
;
}
}
DBUG_RETURN
(
readbytes
);
DBUG_RETURN
(
readbytes
);
...
...
scripts/mysqlhotcopy.sh
View file @
bc09de6f
...
@@ -262,6 +262,7 @@ my $hc_locks = "";
...
@@ -262,6 +262,7 @@ my $hc_locks = "";
my
$hc_tables
=
""
;
my
$hc_tables
=
""
;
my
$num_tables
=
0
;
my
$num_tables
=
0
;
my
$num_files
=
0
;
my
$num_files
=
0
;
my
$raid_dir_regex
=
'[A-Za-z0-9]{2}'
;
foreach my
$rdb
(
@db_desc
)
{
foreach my
$rdb
(
@db_desc
)
{
my
$db
=
$rdb
->
{
src
}
;
my
$db
=
$rdb
->
{
src
}
;
...
@@ -296,7 +297,7 @@ foreach my $rdb ( @db_desc ) {
...
@@ -296,7 +297,7 @@ foreach my $rdb ( @db_desc ) {
my @raid_dir
=
()
;
my @raid_dir
=
()
;
while
(
defined
(
my
$name
=
readdir DBDIR
)
)
{
while
(
defined
(
my
$name
=
readdir DBDIR
)
)
{
if
(
$name
=
~ /^
\d\d
$/
&&
-d
"
$db_dir
/
$name
"
)
{
if
(
$name
=
~ /^
$raid_dir_regex
$/
&&
-d
"
$db_dir
/
$name
"
)
{
push @raid_dir,
$name
;
push @raid_dir,
$name
;
}
}
else
{
else
{
...
@@ -604,7 +605,7 @@ sub copy_files {
...
@@ -604,7 +605,7 @@ sub copy_files {
# add recursive option for scp
# add recursive option for scp
$cp
.
=
" -r"
if
$^
O
=
~ /m^
(
solaris|linux|freebsd|darwin
)
$/
&&
$method
=
~ /^scp
\b
/
;
$cp
.
=
" -r"
if
$^
O
=
~ /m^
(
solaris|linux|freebsd|darwin
)
$/
&&
$method
=
~ /^scp
\b
/
;
my @non_raid
=
map
{
"'
$_
'"
}
grep
{
!
m:/
\d
{
2
}
/[^/]+
$:
}
@
$files
;
my @non_raid
=
map
{
"'
$_
'"
}
grep
{
!
m:/
$raid_dir_regex
/[^/]+
$:
}
@
$files
;
# add files to copy and the destination directory
# add files to copy and the destination directory
safe_system
(
$cp
, @non_raid,
"'
$target
'"
)
if
(
@non_raid
)
;
safe_system
(
$cp
, @non_raid,
"'
$target
'"
)
if
(
@non_raid
)
;
...
@@ -797,7 +798,7 @@ sub get_raid_dirs {
...
@@ -797,7 +798,7 @@ sub get_raid_dirs {
my %dirs
=
()
;
my %dirs
=
()
;
foreach my
$f
(
@
$r_files
)
{
foreach my
$f
(
@
$r_files
)
{
if
(
$f
=
~ m:^
(
\d\d
)
/:
)
{
if
(
$f
=
~ m:^
(
$raid_dir_regex
)
/:
)
{
$dirs
{
$1
}
=
1
;
$dirs
{
$1
}
=
1
;
}
}
}
}
...
...
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