summaryrefslogtreecommitdiff
path: root/storage/maria/ma_statrec.c
diff options
context:
space:
mode:
authorunknown <monty@mysql.com/narttu.mysql.fi>2008-02-21 02:45:02 +0200
committerunknown <monty@mysql.com/narttu.mysql.fi>2008-02-21 02:45:02 +0200
commitdf843c4ce26e2c5d152098302b209252c712382e (patch)
tree01e5c523135209a8a44a7a99d51a1dc1b33a367e /storage/maria/ma_statrec.c
parent8bb95a820ad92cd39e9ade0b70989bee7fe6d040 (diff)
downloadmariadb-git-df843c4ce26e2c5d152098302b209252c712382e.tar.gz
Fixed problems with ma_test2 and mi_test2 on high-byte-first system
Fixed bug in ma_test2 when last row in table is deleted Fixed that ma_test_recovery.pl works on Solaris (by using digest instead of md5sum) Fixed some compiler warnings generated by the Forte compiler dbug/dbug.c: Added cast to get rid of compiler warning mysys/lf_alloc-pin.c: Added cast to get rid of compiler warning mysys/my_bitmap.c: Removed impossible DBUG_ASSERT()'s to get rid of compiler warnings mysys/my_compress.c: Removed wrong cast to get rid of compiler warning storage/maria/lockman.c: Added cast to get rid of compiler warning storage/maria/ma_open.c: Added fix from MyISAM to allocate space in key buffer for nod pointer storage/maria/ma_recovery.c: Fixed initialization that caused compiler warning storage/maria/ma_rsame.c: More DBUG_PRINT storage/maria/ma_scan.c: Better comment storage/maria/ma_statrec.c: More DBUG_PRINT and comments Fixed indentation BitKeeper/etc/ignore: added storage/maria/unittest/tmp/* storage/maria/ma_test2.c: Fixed bug that caused maria_rsame() to fail if test removed last row Fixed wrong usage of longget(); Should be uint4korr() storage/maria/unittest/ma_test_recovery.pl: Use md5sum or digest to calculate md5. This allows this script to be run on Linux and Solaris storage/myisam/mi_test2.c: Fixed wrong usage of longget(); Should be uint4korr() strings/ctype.c: Added casts to get rid of compiler warnings sql-bench/myisam.cnf: New BitKeeper file ``sql-bench/myisam.cnf''
Diffstat (limited to 'storage/maria/ma_statrec.c')
-rw-r--r--storage/maria/ma_statrec.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/storage/maria/ma_statrec.c b/storage/maria/ma_statrec.c
index c8ba1d5d234..3e744e12045 100644
--- a/storage/maria/ma_statrec.c
+++ b/storage/maria/ma_statrec.c
@@ -173,13 +173,14 @@ int _ma_read_static_record(register MARIA_HA *info, register uchar *record,
MARIA_RECORD_POS pos)
{
int error;
+ DBUG_ENTER("_ma_read_static_record");
if (pos != HA_OFFSET_ERROR)
{
if (info->opt_flag & WRITE_CACHE_USED &&
info->rec_cache.pos_in_file <= pos &&
flush_io_cache(&info->rec_cache))
- return(my_errno);
+ DBUG_RETURN(my_errno);
info->rec_cache.seek_not_done=1; /* We have done a seek */
error= (int) info->s->file_read(info, record,info->s->base.reclength,
@@ -190,17 +191,27 @@ int _ma_read_static_record(register MARIA_HA *info, register uchar *record,
if (!*record)
{
/* Record is deleted */
- return ((my_errno=HA_ERR_RECORD_DELETED));
+ DBUG_PRINT("warning", ("Record is deleted"));
+ DBUG_RETURN((my_errno=HA_ERR_RECORD_DELETED));
}
info->update|= HA_STATE_AKTIV; /* Record is read */
- return(0);
+ DBUG_RETURN(0);
}
}
fast_ma_writeinfo(info); /* No such record */
- return(my_errno);
+ DBUG_RETURN(my_errno);
}
+/**
+ @brief Read record from given position or next record
+
+ @note
+ When scanning, this function will return HA_ERR_RECORD_DELETED
+ for deleted rows even if skip_deleted_blocks is set.
+ The reason for this is to allow the caller to calculate the record
+ position without having to do call maria_position() for each record.
+*/
int _ma_read_rnd_static_record(MARIA_HA *info, uchar *buf,
MARIA_RECORD_POS filepos,
@@ -219,7 +230,8 @@ int _ma_read_rnd_static_record(MARIA_HA *info, uchar *buf,
(skip_deleted_blocks || !filepos))
{
cache_read=1; /* Read record using cache */
- cache_length=(uint) (info->rec_cache.read_end - info->rec_cache.read_pos);
+ cache_length= (uint) (info->rec_cache.read_end -
+ info->rec_cache.read_pos);
}
else
info->rec_cache.seek_not_done=1; /* Filepos is changed */