aboutsummaryrefslogtreecommitdiff
path: root/src/test/suite/varchar.sql
blob: 0e83172208807d175aa7670c2a27177ef9f409e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---------------------------------------------------------------------------
--
-- varchar.sql-
--    test CHAR() and VARCHAR() adts
--
--
-- Copyright (c) 1994-5, Regents of the University of California
--
-- $Id: varchar.sql,v 1.1.1.1 1996/07/09 06:22:30 scrappy Exp $
--
---------------------------------------------------------------------------

-- test char(): insert w/ boundary cases
create table f (x char(5));
insert into f values ('zoo');
insert into f values ('a');
insert into f values ('jet');
insert into f values ('abc');
insert into f values ('');
insert into f values ('a c');
insert into f values ('abxyzxyz');
select * from f;
select * from f where x = 'jet';
select * from f where x <> 'jet';
select * from f where x < 'jet';
select * from f where x <= 'jet';
select * from f where x > 'jet';
select * from f where x >= 'jet';
select * from f where x = 'ab';
select * from f where x <> 'ab';
select * from f where x < 'ab';
select * from f where x <= 'ab';
select * from f where x > 'ab';
select * from f where x >= 'ab';
select * from f order by x;
-- test varchar(): insert w/ boundary cases
create table ff (x varchar(5));
insert into ff values ('a');
insert into ff values ('zoo');
insert into ff values ('jet');
insert into ff values ('abc');
insert into ff values ('');
insert into ff values ('a c');
insert into ff values ('abxyzxyz');
select * from ff;
select * from ff where x = 'jet';
select * from ff where x <> 'jet';
select * from ff where x < 'jet';
select * from ff where x <= 'jet';
select * from ff where x > 'jet';
select * from ff where x >= 'jet';
select * from ff where x = 'ab';
select * from ff where x <> 'ab';
select * from ff where x < 'ab';
select * from ff where x <= 'ab';
select * from ff where x > 'ab';
select * from ff where x >= 'ab';
select * from ff order by x using >;

create index f_ind on f using btree (x bpchar_ops);
create index ff_ind on ff using btree (x varchar_ops);

drop table f;
drop table ff;