Skip to content

Commit

Permalink
remainder function should be marked STRICT (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
okbob committed Oct 8, 2023
1 parent 8785767 commit 593d33a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions META.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "orafce",
"abstract": "Oracle's compatibility functions and packages",
"description": "This module allows use a well known Oracle's functions and packages inside PostgreSQL",
"version": "4.6.1",
"version": "4.7.0",
"maintainer": [
"Pavel Stehule <pavel.stehule@gmail.com>",
"Takahiro Itagaki <itagaki.takahiro@gmail.com>"
Expand All @@ -25,7 +25,7 @@
"orafce": {
"file": "sql/orafce.sql",
"docfile": "README.orafce",
"version": "4.6.1",
"version": "4.7.0",
"abstract": "Oracle's compatibility functions and packages"
}
},
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ OBJS= regexp.o\

EXTENSION = orafce

DATA = orafce--4.6.sql\
DATA = orafce--4.7.sql\
orafce--3.2--3.3.sql\
orafce--3.3--3.4.sql\
orafce--3.4--3.5.sql\
Expand Down Expand Up @@ -59,8 +59,10 @@ DATA = orafce--4.6.sql\
orafce--4.1--4.2.sql\
orafce--4.2--4.3.sql\
orafce--4.3--4.4.sql\
orafce--4.4--4.5.sql \
orafce--4.5--4.6.sql
orafce--4.4--4.5.sql\
orafce--4.5--4.6.sql\
orafce--4.6--4.7.sql


DOCS = README.asciidoc COPYRIGHT.orafce INSTALL.orafce

Expand Down
2 changes: 0 additions & 2 deletions math.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ orafce_reminder_smallint(PG_FUNCTION_ARGS)
PG_RETURN_INT16(0);

PG_RETURN_INT16(arg1 - ((int16) round(((double) arg1) / ((double) arg2)) * arg2));

PG_RETURN_NULL();
}

/*
Expand Down
4 changes: 4 additions & 0 deletions orafce--4.6--4.7.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER FUNCTION oracle.remainder(smallint, smallint) STRICT;
ALTER FUNCTION oracle.remainder(int, int) STRICT;
ALTER FUNCTION oracle.remainder(bigint, bigint) STRICT;
ALTER FUNCTION oracle.remainder(numeric, numeric) STRICT;
8 changes: 4 additions & 4 deletions orafce--4.6.sql → orafce--4.7.sql
Original file line number Diff line number Diff line change
Expand Up @@ -329,19 +329,19 @@ $$ LANGUAGE sql IMMUTABLE;

CREATE OR REPLACE FUNCTION oracle.remainder(smallint, smallint)
RETURNS smallint AS 'MODULE_PATHNAME','orafce_reminder_smallint'
LANGUAGE C IMMUTABLE;
LANGUAGE C IMMUTABLE STRICT;

CREATE OR REPLACE FUNCTION oracle.remainder(int, int)
RETURNS int AS 'MODULE_PATHNAME','orafce_reminder_int'
LANGUAGE C IMMUTABLE;
LANGUAGE C IMMUTABLE STRICT;

CREATE OR REPLACE FUNCTION oracle.remainder(bigint, bigint)
RETURNS bigint AS 'MODULE_PATHNAME','orafce_reminder_bigint'
LANGUAGE C IMMUTABLE;
LANGUAGE C IMMUTABLE STRICT;

CREATE OR REPLACE FUNCTION oracle.remainder(numeric, numeric)
RETURNS numeric AS 'MODULE_PATHNAME','orafce_reminder_numeric'
LANGUAGE C IMMUTABLE;
LANGUAGE C IMMUTABLE STRICT;

ALTER FUNCTION oracle.mod(smallint, smallint) PARALLEL SAFE;
ALTER FUNCTION oracle.mod(int, int) PARALLEL SAFE;
Expand Down
2 changes: 1 addition & 1 deletion orafce.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# orafce extension
comment = 'Functions and operators that emulate a subset of functions and packages from the Oracle RDBMS'
default_version = '4.6'
default_version = '4.7'
module_pathname = '$libdir/orafce'
relocatable = false

0 comments on commit 593d33a

Please sign in to comment.