1
1
drop table if exists t1,t2,t3,t4;
3
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
4
Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
3
Period int DEFAULT 0 NOT NULL,
4
Varor_period int DEFAULT 0 NOT NULL
6
6
INSERT INTO t1 VALUES (9410,9412);
7
7
select period from t1;
18
fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,
19
companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
18
fld1 int DEFAULT 0 NOT NULL,
19
companynr int DEFAULT 0 NOT NULL,
20
20
fld3 char(30) DEFAULT '' NOT NULL,
21
21
fld4 char(35) DEFAULT '' NOT NULL,
22
22
fld5 char(35) DEFAULT '' NOT NULL,
4916
4916
ALTER TABLE t2 RENAME t1;
4918
4918
CREATE TABLE t1 (
4919
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
4920
Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
4919
Period int DEFAULT 0 NOT NULL,
4920
Varor_period int DEFAULT 0 NOT NULL
4921
4921
) ENGINE = CSV;
4922
4922
INSERT INTO t1 VALUES (9410,9412);
4923
4923
select period from t1;
5025
5025
DROP TABLE test_repair_table3;
5026
5026
CREATE TABLE test_repair_table4 (
5027
5027
num int not null,
5028
magic_no int(4) unsigned zerofill DEFAULT '0000' NOT NULL,
5028
magic_no int DEFAULT 0 NOT NULL,
5029
5029
company_name char(30) DEFAULT '' NOT NULL,
5030
5030
founded char(4) DEFAULT '' NOT NULL
5031
5031
) ENGINE = CSV;
5043
5043
INSERT INTO test_repair_table4 VALUES (2,101,'MySQL','1995');
5044
5044
SELECT * FROM test_repair_table4;
5045
5045
num magic_no company_name founded
5047
1 0101 Microsoft 1978
5049
CHECK TABLE test_repair_table4;
5050
Table Op Msg_type Msg_text
5051
test.test_repair_table4 check status OK
5052
REPAIR TABLE test_repair_table4;
5053
Table Op Msg_type Msg_text
5054
test.test_repair_table4 repair status OK
5055
SELECT * FROM test_repair_table4;
5056
num magic_no company_name founded
5058
1 0101 Microsoft 1978
5060
CHECK TABLE test_repair_table4;
5061
Table Op Msg_type Msg_text
5062
test.test_repair_table4 check status OK
5063
REPAIR TABLE test_repair_table4;
5064
Table Op Msg_type Msg_text
5065
test.test_repair_table4 repair status OK
5066
SELECT * FROM test_repair_table4;
5067
num magic_no company_name founded
5069
1 0101 Microsoft 1978
5047
1 101 Microsoft 1978
5049
CHECK TABLE test_repair_table4;
5050
Table Op Msg_type Msg_text
5051
test.test_repair_table4 check status OK
5052
REPAIR TABLE test_repair_table4;
5053
Table Op Msg_type Msg_text
5054
test.test_repair_table4 repair status OK
5055
SELECT * FROM test_repair_table4;
5056
num magic_no company_name founded
5058
1 101 Microsoft 1978
5060
CHECK TABLE test_repair_table4;
5061
Table Op Msg_type Msg_text
5062
test.test_repair_table4 check status OK
5063
REPAIR TABLE test_repair_table4;
5064
Table Op Msg_type Msg_text
5065
test.test_repair_table4 repair status OK
5066
SELECT * FROM test_repair_table4;
5067
num magic_no company_name founded
5069
1 101 Microsoft 1978
5071
5071
DROP TABLE test_repair_table4;
5072
5072
CREATE TABLE test_repair_table5 (
5073
5073
num int not null,
5074
magic_no int(4) unsigned zerofill DEFAULT '0000' NOT NULL,
5074
magic_no int DEFAULT 0 NOT NULL,
5075
5075
company_name char(30) DEFAULT '' NOT NULL,
5076
5076
founded char(4) DEFAULT '' NOT NULL
5077
5077
) ENGINE = CSV;
5086
5086
INSERT INTO test_repair_table5 VALUES (1, 102, "CORRECT", 1876);
5087
5087
SELECT * FROM test_repair_table5;
5088
5088
num magic_no company_name founded
5091
5091
CHECK TABLE test_repair_table5;
5092
5092
Table Op Msg_type Msg_text
5096
5096
test.test_repair_table5 repair status OK
5097
5097
SELECT * FROM test_repair_table5;
5098
5098
num magic_no company_name founded
5100
5100
INSERT INTO test_repair_table5 VALUES (1, 102, "CORRECT2", 1876);
5101
5101
SELECT * FROM test_repair_table5;
5102
5102
num magic_no company_name founded
5104
1 0102 CORRECT2 1876
5106
5106
CHECK TABLE test_repair_table5;
5107
5107
Table Op Msg_type Msg_text
5136
5136
affected rows: 4
5137
5137
insert t1 values (1),(2),(3),(4),(5);
5138
5138
truncate table t1;
5141
5141
create table t1 (v varchar(32) not null);
5142
5142
insert into t1 values ('def'),('abc'),('hij'),('3r4f');
5184
5184
alter table t1 change i i bigint;
5185
5185
select * from t1;
5191
5191
alter table t1 add unique key (i, v);
5192
5192
select * from t1 where i between 2 and 4 and v in ('def','3r4f','lmn');
5196
create table bug15205 (val int(11) not null) engine=csv;
5197
create table bug15205_2 (val int(11) not null) engine=csv;
5198
select * from bug15205;
5199
ERROR HY000: Can't get stat of './test/bug15205.CSV' (Errcode: 2)
5200
select * from bug15205_2;
5202
select * from bug15205;
5204
drop table bug15205;
5205
drop table bug15205_2;
5208
c varchar(1) not null,
5209
name varchar(64) not null
5210
) character set latin1 engine=csv;
5211
insert into t1 values (0xC0,'LATIN CAPITAL LETTER A WITH GRAVE');
5212
insert into t1 values (0xE0,'LATIN SMALL LETTER A WITH GRAVE');
5213
insert into t1 values (0xEE,'LATIN SMALL LETTER I WITH CIRCUMFLEX');
5214
insert into t1 values (0xFE,'LATIN SMALL LETTER THORN');
5215
insert into t1 values (0xF7,'DIVISION SIGN');
5216
insert into t1 values (0xFF,'LATIN SMALL LETTER Y WITH DIAERESIS');
5217
select hex(c), c, name from t1 order by 1;
5219
C0 � LATIN CAPITAL LETTER A WITH GRAVE
5220
E0 � LATIN SMALL LETTER A WITH GRAVE
5221
EE � LATIN SMALL LETTER I WITH CIRCUMFLEX
5223
FE � LATIN SMALL LETTER THORN
5224
FF � LATIN SMALL LETTER Y WITH DIAERESIS
5227
5196
create table bug22080_1 (id int not null,string varchar(64) not null) Engine=CSV;
5228
5197
create table bug22080_2 (id int not null,string varchar(64) not null) Engine=CSV;
5229
5198
create table bug22080_3 (id int not null,string varchar(64) not null) Engine=CSV;
5318
5287
create table t1(a datetime not null) engine=csv;
5319
5288
insert into t1 values();
5321
Warning 1364 Field 'a' doesn't have a default value
5326
create table t1(a set('foo','bar') not null) engine=csv;
5327
insert into t1 values();
5329
Warning 1364 Field 'a' doesn't have a default value
5289
ERROR HY000: Field 'a' doesn't have a default value
5334
5293
create table t1(a varchar(32) not null) engine=csv;
5335
5294
insert into t1 values();
5337
Warning 1364 Field 'a' doesn't have a default value
5295
ERROR HY000: Field 'a' doesn't have a default value
5338
5296
select * from t1;
5342
5299
create table t1(a int not null) engine=csv;
5343
5300
insert into t1 values();
5345
Warning 1364 Field 'a' doesn't have a default value
5301
ERROR HY000: Field 'a' doesn't have a default value
5346
5302
select * from t1;
5350
5305
create table t1(a blob not null) engine=csv;
5351
5306
insert into t1 values();
5353
Warning 1364 Field 'a' doesn't have a default value
5307
ERROR HY000: Field 'a' doesn't have a default value
5354
5308
select * from t1;
5358
create table t1(a bit(1) not null) engine=csv;
5359
insert into t1 values();
5361
Warning 1364 Field 'a' doesn't have a default value
5362
select BIN(a) from t1;
5366
5311
create table t1(a enum('foo','bar') default null) engine=csv;
5367
5312
ERROR 42000: The storage engine for the table doesn't support nullable columns
5379
5324
Level Code Message
5380
5325
Error 1178 The storage engine for the table doesn't support nullable columns
5381
5326
Error 1005 Can't create table 'test.t1' (errno: 138)
5382
create table t1 (c1 tinyblob not null) engine=csv;
5327
create table t1 (c1 blob not null) engine=csv;
5383
5328
insert into t1 values("This");
5384
5329
update t1 set c1="That" where c1="This";
5385
5330
affected rows: 1