Below is the list of changes that have just been committed into a local
5.0 repository of Kristofer Pettersson. When Kristofer Pettersson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-10-09 21:13:37+02:00, Kristofer.Pettersson@naruto. +2 -0
Bug#23010 _my_b_read() passing illegal file handles to my_seek()
- The io cache flag seek_not_done was not set properly in the reinit_
io_chache function call and this led my_seek to be called despite an
invalid file handle.
- Added a test in reinit_io_cache to ensure we have a valid file handle
before setting seek_not_done flag.
mysys/mf_iocache.c@stripped, 2006-10-09 20:46:24+02:00, Kristofer.Pettersson@naruto. +5 -1
Added a test to only trigger my_seek function calls if we have
a valid file descriptor.
mysys/my_seek.c@stripped, 2006-10-09 20:46:25+02:00, Kristofer.Pettersson@naruto. +7 -2
Refactored incomplete condition into an assertion. This also ensures that
newpos is initialized.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: Kristofer.Pettersson
# Host: naruto.
# Root: C:/cpp/bug23010/my50-bug23010
--- 1.55/mysys/mf_iocache.c 2006-10-09 21:13:55 +02:00
+++ 1.56/mysys/mf_iocache.c 2006-10-09 21:13:55 +02:00
@@ -333,7 +333,11 @@
{
info->read_end=info->write_pos;
info->end_of_file=my_b_tell(info);
- info->seek_not_done=1;
+ /*
+ Trigger a new seek only if we have a valid
+ file handle.
+ */
+ info->seek_not_done= (info->file != -1);
}
else if (type == WRITE_CACHE)
{
--- 1.12/mysys/my_seek.c 2006-10-09 21:13:55 +02:00
+++ 1.13/mysys/my_seek.c 2006-10-09 21:13:55 +02:00
@@ -29,8 +29,13 @@
whence, MyFlags));
DBUG_ASSERT(pos != MY_FILEPOS_ERROR); /* safety check */
- if (-1 != fd)
- newpos=lseek(fd, pos, whence);
+ /*
+ Make sure we are using a valid file descriptor!
+ */
+ DBUG_ASSERT(fd != -1);
+
+ newpos= lseek(fd, pos, whence);
+
if (newpos == (os_off_t) -1)
{
my_errno=errno;
| Thread |
|---|
| • bk commit into 5.0 tree (Kristofer.Pettersson:1.2273) BUG#23010 | kpettersson | 9 Oct |