Skip to content

Commit ac4bc41

Browse files
committed
Merge REL1_6_STABLE into master
2 parents 5df3520 + 9de9217 commit ac4bc41

File tree

31 files changed

+601
-434
lines changed

31 files changed

+601
-434
lines changed

.github/workflows/ci-runnerpg.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
# does not have a PostgreSQL version in the build matrix. The version that's
44
# preinstalled is the version you get.
55

6-
name: PL/Java CI with PostgreSQL version supplied by the runner
6+
name: CI with runner-supplied PostgreSQL version
7+
8+
permissions:
9+
contents: read
710

811
on:
912
push:
@@ -22,7 +25,7 @@ jobs:
2225
oscc:
2326
- os: ubuntu-latest
2427
cc: gcc
25-
- os: macos-latest
28+
- os: macos-12
2629
cc: clang
2730
# - os: windows-latest
2831
# cc: msvc

pljava-api/src/main/java/org/postgresql/pljava/annotation/Operator.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@
115115
* different, so the two functions can be distinguished by overloading). A
116116
* typical case would be the twin of a cross-type function like {@code add}
117117
* that is commutative, so using the same name makes sense.
118+
*<p>
119+
* When derived by commutation, the synthetic function simply calls the
120+
* base function with the parameters swapped. For negation, the base
121+
* function must return {@code boolean} or {@code Boolean}, and the
122+
* synthetic function returns true for false, false for true, and null
123+
* for null. This will give familiar SQL behavior in many cases. For a base
124+
* function with {@code onNullInput=CALLED}, if it can return non-null
125+
* boolean results on some null inputs, it may be necessary to code
126+
* a negator or commutator by hand if the synthetic one would not have
127+
* the intended semantics.
118128
*/
119129
String[] synthetic() default {};
120130

@@ -129,16 +139,6 @@
129139
* (which must be different) reversed. A typical case would be the twin of a
130140
* cross-type operator like {@code +} that is commutative, so using the same
131141
* name makes sense.
132-
*<p>
133-
* When derived by commutation, the synthetic function simply calls the
134-
* base function with the parameters swapped. For negation, the base
135-
* function must return {@code boolean} or {@code Boolean}, and the
136-
* synthetic function returns true for false, false for true, and null
137-
* for null. This will give familiar SQL behavior in many cases. For a base
138-
* function with {@code onNullInput=CALLED}, if it can return non-null
139-
* boolean results on some null inputs, it may be necessary to code
140-
* a negator or commutator by hand if the synthetic one would not have
141-
* the intended semantics.
142142
*/
143143
String[] commutator() default {};
144144

pljava-api/src/main/java/org/postgresql/pljava/annotation/processing/DDRProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public SourceVersion getSupportedSourceVersion()
173173
* Update latest_tested to be the latest Java release on which this
174174
* annotation processor has been tested without problems.
175175
*/
176-
int latest_tested = 22;
176+
int latest_tested = 23;
177177
int ordinal_9 = SourceVersion.RELEASE_9.ordinal();
178178
int ordinal_latest = latest_tested - 9 + ordinal_9;
179179

pljava-examples/pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@
5858
<arg>--processor-module-path</arg>
5959
<arg>${basedir}/../pljava-api/target/pljava-api-${project.version}.jar</arg>
6060
</compilerArgs>
61+
<annotationProcessors>
62+
<annotationProcessor>
63+
org.postgresql.pljava.annotation.processing.DDRProcessor
64+
</annotationProcessor>
65+
</annotationProcessors>
6166
</configuration>
6267
</plugin>
6368
<plugin>

pljava-packaging/build.xml

+4
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ jos.close();
255255
simple update is possible, just repeat the next entry, with
256256
the from-version changed.
257257
-->
258+
<utf8 dir="target/classes" includes="pljava--.sql"
259+
fullpath=
260+
"pljava/sharedir/pljava/pljava--1.6.8--${project.version}.sql"
261+
/>
258262
<utf8 dir="target/classes" includes="pljava--.sql"
259263
fullpath=
260264
"pljava/sharedir/pljava/pljava--1.6.7--${project.version}.sql"

pljava-packaging/pom.xml

+3
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ function execute()
172172
<goals>
173173
<goal>compile</goal>
174174
</goals>
175+
<configuration>
176+
<proc>none</proc>
177+
</configuration>
175178
</execution>
176179
</executions>
177180
</plugin>

pljava-pgxs/pom.xml

+10
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@
5656

5757
<build>
5858
<plugins>
59+
<plugin>
60+
<groupId>org.apache.maven.plugins</groupId>
61+
<artifactId>maven-compiler-plugin</artifactId>
62+
<configuration>
63+
<proc>none</proc>
64+
</configuration>
65+
</plugin>
66+
5967
<plugin>
6068
<groupId>org.apache.maven.plugins</groupId>
6169
<artifactId>maven-plugin-plugin</artifactId>
@@ -170,6 +178,8 @@ function executeReport(report, locale)
170178
*/
171179
"-locale", locale.toString(),
172180
"-quiet",
181+
"--show-members", "package",
182+
"--show-types", "package",
173183
/*
174184
* Options that are passed to the doclet.
175185
*/

pljava-pgxs/src/main/java/org/postgresql/pljava/pgxs/AbstractPGXS.java

+50-23
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020-2021 Tada AB and other contributors, as listed below.
2+
* Copyright (c) 2020-2024 Tada AB and other contributors, as listed below.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the The BSD 3-Clause License
@@ -21,33 +21,59 @@
2121
import java.util.stream.Collectors;
2222

2323
/**
24-
* Class to act as a blueprint for platform specific build configurations in
25-
* pljava-so/pom.xml
24+
* Class to act as a blueprint for platform-specific build configurations in a
25+
* {@code pom.xml}.
26+
*<p>
27+
* A {@code scripted-goal} configuration in the POM should contain a script
28+
* that somehow selects and supplies a concrete implementation of this abstract
29+
* class.
30+
*<p>
31+
* In {@code pljava-so/pom.xml}, a block of {@code application/javascript} is
32+
* supplied that contains a {@code configuration} array of JS objects, each of
33+
* which has a {@code name} entry, a {@code probe} function returning true on
34+
* some supported platform, and the necessary functions to serve as an
35+
* implementation of this class. The script selects one whose probe succeeds
36+
* and, using JSR 223 magic, makes an instance of this class from it.
37+
*<p>
38+
* The script can make use of convenience methods implemented here, and also
39+
* a number of items (such as a {@code runCommand} function) presupplied in the
40+
* script engine's binding scope by
41+
* {@link PGXSUtils#getScriptEngine PGXSUtils.getScriptEngine} and by
42+
* {@link ScriptingMojo#execute ScriptingMojo.execute}).
2643
*/
2744
public abstract class AbstractPGXS
2845
{
29-
3046
/**
31-
* Add instructions for compiling the pljava-so C files on your platform
32-
* by implementing this method in your configuration block.
47+
* Performs platform-specific compilation of a set of {@code .c} files with
48+
* the specified compiler, target path, includes, defines, and flags.
49+
*<p>
50+
* An implementation should make any needed adjustments to the includes,
51+
* defines, and flags, format everything appropriately for the compiler
52+
* in question, execute it, and return an exit status (zero on success).
3353
*/
34-
public abstract int compile(String compiler, List<String> files, Path targetPath,
35-
List<String> includes, Map<String, String> defines,
36-
List<String> flags);
54+
public abstract int compile(
55+
String compiler, List<String> files, Path targetPath,
56+
List<String> includes, Map<String, String> defines, List<String> flags);
3757

3858
/**
39-
* Add instructions for linking and producing the pljava-so shared library
40-
* artifact on your platform by implementing this method in your
41-
* configuration block.
59+
* Performs platform-specific linking of a set of object files with
60+
* the specified linker and flags, to produce the shared object at the
61+
* specified target path.
62+
*<p>
63+
* An implementation should make any needed adjustments to the flags, format
64+
* everything appropriately for the linker in question, execute it, and
65+
* return an exit status (zero on success).
4266
*/
43-
public abstract int link(String linker, List<String> flags, List<String> files, Path targetPath);
67+
public abstract int link(
68+
String linker, List<String> flags, List<String> files, Path targetPath);
4469

4570
/**
4671
* Returns a list with all items prefixed with correct include flag symbol.
4772
*
4873
* This is the default implementation for formatting the list of includes,
49-
* and prefixes the includes with -I. For compilers like MSVC that require
50-
* different symbols, override this method in your configuration block.
74+
* and prefixes the includes with {@code -I}. For compilers like MSVC that
75+
* require different formatting, the script should supply an overriding
76+
* implementation of this method.
5177
*/
5278
public List<String> formatIncludes(List<String> includesList)
5379
{
@@ -56,12 +82,13 @@ public List<String> formatIncludes(List<String> includesList)
5682
}
5783

5884
/**
59-
* Returns a list with all defines prefixed correctly.
85+
* Returns a list with all defines represented correctly.
6086
*
61-
* This is the default implementation for formatting the list of defines.
62-
* Each item is prefixed with -D. If the define is associated with a value,
63-
* adds equal symbol also followed by the value. If your linker expects a
64-
* different format, override the method in your configuration block.
87+
* This is the default implementation for formatting the map of defines.
88+
* Each item is prefixed with {@code -D}. If the name is mapped to a
89+
* non-null value, an {@code =} is appended, followed by the value. For
90+
* compilers like MSVC that require different formatting, the script should
91+
* supply an overriding implementation of this method.
6592
*/
6693
public List<String> formatDefines(Map<String, String> definesMap)
6794
{
@@ -76,11 +103,11 @@ public List<String> formatDefines(Map<String, String> definesMap)
76103
}
77104

78105
/**
79-
* Returns the input pg_config property as a list of individual flags split
80-
* at whitespace, except when quoted, and the quotes removed.
106+
* Returns the requested {@code pg_config} property as a list of individual
107+
* flags split at whitespace, except when quoted, and the quotes removed.
81108
*<p>
82109
* The assumed quoting convention is single straight quotes around regions
83-
* to be protected, which do not have to be the entire argument. This method
110+
* to be protected, which do not have to be an entire argument. This method
84111
* doesn't handle a value that <em>contains</em> a single quote as content;
85112
* the intended convention for that case doesn't seem to be documented, and
86113
* PostgreSQL's own build breaks in such a case, so there is little need,

0 commit comments

Comments
 (0)