diff options
author | unknown <brian@zim.(none)> | 2005-08-29 15:05:16 -0700 |
---|---|---|
committer | unknown <brian@zim.(none)> | 2005-08-29 15:05:16 -0700 |
commit | 341a08edd34dd4b8bb975af21d6531c1ef62f92d (patch) | |
tree | 6d5f2b5cf63fd7450ba88df0e2dc861f748bdef3 /sql | |
parent | 56b8fc52cfe81b22031ece94475d9a6f3fa663c2 (diff) | |
download | mariadb-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')
-rw-r--r-- | sql/examples/ha_archive.cc | 11 | ||||
-rw-r--r-- | sql/examples/ha_archive.h | 1 | ||||
-rw-r--r-- | sql/handler.h | 2 |
3 files changed, 14 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, diff --git a/sql/handler.h b/sql/handler.h index efcdee8f56c..b69eec3edd5 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -531,6 +531,8 @@ extern TYPELIB tx_isolation_typelib; #define ha_supports_generate(T) (T != DB_TYPE_INNODB && \ T != DB_TYPE_BERKELEY_DB && \ + T != DB_TYPE_ARCHIVE_DB && \ + T != DB_TYPE_FEDERATED_DB && \ T != DB_TYPE_NDBCLUSTER) bool ha_caching_allowed(THD* thd, char* table_key, |