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
03debe19
Commit
03debe19
authored
Nov 24, 2007
by
D'Arcy J.M. Cain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add regression tests for MONEY type.
parent
aca467b9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
252 additions
and
4 deletions
+252
-4
src/test/regress/expected/money.out
src/test/regress/expected/money.out
+187
-0
src/test/regress/expected/sanity_check.out
src/test/regress/expected/sanity_check.out
+2
-1
src/test/regress/output/misc.source
src/test/regress/output/misc.source
+2
-1
src/test/regress/parallel_schedule
src/test/regress/parallel_schedule
+2
-2
src/test/regress/sql/money.sql
src/test/regress/sql/money.sql
+59
-0
No files found.
src/test/regress/expected/money.out
0 → 100644
View file @
03debe19
--
-- MONEY
--
CREATE TABLE money_data (m money);
INSERT INTO money_data VALUES ('123');
SELECT * FROM money_data;
m
---------
$123.00
(1 row)
SELECT m + '123' FROM money_data;
?column?
----------
$246.00
(1 row)
SELECT m + '123.45' FROM money_data;
?column?
----------
$246.45
(1 row)
SELECT m - '123.45' FROM money_data;
?column?
----------
-$0.45
(1 row)
SELECT m * 2 FROM money_data;
?column?
----------
$246.00
(1 row)
SELECT m / 2 FROM money_data;
?column?
----------
$61.50
(1 row)
-- All true
SELECT m = '$123.00' FROM money_data;
?column?
----------
t
(1 row)
SELECT m != '$124.00' FROM money_data;
?column?
----------
t
(1 row)
SELECT m <= '$123.00' FROM money_data;
?column?
----------
t
(1 row)
SELECT m >= '$123.00' FROM money_data;
?column?
----------
t
(1 row)
SELECT m < '$124.00' FROM money_data;
?column?
----------
t
(1 row)
SELECT m > '$122.00' FROM money_data;
?column?
----------
t
(1 row)
-- All false
SELECT m = '$123.01' FROM money_data;
?column?
----------
f
(1 row)
SELECT m != '$123.00' FROM money_data;
?column?
----------
f
(1 row)
SELECT m <= '$122.99' FROM money_data;
?column?
----------
f
(1 row)
SELECT m >= '$123.01' FROM money_data;
?column?
----------
f
(1 row)
SELECT m > '$124.00' FROM money_data;
?column?
----------
f
(1 row)
SELECT m < '$122.00' FROM money_data;
?column?
----------
f
(1 row)
SELECT cashlarger(m, '$124.00') FROM money_data;
cashlarger
------------
$124.00
(1 row)
SELECT cashsmaller(m, '$124.00') FROM money_data;
cashsmaller
-------------
$123.00
(1 row)
SELECT cash_words(m) FROM money_data;
cash_words
-------------------------------------------------
One hundred twenty three dollars and zero cents
(1 row)
SELECT cash_words(m + '1.23') FROM money_data;
cash_words
--------------------------------------------------------
One hundred twenty four dollars and twenty three cents
(1 row)
DELETE FROM money_data;
INSERT INTO money_data VALUES ('$123.45');
SELECT * FROM money_data;
m
---------
$123.45
(1 row)
DELETE FROM money_data;
INSERT INTO money_data VALUES ('$123.451');
SELECT * FROM money_data;
m
---------
$123.45
(1 row)
DELETE FROM money_data;
INSERT INTO money_data VALUES ('$123.454');
SELECT * FROM money_data;
m
---------
$123.45
(1 row)
DELETE FROM money_data;
INSERT INTO money_data VALUES ('$123.455');
SELECT * FROM money_data;
m
---------
$123.46
(1 row)
DELETE FROM money_data;
INSERT INTO money_data VALUES ('$123.456');
SELECT * FROM money_data;
m
---------
$123.46
(1 row)
DELETE FROM money_data;
INSERT INTO money_data VALUES ('$123.459');
SELECT * FROM money_data;
m
---------
$123.46
(1 row)
src/test/regress/expected/sanity_check.out
View file @
03debe19
...
@@ -66,6 +66,7 @@ SELECT relname, relhasindex
...
@@ -66,6 +66,7 @@ SELECT relname, relhasindex
log_table | f
log_table | f
lseg_tbl | f
lseg_tbl | f
main_table | f
main_table | f
money_data | f
num_data | f
num_data | f
num_exp_add | t
num_exp_add | t
num_exp_div | t
num_exp_div | t
...
@@ -148,7 +149,7 @@ SELECT relname, relhasindex
...
@@ -148,7 +149,7 @@ SELECT relname, relhasindex
timetz_tbl | f
timetz_tbl | f
tinterval_tbl | f
tinterval_tbl | f
varchar_tbl | f
varchar_tbl | f
(13
7
rows)
(13
8
rows)
--
--
-- another sanity check: every system catalog that has OIDs should have
-- another sanity check: every system catalog that has OIDs should have
...
...
src/test/regress/output/misc.source
View file @
03debe19
...
@@ -626,6 +626,7 @@ SELECT user_relns() AS user_relns
...
@@ -626,6 +626,7 @@ SELECT user_relns() AS user_relns
log_table
log_table
lseg_tbl
lseg_tbl
main_table
main_table
money_data
num_data
num_data
num_exp_add
num_exp_add
num_exp_div
num_exp_div
...
@@ -666,7 +667,7 @@ SELECT user_relns() AS user_relns
...
@@ -666,7 +667,7 @@ SELECT user_relns() AS user_relns
toyemp
toyemp
varchar_tbl
varchar_tbl
xacttest
xacttest
(10
0
rows)
(10
1
rows)
SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer')));
SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer')));
name
name
...
...
src/test/regress/parallel_schedule
View file @
03debe19
# ----------
# ----------
# $PostgreSQL: pgsql/src/test/regress/parallel_schedule,v 1.4
5 2007/10/13 23:06:27 tgl
Exp $
# $PostgreSQL: pgsql/src/test/regress/parallel_schedule,v 1.4
6 2007/11/24 19:49:23 darcy
Exp $
#
#
# By convention, we put no more than twenty tests in any one parallel group;
# By convention, we put no more than twenty tests in any one parallel group;
# this limits the number of connections needed to run the tests.
# this limits the number of connections needed to run the tests.
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
# ----------
# ----------
# The first group of parallel tests
# The first group of parallel tests
# ----------
# ----------
test: boolean char name varchar text int2 int4 int8 oid float4 float8 bit numeric txid uuid enum
test: boolean char name varchar text int2 int4 int8 oid float4 float8 bit numeric txid uuid enum
money
# Depends on things setup during char, varchar and text
# Depends on things setup during char, varchar and text
test: strings
test: strings
...
...
src/test/regress/sql/money.sql
0 → 100644
View file @
03debe19
--
-- MONEY
--
CREATE
TABLE
money_data
(
m
money
);
INSERT
INTO
money_data
VALUES
(
'123'
);
SELECT
*
FROM
money_data
;
SELECT
m
+
'123'
FROM
money_data
;
SELECT
m
+
'123.45'
FROM
money_data
;
SELECT
m
-
'123.45'
FROM
money_data
;
SELECT
m
*
2
FROM
money_data
;
SELECT
m
/
2
FROM
money_data
;
-- All true
SELECT
m
=
'$123.00'
FROM
money_data
;
SELECT
m
!=
'$124.00'
FROM
money_data
;
SELECT
m
<=
'$123.00'
FROM
money_data
;
SELECT
m
>=
'$123.00'
FROM
money_data
;
SELECT
m
<
'$124.00'
FROM
money_data
;
SELECT
m
>
'$122.00'
FROM
money_data
;
-- All false
SELECT
m
=
'$123.01'
FROM
money_data
;
SELECT
m
!=
'$123.00'
FROM
money_data
;
SELECT
m
<=
'$122.99'
FROM
money_data
;
SELECT
m
>=
'$123.01'
FROM
money_data
;
SELECT
m
>
'$124.00'
FROM
money_data
;
SELECT
m
<
'$122.00'
FROM
money_data
;
SELECT
cashlarger
(
m
,
'$124.00'
)
FROM
money_data
;
SELECT
cashsmaller
(
m
,
'$124.00'
)
FROM
money_data
;
SELECT
cash_words
(
m
)
FROM
money_data
;
SELECT
cash_words
(
m
+
'1.23'
)
FROM
money_data
;
DELETE
FROM
money_data
;
INSERT
INTO
money_data
VALUES
(
'$123.45'
);
SELECT
*
FROM
money_data
;
DELETE
FROM
money_data
;
INSERT
INTO
money_data
VALUES
(
'$123.451'
);
SELECT
*
FROM
money_data
;
DELETE
FROM
money_data
;
INSERT
INTO
money_data
VALUES
(
'$123.454'
);
SELECT
*
FROM
money_data
;
DELETE
FROM
money_data
;
INSERT
INTO
money_data
VALUES
(
'$123.455'
);
SELECT
*
FROM
money_data
;
DELETE
FROM
money_data
;
INSERT
INTO
money_data
VALUES
(
'$123.456'
);
SELECT
*
FROM
money_data
;
DELETE
FROM
money_data
;
INSERT
INTO
money_data
VALUES
(
'$123.459'
);
SELECT
*
FROM
money_data
;
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