Skip to content

Commit c583de9

Browse files
Fix for bug #15558: truncate doesn't clear table on archive storage engine tables.
1 parent 28cf106 commit c583de9

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

mysql-test/r/archive.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2616,6 +2616,7 @@ select count(*) from t4;
26162616
count(*)
26172617
1203
26182618
DELETE FROM t2;
2619+
ERROR HY000: Table storage engine for 't2' doesn't have this option
26192620
SELECT * FROM t2;
26202621
auto fld1 companynr fld3 fld4 fld5 fld6
26212622
1 000001 00 Omaha teethe neat
@@ -5033,6 +5034,7 @@ auto fld1 companynr fld3 fld4 fld5 fld6
50335034
3 011402 37 Romans scholastics jarring
50345035
4 011403 37 intercepted audiology tinily
50355036
TRUNCATE TABLE t2;
5037+
ERROR HY000: Table storage engine for 't2' doesn't have this option
50365038
SELECT * FROM t2;
50375039
auto fld1 companynr fld3 fld4 fld5 fld6
50385040
1 000001 00 Omaha teethe neat

mysql-test/t/archive.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,12 +1316,14 @@ select count(*) from t4;
13161316
#
13171317
# For bug #12836
13181318
# Delete was allowing all rows to be removed
1319+
--error 1031
13191320
DELETE FROM t2;
13201321
SELECT * FROM t2;
13211322
INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W');
13221323
INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring','');
13231324
INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
13241325
SELECT * FROM t2;
1326+
--error 1031
13251327
TRUNCATE TABLE t2;
13261328
SELECT * FROM t2;
13271329

sql/examples/ha_archive.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,6 @@ ha_rows ha_archive::records_in_range(uint inx, key_range *min_key,
10101010
int ha_archive::delete_all_rows()
10111011
{
10121012
DBUG_ENTER("ha_archive::delete_all_rows");
1013-
DBUG_RETURN(0);
1013+
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
10141014
}
10151015
#endif /* HAVE_ARCHIVE_DB */

0 commit comments

Comments
 (0)