4977
4977
DROP TABLE bug14672;
4978
create temporary table t1 (a int not null) engine=csv;
4978
CREATE TABLE test_repair_table ( val integer not null ) ENGINE = CSV;
4979
CHECK TABLE test_repair_table;
4980
Table Op Msg_type Msg_text
4981
test.test_repair_table check status OK
4982
REPAIR TABLE test_repair_table;
4983
Table Op Msg_type Msg_text
4984
test.test_repair_table repair status OK
4985
DROP TABLE test_repair_table;
4986
CREATE TABLE test_repair_table2 ( val integer not null ) ENGINE = CSV;
4987
SELECT * from test_repair_table2;
4990
Error 1194 Table 'test_repair_table2' is marked as crashed and should be repaired
4991
SELECT * from test_repair_table2;
4993
CHECK TABLE test_repair_table2;
4994
Table Op Msg_type Msg_text
4995
test.test_repair_table2 check status OK
4996
DROP TABLE test_repair_table2;
4997
CREATE TABLE test_repair_table3 ( val integer not null ) ENGINE = CSV;
4998
CHECK TABLE test_repair_table3;
4999
Table Op Msg_type Msg_text
5000
test.test_repair_table3 check error Corrupt
5001
REPAIR TABLE test_repair_table3;
5002
Table Op Msg_type Msg_text
5003
test.test_repair_table3 repair status OK
5004
SELECT * FROM test_repair_table3;
5008
DROP TABLE test_repair_table3;
5009
CREATE TABLE test_repair_table4 (
5011
magic_no int DEFAULT 0 NOT NULL,
5012
company_name char(30) DEFAULT '' NOT NULL,
5013
founded char(4) DEFAULT '' NOT NULL
5015
SELECT * FROM test_repair_table4;
5016
num magic_no company_name founded
5018
Error 1194 Table 'test_repair_table4' is marked as crashed and should be repaired
5019
SELECT * FROM test_repair_table4;
5020
num magic_no company_name founded
5021
CHECK TABLE test_repair_table4;
5022
Table Op Msg_type Msg_text
5023
test.test_repair_table4 check status OK
5024
INSERT INTO test_repair_table4 VALUES (2,101,'SAP','1972');
5025
INSERT INTO test_repair_table4 VALUES (1,101,'Microsoft','1978');
5026
INSERT INTO test_repair_table4 VALUES (2,101,'MySQL','1995');
5027
SELECT * FROM test_repair_table4;
5028
num magic_no company_name founded
5030
1 101 Microsoft 1978
5032
CHECK TABLE test_repair_table4;
5033
Table Op Msg_type Msg_text
5034
test.test_repair_table4 check status OK
5035
REPAIR TABLE test_repair_table4;
5036
Table Op Msg_type Msg_text
5037
test.test_repair_table4 repair status OK
5038
SELECT * FROM test_repair_table4;
5039
num magic_no company_name founded
5041
1 101 Microsoft 1978
5043
CHECK TABLE test_repair_table4;
5044
Table Op Msg_type Msg_text
5045
test.test_repair_table4 check status OK
5046
REPAIR TABLE test_repair_table4;
5047
Table Op Msg_type Msg_text
5048
test.test_repair_table4 repair status OK
5049
SELECT * FROM test_repair_table4;
5050
num magic_no company_name founded
5052
1 101 Microsoft 1978
5054
DROP TABLE test_repair_table4;
5055
CREATE TABLE test_repair_table5 (
5057
magic_no int DEFAULT 0 NOT NULL,
5058
company_name char(30) DEFAULT '' NOT NULL,
5059
founded char(4) DEFAULT '' NOT NULL
5061
CHECK TABLE test_repair_table5;
5062
Table Op Msg_type Msg_text
5063
test.test_repair_table5 check error Corrupt
5064
REPAIR TABLE test_repair_table5;
5065
Table Op Msg_type Msg_text
5066
test.test_repair_table5 repair status OK
5067
SELECT * FROM test_repair_table5;
5068
num magic_no company_name founded
5069
INSERT INTO test_repair_table5 VALUES (1, 102, "CORRECT", 1876);
5070
SELECT * FROM test_repair_table5;
5071
num magic_no company_name founded
5074
CHECK TABLE test_repair_table5;
5075
Table Op Msg_type Msg_text
5076
test.test_repair_table5 check error Corrupt
5077
REPAIR TABLE test_repair_table5;
5078
Table Op Msg_type Msg_text
5079
test.test_repair_table5 repair status OK
5080
SELECT * FROM test_repair_table5;
5081
num magic_no company_name founded
5083
INSERT INTO test_repair_table5 VALUES (1, 102, "CORRECT2", 1876);
5084
SELECT * FROM test_repair_table5;
5085
num magic_no company_name founded
5089
CHECK TABLE test_repair_table5;
5090
Table Op Msg_type Msg_text
5091
test.test_repair_table5 check error Corrupt
5092
REPAIR TABLE test_repair_table5;
5093
Table Op Msg_type Msg_text
5094
test.test_repair_table5 repair status OK
5095
SELECT * FROM test_repair_table5;
5096
num magic_no company_name founded
5099
DROP TABLE test_repair_table5;
5100
create table t1 (a int not null) engine=csv;
4979
5101
insert t1 values (1);
4980
5102
delete from t1;
4981
5103
affected rows: 1
4999
5121
truncate table t1;
5000
5122
affected rows: 5
5002
create temporary table float_test (id float not null,string varchar(64) not null) Engine=CSV;
5124
create table t1 (v varchar(32) not null);
5125
insert into t1 values ('def'),('abc'),('hij'),('3r4f');
5132
alter table t1 change v v2 varchar(32);
5139
alter table t1 change v2 v varchar(64);
5146
update t1 set v = 'lmn' where v = 'hij';
5153
alter table t1 add i int auto_increment not null primary key first;
5160
update t1 set i=5 where i=3;
5167
alter table t1 change i i bigint;
5174
alter table t1 add unique key (i, v);
5175
select * from t1 where i between 2 and 4 and v in ('def','3r4f','lmn');
5179
create table bug22080_1 (id int not null,string varchar(64) not null) Engine=CSV;
5180
create table bug22080_2 (id int not null,string varchar(64) not null) Engine=CSV;
5181
create table bug22080_3 (id int not null,string varchar(64) not null) Engine=CSV;
5182
insert into bug22080_1 values(1,'string');
5183
insert into bug22080_1 values(2,'string');
5184
insert into bug22080_1 values(3,'string');
5185
check table bug22080_2;
5186
Table Op Msg_type Msg_text
5187
test.bug22080_2 check error Corrupt
5188
check table bug22080_3;
5189
Table Op Msg_type Msg_text
5190
test.bug22080_3 check error Corrupt
5191
drop tables bug22080_1,bug22080_2,bug22080_3;
5192
create table float_test (id float not null,string varchar(64) not null) Engine=CSV;
5003
5193
insert into float_test values(1.0,'string');
5004
5194
insert into float_test values(2.23,'serg.g');
5005
5195
insert into float_test values(0.03,'string');
5059
5267
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;
5270
create table t1(a datetime not null) engine=csv;
5271
insert into t1 values();
5272
ERROR HY000: Field 'a' doesn't have a default value
5276
create table t1(a varchar(32) not null) engine=csv;
5277
insert into t1 values();
5278
ERROR HY000: Field 'a' doesn't have a default value
5282
create table t1(a int not null) engine=csv;
5283
insert into t1 values();
5284
ERROR HY000: Field 'a' doesn't have a default value
5288
create table t1(a blob not null) engine=csv;
5289
insert into t1 values();
5290
ERROR HY000: Field 'a' doesn't have a default value
5294
create table t1(a enum('foo','bar') default null) engine=csv;
5295
ERROR 42000: The storage engine for the table doesn't support nullable columns
5296
create table t1(a enum('foo','bar') default 'foo') engine=csv;
5297
ERROR 42000: The storage engine for the table doesn't support nullable columns
5298
create table t1(a enum('foo','bar') default 'foo' not null) engine=csv;
5091
5299
insert into t1 values();
5092
5300
select * from t1;
5096
CREATE TEMPORARY TABLE t1(a INT) ENGINE=CSV;
5304
CREATE TABLE t1(a INT) ENGINE=CSV;
5097
5305
ERROR 42000: The storage engine for the table doesn't support nullable columns
5099
5307
Level Code Message
5100
5308
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;
5309
Error 1005 Can't create table 'test.t1' (errno: 138)
5310
create table t1 (c1 blob not null) engine=csv;
5103
5311
insert into t1 values("This");
5104
5312
update t1 set c1="That" where c1="This";
5105
5313
affected rows: 1