~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/archive.test

  • Committer: Monty Taylor
  • Date: 2009-03-08 23:45:12 UTC
  • mto: (923.2.1 mordred)
  • mto: This revision was merged to the branch mainline in revision 921.
  • Revision ID: mordred@inaugust.com-20090308234512-tqkygxtu1iaig23s
Removed C99 isnan() usage, which allows us to remove the util/math.{cc,h} workarounds. Yay for standards!

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;
41
42
#
42
43
 
43
44
--disable_query_log
44
 
begin;
45
45
INSERT INTO t2 VALUES (1,000001,00,'Omaha','teethe','neat','');
46
46
INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W');
47
47
INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring','');
1241
1241
INSERT INTO t2 VALUES (1191,068504,00,'bonfire','corresponds','positively','');
1242
1242
INSERT INTO t2 VALUES (1192,068305,00,'Colombo','hardware','colicky','');
1243
1243
INSERT INTO t2 VALUES (1193,000000,00,'nondecreasing','implant','thrillingly','');
1244
 
commit;
1245
1244
--enable_query_log
1246
1245
 
1247
1246
#
1317
1316
INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring','');
1318
1317
INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
1319
1318
SELECT * FROM t2;
1320
 
ALTER TABLE t2 ENGINE=ARCHIVE;
 
1319
OPTIMIZE TABLE t2;
1321
1320
SELECT * FROM t2;
1322
1321
INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W');
1323
1322
INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring','');
1324
1323
INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
1325
 
ALTER TABLE t2 ENGINE=ARCHIVE;
 
1324
OPTIMIZE TABLE t2;
 
1325
SELECT * FROM t2;
 
1326
REPAIR TABLE t2;
1326
1327
SELECT * FROM t2;
1327
1328
 
1328
1329
#
1333
1334
#
1334
1335
# For bug #12836
1335
1336
# Delete was allowing all rows to be removed
1336
 
--error ER_ILLEGAL_HA
 
1337
--error 1031
1337
1338
DELETE FROM t2;
1338
1339
SELECT * FROM t2;
1339
1340
INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W');
1340
1341
INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring','');
1341
1342
INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
1342
1343
SELECT * FROM t2;
1343
 
--error ER_ILLEGAL_HA
 
1344
--error 1031
1344
1345
TRUNCATE TABLE t2;
1345
1346
SELECT * FROM t2;
1346
1347
 
1349
1350
SELECT * FROM t2;
1350
1351
 
1351
1352
 
 
1353
# Test INSERT DELAYED and wait until the table has one more record
 
1354
SELECT COUNT(auto) FROM t2;
 
1355
INSERT DELAYED INTO t2 VALUES (99999,011403,37,'the','delayed','insert','');
 
1356
 
 
1357
# Insert another record since in Archive delayed values are only
 
1358
# guaranteed to materialize based on either:
 
1359
# 1) A new row showing up from a normal insert
 
1360
# 2) A flush table  has occurred.
 
1361
INSERT INTO t2 VALUES (100000,000001,00,'after','delayed','insert','');
 
1362
 
 
1363
# Wait for the delayed insert to appear
 
1364
while (`SELECT COUNT(auto)!=1215 FROM t2`)
 
1365
{
 
1366
  sleep 0.1;
 
1367
}
 
1368
SELECT COUNT(auto) FROM t2;
 
1369
 
1352
1370
# Adding test for ALTER TABLE
1353
1371
ALTER TABLE t2 DROP COLUMN fld6; 
1354
1372
SHOW CREATE TABLE t2;
1370
1388
INSERT INTO t5 VALUES (NULL, "foo");
1371
1389
INSERT INTO t5 VALUES (NULL, "foo");
1372
1390
INSERT INTO t5 VALUES (32, "foo");
1373
 
--error ER_DUP_KEY
 
1391
--error 1022
1374
1392
INSERT INTO t5 VALUES (23, "foo");
1375
1393
INSERT INTO t5 VALUES (NULL, "foo");
1376
1394
INSERT INTO t5 VALUES (NULL, "foo");
1377
 
--error ER_DUP_KEY
 
1395
--error 1022
1378
1396
INSERT INTO t5 VALUES (3, "foo");
1379
1397
INSERT INTO t5 VALUES (NULL, "foo");
1380
1398
SELECT * FROM t5;
1401
1419
INSERT INTO t5 VALUES (3, "foo");
1402
1420
INSERT INTO t5 VALUES (NULL, "foo");
1403
1421
SELECT * FROM t5;
1404
 
ALTER TABLE t5 ENGINE=ARCHIVE;
 
1422
OPTIMIZE TABLE t5;
1405
1423
SELECT * FROM t5;
1406
1424
 
1407
1425
SELECT * FROM t5 WHERE a=32;
1533
1551
--enable_warnings
1534
1552
 
1535
1553
#
 
1554
# BUG#26138 - REPAIR TABLE with option USE_FRM erases all records in ARCHIVE
 
1555
#             table
 
1556
#
 
1557
create table t1 (i int) engine=archive;
 
1558
insert into t1 values (1);
 
1559
repair table t1 use_frm;
 
1560
select * from t1;
 
1561
drop table t1;
 
1562
 
 
1563
#
1536
1564
# BUG#29207 - archive table reported as corrupt by check table
1537
1565
#
1538
1566
create table t1(a blob) engine=archive;
1539
1567
insert into t1 set a='';
1540
1568
insert into t1 set a='a';
1541
 
check table t1;
 
1569
check table t1 extended;
1542
1570
drop table t1;
1543
1571
 
1544
1572
#
1549
1577
 
1550
1578
let $bug31036=41;
1551
1579
--disable_query_log
1552
 
begin;
1553
1580
while($bug31036)
1554
1581
{
1555
1582
  INSERT INTO t1(a) VALUES (REPEAT('a', 510));
1556
1583
  dec $bug31036;
1557
1584
}
1558
 
commit;
1559
1585
--enable_query_log
1560
1586
INSERT INTO t1(a) VALUES ('');
1561
1587
 
1573
1599
INSERT INTO t1 VALUES (NULL, NULL),(NULL, NULL);
1574
1600
FLUSH TABLE t1;
1575
1601
SELECT * FROM t1 ORDER BY a;
1576
 
DROP TABLE t1;