~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/csv.result

  • Committer: devananda
  • Date: 2009-06-30 14:27:54 UTC
  • mfrom: (1030.2.4 trunk)
  • mto: (1093.1.7 captain)
  • mto: This revision was merged to the branch mainline in revision 1095.
  • Revision ID: devananda.vdv@gmail.com-20090630142754-vm9w374yxkf1pikc
mergeĀ fromĀ lp

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
drop table if exists t1,t2,t3,t4;
2
 
CREATE TABLE t1 (
 
2
CREATE TEMPORARY TABLE t1 (
3
3
Period int DEFAULT 0 NOT NULL,
4
4
Varor_period int DEFAULT 0 NOT NULL
5
5
) ENGINE = CSV;
13
13
select t1.* from t1;
14
14
Period  Varor_period
15
15
9410    9412
16
 
CREATE TABLE t2 (
 
16
CREATE TEMPORARY TABLE t2 (
17
17
auto int not null,
18
18
fld1 int DEFAULT 0 NOT NULL,
19
19
companynr int DEFAULT 0 NOT NULL,
4915
4915
DROP TABLE t1;
4916
4916
ALTER TABLE t2 RENAME t1;
4917
4917
DROP TABLE t1;
4918
 
CREATE TABLE t1 (
 
4918
CREATE TEMPORARY TABLE t1 (
4919
4919
Period int DEFAULT 0 NOT NULL,
4920
4920
Varor_period int DEFAULT 0 NOT NULL
4921
4921
) ENGINE = CSV;
4929
4929
Note    1051    Unknown table 't3'
4930
4930
Note    1051    Unknown table 't4'
4931
4931
DROP TABLE IF EXISTS bug13894;
4932
 
CREATE TABLE bug13894 ( val integer not null ) ENGINE = CSV;
 
4932
CREATE TEMPORARY TABLE bug13894 ( val integer not null ) ENGINE = CSV;
4933
4933
INSERT INTO bug13894 VALUES (5);
4934
4934
INSERT INTO bug13894 VALUES (10);
4935
4935
INSERT INTO bug13894 VALUES (11);
4949
4949
11
4950
4950
DROP TABLE bug13894;
4951
4951
DROP TABLE IF EXISTS bug14672;
4952
 
CREATE TABLE bug14672 (c1 integer not null) engine = CSV;
 
4952
CREATE TEMPORARY TABLE bug14672 (c1 integer not null) engine = CSV;
4953
4953
INSERT INTO bug14672 VALUES (1), (2), (3);
4954
4954
SELECT * FROM bug14672;
4955
4955
c1
4975
4975
4
4976
4976
5
4977
4977
DROP TABLE bug14672;
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;
4988
 
val
4989
 
Warnings:
4990
 
Error   1194    Table 'test_repair_table2' is marked as crashed and should be repaired
4991
 
SELECT * from test_repair_table2;
4992
 
val
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;
5005
 
val
5006
 
1
5007
 
4
5008
 
DROP TABLE test_repair_table3;
5009
 
CREATE TABLE test_repair_table4 (
5010
 
num int not null,
5011
 
magic_no int DEFAULT 0 NOT NULL,
5012
 
company_name char(30) DEFAULT '' NOT NULL,
5013
 
founded char(4) DEFAULT '' NOT NULL
5014
 
) ENGINE = CSV;
5015
 
SELECT * FROM test_repair_table4;
5016
 
num     magic_no        company_name    founded
5017
 
Warnings:
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
5029
 
2       101     SAP     1972
5030
 
1       101     Microsoft       1978
5031
 
2       101     MySQL   1995
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
5040
 
2       101     SAP     1972
5041
 
1       101     Microsoft       1978
5042
 
2       101     MySQL   1995
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
5051
 
2       101     SAP     1972
5052
 
1       101     Microsoft       1978
5053
 
2       101     MySQL   1995
5054
 
DROP TABLE test_repair_table4;
5055
 
CREATE TABLE test_repair_table5 (
5056
 
num int not null,
5057
 
magic_no int DEFAULT 0 NOT NULL,
5058
 
company_name char(30) DEFAULT '' NOT NULL,
5059
 
founded char(4) DEFAULT '' NOT NULL
5060
 
) ENGINE = CSV;
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
5072
 
1       102     CORRECT 1876
5073
 
FLUSH TABLES;
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
5082
 
1       102     CORRECT 1876
5083
 
INSERT INTO test_repair_table5 VALUES (1, 102, "CORRECT2", 1876);
5084
 
SELECT * FROM test_repair_table5;
5085
 
num     magic_no        company_name    founded
5086
 
1       102     CORRECT 1876
5087
 
1       102     CORRECT2        1876
5088
 
FLUSH TABLES;
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
5097
 
1       102     CORRECT 1876
5098
 
1       102     CORRECT2        1876
5099
 
DROP TABLE test_repair_table5;
5100
 
create table t1 (a int not null) engine=csv;
 
4978
create temporary table t1 (a int not null) engine=csv;
5101
4979
insert t1 values (1);
5102
4980
delete from t1;
5103
4981
affected rows: 1
5119
4997
affected rows: 4
5120
4998
insert t1 values (1),(2),(3),(4),(5);
5121
4999
truncate table t1;
5122
 
affected rows: 5
5123
 
drop table t1;
5124
 
create table t1 (v varchar(32) not null);
5125
 
insert into t1 values ('def'),('abc'),('hij'),('3r4f');
5126
 
select * from t1;
5127
 
v
5128
 
def
5129
 
abc
5130
 
hij
5131
 
3r4f
5132
 
alter table t1 change v v2 varchar(32);
5133
 
select * from t1;
5134
 
v2
5135
 
def
5136
 
abc
5137
 
hij
5138
 
3r4f
5139
 
alter table t1 change v2 v varchar(64);
5140
 
select * from t1;
5141
 
v
5142
 
def
5143
 
abc
5144
 
hij
5145
 
3r4f
5146
 
update t1 set v = 'lmn' where v = 'hij';
5147
 
select * from t1;
5148
 
v
5149
 
def
5150
 
abc
5151
 
lmn
5152
 
3r4f
5153
 
alter table t1 add i int auto_increment not null primary key first;
5154
 
select * from t1;
5155
 
i       v
5156
 
1       def
5157
 
2       abc
5158
 
3       lmn
5159
 
4       3r4f
5160
 
update t1 set i=5 where i=3;
5161
 
select * from t1;
5162
 
i       v
5163
 
1       def
5164
 
2       abc
5165
 
4       3r4f
5166
 
5       lmn
5167
 
alter table t1 change i i bigint;
5168
 
select * from t1;
5169
 
i       v
5170
 
1       def
5171
 
2       abc
5172
 
4       3r4f
5173
 
5       lmn
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');
5176
 
i       v
5177
 
4       3r4f
5178
 
drop table t1;
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;
 
5000
affected rows: 0
 
5001
drop table t1;
 
5002
create temporary table float_test (id float not null,string varchar(64) not null) Engine=CSV;
5193
5003
insert into float_test values(1.0,'string');
5194
5004
insert into float_test values(2.23,'serg.g');
5195
5005
insert into float_test values(0.03,'string');
5205
5015
0.67    string
5206
5016
9.67    string
5207
5017
drop table float_test;
5208
 
CREATE TABLE `bug21328` (
 
5018
CREATE TEMPORARY TABLE `bug21328` (
5209
5019
`col1` int NOT NULL,
5210
5020
`col2` int NOT NULL,
5211
5021
`col3` int NOT NULL
5213
5023
insert into bug21328 values (1,0,0);
5214
5024
alter table bug21328 engine=myisam;
5215
5025
drop table bug21328;
5216
 
create table t1(a blob not null, b int not null) engine=csv;
 
5026
create temporary table t1(a blob not null, b int not null) engine=csv;
5217
5027
insert into t1 values('a', 1);
5218
5028
flush tables;
5219
5029
update t1 set b=2;
5221
5031
a       b
5222
5032
a       2
5223
5033
drop table t1;
5224
 
create table t1(a int not null) engine=csv;
 
5034
create temporary table t1(a int not null) engine=csv;
5225
5035
insert into t1 values(-1), (-123.34), (2), (-23);
5226
5036
select * from t1;
5227
5037
a
5233
5043
Table   Op      Msg_type        Msg_text
5234
5044
test.t1 check   status  OK
5235
5045
drop table t1;
5236
 
create table t1(a int not null, b int not null) engine=csv;
5237
 
repair table t1;
5238
 
Table   Op      Msg_type        Msg_text
5239
 
test.t1 repair  Warning Data truncated for column 'a' at row 5
5240
 
test.t1 repair  status  OK
5241
 
check table t1;
5242
 
Table   Op      Msg_type        Msg_text
5243
 
test.t1 check   status  OK
5244
 
select * from t1;
5245
 
a       b
5246
 
1       0
5247
 
-200    1
5248
 
-1      -1
5249
 
-1      -100
5250
 
check table t1;
5251
 
Table   Op      Msg_type        Msg_text
5252
 
test.t1 check   status  OK
5253
 
drop table t1;
5254
 
create table t1(a int not null) engine=csv;
 
5046
create temporary table t1(a int not null) engine=csv;
5255
5047
insert into t1 values (0), (1), (2);
5256
5048
delete from t1 limit 2;
5257
5049
check table t1;
5267
5059
select * from t1;
5268
5060
a
5269
5061
drop table t1;
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
5273
 
select * from t1;
5274
 
a
5275
 
drop table t1;
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
5279
 
select * from t1;
5280
 
a
5281
 
drop table t1;
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
5285
 
select * from t1;
5286
 
a
5287
 
drop table t1;
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
5291
 
select * from t1;
5292
 
a
5293
 
drop table t1;
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;
 
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
 
5065
select * from t1;
 
5066
a
 
5067
drop table t1;
 
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
 
5071
select * from t1;
 
5072
a
 
5073
drop table t1;
 
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
 
5077
select * from t1;
 
5078
a
 
5079
drop table t1;
 
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
 
5083
select * from t1;
 
5084
a
 
5085
drop table t1;
 
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;
5299
5091
insert into t1 values();
5300
5092
select * from t1;
5301
5093
a
5302
5094
foo
5303
5095
drop table t1;
5304
 
CREATE TABLE t1(a INT) ENGINE=CSV;
 
5096
CREATE TEMPORARY TABLE t1(a INT) ENGINE=CSV;
5305
5097
ERROR 42000: The storage engine for the table doesn't support nullable columns
5306
5098
SHOW WARNINGS;
5307
5099
Level   Code    Message
5308
5100
Error   1178    The storage engine for the table doesn't support nullable columns
5309
5101
Error   1005    Can't create table 'test.t1' (errno: 138)
5310
 
create table t1 (c1 blob not null) engine=csv;
 
5102
create temporary table t1 (c1 blob not null) engine=csv;
5311
5103
insert into t1 values("This");
5312
5104
update t1 set c1="That" where c1="This";
5313
5105
affected rows: 1
5317
5109
That
5318
5110
drop table t1;
5319
5111
drop table if exists t1;
5320
 
create table t1 (val int not null) engine=csv;
5321
 
select * from t1;
5322
 
ERROR HY000: Can't find file: 't1' (errno: 2)
5323
5112
End of 5.1 tests