summaryrefslogtreecommitdiff
path: root/sql/examples
diff options
context:
space:
mode:
authorbrian@avenger.(none) <>2004-05-25 13:27:01 -0700
committerbrian@avenger.(none) <>2004-05-25 13:27:01 -0700
commit72e7d696748911225bf9cab0dc443f421a41d439 (patch)
treebd3395918279d1b8a5aa6cafb13cf1472de1b756 /sql/examples
parentfe83735a263e75d4d3ac5f5717ebc6ae9ec6fb22 (diff)
downloadmariadb-git-72e7d696748911225bf9cab0dc443f421a41d439.tar.gz
Added tests for archive. Cleaned up a merge mistake and added some information on how well archive compresses.
Diffstat (limited to 'sql/examples')
-rw-r--r--sql/examples/ha_archive.cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc
index 21a5c398a20..a15e5a9401f 100644
--- a/sql/examples/ha_archive.cc
+++ b/sql/examples/ha_archive.cc
@@ -53,6 +53,18 @@
to be any faster. For writes it is always a bit slower then MyISAM. It has no
internal limits though for row length.
+ Examples between MyISAM and Archive.
+
+ Table with 76695844 identical rows:
+ 29680807 a_archive.ARZ
+ 920350317 a.MYD
+
+
+ Table with 8991478 rows (all of Slashdot's comments):
+ 1922964506 comment_archive.ARZ
+ 2944970297 comment_text.MYD
+
+
TODO:
Add bzip optional support.
Allow users to set compression level.
@@ -225,7 +237,7 @@ int ha_archive::close(void)
if (gzclose(archive) == Z_ERRNO)
rc =-1;
rc |= free_share(share);
- DBUG_RETURN();
+ DBUG_RETURN(rc);
}
@@ -276,7 +288,7 @@ int ha_archive::write_row(byte * buf)
statistic_increment(ha_write_count,&LOCK_status);
if (table->timestamp_default_now)
- update_timestamp(record+table->timestamp_default_now-1);
+ update_timestamp(buf+table->timestamp_default_now-1);
written = gzwrite(share->archive_write, buf, table->reclength);
share->dirty= true;
if (written == 0 || written != table->reclength)
@@ -335,7 +347,7 @@ int ha_archive::rnd_init(bool scan)
intact.
*/
read= gzread(archive, &version, sizeof(version));
- if (written == 0 || written != sizeof(version))
+ if (read == 0 || read != sizeof(version))
DBUG_RETURN(-1);
records = 0;
DBUG_RETURN(0);