diff --git a/jOOQ-test/src/org/jooq/test/_/testcases/ExoticTests.java b/jOOQ-test/src/org/jooq/test/_/testcases/ExoticTests.java index 7515103153..ba37eafd08 100644 --- a/jOOQ-test/src/org/jooq/test/_/testcases/ExoticTests.java +++ b/jOOQ-test/src/org/jooq/test/_/testcases/ExoticTests.java @@ -343,17 +343,46 @@ extends BaseTest paths = create().select( lower(connectByRoot(TDirectory_NAME())), + connectByIsLeaf(), + connectByIsCycle(), substring(sysConnectByPath(lower(TDirectory_NAME()), "/"), 2).as("dir")) .from(TDirectory()) .where(trueCondition()) .and(trueCondition()) - .connectBy(prior(TDirectory_ID()).equal(TDirectory_PARENT_ID())) + .connectByNoCycle(prior(TDirectory_ID()).equal(TDirectory_PARENT_ID())) .startWith(TDirectory_PARENT_ID().isNull()) - .orderBy(2) + .orderBy(4) .fetch(); assertEquals(25, paths.size()); assertEquals(Collections.nCopies(25, "c:"), paths.getValues(0)); + assertEquals(Arrays.asList( + false, // c: + false, // c:/eclipse + true, + true, + true, + true, + true, + true, + false, // c:/eclipse/readme + true, + true, + false, // c:/program files + false, // c:/program files/internet explorer + true, + true, + true, + false, // c:/program files/java + false, // c:/program files/java/jre6 + false, // c:/program files/java/jre6/bin, + true, + true, + true, + false, // c:/program files/java/jre6/lib + true, + true), paths.getValues(1)); + assertEquals(Collections.nCopies(25, false), paths.getValues(2)); assertEquals(Arrays.asList( "c:", "c:/eclipse", @@ -379,6 +408,6 @@ extends BaseTest Field connectByRoot(Field field) { - return field("connect_by_root {0}", nullSafe(field).getDataType(), field); + return field("{connect_by_root} {0}", nullSafe(field).getDataType(), field); } /** @@ -4885,7 +4885,7 @@ public class Factory implements FactoryOperations { */ @Support({ CUBRID, ORACLE }) public static Field sysConnectByPath(Field field, String separator) { - return function("sys_connect_by_path", String.class, field, inline(separator)); + return field("{sys_connect_by_path}({0}, {1})", String.class, field, inline(separator)); } /**