~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/csv.test

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
--enable_warnings
14
14
 
15
15
CREATE TABLE t1 (
16
 
  Period int DEFAULT 0 NOT NULL,
17
 
  Varor_period int DEFAULT 0 NOT NULL
 
16
  Period int(4) zerofill DEFAULT '0000' NOT NULL,
 
17
  Varor_period int(4) DEFAULT '0' NOT NULL
18
18
) ENGINE = CSV;
19
19
 
20
20
INSERT INTO t1 VALUES (9410,9412);
29
29
 
30
30
CREATE TABLE t2 (
31
31
  auto int not null,
32
 
  fld1 int DEFAULT 0 NOT NULL,
33
 
  companynr int DEFAULT 0 NOT NULL,
 
32
  fld1 int(6) zerofill DEFAULT '000000' NOT NULL,
 
33
  companynr int(2) zerofill DEFAULT '00' NOT NULL,
34
34
  fld3 char(30) DEFAULT '' NOT NULL,
35
35
  fld4 char(35) DEFAULT '' NOT NULL,
36
36
  fld5 char(35) DEFAULT '' NOT NULL,
42
42
#
43
43
 
44
44
--disable_query_log
45
 
begin;
46
45
INSERT INTO t2 VALUES (1,000001,00,'Omaha','teethe','neat','');
47
46
INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W');
48
47
INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring','');
1242
1241
INSERT INTO t2 VALUES (1191,068504,00,'bonfire','corresponds','positively','');
1243
1242
INSERT INTO t2 VALUES (1192,068305,00,'Colombo','hardware','colicky','');
1244
1243
INSERT INTO t2 VALUES (1193,000000,00,'nondecreasing','implant','thrillingly','');
1245
 
commit;
1246
1244
--enable_query_log
1247
1245
 
1248
1246
#
1306
1304
 
1307
1305
DROP TABLE t1;
1308
1306
CREATE TABLE t1 (
1309
 
  Period int DEFAULT 0 NOT NULL,
1310
 
  Varor_period int DEFAULT 0 NOT NULL
 
1307
  Period int(4) zerofill DEFAULT '0000' NOT NULL,
 
1308
  Varor_period int(4) DEFAULT '0' NOT NULL
1311
1309
) ENGINE = CSV;
1312
1310
 
1313
1311
INSERT INTO t1 VALUES (9410,9412);
1441
1439
 
1442
1440
CREATE TABLE test_repair_table4 (
1443
1441
  num int not null,
1444
 
  magic_no int DEFAULT 0 NOT NULL,
 
1442
  magic_no int(4) zerofill DEFAULT '0000' NOT NULL,
1445
1443
  company_name char(30) DEFAULT '' NOT NULL,
1446
1444
  founded char(4) DEFAULT '' NOT NULL
1447
1445
) ENGINE = CSV;
1473
1471
 
1474
1472
CREATE TABLE test_repair_table5 (
1475
1473
  num int not null,
1476
 
  magic_no int DEFAULT 0 NOT NULL,
 
1474
  magic_no int(4) zerofill DEFAULT '0000' NOT NULL,
1477
1475
  company_name char(30) DEFAULT '' NOT NULL,
1478
1476
  founded char(4) DEFAULT '' NOT NULL
1479
1477
) ENGINE = CSV;
1585
1583
# resulted in scanning through deleted memory and we were geting a crash.
1586
1584
# that's why we need two tables in the bugtest
1587
1585
 
1588
 
# TODO: Bug lp:311104
1589
 
#create table bug15205 (val int not null) engine=csv;
1590
 
#create table bug15205_2 (val int not null) engine=csv;
1591
 
#--remove_file $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV
1592
 
## system error (can't open the datafile)
1593
 
#--replace_result $MYSQLTEST_VARDIR . master-data/ ''
1594
 
#--error 13
1595
 
#select * from bug15205;
1596
 
#select * from bug15205_2;
1597
 
## Create empty file
1598
 
#--write_file $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV
1599
 
#EOF
1600
 
#select * from bug15205;
1601
 
#drop table bug15205;
1602
 
#drop table bug15205_2;
 
1586
create table bug15205 (val int(11) not null) engine=csv;
 
1587
create table bug15205_2 (val int(11) not null) engine=csv;
 
1588
--remove_file $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV
 
1589
# system error (can't open the datafile)
 
1590
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
 
1591
--error 13
 
1592
select * from bug15205;
 
1593
select * from bug15205_2;
 
1594
# Create empty file
 
1595
--write_file $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV
 
1596
EOF
 
1597
select * from bug15205;
 
1598
drop table bug15205;
 
1599
drop table bug15205_2;
 
1600
 
 
1601
 
 
1602
#
 
1603
# Bug#28862 "Extended Latin1 characters get lost in CVS engine"
 
1604
#
 
1605
set names latin1;
 
1606
create table t1 (
 
1607
  c varchar(1) not null,
 
1608
  name varchar(64) not null
 
1609
) character set latin1 engine=csv;
 
1610
insert into t1 values (0xC0,'LATIN CAPITAL LETTER A WITH GRAVE');
 
1611
insert into t1 values (0xE0,'LATIN SMALL LETTER A WITH GRAVE');
 
1612
insert into t1 values (0xEE,'LATIN SMALL LETTER I WITH CIRCUMFLEX');
 
1613
insert into t1 values (0xFE,'LATIN SMALL LETTER THORN');
 
1614
insert into t1 values (0xF7,'DIVISION SIGN');
 
1615
insert into t1 values (0xFF,'LATIN SMALL LETTER Y WITH DIAERESIS');
 
1616
select hex(c), c, name from t1 order by 1;
 
1617
drop table t1;
 
1618
 
 
1619
--echo End of 5.0 tests
1603
1620
 
1604
1621
 
1605
1622
#
1653
1670
#
1654
1671
 
1655
1672
CREATE TABLE `bug21328` (
1656
 
  `col1` int NOT NULL,
1657
 
  `col2` int NOT NULL,
1658
 
  `col3` int NOT NULL
 
1673
  `col1` int(11) NOT NULL,
 
1674
  `col2` int(11) NOT NULL,
 
1675
  `col3` int(11) NOT NULL
1659
1676
) ENGINE=CSV;
1660
1677
 
1661
1678
insert into bug21328 values (1,0,0);
1714
1731
# Bug #31473: does not work with NULL value in datetime field
1715
1732
#
1716
1733
create table t1(a datetime not null) engine=csv;
1717
 
--error 1364
 
1734
insert into t1 values();
 
1735
select * from t1;
 
1736
drop table t1;
 
1737
create table t1(a set('foo','bar') not null) engine=csv;
1718
1738
insert into t1 values();
1719
1739
select * from t1;
1720
1740
drop table t1;
1721
1741
create table t1(a varchar(32) not null) engine=csv;
1722
 
--error 1364
1723
1742
insert into t1 values();
1724
1743
select * from t1;
1725
1744
drop table t1;
1726
1745
create table t1(a int not null) engine=csv;
1727
 
--error 1364
1728
1746
insert into t1 values();
1729
1747
select * from t1;
1730
1748
drop table t1;
1731
1749
create table t1(a blob not null) engine=csv;
1732
 
--error 1364
1733
1750
insert into t1 values();
1734
1751
select * from t1;
1735
1752
drop table t1;
 
1753
create table t1(a bit(1) not null) engine=csv;
 
1754
insert into t1 values();
 
1755
select BIN(a) from t1;
 
1756
drop table t1;
1736
1757
# We prevent creation of table with nullable ENUM
1737
1758
--error ER_CHECK_NOT_IMPLEMENTED
1738
1759
create table t1(a enum('foo','bar') default null) engine=csv;
1755
1776
#
1756
1777
# BUG#33067 - .
1757
1778
#
1758
 
create table t1 (c1 blob not null) engine=csv;
 
1779
create table t1 (c1 tinyblob not null) engine=csv;
1759
1780
insert into t1 values("This");
1760
1781
--enable_info            
1761
1782
update t1 set c1="That" where c1="This";
1763
1784
select * from t1;
1764
1785
drop table t1;
1765
1786
 
1766
 
#
1767
 
# Bug#311104
1768
 
# CSV engine reports "out of memory" when you select
1769
 
# from a missing file
1770
 
#
1771
 
--disable_warnings
1772
 
drop table if exists t1;
1773
 
--enable_warnings
1774
 
 
1775
 
create table t1 (val int not null) engine=csv;
1776
 
--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV
1777
 
 
1778
 
--error 1017
1779
 
select * from t1;
1780
 
 
1781
1787
--echo End of 5.1 tests