summaryrefslogtreecommitdiff
path: root/mysys/mf_iocache2.c
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2002-01-31 16:17:24 -0700
committerunknown <sasha@mysql.sashanet.com>2002-01-31 16:17:24 -0700
commit552656c3ba5e3604fabc656f8b7dec805febb91b (patch)
treeecfec25ec880212bd112f7b24ddd98598dc874bb /mysys/mf_iocache2.c
parent8612588aeb74cc1a3252206da9c14cd83f392b4e (diff)
downloadmariadb-git-552656c3ba5e3604fabc656f8b7dec805febb91b.tar.gz
fixed wrong DBUG_ASSERT() in IO_CACHE
fixed apparent typo in opt_sum.cc I will push this Changeset although it fails select test - failing select is better than the code that does not compile. mysql-test/r/rpl000001.result: updated result mysys/mf_iocache2.c: fixed wrong DBUG_ASSERT() sql/opt_sum.cc: fixed an apparent typo to make it compile
Diffstat (limited to 'mysys/mf_iocache2.c')
-rw-r--r--mysys/mf_iocache2.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index 00ebf1e6846..127bf20e8fe 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -41,8 +41,20 @@ my_off_t my_b_append_tell(IO_CACHE* info)
/* save the value of my_tell in res so we can see it when studying
coredump
*/
- DBUG_ASSERT(info->end_of_file - (info->append_read_pos-info->write_buffer)
+#ifndef DBUG_OFF
+ /* make sure EOF is where we think it is. Note that we cannot just use
+ my_tell() because we have a reader thread that could have left the
+ file offset in a non-EOF location
+ */
+ {
+ volatile my_off_t save_pos;
+ save_pos = my_tell(info->file,MYF(0));
+ my_seek(info->file,(my_off_t)0,MY_SEEK_END,MYF(0));
+ DBUG_ASSERT(info->end_of_file - (info->append_read_pos-info->write_buffer)
== (res=my_tell(info->file,MYF(0))));
+ my_seek(info->file,save_pos,MY_SEEK_SET,MYF(0));
+ }
+#endif
res = info->end_of_file + (info->write_pos-info->append_read_pos);
#ifdef THREAD
pthread_mutex_unlock(&info->append_buffer_lock);