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

Commitb5c4b77

Browse files
Jan WieckJan Wieck
Jan Wieck
authored and
Jan Wieck
committed
Added nbtree operator class for NUMERIC
Jan
1 parenta6528e0 commitb5c4b77

File tree

6 files changed

+50
-6
lines changed

6 files changed

+50
-6
lines changed

‎src/backend/utils/adt/numeric.c

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
*1998 Jan Wieck
77
*
8-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.19 1999/07/17 20:17:58 momjian Exp $
8+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.20 1999/09/29 21:13:25 wieck Exp $
99
*
1010
* ----------
1111
*/
@@ -690,6 +690,34 @@ numeric_floor(Numeric num)
690690
*/
691691

692692

693+
int32
694+
numeric_cmp(Numericnum1,Numericnum2)
695+
{
696+
intresult;
697+
NumericVararg1;
698+
NumericVararg2;
699+
700+
if (num1==NULL||num2==NULL)
701+
return (int32)0;
702+
703+
if (NUMERIC_IS_NAN(num1)||NUMERIC_IS_NAN(num2))
704+
return (int32)0;
705+
706+
init_var(&arg1);
707+
init_var(&arg2);
708+
709+
set_var_from_num(num1,&arg1);
710+
set_var_from_num(num2,&arg2);
711+
712+
result=cmp_var(&arg1,&arg2);
713+
714+
free_var(&arg1);
715+
free_var(&arg2);
716+
717+
return (int32)((result==0) ?0 : ((result<0) ?-1 :1));
718+
}
719+
720+
693721
bool
694722
numeric_eq(Numericnum1,Numericnum2)
695723
{

‎src/include/catalog/pg_amop.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: pg_amop.h,v 1.23 1999/04/03 18:07:47 tgl Exp $
10+
* $Id: pg_amop.h,v 1.24 1999/09/29 21:13:30 wieck Exp $
1111
*
1212
* NOTES
1313
* the genbki.sh script reads this file and generates .bki
@@ -338,6 +338,16 @@ DATA(insert OID = 0 ( 403 652 820 3 btreesel btreenpage ));
338338
DATA(insertOID=0 (4036528254btreeselbtreenpage ));
339339
DATA(insertOID=0 (4036528245btreeselbtreenpage ));
340340

341+
/*
342+
*nbtree numeric
343+
*/
344+
345+
DATA(insertOID=0 (403176817541btreeselbtreenpage ));
346+
DATA(insertOID=0 (403176817552btreeselbtreenpage ));
347+
DATA(insertOID=0 (403176817523btreeselbtreenpage ));
348+
DATA(insertOID=0 (403176817574btreeselbtreenpage ));
349+
DATA(insertOID=0 (403176817565btreeselbtreenpage ));
350+
341351
/*
342352
*hash table _ops
343353
*/

‎src/include/catalog/pg_amproc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
* Copyright (c) 1994, Regents of the University of California
1111
*
12-
* $Id: pg_amproc.h,v 1.14 1999/03/26 07:32:41 tgl Exp $
12+
* $Id: pg_amproc.h,v 1.15 1999/09/29 21:13:30 wieck Exp $
1313
*
1414
* NOTES
1515
* the genbki.sh script reads this file and generates .bki
@@ -96,6 +96,7 @@ DATA(insert OID = 0 (403 1312 1314 1));
9696
DATA(insertOID=0 (403131313151));
9797
DATA(insertOID=0 (4038108361));
9898
DATA(insertOID=0 (4039359261));
99+
DATA(insertOID=0 (403176817691));
99100

100101

101102
/* hash */

‎src/include/catalog/pg_opclass.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: pg_opclass.h,v 1.19 1999/05/25 16:13:45 momjian Exp $
10+
* $Id: pg_opclass.h,v 1.20 1999/09/29 21:13:30 wieck Exp $
1111
*
1212
* NOTES
1313
* the genbki.sh script reads this file and generates .bki
@@ -115,5 +115,7 @@ DATA(insert OID = 935 (network_ops 869));
115115
DESCR("");
116116
DATA(insertOID=652 (network_ops650));
117117
DESCR("");
118+
DATA(insertOID=1768 (numeric_ops1700));
119+
DESCR("");
118120

119121
#endif/* PG_OPCLASS_H */

‎src/include/catalog/pg_proc.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: pg_proc.h,v 1.102 1999/09/26 02:28:38 tgl Exp $
9+
* $Id: pg_proc.h,v 1.103 1999/09/29 21:13:30 wieck Exp $
1010
*
1111
* NOTES
1212
* The script catalog/genbki.sh reads this file and generates .bki
@@ -2306,6 +2306,8 @@ DATA(insert OID = 1766 ( numeric_smallerPGUID 11 f t t 2 f 1700 "1700 1700" 10
23062306
DESCR("smaller of two numbers");
23072307
DATA(insertOID=1767 (numeric_largerPGUID11ftt2f1700"1700 1700"10000100numeric_larger- ));
23082308
DESCR("larger of two numbers");
2309+
DATA(insertOID=1769 (numeric_cmpPGUID11ftt2f23"1700 1700"10000100numeric_cmp- ));
2310+
DESCR("compare two numbers");
23092311

23102312

23112313
/*

‎src/include/utils/builtins.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: builtins.h,v 1.85 1999/08/01 04:54:20 tgl Exp $
9+
* $Id: builtins.h,v 1.86 1999/09/29 21:13:31 wieck Exp $
1010
*
1111
* NOTES
1212
* This should normally only be included by fmgr.h.
@@ -572,6 +572,7 @@ Numericnumeric_round(Numeric num, int32 scale);
572572
Numericnumeric_trunc(Numericnum,int32scale);
573573
Numericnumeric_ceil(Numericnum);
574574
Numericnumeric_floor(Numericnum);
575+
int32numeric_cmp(Numericnum1,Numericnum2);
575576
boolnumeric_eq(Numericnum1,Numericnum2);
576577
boolnumeric_ne(Numericnum1,Numericnum2);
577578
boolnumeric_gt(Numericnum1,Numericnum2);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp