4977
4977
DROP TABLE bug14672;
4978
create temporary table t1 (a int not null) engine=csv;
4978
CREATE TABLE test_concurrent_insert ( val integer not null ) ENGINE = CSV;
4979
LOCK TABLES test_concurrent_insert READ LOCAL;
4980
INSERT INTO test_concurrent_insert VALUES (1);
4981
SELECT * FROM test_concurrent_insert;
4984
SELECT * FROM test_concurrent_insert;
4987
LOCK TABLES test_concurrent_insert WRITE;
4988
INSERT INTO test_concurrent_insert VALUES (2);
4989
SELECT * FROM test_concurrent_insert;
4994
DROP TABLE test_concurrent_insert;
4995
CREATE TABLE test_repair_table ( val integer not null ) ENGINE = CSV;
4996
CHECK TABLE test_repair_table;
4997
Table Op Msg_type Msg_text
4998
test.test_repair_table check status OK
4999
REPAIR TABLE test_repair_table;
5000
Table Op Msg_type Msg_text
5001
test.test_repair_table repair status OK
5002
DROP TABLE test_repair_table;
5003
CREATE TABLE test_repair_table2 ( val integer not null ) ENGINE = CSV;
5004
SELECT * from test_repair_table2;
5007
Error 1194 Table 'test_repair_table2' is marked as crashed and should be repaired
5008
SELECT * from test_repair_table2;
5010
CHECK TABLE test_repair_table2;
5011
Table Op Msg_type Msg_text
5012
test.test_repair_table2 check status OK
5013
DROP TABLE test_repair_table2;
5014
CREATE TABLE test_repair_table3 ( val integer not null ) ENGINE = CSV;
5015
CHECK TABLE test_repair_table3;
5016
Table Op Msg_type Msg_text
5017
test.test_repair_table3 check error Corrupt
5018
REPAIR TABLE test_repair_table3;
5019
Table Op Msg_type Msg_text
5020
test.test_repair_table3 repair status OK
5021
SELECT * FROM test_repair_table3;
5025
DROP TABLE test_repair_table3;
5026
CREATE TABLE test_repair_table4 (
5028
magic_no int DEFAULT 0 NOT NULL,
5029
company_name char(30) DEFAULT '' NOT NULL,
5030
founded char(4) DEFAULT '' NOT NULL
5032
SELECT * FROM test_repair_table4;
5033
num magic_no company_name founded
5035
Error 1194 Table 'test_repair_table4' is marked as crashed and should be repaired
5036
SELECT * FROM test_repair_table4;
5037
num magic_no company_name founded
5038
CHECK TABLE test_repair_table4;
5039
Table Op Msg_type Msg_text
5040
test.test_repair_table4 check status OK
5041
INSERT INTO test_repair_table4 VALUES (2,101,'SAP','1972');
5042
INSERT INTO test_repair_table4 VALUES (1,101,'Microsoft','1978');
5043
INSERT INTO test_repair_table4 VALUES (2,101,'MySQL','1995');
5044
SELECT * FROM test_repair_table4;
5045
num magic_no company_name founded
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
DROP TABLE test_repair_table4;
5072
CREATE TABLE test_repair_table5 (
5074
magic_no int DEFAULT 0 NOT NULL,
5075
company_name char(30) DEFAULT '' NOT NULL,
5076
founded char(4) DEFAULT '' NOT NULL
5078
CHECK TABLE test_repair_table5;
5079
Table Op Msg_type Msg_text
5080
test.test_repair_table5 check error Corrupt
5081
REPAIR TABLE test_repair_table5;
5082
Table Op Msg_type Msg_text
5083
test.test_repair_table5 repair status OK
5084
SELECT * FROM test_repair_table5;
5085
num magic_no company_name founded
5086
INSERT INTO test_repair_table5 VALUES (1, 102, "CORRECT", 1876);
5087
SELECT * FROM test_repair_table5;
5088
num magic_no company_name founded
5091
CHECK TABLE test_repair_table5;
5092
Table Op Msg_type Msg_text
5093
test.test_repair_table5 check error Corrupt
5094
REPAIR TABLE test_repair_table5;
5095
Table Op Msg_type Msg_text
5096
test.test_repair_table5 repair status OK
5097
SELECT * FROM test_repair_table5;
5098
num magic_no company_name founded
5100
INSERT INTO test_repair_table5 VALUES (1, 102, "CORRECT2", 1876);
5101
SELECT * FROM test_repair_table5;
5102
num magic_no company_name founded
5106
CHECK TABLE test_repair_table5;
5107
Table Op Msg_type Msg_text
5108
test.test_repair_table5 check error Corrupt
5109
REPAIR TABLE test_repair_table5;
5110
Table Op Msg_type Msg_text
5111
test.test_repair_table5 repair status OK
5112
SELECT * FROM test_repair_table5;
5113
num magic_no company_name founded
5116
DROP TABLE test_repair_table5;
5117
create table t1 (a int not null) engine=csv;
4979
5118
insert t1 values (1);
4980
5119
delete from t1;
4981
5120
affected rows: 1
4999
5138
truncate table t1;
5000
5139
affected rows: 5
5002
create temporary table float_test (id float not null,string varchar(64) not null) Engine=CSV;
5141
create table t1 (v varchar(32) not null);
5142
insert into t1 values ('def'),('abc'),('hij'),('3r4f');
5149
alter table t1 change v v2 varchar(32);
5156
alter table t1 change v2 v varchar(64);
5163
update t1 set v = 'lmn' where v = 'hij';
5170
alter table t1 add i int auto_increment not null primary key first;
5177
update t1 set i=5 where i=3;
5184
alter table t1 change i i bigint;
5191
alter table t1 add unique key (i, v);
5192
select * from t1 where i between 2 and 4 and v in ('def','3r4f','lmn');
5196
create table bug22080_1 (id int not null,string varchar(64) not null) Engine=CSV;
5197
create table bug22080_2 (id int not null,string varchar(64) not null) Engine=CSV;
5198
create table bug22080_3 (id int not null,string varchar(64) not null) Engine=CSV;
5199
insert into bug22080_1 values(1,'string');
5200
insert into bug22080_1 values(2,'string');
5201
insert into bug22080_1 values(3,'string');
5202
check table bug22080_2;
5203
Table Op Msg_type Msg_text
5204
test.bug22080_2 check error Corrupt
5205
check table bug22080_3;
5206
Table Op Msg_type Msg_text
5207
test.bug22080_3 check error Corrupt
5208
drop tables bug22080_1,bug22080_2,bug22080_3;
5209
create table float_test (id float not null,string varchar(64) not null) Engine=CSV;
5003
5210
insert into float_test values(1.0,'string');
5004
5211
insert into float_test values(2.23,'serg.g');
5005
5212
insert into float_test values(0.03,'string');
5059
5284
select * from t1;
5062
create temporary table t1(a datetime not null) engine=csv;
5063
insert into t1 values();
5064
ERROR HY000: Field 'a' doesn't have a default value
5068
create temporary table t1(a varchar(32) not null) engine=csv;
5069
insert into t1 values();
5070
ERROR HY000: Field 'a' doesn't have a default value
5074
create temporary table t1(a int not null) engine=csv;
5075
insert into t1 values();
5076
ERROR HY000: Field 'a' doesn't have a default value
5080
create temporary table t1(a blob not null) engine=csv;
5081
insert into t1 values();
5082
ERROR HY000: Field 'a' doesn't have a default value
5086
create temporary table t1(a enum('foo','bar') default null) engine=csv;
5087
ERROR 42000: The storage engine for the table doesn't support nullable columns
5088
create temporary table t1(a enum('foo','bar') default 'foo') engine=csv;
5089
ERROR 42000: The storage engine for the table doesn't support nullable columns
5090
create temporary table t1(a enum('foo','bar') default 'foo' not null) engine=csv;
5287
create table t1(a datetime not null) engine=csv;
5288
insert into t1 values();
5289
ERROR HY000: Field 'a' doesn't have a default value
5293
create table t1(a varchar(32) not null) engine=csv;
5294
insert into t1 values();
5295
ERROR HY000: Field 'a' doesn't have a default value
5299
create table t1(a int not null) engine=csv;
5300
insert into t1 values();
5301
ERROR HY000: Field 'a' doesn't have a default value
5305
create table t1(a blob not null) engine=csv;
5306
insert into t1 values();
5307
ERROR HY000: Field 'a' doesn't have a default value
5311
create table t1(a enum('foo','bar') default null) engine=csv;
5312
ERROR 42000: The storage engine for the table doesn't support nullable columns
5313
create table t1(a enum('foo','bar') default 'foo') engine=csv;
5314
ERROR 42000: The storage engine for the table doesn't support nullable columns
5315
create table t1(a enum('foo','bar') default 'foo' not null) engine=csv;
5091
5316
insert into t1 values();
5092
5317
select * from t1;
5096
CREATE TEMPORARY TABLE t1(a INT) ENGINE=CSV;
5321
CREATE TABLE t1(a INT) ENGINE=CSV;
5097
5322
ERROR 42000: The storage engine for the table doesn't support nullable columns
5099
5324
Level Code Message
5100
5325
Error 1178 The storage engine for the table doesn't support nullable columns
5101
Error 1005 Can't create table 'test.#t1' (errno: 138)
5102
create temporary table t1 (c1 blob not null) engine=csv;
5326
Error 1005 Can't create table 'test.t1' (errno: 138)
5327
create table t1 (c1 blob not null) engine=csv;
5103
5328
insert into t1 values("This");
5104
5329
update t1 set c1="That" where c1="This";
5105
5330
affected rows: 1