mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Update for delete_all_rows() which will be used for TRUNCATE and DELETE support.
mysql-test/t/archive.test: Auto merged sql/handler.h: Auto merged mysql-test/r/archive.result: Result sets sql/examples/ha_archive.cc: Update for tests sql/examples/ha_archive.h: Updated from merge, added new method for solving truncate problems.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -1332,6 +1332,19 @@ INSERT DELAYED INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily',''
|
|||||||
#
|
#
|
||||||
# Cleanup, test is over
|
# Cleanup, test is over
|
||||||
#
|
#
|
||||||
drop table t1, t2, t4;
|
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
|
||||||
|
#
|
||||||
|
# For bug #12836
|
||||||
|
# Delete was allowing all rows to be removed
|
||||||
|
DELETE FROM t2;
|
||||||
|
SELECT * FROM t2;
|
||||||
|
INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W');
|
||||||
|
INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring','');
|
||||||
|
INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
|
||||||
|
SELECT * FROM t2;
|
||||||
|
TRUNCATE TABLE t2;
|
||||||
|
SELECT * FROM t2;
|
||||||
|
|
||||||
|
drop table t1, t2, t4;
|
||||||
|
@ -1028,4 +1028,15 @@ int ha_archive::end_bulk_insert()
|
|||||||
share->dirty= TRUE;
|
share->dirty= TRUE;
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
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 */
|
#endif /* HAVE_ARCHIVE_DB */
|
||||||
|
@ -78,6 +78,7 @@ public:
|
|||||||
int close(void);
|
int close(void);
|
||||||
int write_row(byte * buf);
|
int write_row(byte * buf);
|
||||||
int real_write_row(byte *buf, gzFile writer);
|
int real_write_row(byte *buf, gzFile writer);
|
||||||
|
int delete_row(const byte * buf);
|
||||||
int rnd_init(bool scan=1);
|
int rnd_init(bool scan=1);
|
||||||
int rnd_next(byte *buf);
|
int rnd_next(byte *buf);
|
||||||
int rnd_pos(byte * buf, byte *pos);
|
int rnd_pos(byte * buf, byte *pos);
|
||||||
|
@ -824,6 +824,8 @@ extern ulong total_ha, total_ha_2pc;
|
|||||||
|
|
||||||
#define ha_supports_generate(T) (T != DB_TYPE_INNODB && \
|
#define ha_supports_generate(T) (T != DB_TYPE_INNODB && \
|
||||||
T != DB_TYPE_BERKELEY_DB && \
|
T != DB_TYPE_BERKELEY_DB && \
|
||||||
|
T != DB_TYPE_ARCHIVE_DB && \
|
||||||
|
T != DB_TYPE_FEDERATED_DB && \
|
||||||
T != DB_TYPE_NDBCLUSTER)
|
T != DB_TYPE_NDBCLUSTER)
|
||||||
|
|
||||||
/* lookups */
|
/* lookups */
|
||||||
|
Reference in New Issue
Block a user