summaryrefslogtreecommitdiff
path: root/storage/archive
diff options
context:
space:
mode:
authorMikael Ronstrom <mikael@mysql.com>2009-06-11 12:07:59 +0200
committerMikael Ronstrom <mikael@mysql.com>2009-06-11 12:07:59 +0200
commita22c8c5be5ceadd23eed707ae2f1308ced2de977 (patch)
tree796cc97d1d103e18e0672d9b57dee4c54857073c /storage/archive
parent510835a0727fc1ebe98e2808cae91c8ab014d27e (diff)
parent585cf08fe6a8d6e237732daa94a969f93e5c84ec (diff)
downloadmariadb-git-a22c8c5be5ceadd23eed707ae2f1308ced2de977.tar.gz
Merge MySQL 5.1.35 into MySQL 5.4
Diffstat (limited to 'storage/archive')
-rw-r--r--storage/archive/azio.c2
-rw-r--r--storage/archive/azlib.h2
-rw-r--r--storage/archive/ha_archive.cc12
3 files changed, 9 insertions, 7 deletions
diff --git a/storage/archive/azio.c b/storage/archive/azio.c
index 59fbe2182ee..916dd8ba59d 100644
--- a/storage/archive/azio.c
+++ b/storage/archive/azio.c
@@ -390,7 +390,7 @@ int destroy (s)
Reads the given number of uncompressed bytes from the compressed file.
azread returns the number of bytes actually read (0 for end of file).
*/
-unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, unsigned int len, int *error)
+unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, size_t len, int *error)
{
Bytef *start = (Bytef*)buf; /* starting point for crc computation */
Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */
diff --git a/storage/archive/azlib.h b/storage/archive/azlib.h
index 47772b1c4fe..d7abb40b2ae 100644
--- a/storage/archive/azlib.h
+++ b/storage/archive/azlib.h
@@ -265,7 +265,7 @@ int azdopen(azio_stream *s,File fd, int Flags);
*/
-extern unsigned int azread ( azio_stream *s, voidp buf, unsigned int len, int *error);
+extern unsigned int azread ( azio_stream *s, voidp buf, size_t len, int *error);
/*
Reads the given number of uncompressed bytes from the compressed file.
If the input file was not in gzip format, gzread copies the given number
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index ff59a3eef5c..46e9a99c446 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -1078,16 +1078,18 @@ int ha_archive::unpack_row(azio_stream *file_to_read, uchar *record)
row_len= uint4korr(size_buffer);
DBUG_PRINT("ha_archive",("Unpack row length %u -> %u", row_len,
(unsigned int)table->s->reclength));
- fix_rec_buff(row_len);
+
+ if (fix_rec_buff(row_len))
+ {
+ DBUG_RETURN(HA_ERR_OUT_OF_MEM);
+ }
DBUG_ASSERT(row_len <= record_buffer->length);
read= azread(file_to_read, record_buffer->buffer, row_len, &error);
- DBUG_ASSERT(row_len == read);
-
if (read != row_len || error)
{
- DBUG_RETURN(-1);
+ DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
}
/* Copy null bits */
@@ -1280,7 +1282,7 @@ int ha_archive::repair(THD* thd, HA_CHECK_OPT* check_opt)
int rc= optimize(thd, check_opt);
if (rc)
- DBUG_RETURN(HA_ERR_CRASHED_ON_REPAIR);
+ DBUG_RETURN(HA_ADMIN_CORRUPT);
share->crashed= FALSE;
DBUG_RETURN(0);