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