~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/archive.test

  • Committer: Jay Pipes
  • Date: 2009-03-13 23:42:05 UTC
  • mto: This revision was merged to the branch mainline in revision 937.
  • Revision ID: jpipes@serialcoder-20090313234205-fmr8bd072nvfa28v
Forgot to add the new files...

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
# Simple test for archive example
3
3
# Taken FROM the select test
4
4
#
 
5
-- source include/have_archive.inc
5
6
 
6
7
--disable_warnings
7
8
DROP TABLE if exists t1,t2,t3,t4,t5,t6;
1317
1318
INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring','');
1318
1319
INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
1319
1320
SELECT * FROM t2;
1320
 
ALTER TABLE t2 ENGINE=ARCHIVE;
 
1321
OPTIMIZE TABLE t2;
1321
1322
SELECT * FROM t2;
1322
1323
INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W');
1323
1324
INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring','');
1324
1325
INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
1325
 
ALTER TABLE t2 ENGINE=ARCHIVE;
 
1326
OPTIMIZE TABLE t2;
 
1327
SELECT * FROM t2;
 
1328
REPAIR TABLE t2;
1326
1329
SELECT * FROM t2;
1327
1330
 
1328
1331
#
1349
1352
SELECT * FROM t2;
1350
1353
 
1351
1354
 
 
1355
# Test INSERT DELAYED and wait until the table has one more record
 
1356
SELECT COUNT(auto) FROM t2;
 
1357
INSERT DELAYED INTO t2 VALUES (99999,011403,37,'the','delayed','insert','');
 
1358
 
 
1359
# Insert another record since in Archive delayed values are only
 
1360
# guaranteed to materialize based on either:
 
1361
# 1) A new row showing up from a normal insert
 
1362
# 2) A flush table  has occurred.
 
1363
INSERT INTO t2 VALUES (100000,000001,00,'after','delayed','insert','');
 
1364
 
 
1365
# Wait for the delayed insert to appear
 
1366
while (`SELECT COUNT(auto)!=1215 FROM t2`)
 
1367
{
 
1368
  sleep 0.1;
 
1369
}
 
1370
SELECT COUNT(auto) FROM t2;
 
1371
 
1352
1372
# Adding test for ALTER TABLE
1353
1373
ALTER TABLE t2 DROP COLUMN fld6; 
1354
1374
SHOW CREATE TABLE t2;
1401
1421
INSERT INTO t5 VALUES (3, "foo");
1402
1422
INSERT INTO t5 VALUES (NULL, "foo");
1403
1423
SELECT * FROM t5;
1404
 
ALTER TABLE t5 ENGINE=ARCHIVE;
 
1424
OPTIMIZE TABLE t5;
1405
1425
SELECT * FROM t5;
1406
1426
 
1407
1427
SELECT * FROM t5 WHERE a=32;
1533
1553
--enable_warnings
1534
1554
 
1535
1555
#
 
1556
# BUG#26138 - REPAIR TABLE with option USE_FRM erases all records in ARCHIVE
 
1557
#             table
 
1558
#
 
1559
create table t1 (i int) engine=archive;
 
1560
insert into t1 values (1);
 
1561
repair table t1 use_frm;
 
1562
select * from t1;
 
1563
drop table t1;
 
1564
 
 
1565
#
1536
1566
# BUG#29207 - archive table reported as corrupt by check table
1537
1567
#
1538
1568
create table t1(a blob) engine=archive;
1539
1569
insert into t1 set a='';
1540
1570
insert into t1 set a='a';
1541
 
check table t1;
 
1571
check table t1 extended;
1542
1572
drop table t1;
1543
1573
 
1544
1574
#
1573
1603
INSERT INTO t1 VALUES (NULL, NULL),(NULL, NULL);
1574
1604
FLUSH TABLE t1;
1575
1605
SELECT * FROM t1 ORDER BY a;
1576
 
DROP TABLE t1;