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
cc128834
Commit
cc128834
authored
Dec 09, 2010
by
Ramil Kalimullin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug#48451: my_seek and my_tell ignore MY_WME flag
my_seek() and my_tell() functions now honour MY_WME flag.
parent
a9d18aaf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
8 deletions
+25
-8
include/mysys_err.h
include/mysys_err.h
+2
-1
mysys/errors.c
mysys/errors.c
+2
-0
mysys/my_seek.c
mysys/my_seek.c
+10
-3
mysys/my_symlink.c
mysys/my_symlink.c
+1
-2
storage/myisam/ha_myisam.cc
storage/myisam/ha_myisam.cc
+10
-2
No files found.
include/mysys_err.h
View file @
cc128834
...
@@ -64,7 +64,8 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */
...
@@ -64,7 +64,8 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */
#define EE_FILE_NOT_CLOSED 30
#define EE_FILE_NOT_CLOSED 30
#define EE_CHANGE_OWNERSHIP 31
#define EE_CHANGE_OWNERSHIP 31
#define EE_CHANGE_PERMISSIONS 32
#define EE_CHANGE_PERMISSIONS 32
#define EE_ERROR_LAST 32
/* Copy last error nr */
#define EE_CANT_SEEK 33
#define EE_ERROR_LAST 33
/* Copy last error nr */
/* Add error numbers before EE_ERROR_LAST and change it accordingly. */
/* Add error numbers before EE_ERROR_LAST and change it accordingly. */
/* exit codes for all MySQL programs */
/* exit codes for all MySQL programs */
...
...
mysys/errors.c
View file @
cc128834
...
@@ -52,6 +52,7 @@ const char * NEAR globerrs[GLOBERRS]=
...
@@ -52,6 +52,7 @@ const char * NEAR globerrs[GLOBERRS]=
"File '%s' (fileno: %d) was not closed"
,
"File '%s' (fileno: %d) was not closed"
,
"Can't change ownership of the file '%s' (Errcode: %d)"
,
"Can't change ownership of the file '%s' (Errcode: %d)"
,
"Can't change permissions of the file '%s' (Errcode: %d)"
,
"Can't change permissions of the file '%s' (Errcode: %d)"
,
"Can't seek in file '%s' (Errcode: %d)"
};
};
void
init_glob_errs
(
void
)
void
init_glob_errs
(
void
)
...
@@ -94,6 +95,7 @@ void init_glob_errs()
...
@@ -94,6 +95,7 @@ void init_glob_errs()
EE
(
EE_FILE_NOT_CLOSED
)
=
"File '%s' (fileno: %d) was not closed"
;
EE
(
EE_FILE_NOT_CLOSED
)
=
"File '%s' (fileno: %d) was not closed"
;
EE
(
EE_CHANGE_OWNERSHIP
)
=
"Can't change ownership of the file '%s' (Errcode: %d)"
;
EE
(
EE_CHANGE_OWNERSHIP
)
=
"Can't change ownership of the file '%s' (Errcode: %d)"
;
EE
(
EE_CHANGE_PERMISSIONS
)
=
"Can't change permissions of the file '%s' (Errcode: %d)"
;
EE
(
EE_CHANGE_PERMISSIONS
)
=
"Can't change permissions of the file '%s' (Errcode: %d)"
;
EE
(
EE_CANT_SEEK
)
=
"Can't seek in file '%s' (Errcode: %d)"
;
}
}
#endif
#endif
...
...
mysys/my_seek.c
View file @
cc128834
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "mysys_priv.h"
#include "mysys_priv.h"
#include "mysys_err.h"
/*
/*
Seek to a position in a file.
Seek to a position in a file.
...
@@ -42,8 +43,7 @@
...
@@ -42,8 +43,7 @@
actual error.
actual error.
*/
*/
my_off_t
my_seek
(
File
fd
,
my_off_t
pos
,
int
whence
,
my_off_t
my_seek
(
File
fd
,
my_off_t
pos
,
int
whence
,
myf
MyFlags
)
myf
MyFlags
__attribute__
((
unused
)))
{
{
reg1
os_off_t
newpos
=
-
1
;
reg1
os_off_t
newpos
=
-
1
;
DBUG_ENTER
(
"my_seek"
);
DBUG_ENTER
(
"my_seek"
);
...
@@ -69,6 +69,8 @@ my_off_t my_seek(File fd, my_off_t pos, int whence,
...
@@ -69,6 +69,8 @@ my_off_t my_seek(File fd, my_off_t pos, int whence,
if
(
newpos
==
(
os_off_t
)
-
1
)
if
(
newpos
==
(
os_off_t
)
-
1
)
{
{
my_errno
=
errno
;
my_errno
=
errno
;
if
(
MyFlags
&
MY_WME
)
my_error
(
EE_CANT_SEEK
,
MYF
(
0
),
my_filename
(
fd
),
my_errno
);
DBUG_PRINT
(
"error"
,(
"lseek: %lu errno: %d"
,
(
ulong
)
newpos
,
errno
));
DBUG_PRINT
(
"error"
,(
"lseek: %lu errno: %d"
,
(
ulong
)
newpos
,
errno
));
DBUG_RETURN
(
MY_FILEPOS_ERROR
);
DBUG_RETURN
(
MY_FILEPOS_ERROR
);
}
}
...
@@ -83,7 +85,7 @@ my_off_t my_seek(File fd, my_off_t pos, int whence,
...
@@ -83,7 +85,7 @@ my_off_t my_seek(File fd, my_off_t pos, int whence,
/* Tell current position of file */
/* Tell current position of file */
/* ARGSUSED */
/* ARGSUSED */
my_off_t
my_tell
(
File
fd
,
myf
MyFlags
__attribute__
((
unused
))
)
my_off_t
my_tell
(
File
fd
,
myf
MyFlags
)
{
{
os_off_t
pos
;
os_off_t
pos
;
DBUG_ENTER
(
"my_tell"
);
DBUG_ENTER
(
"my_tell"
);
...
@@ -95,7 +97,12 @@ my_off_t my_tell(File fd, myf MyFlags __attribute__((unused)))
...
@@ -95,7 +97,12 @@ my_off_t my_tell(File fd, myf MyFlags __attribute__((unused)))
pos
=
lseek
(
fd
,
0L
,
MY_SEEK_CUR
);
pos
=
lseek
(
fd
,
0L
,
MY_SEEK_CUR
);
#endif
#endif
if
(
pos
==
(
os_off_t
)
-
1
)
if
(
pos
==
(
os_off_t
)
-
1
)
{
my_errno
=
errno
;
my_errno
=
errno
;
if
(
MyFlags
&
MY_WME
)
my_error
(
EE_CANT_SEEK
,
MYF
(
0
),
my_filename
(
fd
),
my_errno
);
DBUG_PRINT
(
"error"
,
(
"tell: %lu errno: %d"
,
(
ulong
)
pos
,
my_errno
));
}
DBUG_PRINT
(
"exit"
,(
"pos: %lu"
,
(
ulong
)
pos
));
DBUG_PRINT
(
"exit"
,(
"pos: %lu"
,
(
ulong
)
pos
));
DBUG_RETURN
((
my_off_t
)
pos
);
DBUG_RETURN
((
my_off_t
)
pos
);
}
/* my_tell */
}
/* my_tell */
mysys/my_symlink.c
View file @
cc128834
...
@@ -118,8 +118,7 @@ int my_is_symlink(const char *filename __attribute__((unused)))
...
@@ -118,8 +118,7 @@ int my_is_symlink(const char *filename __attribute__((unused)))
'to' may be equal to 'filename'
'to' may be equal to 'filename'
*/
*/
int
my_realpath
(
char
*
to
,
const
char
*
filename
,
int
my_realpath
(
char
*
to
,
const
char
*
filename
,
myf
MyFlags
)
myf
MyFlags
__attribute__
((
unused
)))
{
{
#if defined(HAVE_REALPATH) && !defined(HAVE_BROKEN_REALPATH)
#if defined(HAVE_REALPATH) && !defined(HAVE_BROKEN_REALPATH)
int
result
=
0
;
int
result
=
0
;
...
...
storage/myisam/ha_myisam.cc
View file @
cc128834
...
@@ -590,7 +590,11 @@ int ha_myisam::net_read_dump(NET* net)
...
@@ -590,7 +590,11 @@ int ha_myisam::net_read_dump(NET* net)
int
data_fd
=
file
->
dfile
;
int
data_fd
=
file
->
dfile
;
int
error
=
0
;
int
error
=
0
;
my_seek
(
data_fd
,
0L
,
MY_SEEK_SET
,
MYF
(
MY_WME
));
if
(
my_seek
(
data_fd
,
0L
,
MY_SEEK_SET
,
MYF
(
MY_WME
))
==
MY_FILEPOS_ERROR
)
{
error
=
my_errno
;
goto
err
;
}
for
(;;)
for
(;;)
{
{
ulong
packet_len
=
my_net_read
(
net
);
ulong
packet_len
=
my_net_read
(
net
);
...
@@ -626,7 +630,11 @@ int ha_myisam::dump(THD* thd, int fd)
...
@@ -626,7 +630,11 @@ int ha_myisam::dump(THD* thd, int fd)
return
ENOMEM
;
return
ENOMEM
;
int
error
=
0
;
int
error
=
0
;
my_seek
(
data_fd
,
0L
,
MY_SEEK_SET
,
MYF
(
MY_WME
));
if
(
my_seek
(
data_fd
,
0L
,
MY_SEEK_SET
,
MYF
(
MY_WME
))
==
MY_FILEPOS_ERROR
)
{
error
=
my_errno
;
goto
err
;
}
for
(;
bytes_to_read
>
0
;)
for
(;
bytes_to_read
>
0
;)
{
{
size_t
bytes
=
my_read
(
data_fd
,
buf
,
blocksize
,
MYF
(
MY_WME
));
size_t
bytes
=
my_read
(
data_fd
,
buf
,
blocksize
,
MYF
(
MY_WME
));
...
...
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