Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1d7b6f1

Browse files
author
Thomas G. Lockhart
committed
Adjust tests to reflect removal of time travel.
Add tests for strings and varchar.
1 parent f901971 commit 1d7b6f1

File tree

7 files changed

+78
-21
lines changed

7 files changed

+78
-21
lines changed

src/test/regress/sql/alter_table.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ DROP TABLE temp;
7070
-- the wolf bug - schema mods caused inconsistent row descriptors
7171
CREATE TABLE temp (
7272
initial int4
73-
) ARCHIVE = light;
73+
);
7474

7575
ALTER TABLE temp ADD COLUMN a int4;
7676

@@ -132,7 +132,7 @@ INSERT INTO temp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u,
132132
'(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '["current" "infinity"]',
133133
'1/3', '1,char16', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
134134

135-
SELECT * FROM temp[,];
135+
SELECT * FROM temp;
136136

137137
DROP TABLE temp;
138138

src/test/regress/sql/boolean.sql

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--
22
-- boolean.source
33
--
4-
-- $Header: /cvsroot/pgsql/src/test/regress/sql/boolean.sql,v 1.4 1997/10/25 06:02:33 thomas Exp $
4+
-- $Header: /cvsroot/pgsql/src/test/regress/sql/boolean.sql,v 1.5 1997/12/01 02:45:59 thomas Exp $
55
--
66

77
--
@@ -72,12 +72,11 @@ INSERT INTO BOOLTBL2 (f1) VALUES ('False'::bool);
7272

7373
INSERT INTO BOOLTBL2 (f1) VALUES ('FALSE'::bool);
7474

75-
-- this is now an invalid expression
76-
-- pre-v6.3 this evaluated to false - thomas 1997-10-23
75+
-- This is now an invalid expression
76+
-- For pre-v6.3 this evaluated to false - thomas 1997-10-23
7777
INSERT INTO BOOLTBL2 (f1)
7878
VALUES ('XXX'::bool);
7979

80-
8180
-- BOOLTBL2 should be full of false's at this point
8281
SELECT '' AS f_4, BOOLTBL2.*;
8382

@@ -98,6 +97,33 @@ SELECT '' AS tf_12_ff_4, BOOLTBL1.*, BOOLTBL2.*
9897
WHERE BOOLTBL2.f1 = BOOLTBL1.f1 or BOOLTBL1.f1 = 'true'::bool
9998
ORDER BY BOOLTBL1.f1, BOOLTBL2.f1;
10099

100+
--
101+
-- SQL92 syntax - thomas 1997-11-30
102+
--
103+
104+
SELECT '' AS "True", BOOLTBL1.*
105+
FROM BOOLTBL1
106+
WHERE f1 IS TRUE;
107+
108+
SELECT '' AS "Not False", BOOLTBL1.*
109+
FROM BOOLTBL1
110+
WHERE f1 IS NOT FALSE;
111+
112+
SELECT '' AS "False", BOOLTBL1.*
113+
FROM BOOLTBL1
114+
WHERE f1 IS FALSE;
115+
116+
SELECT '' AS "Not True", BOOLTBL1.*
117+
FROM BOOLTBL1
118+
WHERE f1 IS NOT TRUE;
119+
120+
--
121+
-- Clean up
122+
-- Many tables are retained by the regression test, but these do not seem
123+
-- particularly useful so just get rid of them for now.
124+
-- - thomas 1997-11-30
125+
--
126+
101127
DROP TABLE BOOLTBL1;
102128

103129
DROP TABLE BOOLTBL2;

src/test/regress/sql/char.sql

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
-- all inputs are SILENTLY truncated at 1 character
44
--
55

6+
-- fixed-length by value
7+
-- internally passed by value if <= 4 bytes in storage
8+
-- Not sure why this is a really useful test,
9+
-- but this test has been here forever. - thomas 1997-11-30
10+
11+
SELECT 'c'::char = 'c'::char AS true;
12+
13+
--
14+
-- Build a table for testing
15+
--
16+
617
CREATE TABLE CHAR_TBL(f1 char);
718

819
INSERT INTO CHAR_TBL (f1) VALUES ('a');
@@ -51,3 +62,16 @@ SELECT '' AS two, c.*
5162

5263
DROP TABLE CHAR_TBL;
5364

65+
--
66+
-- Now test longer arrays of char
67+
--
68+
69+
CREATE TABLE CHAR_TBL(f1 char(4));
70+
71+
INSERT INTO CHAR_TBL (f1) VALUES ('a');
72+
INSERT INTO CHAR_TBL (f1) VALUES ('ab');
73+
INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
74+
INSERT INTO CHAR_TBL (f1) VALUES ('abcde');
75+
76+
SELECT '' AS four, CHAR_TBL.*;
77+

src/test/regress/sql/char16.sql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
-- all inputs are silently truncated at 16 characters
44
--
55

6+
-- fixed-length by reference
7+
SELECT 'char 16 string'::char16 = 'char 16 string'::char16 AS "True";
8+
9+
SELECT 'char 16 string'::char16 = 'char 16 string '::char16 AS "False";
10+
11+
--
12+
--
13+
--
14+
615
CREATE TABLE CHAR16_TBL(f1 char16);
716

817
INSERT INTO CHAR16_TBL(f1) VALUES ('ABCDEFGHIJKLMNOP');

src/test/regress/sql/select_views.sql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
--
44
-- test the views defined in create.source
55
--
6-
SELECT * from street;
6+
SELECT * FROM street;
77

8-
SELECT * from iexit;
8+
SELECT * FROM iexit
9+
ORDER BY 1, 2;
910

10-
SELECT * from toyemp where name='sharon';
11+
SELECT * FROM toyemp WHERE name = 'sharon';
1112

src/test/regress/sql/tests

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
boolean
22
char
3-
char16
43
char2
54
char4
65
char8
6+
char16
7+
varchar
78
text
9+
strings
810
int2
911
int4
1012
oid
@@ -56,5 +58,4 @@ btree_index
5658
hash_index
5759
select_views
5860
alter_table
59-
purge
6061
portals_p2

src/test/regress/sql/text.sql

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
-- *************testing built-in type text ****************
22

3-
--
4-
-- adt operators in the target list
5-
--
6-
-- fixed-length by reference
7-
SELECT 'char 16 string'::char16 = 'char 16 string '::char16 AS false;
8-
9-
-- fixed-length by value
10-
SELECT 'c'::char = 'c'::char AS true;
11-
12-
-- variable-length
133
SELECT 'this is a text string'::text = 'this is a text string'::text AS true;
144

155
SELECT 'this is a text string'::text = 'this is a text strin'::text AS false;
166

7+
CREATE TABLE TEXT_TBL (f1 text);
8+
9+
INSERT INTO TEXT_TBL VALUES ('doh!');
10+
INSERT INTO TEXT_TBL VALUES ('hi de ho neighbor');
11+
12+
SELECT '' AS two, * FROM TEXT_TBL;
1713

0 commit comments

Comments
 (0)