Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit323b96a

Browse files
committed
Register missing money operators in system catalogs
The operators money*int8, int8*money, and money/int8 were implemented incode but not registered in pg_operator or pg_proc.Reviewed-by: Pavel Stehule <pavel.stehule@gmail.com>
1 parent09e3531 commit323b96a

File tree

5 files changed

+31
-1
lines changed

5 files changed

+31
-1
lines changed

‎src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO201701171
56+
#defineCATALOG_VERSION_NO201701172
5757

5858
#endif

‎src/include/catalog/pg_operator.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,10 @@ DATA(insert OID = 908 ( "*" PGNSP PGUID b f f790 701790 916 0 cash_mul_
709709
DESCR("multiply");
710710
DATA(insertOID=909 ("/"PGNSPPGUIDbff79070179000cash_div_flt8-- ));
711711
DESCR("divide");
712+
DATA(insertOID=3346 ("*"PGNSPPGUIDbff7902079033490cash_mul_int8-- ));
713+
DESCR("multiply");
714+
DATA(insertOID=3347 ("/"PGNSPPGUIDbff7902079000cash_div_int8-- ));
715+
DESCR("divide");
712716
DATA(insertOID=912 ("*"PGNSPPGUIDbff790237909170cash_mul_int4-- ));
713717
DESCR("multiply");
714718
DATA(insertOID=913 ("/"PGNSPPGUIDbff7902379000cash_div_int4-- ));
@@ -719,6 +723,8 @@ DATA(insert OID = 915 ( "/" PGNSP PGUID b f f790 21790 0 0 cash_div_
719723
DESCR("divide");
720724
DATA(insertOID=916 ("*"PGNSPPGUIDbff7017907909080flt8_mul_cash-- ));
721725
DESCR("multiply");
726+
DATA(insertOID=3349 ("*"PGNSPPGUIDbff2079079033460int8_mul_cash-- ));
727+
DESCR("multiply");
722728
DATA(insertOID=917 ("*"PGNSPPGUIDbff237907909120int4_mul_cash-- ));
723729
DESCR("multiply");
724730
DATA(insertOID=918 ("*"PGNSPPGUIDbff217907909140int2_mul_cash-- ));

‎src/include/catalog/pg_proc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,8 +957,11 @@ DESCR("name of the current database");
957957
DATA(insert OID = 817 ( current_query PGNSP PGUID 12 1 0 0 0 f f f f f f v r 0 0 25 "" _null_ _null_ _null_ _null__null_ current_query _null_ _null_ _null_ ));
958958
DESCR("get the currently executing query");
959959

960+
DATA(insert OID = 3343 ( int8_mul_cash PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "20 790" _null_ _null_ _null_ _null_ _null_ int8_mul_cash _null_ _null_ _null_ ));
960961
DATA(insert OID = 862 ( int4_mul_cash PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "23 790" _null_ _null_ _null_ _null_ _null_ int4_mul_cash _null_ _null_ _null_ ));
961962
DATA(insert OID = 863 ( int2_mul_cash PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "21 790" _null_ _null_ _null_ _null_ _null_ int2_mul_cash _null_ _null_ _null_ ));
963+
DATA(insert OID = 3344 ( cash_mul_int8 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "790 20" _null_ _null_ _null_ _null_ _null_ cash_mul_int8 _null_ _null_ _null_ ));
964+
DATA(insert OID = 3345 ( cash_div_int8 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "790 20" _null_ _null_ _null_ _null_ _null_ cash_div_int8 _null_ _null_ _null_ ));
962965
DATA(insert OID = 864 ( cash_mul_int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "790 23" _null_ _null_ _null_ _null_ _null_ cash_mul_int4 _null_ _null_ _null_ ));
963966
DATA(insert OID = 865 ( cash_div_int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "790 23" _null_ _null_ _null_ _null_ _null_ cash_div_int4 _null_ _null_ _null_ ));
964967
DATA(insert OID = 866 ( cash_mul_int2 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "790 21" _null_ _null_ _null_ _null_ _null_ cash_mul_int2 _null_ _null_ _null_ ));

‎src/test/regress/expected/money.out

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@ SELECT m / 2::int2 FROM money_data;
6969
$61.50
7070
(1 row)
7171

72+
SELECT m * 2::int8 FROM money_data;
73+
?column?
74+
----------
75+
$246.00
76+
(1 row)
77+
78+
SELECT 2::int8 * m FROM money_data;
79+
?column?
80+
----------
81+
$246.00
82+
(1 row)
83+
84+
SELECT m / 2::int8 FROM money_data;
85+
?column?
86+
----------
87+
$61.50
88+
(1 row)
89+
7290
SELECT m * 2::float8 FROM money_data;
7391
?column?
7492
----------

‎src/test/regress/sql/money.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ SELECT m / 2 FROM money_data;
1616
SELECT m*2::int2FROM money_data;
1717
SELECT2::int2* mFROM money_data;
1818
SELECT m/2::int2FROM money_data;
19+
SELECT m*2::int8FROM money_data;
20+
SELECT2::int8* mFROM money_data;
21+
SELECT m/2::int8FROM money_data;
1922
SELECT m*2::float8FROM money_data;
2023
SELECT2::float8* mFROM money_data;
2124
SELECT m/2::float8FROM money_data;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp