adding test scripts
[csql.git] / test / tools / csql / datatype12.sql
blob27571c89eb2f8c14bf0c9318b4e1168e904c66c1
1 echo binary data type testing with primary key;
3 echo create table t1 (f1 int, f2 binary(4) DEFAULT 'abcd12' ,primary key(f2));
4 create table t1 (f1 int, f2 binary(4) DEFAULT 'abcd12' ,primary key(f2));
5 insert into t1 values (10, '12fe');
6 insert into t1 (f1) values (10);
7 insert into t1 values (11, '245af');
8 insert into t1 values (12, '2423fe');
9 insert into t1 values (13, '12fe');
10 insert into t1 values (-2147483648,'dc23' );
11 insert into t1 values (2147483647, '323a34');
12 echo select * from t1;
13 select * from t1;
14 echo select * from t1 where f2 = '12fe';
15 select * from t1 where f2 = '12fe';
16 echo select * from t1 where f2 != '323a34' AND f1 = 13;
17 select * from t1 where f2 != '323a34' AND f1 = 13;
18 echo select * from t1 where f1 = 12 AND f2 >= '245af';
19 select * from t1 where f1 = 12 AND f2 >= '245af';
20 echo select * from t1 where f1 = 12 OR  f2 > 'dc23';
21 select * from t1 where f1 = 12 OR  f2 > 'dc23';
22 echo select * from t1 where f1 = 12 OR f2 < 'dc23';
23 select * from t1 where f1 = 12 OR f2 < 'dc23';
24 echo select * from t1 where f1 = 12 OR f2 <> '245af';
25 select * from t1 where f1 = 12 OR f2 <> '245af';
26 echo select * from t1 where NOT f2 ='12fe';
27 select * from t1 where NOT f2 ='12fe';
28 echo select * from t1 where f2 != '12fe';
29 select * from t1 where  f2 != '12fe';
30 echo select * from t1 where NOT  f2 != '12fe';
31 select * from t1 where NOT  f2 != '12fe';
32 echo select * from t1 where f1 = f2;
33 select * from t1 where f1 = f2;
34 echo select * from t1 where f2 in ('245af','12fe');
35 select * from t1 where f2 in ('245af','12fe');
36 echo select * from t1 where f2 between '00000000' and 'ffffffff';
37 select * from t1 where f2 between '00000000' and 'ffffffff';
38 echo select * from t1 where f2 between '122' and '12a2';
39 select * from t1 where f2 between '122' and '12a2';
41 echo update t1 set f2 = '435f3' where f1 != 13 and  f2='323a34' ;
42 update t1 set f2 ='435f3'  where f1 != 13 and  f2='323a34';
43 select * from t1;
45 echo delete from t1 where f2 = '12fe';
46 delete from t1 where f2 = '12fe';
47 select * from t1;
48 drop table t1;