Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
7a86a2a9
Commit
7a86a2a9
authored
Dec 01, 1997
by
Thomas G. Lockhart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for varchar() and combinations of string types.
parent
1d7b6f14
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
202 additions
and
0 deletions
+202
-0
src/test/regress/expected/strings.out
src/test/regress/expected/strings.out
+17
-0
src/test/regress/expected/varchar.out
src/test/regress/expected/varchar.out
+98
-0
src/test/regress/sql/strings.sql
src/test/regress/sql/strings.sql
+23
-0
src/test/regress/sql/varchar.sql
src/test/regress/sql/varchar.sql
+64
-0
No files found.
src/test/regress/expected/strings.out
0 → 100644
View file @
7a86a2a9
QUERY: SELECT 'first line'
' - next line'
' - third line'
AS "Three lines to one";
Three lines to one
-----------------------------------
first line - next line - third line
(1 row)
QUERY: SELECT 'first line'
' - next line' /* this comment is not allowed here */
' - third line';
WARN:parser: parse error at or near "'"
QUERY: SELECT text(f1) FROM CHAR_TBL;
WARN:func_get_detail: function text(bpchar) does not exist
QUERY: SELECT text(f1) FROM VARCHAR_TBL;
WARN:func_get_detail: function text(varchar) does not exist
src/test/regress/expected/varchar.out
0 → 100644
View file @
7a86a2a9
QUERY: CREATE TABLE VARCHAR_TBL(f1 varchar(1));
QUERY: INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
QUERY: INSERT INTO VARCHAR_TBL (f1) VALUES ('A');
QUERY: INSERT INTO VARCHAR_TBL (f1) VALUES ('1');
QUERY: INSERT INTO VARCHAR_TBL (f1) VALUES (2);
QUERY: INSERT INTO VARCHAR_TBL (f1) VALUES ('3');
QUERY: INSERT INTO VARCHAR_TBL (f1) VALUES ('');
QUERY: INSERT INTO VARCHAR_TBL (f1) VALUES ('cd');
QUERY: SELECT '' AS seven, VARCHAR_TBL.*;
seven|f1
-----+--
|a
|A
|1
|2
|3
|
|c
(7 rows)
QUERY: SELECT '' AS six, c.*
FROM VARCHAR_TBL c
WHERE c.f1 <> 'a';
six|f1
---+--
|A
|1
|2
|3
|
|c
(6 rows)
QUERY: SELECT '' AS one, c.*
FROM VARCHAR_TBL c
WHERE c.f1 = 'a';
one|f1
---+--
|a
(1 row)
QUERY: SELECT '' AS five, c.*
FROM VARCHAR_TBL c
WHERE c.f1 < 'a';
five|f1
----+--
|A
|1
|2
|3
|
(5 rows)
QUERY: SELECT '' AS six, c.*
FROM VARCHAR_TBL c
WHERE c.f1 <= 'a';
six|f1
---+--
|a
|A
|1
|2
|3
|
(6 rows)
QUERY: SELECT '' AS one, c.*
FROM VARCHAR_TBL c
WHERE c.f1 > 'a';
one|f1
---+--
|c
(1 row)
QUERY: SELECT '' AS two, c.*
FROM VARCHAR_TBL c
WHERE c.f1 >= 'a';
two|f1
---+--
|a
|c
(2 rows)
QUERY: DROP TABLE VARCHAR_TBL;
QUERY: CREATE TABLE VARCHAR_TBL(f1 varchar(4));
QUERY: INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
QUERY: INSERT INTO VARCHAR_TBL (f1) VALUES ('ab');
QUERY: INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd');
QUERY: INSERT INTO VARCHAR_TBL (f1) VALUES ('abcde');
QUERY: SELECT '' AS four, VARCHAR_TBL.*;
four|f1
----+----
|a
|ab
|abcd
|abcd
(4 rows)
src/test/regress/sql/strings.sql
0 → 100644
View file @
7a86a2a9
--
-- Test various data entry syntaxes.
--
-- SQL92 string continuation syntax
SELECT
'first line'
' - next line'
' - third line'
AS
"Three lines to one"
;
-- illegal string continuation syntax
SELECT
'first line'
' - next line'
/* this comment is not allowed here */
' - third line'
;
--
-- test conversions between various string types
--
SELECT
text
(
f1
)
FROM
CHAR_TBL
;
SELECT
text
(
f1
)
FROM
VARCHAR_TBL
;
src/test/regress/sql/varchar.sql
0 → 100644
View file @
7a86a2a9
-- ****************** test built-in type varchar **************
--
CREATE
TABLE
VARCHAR_TBL
(
f1
varchar
(
1
));
INSERT
INTO
VARCHAR_TBL
(
f1
)
VALUES
(
'a'
);
INSERT
INTO
VARCHAR_TBL
(
f1
)
VALUES
(
'A'
);
-- any of the following three input formats are acceptable
INSERT
INTO
VARCHAR_TBL
(
f1
)
VALUES
(
'1'
);
INSERT
INTO
VARCHAR_TBL
(
f1
)
VALUES
(
2
);
INSERT
INTO
VARCHAR_TBL
(
f1
)
VALUES
(
'3'
);
-- zero-length char
INSERT
INTO
VARCHAR_TBL
(
f1
)
VALUES
(
''
);
-- try varchar's of greater than 1 length
INSERT
INTO
VARCHAR_TBL
(
f1
)
VALUES
(
'cd'
);
SELECT
''
AS
seven
,
VARCHAR_TBL
.
*
;
SELECT
''
AS
six
,
c
.
*
FROM
VARCHAR_TBL
c
WHERE
c
.
f1
<>
'a'
;
SELECT
''
AS
one
,
c
.
*
FROM
VARCHAR_TBL
c
WHERE
c
.
f1
=
'a'
;
SELECT
''
AS
five
,
c
.
*
FROM
VARCHAR_TBL
c
WHERE
c
.
f1
<
'a'
;
SELECT
''
AS
six
,
c
.
*
FROM
VARCHAR_TBL
c
WHERE
c
.
f1
<=
'a'
;
SELECT
''
AS
one
,
c
.
*
FROM
VARCHAR_TBL
c
WHERE
c
.
f1
>
'a'
;
SELECT
''
AS
two
,
c
.
*
FROM
VARCHAR_TBL
c
WHERE
c
.
f1
>=
'a'
;
DROP
TABLE
VARCHAR_TBL
;
--
-- Now test longer arrays of char
--
CREATE
TABLE
VARCHAR_TBL
(
f1
varchar
(
4
));
INSERT
INTO
VARCHAR_TBL
(
f1
)
VALUES
(
'a'
);
INSERT
INTO
VARCHAR_TBL
(
f1
)
VALUES
(
'ab'
);
INSERT
INTO
VARCHAR_TBL
(
f1
)
VALUES
(
'abcd'
);
INSERT
INTO
VARCHAR_TBL
(
f1
)
VALUES
(
'abcde'
);
SELECT
''
AS
four
,
VARCHAR_TBL
.
*
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment