Skip to content

Commit 09d27ed

Browse files
zhrt123my-ship-it
authored andcommitted
Merge commit '3ba9d30f86ac8dd729cb71eae8b5ef8fd2c09690' as 'gpcontrib/orafce'
1 parent f981fe1 commit 09d27ed

203 files changed

Lines changed: 61075 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

gpcontrib/orafce/.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
root = true
2+
3+
[*.{c,h,l,y,pl,pm}]
4+
indent_style = tab
5+
indent_size = tab
6+
tab_width = 4
7+
8+
[*.{sgml,xml}]
9+
indent_style = space
10+
indent_size = 1
11+
12+
[*.xsl]
13+
indent_style = space
14+
indent_size = 2

gpcontrib/orafce/.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*.o
2+
*.a
3+
*.so
4+
*.so.*
5+
*.sdf
6+
*.opensdf
7+
*.suo
8+
*.*.user
9+
*.bc
10+
/.deps/
11+
/orafce.sql
12+
/orafce.sql.in
13+
/results
14+
[Oo]bj/
15+
[Bb]in/

gpcontrib/orafce/.travis.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# run the testsuite on travis-ci.org
2+
---
3+
# run once for each of these
4+
env:
5+
- PGVERSION=9.5
6+
- PGVERSION=9.6
7+
- PGVERSION=10
8+
- PGVERSION=11
9+
- PGVERSION=12
10+
- PGVERSION=13
11+
12+
language: C
13+
dist: xenial
14+
arch:
15+
- amd64
16+
- ppc64le
17+
sudo: required
18+
19+
before_install:
20+
- sudo apt-get update -qq
21+
22+
install:
23+
# remove all existing clusters
24+
- sudo rm -rf /etc/postgresql /var/lib/postgresql
25+
# upgrade postgresql-common for new apt.postgresql.org.sh
26+
- sudo apt-get install -y postgresql-common
27+
- sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -p -v $PGVERSION -i
28+
- sudo apt-get install -y bison flex libicu-dev libssl-dev
29+
- sudo -u postgres createuser --superuser $USER
30+
31+
script:
32+
- make
33+
- sudo make install
34+
- make installcheck
35+
- if test -s regression.diffs; then cat regression.diffs; fi

gpcontrib/orafce/COPYRIGHT.orafce

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
0-clause license ("Zero Clause BSD")
2+
3+
Copyright (C) 2008-2023 by Pavel Stehule <pavel.stehule@gmail.com>
4+
5+
Permission to use, copy, modify, and/or distribute this software for any purpose
6+
with or without fee is hereby granted.
7+
8+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13+
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14+
PERFORMANCE OF THIS SOFTWARE.

gpcontrib/orafce/INSTALL.orafce

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Installation
2+
============
3+
4+
This module is normally distributed as a PostgreSQL 'contrib' module. To
5+
install it from a pre-configured source tree run the following commands
6+
as a user with appropriate privileges from the orafce source directory:
7+
8+
export NO_PGXS=1
9+
make
10+
make install
11+
12+
Alternatively, if you have no source tree you can install using PGXS. Simply
13+
run the following commands the adminpack source directory:
14+
15+
make
16+
make install
17+
18+
To install Orafce functions in the database, either run the orafce.sql script
19+
using the pgAdmin SQL tool (and then close and reopen the connection to the
20+
freshly instrumented server), or run the script using psql, eg:
21+
22+
CREATE EXTENSION orafce;
23+
24+
Other administration tools that use this module may have different requirements,
25+
please consult the tool's documentation for further details.
26+
27+
This package requires PostgreSQL 9.5 or later.

gpcontrib/orafce/META.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"name": "orafce",
3+
"abstract": "Oracle's compatibility functions and packages",
4+
"description": "This module allows use a well known Oracle's functions and packages inside PostgreSQL",
5+
"version": "4.9.2",
6+
"maintainer": [
7+
"Pavel Stehule <pavel.stehule@gmail.com>",
8+
"Takahiro Itagaki <itagaki.takahiro@gmail.com>"
9+
],
10+
"license": {
11+
"PostgreSQL": "http://www.postgresql.org/about/licence"
12+
},
13+
"prereqs": {
14+
"runtime": {
15+
"requires": {
16+
"plpgsql": 0,
17+
"PostgreSQL": "11.0.0"
18+
},
19+
"recommends": {
20+
"PostgreSQL": "16.0.0"
21+
}
22+
}
23+
},
24+
"provides": {
25+
"orafce": {
26+
"file": "sql/orafce.sql",
27+
"docfile": "README.orafce",
28+
"version": "4.9.2",
29+
"abstract": "Oracle's compatibility functions and packages"
30+
}
31+
},
32+
"resources": {
33+
"homepage": "http://www.pgsql.cz/index.php/Oracle_functionality_%28en%29",
34+
"repository": {
35+
"url": "https://github.com/orafce/orafce",
36+
"web": "https://github.com/orafce/orafce",
37+
"type": "git"
38+
}
39+
},
40+
"generated_by": "Pavel Stehule",
41+
"meta-spec": {
42+
"version": "1.0.0",
43+
"url": "http://pgxn.org/meta/spec.txt"
44+
},
45+
"release_status": "stable",
46+
"tags": [
47+
"oracle",
48+
"compatibility",
49+
"user function",
50+
"custom function",
51+
"intrerprocess communication",
52+
"read from file",
53+
"write to file",
54+
"bussiness calendar"
55+
]
56+
}

gpcontrib/orafce/Makefile

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
MODULE_big = orafce
2+
OBJS= regexp.o\
3+
parse_keyword.o\
4+
convert.o file.o\
5+
datefce.o\
6+
magic.o\
7+
others.o\
8+
plvstr.o\
9+
plvdate.o\
10+
shmmc.o\
11+
plvsubst.o\
12+
utility.o\
13+
plvlex.o\
14+
alert.o\
15+
pipe.o\
16+
sqlparse.o\
17+
putline.o\
18+
assert.o\
19+
plunit.o\
20+
random.o\
21+
aggregate.o\
22+
orafce.o\
23+
varchar2.o\
24+
nvarchar2.o\
25+
charpad.o\
26+
charlen.o\
27+
replace_empty_string.o\
28+
math.o\
29+
dbms_sql.o
30+
31+
EXTENSION = orafce
32+
33+
DATA = orafce--4.9.sql\
34+
orafce--3.2--3.3.sql\
35+
orafce--3.3--3.4.sql\
36+
orafce--3.4--3.5.sql\
37+
orafce--3.5--3.6.sql\
38+
orafce--3.6--3.7.sql\
39+
orafce--3.7--3.8.sql\
40+
orafce--3.8--3.9.sql\
41+
orafce--3.9--3.10.sql\
42+
orafce--3.10--3.11.sql\
43+
orafce--3.11--3.12.sql\
44+
orafce--3.12--3.13.sql\
45+
orafce--3.13--3.14.sql\
46+
orafce--3.14--3.15.sql\
47+
orafce--3.15--3.16.sql\
48+
orafce--3.16--3.17.sql\
49+
orafce--3.17--3.18.sql\
50+
orafce--3.18--3.19.sql\
51+
orafce--3.19--3.20.sql\
52+
orafce--3.20--3.21.sql\
53+
orafce--3.21--3.22.sql\
54+
orafce--3.22--3.23.sql\
55+
orafce--3.23--3.24.sql\
56+
orafce--3.24--3.25.sql\
57+
orafce--3.25--4.0.sql\
58+
orafce--4.0--4.1.sql\
59+
orafce--4.1--4.2.sql\
60+
orafce--4.2--4.3.sql\
61+
orafce--4.3--4.4.sql\
62+
orafce--4.4--4.5.sql\
63+
orafce--4.5--4.6.sql\
64+
orafce--4.6--4.7.sql\
65+
orafce--4.7--4.8.sql\
66+
orafce--4.8--4.9.sql
67+
68+
69+
DOCS = README.asciidoc COPYRIGHT.orafce INSTALL.orafce
70+
71+
PG_CONFIG ?= pg_config
72+
73+
# make "all" the default target
74+
all:
75+
76+
REGRESS = orafce\
77+
orafce2\
78+
dbms_output\
79+
dbms_utility\
80+
files\
81+
varchar2\
82+
nvarchar2\
83+
aggregates\
84+
nlssort\
85+
dbms_random\
86+
regexp_func\
87+
dbms_sql
88+
89+
#REGRESS_OPTS = --load-language=plpgsql --schedule=parallel_schedule --encoding=utf8
90+
REGRESS_OPTS = --schedule=parallel_schedule --encoding=utf8
91+
92+
# override CFLAGS += -Wextra -Wimplicit-fallthrough=0
93+
94+
ifdef NO_PGXS
95+
subdir = contrib/$(MODULE_big)
96+
top_builddir = ../..
97+
include $(top_builddir)/src/Makefile.global
98+
include $(top_srcdir)/contrib/contrib-global.mk
99+
else
100+
PG_CONFIG = pg_config
101+
PGXS := $(shell $(PG_CONFIG) --pgxs)
102+
include $(PGXS)
103+
endif
104+
105+
ifeq ($(enable_nls), yes)
106+
SHLIB_LINK += $(filter -lintl,$(LIBS))
107+
endif
108+
109+
# remove dependency to libxml2 and libxslt
110+
LIBS := $(filter-out -lxml2, $(LIBS))
111+
LIBS := $(filter-out -lxslt, $(LIBS))
112+
113+
plvlex.o: sqlparse.o
114+
115+
sqlparse.o: $(srcdir)/sqlscan.c
116+
117+
$(srcdir)/sqlparse.h: $(srcdir)/sqlparse.c ;
118+
119+
$(srcdir)/sqlparse.c: sqlparse.y
120+
ifdef BISON
121+
$(BISON) -d $(BISONFLAGS) -o $@ $<
122+
else
123+
ifdef YACC
124+
$(YACC) -d $(YFLAGS) -p cube_yy $<
125+
mv -f y.tab.c sqlparse.c
126+
mv -f y.tab.h sqlparse.h
127+
else
128+
bison -d $(BISONFLAGS) -o $@ $<
129+
endif
130+
endif
131+
132+
$(srcdir)/sqlscan.c: sqlscan.l
133+
ifdef FLEX
134+
$(FLEX) $(FLEXFLAGS) -o'$@' $<
135+
else
136+
flex $(FLEXFLAGS) -o'$@' $<
137+
endif
138+
139+
distprep: $(srcdir)/sqlparse.c $(srcdir)/sqlscan.c
140+
141+
maintainer-clean:
142+
rm -f $(srcdir)/sqlparse.c $(srcdir)/sqlscan.c $(srcdir)/sqlparse.h $(srcdir)/y.tab.c $(srcdir)/y.tab.h

0 commit comments

Comments
 (0)