summaryrefslogtreecommitdiff
path: root/sql/examples
diff options
context:
space:
mode:
authorunknown <brian@zim.(none)>2005-08-29 15:05:16 -0700
committerunknown <brian@zim.(none)>2005-08-29 15:05:16 -0700
commit341a08edd34dd4b8bb975af21d6531c1ef62f92d (patch)
tree6d5f2b5cf63fd7450ba88df0e2dc861f748bdef3 /sql/examples
parent56b8fc52cfe81b22031ece94475d9a6f3fa663c2 (diff)
downloadmariadb-git-341a08edd34dd4b8bb975af21d6531c1ef62f92d.tar.gz
Added support for delete_all_rows() for archive. This fixes bug #12836.
mysql-test/r/archive.result: Update for test case to make sure that TRUNCATE and DELETE function(hah!) as designed. mysql-test/t/archive.test: Add TRUNCATE and DELETE support. sql/examples/ha_archive.cc: Added delete_all_rows() support. sql/examples/ha_archive.h: Added delete_all_rows() support. sql/handler.h: Added flags for fast delete support for archive and federated.
Diffstat (limited to 'sql/examples')
-rw-r--r--sql/examples/ha_archive.cc11
-rw-r--r--sql/examples/ha_archive.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc
index b125f435cfa..b754c429dda 100644
--- a/sql/examples/ha_archive.cc
+++ b/sql/examples/ha_archive.cc
@@ -1001,4 +1001,15 @@ ha_rows ha_archive::records_in_range(uint inx, key_range *min_key,
DBUG_ENTER("ha_archive::records_in_range ");
DBUG_RETURN(records); // HA_ERR_WRONG_COMMAND
}
+
+/*
+ We cancel a truncate command. The only way to delete an archive table is to drop it.
+ This is done for security reasons. In a later version we will enable this by
+ allowing the user to select a different row format.
+*/
+int ha_archive::delete_all_rows()
+{
+ DBUG_ENTER("ha_archive::delete_all_rows");
+ DBUG_RETURN(0);
+}
#endif /* HAVE_ARCHIVE_DB */
diff --git a/sql/examples/ha_archive.h b/sql/examples/ha_archive.h
index 52300fda8a2..6ceb660e951 100644
--- a/sql/examples/ha_archive.h
+++ b/sql/examples/ha_archive.h
@@ -95,6 +95,7 @@ public:
int write_row(byte * buf);
int update_row(const byte * old_data, byte * new_data);
int delete_row(const byte * buf);
+ int delete_all_rows();
int index_read(byte * buf, const byte * key,
uint key_len, enum ha_rkey_function find_flag);
int index_read_idx(byte * buf, uint idx, const byte * key,