File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,40 @@ try (
233233
234234 succeeding = true; // become optimistic, will be using &= below
235235
236+ succeeding &= stateMachine(
237+ "check pljava.libjvm_location",
238+ null,
239+
240+ q(c, "SHOW pljava.libjvm_location")
241+ .flatMap(Node::semiFlattenDiagnostics),
242+
243+ // state 1: consume any diagnostics, or to state 2 with same item
244+ (o,p,q) -> {
245+ if ( ! isDiagnostic(o, Set.of("error")) )
246+ return -2;
247+ Node.peek(o);
248+ return 1;
249+ },
250+
251+ (o,p,q) -> { // state 2
252+ if ( ! ( o instanceof ResultSet ) )
253+ return false;
254+ ResultSet rs = (ResultSet)o;
255+ if ( ! rs.next() )
256+ return false;
257+ System.err.println("pljava.libjvm_location: " + rs.getString(1));
258+ if ( rs.next() )
259+ return false;
260+ return 3;
261+ },
262+
263+ // state 3: must be end of input
264+ (o,p,q) -> null == o
265+ );
266+ }
267+
268+ try ( Connection c = n1.connect() )
269+ {
236270 succeeding &= stateMachine(
237271 "create extension no result",
238272 null,
You can’t perform that action at this time.
0 commit comments