Commit 9a162f9a authored by unknown's avatar unknown
Browse files

Added tests for archive. Cleaned up a merge mistake and added some information...

Added tests for archive. Cleaned up a merge mistake and added some information on how well archive compresses. 


sql/examples/ha_archive.cc:
  Added in example information from testing archive with Slashdot's comments.
sql/handler.h:
  Fixed broken merge.
sql/set_var.cc:
  Adding in "have_archive" to variables shown to make tests work.
parent 64285a73
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
-- require r/have_archive.require
disable_query_log;
show variables like "have_archive";
enable_query_log;
+1396 −0

File added.

Preview size limit exceeded, changes collapsed.

+2 −0
Original line number Diff line number Diff line
Variable_name	Value
have_archive	YES
+1300 −0

File added.

Preview size limit exceeded, changes collapsed.

+15 −3
Original line number Diff line number Diff line
@@ -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);
Loading