Renamed [com] to [pro]
This commit is contained in:
parent
87e4b5fdd0
commit
15d01bc6f1
@ -19,13 +19,13 @@
|
||||
<url>http://www.jooq.org/inc/LICENSE.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
<!-- [com] -->
|
||||
<!-- [pro] -->
|
||||
<license>
|
||||
<name>jOOQ License and Maintenance Agreement</name>
|
||||
<url>http://www.jooq.org/eula</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
<!-- [/com] -->
|
||||
<!-- [/pro] -->
|
||||
</licenses>
|
||||
|
||||
<properties>
|
||||
|
||||
@ -20,13 +20,13 @@
|
||||
<url>http://www.jooq.org/inc/LICENSE.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
<!-- [com] -->
|
||||
<!-- [pro] -->
|
||||
<license>
|
||||
<name>jOOQ License and Maintenance Agreement</name>
|
||||
<url>http://www.jooq.org/eula</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
<!-- [/com] -->
|
||||
<!-- [/pro] -->
|
||||
</licenses>
|
||||
|
||||
<profiles>
|
||||
|
||||
@ -20,13 +20,13 @@
|
||||
<url>http://www.jooq.org/inc/LICENSE.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
<!-- [com] -->
|
||||
<!-- [pro] -->
|
||||
<license>
|
||||
<name>jOOQ License and Maintenance Agreement</name>
|
||||
<url>http://www.jooq.org/eula</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
<!-- [/com] -->
|
||||
<!-- [/pro] -->
|
||||
</licenses>
|
||||
|
||||
<profiles>
|
||||
|
||||
@ -19,13 +19,13 @@
|
||||
<url>http://www.jooq.org/inc/LICENSE.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
<!-- [com] -->
|
||||
<!-- [pro] -->
|
||||
<license>
|
||||
<name>jOOQ License and Maintenance Agreement</name>
|
||||
<url>http://www.jooq.org/eula</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
<!-- [/com] -->
|
||||
<!-- [/pro] -->
|
||||
</licenses>
|
||||
|
||||
<build>
|
||||
|
||||
@ -242,14 +242,14 @@ public abstract class AbstractDatabase implements Database {
|
||||
}
|
||||
else {
|
||||
for (Schema schema : configuredSchemata) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
|
||||
// [#1418] Oracle has case-insensitive schema names.
|
||||
if (this instanceof OracleDatabase) {
|
||||
inputSchemata.add(schema.getInputSchema().toUpperCase());
|
||||
}
|
||||
else
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
{
|
||||
inputSchemata.add(schema.getInputSchema());
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ public class DefaultDataTypeDefinition implements DataTypeDefinition {
|
||||
|
||||
@Override
|
||||
public final boolean isGenericNumberType() {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
switch (getDialect().family()) {
|
||||
case ORACLE: {
|
||||
return (OracleDataType.NUMBER.getTypeName().equalsIgnoreCase(typeName)
|
||||
@ -162,7 +162,7 @@ public class DefaultDataTypeDefinition implements DataTypeDefinition {
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
*/
|
||||
package org.jooq.examples;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
|
||||
import static org.jooq.examples.sqlserver.adventureworks.humanresources.Tables.Department;
|
||||
import static org.jooq.examples.sqlserver.adventureworks.humanresources.Tables.Employee;
|
||||
@ -79,4 +79,4 @@ public class AdventureWorks {
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
@ -40,7 +40,7 @@
|
||||
*/
|
||||
package org.jooq.examples;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
|
||||
import static org.jooq.impl.DSL.table;
|
||||
|
||||
@ -80,4 +80,4 @@ public class DBMS_XPLAN {
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
package org.jooq.test;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
|
||||
import static org.jooq.test.ase.generatedclasses.Tables.T_BOOK_TO_BOOK_STORE;
|
||||
import static org.jooq.test.ase.generatedclasses.Tables.T_BOOLEANS;
|
||||
@ -783,4 +783,4 @@ public class ASETest extends jOOQAbstractTest<
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
package org.jooq.test;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
|
||||
import static org.jooq.test.db2.generatedclasses.Tables.T_BOOK_TO_BOOK_STORE;
|
||||
import static org.jooq.test.db2.generatedclasses.Tables.T_BOOLEANS;
|
||||
@ -773,4 +773,4 @@ public class DB2Test extends jOOQAbstractTest<
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
package org.jooq.test;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
|
||||
import static org.jooq.test.ingres.generatedclasses.Tables.T_BOOK_TO_BOOK_STORE;
|
||||
import static org.jooq.test.ingres.generatedclasses.Tables.T_BOOLEANS;
|
||||
@ -793,4 +793,4 @@ public class IngresTest extends jOOQAbstractTest<
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
package org.jooq.test;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
import static java.util.Collections.emptyList;
|
||||
@ -1439,4 +1439,4 @@ public class OracleTest extends jOOQAbstractTest<
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
package org.jooq.test;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.SQLDialect;
|
||||
@ -60,4 +60,4 @@ public class OracleTest11g extends OracleTest {
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
package org.jooq.test;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.SQLDialect;
|
||||
@ -64,4 +64,4 @@ public class OracleTestInline extends OracleTest {
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
package org.jooq.test;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.SQLDialect;
|
||||
@ -59,4 +59,4 @@ public class SQLServer2008Test extends SQLServerTest {
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
package org.jooq.test;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static org.jooq.test.sqlserver.generatedclasses.Tables.T_639_NUMBERS_TABLE;
|
||||
@ -780,4 +780,4 @@ public class SQLServerTest extends jOOQAbstractTest<
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
package org.jooq.test;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.SQLDialect;
|
||||
@ -63,4 +63,4 @@ public class SQLServerTestInline extends SQLServerTest {
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
package org.jooq.test;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
|
||||
import static org.jooq.test.sybase.generatedclasses.Tables.T_639_NUMBERS_TABLE;
|
||||
import static org.jooq.test.sybase.generatedclasses.Tables.T_725_LOB_TEST;
|
||||
@ -781,4 +781,4 @@ public class SybaseTest extends jOOQAbstractTest<
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
@ -163,12 +163,12 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
// Use AVG instead, as in this example the values of MEDIAN and AVG
|
||||
// are the same
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
case DB2:
|
||||
case SQLSERVER:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
|
||||
case CUBRID:
|
||||
case DERBY:
|
||||
@ -267,7 +267,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertEquals(0.25, result2.get(1).getValue(3, Double.class));
|
||||
|
||||
// DB2 only knows STDDEV_POP / VAR_POP
|
||||
if (true/* [com] */ && dialect() != SQLDialect.DB2/* [/com] */) {
|
||||
if (true/* [pro] */ && dialect() != SQLDialect.DB2/* [/pro] */) {
|
||||
assertEquals("0.707", result2.get(0).getValue(2, String.class).substring(0, 5));
|
||||
assertEquals(0.5, result2.get(0).getValue(4, Double.class));
|
||||
assertEquals("0.707", result2.get(1).getValue(2, String.class).substring(0, 5));
|
||||
@ -330,11 +330,11 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testLinearRegressionFunctions() throws Exception {
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
case SQLSERVER:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
@ -365,13 +365,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
List<String> values = Arrays.asList("1.5", "2.5", "4.0", "-0.5", "0.8", "2.0", "1.0", "2.0", "5.0");
|
||||
assertEquals(values, Arrays.asList(roundStrings(1, record.into(String[].class))));
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
switch (dialect()) {
|
||||
case DB2:
|
||||
log.info("SKIPPING", "Skipping linear regression window function tests");
|
||||
return;
|
||||
}
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
|
||||
// [#600] As window functions
|
||||
Result<Record9<BigDecimal, BigDecimal, BigDecimal, BigDecimal, BigDecimal, BigDecimal, BigDecimal, BigDecimal, BigDecimal>> result =
|
||||
@ -398,10 +398,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testWindowFunctions() throws Exception {
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case FIREBIRD:
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
@ -536,9 +536,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertEquals(Integer.valueOf(1), result.getValue(3, column));
|
||||
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
log.info("SKIPPING", "PERCENT_RANK() and CUME_DIST() window function tests");
|
||||
break;
|
||||
@ -645,7 +645,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertEquals(0.25, result.get(0).getValue(7, Double.class));
|
||||
|
||||
// DB2 only knows STDDEV_POP / VAR_POP
|
||||
if (true/* [com] */ && dialect() != SQLDialect.DB2/* [/com] */) {
|
||||
if (true/* [pro] */ && dialect() != SQLDialect.DB2/* [/pro] */) {
|
||||
assertEquals("1.290", result.get(0).getValue(2, String.class).substring(0, 5));
|
||||
assertEquals("1.666", result.get(0).getValue(4, String.class).substring(0, 5));
|
||||
assertEquals("0.707", result.get(0).getValue(6, String.class).substring(0, 5));
|
||||
@ -653,12 +653,12 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
}
|
||||
|
||||
// NTILE()
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (asList(DB2, SYBASE).contains(dialect())) {
|
||||
log.info("SKIPPING", "NTILE tests");
|
||||
}
|
||||
else
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
{
|
||||
result =
|
||||
create().select(TBook_ID(),
|
||||
@ -739,9 +739,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
}
|
||||
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case SQLSERVER:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case POSTGRES:
|
||||
log.info("SKIPPING", "FIRST_VALUE(... IGNORE NULLS) window function test");
|
||||
@ -774,12 +774,12 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
}
|
||||
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case SYBASE:
|
||||
log.info("SKIPPING", "LEAD/LAG tests");
|
||||
break;
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
default: {
|
||||
column = 0;
|
||||
|
||||
@ -920,11 +920,11 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testListAgg() throws Exception {
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
case SQLSERVER:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case SQLITE:
|
||||
log.info("SKIPPING", "LISTAGG tests");
|
||||
@ -959,10 +959,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertEquals("4, 3", result1.getValue(1, "books2"));
|
||||
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case H2:
|
||||
case HSQLDB:
|
||||
|
||||
@ -199,9 +199,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testAliasingDelete() throws Exception {
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case SQLSERVER:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case SQLITE:
|
||||
log.info("SKIPPING", "Aliasing DELETE tests");
|
||||
return;
|
||||
|
||||
@ -406,12 +406,12 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertEquals("1985", book1.getValue(TBook_TITLE()));
|
||||
assertEquals("1985", book2.getValue(TBook_TITLE()));
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// No ON DELETE CASCADE constraints for Sybase ASE
|
||||
if (dialect() == SQLDialect.ASE) {
|
||||
create().truncate(table("t_book_to_book_store")).execute();
|
||||
}
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
|
||||
// Delete the modified record
|
||||
assertEquals(1, book1.delete());
|
||||
@ -572,7 +572,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertEquals(null, create().fetchOne(TBookStore(), TBookStore_NAME().equal("Amazon")));
|
||||
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Sybase ASE and SQL server do not allow for explicitly setting
|
||||
// values on IDENTITY columns
|
||||
case ASE:
|
||||
@ -580,7 +580,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
log.info("SKIPPING", "Storing previously deleted UpdatableRecords");
|
||||
break;
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
default:
|
||||
store.store();
|
||||
assertEquals("Amazon", store.getValue(TBookStore_NAME()));
|
||||
@ -688,12 +688,12 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
public void testStoreWithOptimisticLock() throws Exception {
|
||||
jOOQAbstractTest.reset = false;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// No ON DELETE CASCADE constraints for Sybase ASE
|
||||
if (dialect() == SQLDialect.ASE) {
|
||||
create().truncate(table("t_book_to_book_store")).execute();
|
||||
}
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
|
||||
testStoreWithOptimisticLock0(TBook(), TBook_ID(), TBook_TITLE());
|
||||
|
||||
|
||||
@ -189,7 +189,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
switch (dialect().family()) {
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// In ASE, there don't seem to be any empty byte[]
|
||||
case ASE:
|
||||
assertEquals(1, record.getValue(T725_LOB()).length);
|
||||
@ -198,7 +198,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// These don't make a difference between an empty byte[] and null
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case SQLITE:
|
||||
assertNull(record.getValue(T725_LOB()));
|
||||
break;
|
||||
@ -226,14 +226,14 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
record.refresh();
|
||||
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
assertEquals(1, record.getValue(T725_LOB()).length);
|
||||
assertEquals(0, record.getValue(T725_LOB())[0]);
|
||||
break;
|
||||
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case SQLITE:
|
||||
assertNull(record.getValue(T725_LOB()));
|
||||
break;
|
||||
@ -256,14 +256,14 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertNull(result.getValue(1, 1));
|
||||
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
assertEquals(1, result.getValue(2, T725_LOB()).length);
|
||||
assertEquals(0, result.getValue(2, T725_LOB())[0]);
|
||||
break;
|
||||
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case SQLITE:
|
||||
assertNull(result.getValue(2, T725_LOB()));
|
||||
break;
|
||||
@ -424,7 +424,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testCastingToDialectDataType() throws Exception {
|
||||
for (DataType<?> type : getCastableDataTypes()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (dialect() == SQLDialect.ASE ||
|
||||
dialect() == SQLDialect.DB2 ||
|
||||
dialect() == SQLDialect.SYBASE) {
|
||||
@ -434,7 +434,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
assertEquals(null, create().select(val(null, type).cast(type)).fetchOne(0));
|
||||
}
|
||||
}
|
||||
@ -474,7 +474,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
SQLDataType.VARBINARY,
|
||||
SQLDataType.VARCHAR)) {
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (dialect().family() == SQLDialect.ORACLE) {
|
||||
if (type.getType() == byte[].class ||
|
||||
type == SQLDataType.CLOB ||
|
||||
@ -495,7 +495,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
assertEquals(null, create().select(val(null, type).cast(type)).fetchOne(0));
|
||||
}
|
||||
}
|
||||
@ -505,7 +505,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
if (dialect() != SQLDialect.HSQLDB) {
|
||||
assertEquals(true, create().select(cast(1, Boolean.class)).fetchOne(0));
|
||||
|
||||
if (true/* [com] */ && dialect() != SQLDialect.INGRES/* [/com] */) {
|
||||
if (true/* [pro] */ && dialect() != SQLDialect.INGRES/* [/pro] */) {
|
||||
assertEquals(true, create().select(cast("1", Boolean.class)).fetchOne(0));
|
||||
}
|
||||
}
|
||||
@ -513,7 +513,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertEquals(BigInteger.ONE, create().select(cast("1", BigInteger.class)).fetchOne(0));
|
||||
assertEquals(BigInteger.ONE, create().select(cast(1, BigInteger.class)).fetchOne(0));
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Sybase applies the wrong scale when casting. Force scale before comparing (Sybase returns 1.0000 when we expect 1)
|
||||
if (dialect() == SQLDialect.SYBASE) {
|
||||
BigDecimal result = (BigDecimal)create().select(cast("1", BigDecimal.class)).fetchOne(0);
|
||||
@ -524,7 +524,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
result = result.setScale(0);
|
||||
assertEquals(BigDecimal.ONE, result);
|
||||
} else
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
{
|
||||
assertEquals(0, BigDecimal.ONE.compareTo((BigDecimal) create().select(cast("1", BigDecimal.class)).fetchOne(0)));
|
||||
assertEquals(0, BigDecimal.ONE.compareTo((BigDecimal) create().select(cast(1, BigDecimal.class)).fetchOne(0)));
|
||||
@ -548,7 +548,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertEquals("1", create().select(cast(1, String.class)).fetchOne(0));
|
||||
|
||||
// Sybase ASE does not know null bits
|
||||
if (true/* [com] */ && dialect() != SQLDialect.ASE/* [/com] */) {
|
||||
if (true/* [pro] */ && dialect() != SQLDialect.ASE/* [/pro] */) {
|
||||
assertEquals(null, create().select(castNull(Boolean.class)).fetchOne(0));
|
||||
}
|
||||
|
||||
@ -1378,13 +1378,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// Interval tests
|
||||
// --------------
|
||||
if (/* [com] */
|
||||
if (/* [pro] */
|
||||
dialect() == ASE ||
|
||||
dialect() == DB2 ||
|
||||
dialect() == INGRES || // [#1285] TODO: Fix this for Ingres
|
||||
dialect().family() == SQLSERVER ||
|
||||
dialect() == SYBASE ||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
dialect() == CUBRID ||
|
||||
dialect() == DERBY ||
|
||||
dialect() == FIREBIRD ||
|
||||
@ -1444,14 +1444,14 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testDateTimeArithmetic() throws Exception {
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// [#1285] TODO: Fix this for INGRES
|
||||
if (dialect() == INGRES) {
|
||||
log.info("SKIPPING", "Date time arithmetic tests");
|
||||
return;
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// [#1009] SQL DATE doesn't have a time zone. SQL TIMESTAMP does
|
||||
long tsShift = -3600000;
|
||||
|
||||
|
||||
@ -114,12 +114,12 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testTableWithHint() throws Exception {
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
@ -151,13 +151,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testPivotClause() throws Exception {
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
@ -285,13 +285,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testAliasingPivot() throws Exception {
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
@ -405,13 +405,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testConnectBySimple() throws Exception {
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
case H2:
|
||||
@ -467,13 +467,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testConnectByDirectory() throws Exception {
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
case H2:
|
||||
|
||||
@ -419,10 +419,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testFetchMany() throws Exception {
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case SQLITE:
|
||||
log.info("SKIPPING", "Fetch Many tests");
|
||||
return;
|
||||
@ -439,14 +439,14 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
@Test
|
||||
public void testFetchWithoutResults() throws Exception {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
switch (dialect()) {
|
||||
case ASE:
|
||||
log.info("SKIPPING", "Fetch without results tests");
|
||||
return;
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
Result<Record> result =
|
||||
create().fetch(
|
||||
create().update(TAuthor())
|
||||
@ -473,10 +473,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
public void testFetchIntoWithAnnotations() throws Exception {
|
||||
// TODO [#791] Fix test data and have all upper case columns everywhere
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case POSTGRES:
|
||||
log.info("SKIPPING", "fetchInto() tests");
|
||||
@ -653,10 +653,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
public void testFetchIntoWithoutAnnotations() throws Exception {
|
||||
// TODO [#791] Fix test data and have all upper case columns everywhere
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case POSTGRES:
|
||||
log.info("SKIPPING", "fetchInto() tests");
|
||||
@ -741,10 +741,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// TODO [#791] Fix test data and have all upper case columns everywhere
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case POSTGRES:
|
||||
log.info("SKIPPING", "fetchInto() tests");
|
||||
@ -785,10 +785,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// TODO [#791] Fix test data and have all upper case columns everywhere
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case POSTGRES:
|
||||
log.info("SKIPPING", "fetchInto() tests");
|
||||
@ -852,10 +852,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// TODO [#791] Fix test data and have all upper case columns everywhere
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case POSTGRES:
|
||||
log.info("SKIPPING", "testRecordFromUpdatePK() tests");
|
||||
@ -950,10 +950,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// TODO [#791] Fix test data and have all upper case columns everywhere
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case POSTGRES:
|
||||
log.info("SKIPPING", "fetchInto() tests");
|
||||
@ -1015,10 +1015,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// TODO [#791] Fix test data and have all upper case columns everywhere
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case POSTGRES:
|
||||
log.info("SKIPPING", "fetchInto() tests");
|
||||
@ -1117,10 +1117,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// TODO [#791] Fix test data and have all upper case columns everywhere
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case POSTGRES:
|
||||
log.info("SKIPPING", "fetchInto() tests");
|
||||
@ -1310,10 +1310,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// TODO [#791] Fix test data and have all upper case columns everywhere
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case POSTGRES:
|
||||
log.info("SKIPPING", "fetchInto() tests");
|
||||
@ -2174,13 +2174,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertEquals(r2.get(0).getValue(TBook_TITLE()), r2.get(1).getValue(TBook_TITLE()));
|
||||
assertEquals(r3.get(0).getValue(TBook_TITLE()), r3.get(1).getValue(TBook_TITLE()));
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Some JDBC drivers already perform string interning...
|
||||
if (dialect().family() == ORACLE) {
|
||||
Assert.assertNotSame(r1.get(0).getValue(TBook_TITLE()), r1.get(1).getValue(TBook_TITLE()));
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
Assert.assertSame(r2.get(0).getValue(TBook_TITLE()), r2.get(1).getValue(TBook_TITLE()));
|
||||
Assert.assertSame(r3.get(0).getValue(TBook_TITLE()), r3.get(1).getValue(TBook_TITLE()));
|
||||
|
||||
|
||||
@ -232,7 +232,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertEquals("2", create().select(nvl("2", "1")).fetchOne(0));
|
||||
|
||||
// TODO [#831] Fix this for Sybase ASE
|
||||
if (true/* [com] */ && dialect() != SQLDialect.ASE/* [/com] */) {
|
||||
if (true/* [pro] */ && dialect() != SQLDialect.ASE/* [/pro] */) {
|
||||
assertTrue(("" + create()
|
||||
.select(nvl(TBook_CONTENT_TEXT(), "abc"))
|
||||
.from(TBook())
|
||||
@ -253,7 +253,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertEquals("2", create().select(nvl2(val("2"), "2", "1")).fetchOne(0));
|
||||
|
||||
// TODO [#831] Fix this for Sybase ASE
|
||||
if (true/* [com] */ && dialect() != SQLDialect.ASE/* [/com] */) {
|
||||
if (true/* [pro] */ && dialect() != SQLDialect.ASE/* [/pro] */) {
|
||||
assertEquals("abc", create()
|
||||
.select(nvl2(TBook_CONTENT_TEXT(), "abc", "xyz"))
|
||||
.from(TBook())
|
||||
@ -350,12 +350,12 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
boolean noSubselects = false;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Ingres does not allow sub selects in CASE expressions
|
||||
if (dialect() == INGRES)
|
||||
noSubselects = true;
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
Field<?> case2 = noSubselects
|
||||
? decode()
|
||||
.value(TBook_AUTHOR_ID())
|
||||
@ -584,9 +584,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// ASCII
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case INGRES: // TODO [#864]
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case SQLITE: // TODO [#862]
|
||||
log.info("SKIPPING", "ASCII function test");
|
||||
@ -613,13 +613,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// MD5
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
@ -630,9 +630,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
log.info("SKIPPING", "MD5 function test");
|
||||
break;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
default:
|
||||
@ -646,7 +646,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// Some databases are limited or buggy
|
||||
boolean sqlite = (dialect() == SQLITE);
|
||||
boolean ingres = false/* [com] */ || (dialect() == INGRES)/* [/com] */;
|
||||
boolean ingres = false/* [pro] */ || (dialect() == INGRES)/* [/pro] */;
|
||||
|
||||
// The random function
|
||||
BigDecimal rand = create().select(rand()).fetchOne(rand());
|
||||
@ -1031,9 +1031,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testBitwiseOperations() throws Exception {
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
log.info("SKIPPING", "Tests for bitwise operations");
|
||||
return;
|
||||
@ -1041,13 +1041,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
Field<Integer> bitCount = bitCount(3);
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// TODO [#896] This somehow doesn't work on some dialects
|
||||
if (asList(ASE, DB2, SQLSERVER).contains(dialect().family())) {
|
||||
bitCount = val(2);
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
Record result =
|
||||
create().select(
|
||||
bitCount,
|
||||
|
||||
@ -150,14 +150,14 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
case HSQLDB:
|
||||
case DERBY:
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Ingres has smoe weird issue, claiming that NEXT VALUE was not
|
||||
// requested before CURRENT VALUE
|
||||
case INGRES:
|
||||
log.info("SKIPPING", "Sequence CURRVAL tests");
|
||||
break;
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
default:
|
||||
currval = sequence.currval();
|
||||
assertEquals("5", "" + create().select(currval).fetchOne(currval));
|
||||
|
||||
@ -186,10 +186,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testGroupByCubeRollup() throws Exception {
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
case H2:
|
||||
@ -231,10 +231,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
// ROLLUP clause
|
||||
// -------------
|
||||
Field<Integer> groupingId = groupingId(TBook_ID(), TBook_AUTHOR_ID());
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (asList(DB2, SYBASE).contains(dialect()))
|
||||
groupingId = one();
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
|
||||
Result<Record4<Integer, Integer, Integer, Integer>> result2 = create()
|
||||
.select(
|
||||
@ -255,9 +255,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertEquals(Arrays.asList(null, null, 1, null, 1, null, 2, null, 2), result2.getValues(1));
|
||||
assertEquals(Arrays.asList(1, 0, 0, 0, 0, 0, 0, 0, 0), result2.getValues(2));
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (!asList(DB2, SYBASE).contains(dialect()))
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
assertEquals(Arrays.asList(3, 1, 0, 1, 0, 1, 0, 1, 0), result2.getValues(3));
|
||||
|
||||
// CUBE clause
|
||||
@ -280,9 +280,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertEquals(Arrays.asList(null, 1, 2, null, 1, null, 1, null, 2, null, 2), result3.getValues(1));
|
||||
assertEquals(Arrays.asList(1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0), result3.getValues(2));
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (!asList(DB2, SYBASE).contains(dialect()))
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
assertEquals(Arrays.asList(3, 2, 2, 1, 0, 1, 0, 1, 0, 1, 0), result3.getValues(3));
|
||||
|
||||
// GROUPING SETS clause
|
||||
@ -307,9 +307,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertEquals(Arrays.asList(null, null, 1, 2, 2, 1, 1, 2, 2), result4.getValues(1));
|
||||
assertEquals(Arrays.asList(1, 1, 1, 1, 1, 0, 0, 0, 0), result4.getValues(2));
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (!asList(DB2, SYBASE).contains(dialect()))
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
assertEquals(Arrays.asList(3, 3, 2, 2, 2, 0, 0, 0, 0), result4.getValues(3));
|
||||
}
|
||||
|
||||
|
||||
@ -159,8 +159,8 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
int firstId = create().select(max(id)).from(table).fetchOne(max(id));
|
||||
|
||||
if (dialect() != POSTGRES/* [com] */ &&
|
||||
dialect() != DB2/* [/com] */) {
|
||||
if (dialect() != POSTGRES/* [pro] */ &&
|
||||
dialect() != DB2/* [/pro] */) {
|
||||
|
||||
assertEquals(new BigInteger("" + firstId), create().lastID());
|
||||
}
|
||||
@ -178,8 +178,8 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
.returning()
|
||||
.fetchOne();
|
||||
|
||||
if (dialect() != POSTGRES/* [com] */ &&
|
||||
dialect() != DB2/* [/com] */) {
|
||||
if (dialect() != POSTGRES/* [pro] */ &&
|
||||
dialect() != DB2/* [/pro] */) {
|
||||
|
||||
assertEquals(new BigInteger("" + (firstId + 1)), create().lastID());
|
||||
assertEquals(new BigInteger("" + (firstId + 1)), create().lastID());
|
||||
@ -195,12 +195,12 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
// TODO [#1004] Make this work for SQL Server also
|
||||
// TODO ... and then, think about Ingres, H2 and Derby as well
|
||||
if (dialect() == CUBRID ||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
dialect() == ASE ||
|
||||
dialect() == SYBASE ||
|
||||
dialect().family() == SQLSERVER ||
|
||||
dialect() == INGRES ||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
dialect() == H2 ||
|
||||
dialect() == DERBY) {
|
||||
|
||||
@ -374,9 +374,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
Field<?> nullField = null;
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case POSTGRES:
|
||||
// TODO: cast this to the UDT type
|
||||
nullField = cast(null, TAuthor_ADDRESS());
|
||||
@ -425,11 +425,11 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
Field<Integer> ID4;
|
||||
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Sybase ASE doesn't allow for selecting data inside VALUES()
|
||||
case ASE:
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// MySQL doesn't allow for selecting from the INSERT INTO table
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
@ -639,13 +639,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertNull(returned.getValue(TTriggers_COUNTER()));
|
||||
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// TODO [#1260] This should work eventually, when CUBRID fixes this
|
||||
// JDBC bug
|
||||
case CUBRID:
|
||||
@ -747,14 +747,14 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testUpdateReturning() throws Exception {
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case DERBY:
|
||||
case H2:
|
||||
@ -805,10 +805,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testInsertOnDuplicateKeyUpdate() throws Exception {
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case H2:
|
||||
case POSTGRES:
|
||||
@ -845,10 +845,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testInsertOnDuplicateKeyIgnore() throws Exception {
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case H2:
|
||||
case POSTGRES:
|
||||
@ -884,10 +884,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testMerge() throws Exception {
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case H2:
|
||||
case MARIADB:
|
||||
@ -1007,13 +1007,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testMergeWithOracleSyntaxExtension() throws Exception {
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
case H2:
|
||||
@ -1104,10 +1104,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testMergeWithH2SyntaxExtension() throws Exception {
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
@ -1237,11 +1237,11 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testUpdateJoin() throws Exception {
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
case ORACLE:
|
||||
case SQLSERVER:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
case H2:
|
||||
|
||||
@ -308,10 +308,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testNaturalJoin() throws Exception {
|
||||
boolean unqualified = false;
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (dialect().family() == SQLDialect.ORACLE)
|
||||
unqualified = true;
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
|
||||
Result<Record2<String, String>> result =
|
||||
create().select(TAuthor_LAST_NAME(), TBook_TITLE())
|
||||
@ -355,10 +355,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testJoinUsing() throws Exception {
|
||||
boolean unqualified = false;
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (dialect().family() == SQLDialect.ORACLE)
|
||||
unqualified = true;
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
|
||||
Result<Record2<String, String>> result =
|
||||
create().select(TAuthor_LAST_NAME(), TBook_TITLE())
|
||||
@ -627,9 +627,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
// --------------------
|
||||
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case DERBY:
|
||||
case H2:
|
||||
|
||||
@ -224,10 +224,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
|
||||
boolean oracle = false;
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (dialect().family() == ORACLE)
|
||||
oracle = true;
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
|
||||
assertEquals(2, (int) create().select(count)
|
||||
.from(TAuthor())
|
||||
@ -277,10 +277,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
// Update duplicate records
|
||||
// ------------------------
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case H2:
|
||||
case POSTGRES:
|
||||
|
||||
@ -116,8 +116,8 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
sequences++;
|
||||
|
||||
// DB2 has an additional sequence for the T_TRIGGERS table
|
||||
if (/* [com] */dialect().family() == DB2 ||
|
||||
/* [/com] */dialect().family() == H2) {
|
||||
if (/* [pro] */dialect().family() == DB2 ||
|
||||
/* [/pro] */dialect().family() == H2) {
|
||||
|
||||
sequences++;
|
||||
}
|
||||
@ -127,12 +127,12 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
sequences += 3;
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Oracle has additional sequences for [#961]
|
||||
else if (dialect().family() == ORACLE) {
|
||||
sequences += 5;
|
||||
}
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
}
|
||||
|
||||
assertEquals(sequences, schema.getSequences().size());
|
||||
@ -181,13 +181,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
if (cUAddressType() == null) {
|
||||
assertEquals(0, schema.getUDTs().size());
|
||||
}
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// [#643] The U_INVALID types are only available in Oracle
|
||||
// [#799] The member procedure UDT's too
|
||||
else if (dialect().family() == ORACLE) {
|
||||
assertEquals(7, schema.getUDTs().size());
|
||||
}
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
else {
|
||||
assertEquals(3, schema.getUDTs().size());
|
||||
}
|
||||
@ -339,10 +339,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// [#745] TODO: Unify distinction between NUMERIC and DECIMAL
|
||||
else if ("BIG_DECIMAL".equalsIgnoreCase(field.getName())
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
&& dialect().family() != SQLDialect.ORACLE
|
||||
&& dialect().family() != SQLDialect.SQLSERVER
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
&& dialect().family() != SQLDialect.POSTGRES
|
||||
&& dialect().family() != SQLDialect.SQLITE) {
|
||||
|
||||
@ -368,9 +368,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
&& dialect() != SQLDialect.HSQLDB
|
||||
&& dialect() != SQLDialect.MARIADB
|
||||
&& dialect() != SQLDialect.MYSQL
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
&& dialect() != SQLDialect.SYBASE
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
) {
|
||||
assertEquals(Float.class, field.getType());
|
||||
assertEquals(SQLDataType.REAL, field.getDataType());
|
||||
@ -379,9 +379,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
else if ("FLOAT".equalsIgnoreCase(field.getName())
|
||||
&& dialect() != SQLDialect.MARIADB
|
||||
&& dialect() != SQLDialect.MYSQL
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
&& dialect() != SQLDialect.SYBASE
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
) {
|
||||
assertEquals(Double.class, field.getType());
|
||||
assertEquals(SQLDataType.DOUBLE, field.getDataType());
|
||||
@ -395,10 +395,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// [#746] TODO: Fix this, too
|
||||
else if ("DOUBLE".equalsIgnoreCase(field.getName())
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
&& dialect().family() != SQLDialect.SQLSERVER
|
||||
&& dialect() != SQLDialect.ASE
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
) {
|
||||
|
||||
assertEquals(Double.class, field.getType());
|
||||
|
||||
@ -105,7 +105,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
@Test
|
||||
public void testOrderByInSubquery() throws Exception {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// TODO: [#780] Fix this for Ingres and Sybase ASE
|
||||
switch (dialect()) {
|
||||
case ASE:
|
||||
@ -114,7 +114,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
return;
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// Some RDBMS don't accept ORDER BY clauses in subqueries without
|
||||
// TOP clause (e.g. SQL Server). jOOQ will synthetically add a
|
||||
// TOP 100 PERCENT clause, if necessary
|
||||
@ -288,13 +288,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
create().select().from(TBook()).limit(i).fetch().size());
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (dialect() == SQLDialect.ASE) {
|
||||
log.info("SKIPPING", "LIMIT .. OFFSET tests");
|
||||
return;
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
for (int i = 1; i < 6; i++) {
|
||||
assertEquals(Math.min(i, 3),
|
||||
create().selectFrom(TBook()).limit(1, i).fetch().size());
|
||||
@ -318,13 +318,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
@Test
|
||||
public void testLimitAliased() throws Exception {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (asList(ASE, SQLSERVER).contains(dialect().family())) {
|
||||
log.info("SKIPPING", "LIMIT .. OFFSET tests");
|
||||
return;
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// [#2080] Some databases generate ORDER BY clauses within their ranking
|
||||
// functions. There are some syntax problems, when selectable columns
|
||||
// have aliases
|
||||
@ -386,13 +386,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
@Test
|
||||
public void testLimitNamedParams() throws Exception {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (asList(ASE, INGRES).contains(dialect())) {
|
||||
log.info("SKIPPING", "Parameterised LIMIT .. OFFSET tests");
|
||||
return;
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// Some dialects don't support LIMIT 0 / TOP 0
|
||||
for (int i = 1; i < 6; i++) {
|
||||
Select<?> s1 = create().selectFrom(TBook()).limit(param("limit", i));
|
||||
@ -456,7 +456,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
@Test
|
||||
public void testLimitNested() throws Exception {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// TODO [#780] This is not supported in Ingres
|
||||
if (dialect() == SQLDialect.INGRES ||
|
||||
dialect() == SQLDialect.ASE) {
|
||||
@ -465,7 +465,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
return;
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
Table<B> nested = table(create()
|
||||
.selectFrom(TBook())
|
||||
.orderBy(TBook_ID().desc())
|
||||
|
||||
@ -157,7 +157,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// The below code throws an exception on Ingres when run once. When run
|
||||
// twice, the DB crashes... This seems to be a driver / database bug
|
||||
if (true/* [com] */ && dialect() != SQLDialect.INGRES/* [/com] */) {
|
||||
if (true/* [pro] */ && dialect() != SQLDialect.INGRES/* [/pro] */) {
|
||||
assertEquals(0, create().select().where(val(false).isTrue()).fetch().size());
|
||||
assertEquals(1, create().select().where(val(false).isFalse()).fetch().size());
|
||||
assertEquals(1, create().select().where(val(true).isTrue()).fetch().size());
|
||||
@ -184,13 +184,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
Field<String> notLike = TBook_PUBLISHED_IN().cast(String.class);
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// DB2 doesn't support this syntax
|
||||
if (dialect() == DB2) {
|
||||
notLike = val("bbb");
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
Result<B> books =
|
||||
create().selectFrom(TBook())
|
||||
.where(TBook_TITLE().like("%a%"))
|
||||
@ -322,12 +322,12 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testLikeRegex() throws Exception {
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case SQLSERVER:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
case SQLITE:
|
||||
@ -465,7 +465,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
.fetch(TBook_ID()));
|
||||
|
||||
// [#1073] Some dialects incorrectly handle NULL in NOT IN predicates
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (asList(ASE).contains(dialect())) {
|
||||
assertEquals(
|
||||
asList(2, 3, 4),
|
||||
@ -476,7 +476,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
.fetch(TBook_ID()));
|
||||
}
|
||||
else
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
{
|
||||
assertEquals(
|
||||
asList(),
|
||||
@ -523,9 +523,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// = { ALL | ANY | SOME }
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case INGRES: // Ingres supports these syntaxes but has internal errors...
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case SQLITE:
|
||||
log.info("SKIPPING", "= { ALL | ANY | SOME } tests");
|
||||
break;
|
||||
|
||||
@ -154,9 +154,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testResultSetConcurrency() throws Exception {
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case MARIADB:
|
||||
case SQLITE:
|
||||
log.info("SKIPPING", "ResultSet concurrency tests");
|
||||
|
||||
@ -180,7 +180,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// TODO: [#459] Sybase messes up IN/OUT parameter orders.
|
||||
// Check back on this, when this is fixed.
|
||||
if (true/* [com] */ && dialect() != SQLDialect.SYBASE/* [/com] */) {
|
||||
if (true/* [pro] */ && dialect() != SQLDialect.SYBASE/* [/pro] */) {
|
||||
Object p391b = invoke(cRoutines(), "p391", create().configuration(), null, 2, DUMMY_OUT_INT, DUMMY_OUT_INT, 3, null);
|
||||
assertEquals(null, invoke(p391b, "getIo1"));
|
||||
assertEquals("2", "" + invoke(p391b, "getO1"));
|
||||
@ -197,7 +197,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// F378, which is a stored function with OUT parameters
|
||||
// ---------------------------------------------------------------------
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
switch (dialect().family()) {
|
||||
|
||||
// Currently, this is only supported for oracle
|
||||
@ -233,7 +233,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertEquals("3", "" + invoke(result3b, "getReturnValue"));
|
||||
break;
|
||||
}
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -1215,9 +1215,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testStoredProceduresWithCursorParameters() throws Exception {
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case H2:
|
||||
case HSQLDB:
|
||||
case POSTGRES:
|
||||
|
||||
@ -404,12 +404,12 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
|
||||
// SQL standard (DATE, INTERVAL) OVERLAPS (DATE, INTERVAL) predicate
|
||||
// -----------------------------------------------------------------
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (asList(INGRES).contains(dialect())) {
|
||||
log.info("SKIPPING", "Ingres INTERVAL OVERLAPS tests");
|
||||
}
|
||||
else
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
{
|
||||
assertEquals(1, (int)
|
||||
create().selectOne()
|
||||
|
||||
@ -169,14 +169,14 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
// Schema mapping is supported in many RDBMS. But maintaining several
|
||||
// databases is non-trivial in some of them.
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case DERBY:
|
||||
case H2:
|
||||
|
||||
@ -455,13 +455,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
// Check again with limit / offset clauses
|
||||
// ---------------------------------------
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
log.info("SKIPPING", "LIMIT .. OFFSET .. FOR UPDATE");
|
||||
break;
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
default: {
|
||||
Result<Record1<Integer>> result3 = create()
|
||||
.select(TAuthor_ID())
|
||||
@ -481,12 +481,12 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
}
|
||||
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
case HSQLDB:
|
||||
@ -496,9 +496,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
log.info("SKIPPING", "FOR UPDATE .. WAIT/NOWAIT tests");
|
||||
break;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case POSTGRES:
|
||||
default: {
|
||||
Result<Record1<Integer>> r1a = create()
|
||||
@ -509,7 +509,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
.fetch();
|
||||
assertEquals(2, r1a.size());
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (dialect().family() == ORACLE) {
|
||||
Result<Record1<Integer>> r2a = create()
|
||||
.select(TAuthor_ID())
|
||||
@ -545,7 +545,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
.fetch();
|
||||
assertEquals(2, r3b.size());
|
||||
}
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
}
|
||||
}
|
||||
|
||||
@ -585,9 +585,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
}
|
||||
|
||||
switch (dialect()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE: // This should normally work. Why doesn't it?
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
log.info("SKIPPING", "FOR UPDATE OF tests");
|
||||
|
||||
@ -111,14 +111,14 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testTruncateCascade() throws Exception {
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
@ -152,14 +152,14 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
@Test
|
||||
public void testTruncateRestartIdentity() throws Exception {
|
||||
switch (dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
|
||||
@ -247,7 +247,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
.where(TBook_TITLE().eq("changed"))
|
||||
));
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (dialect().family() == ORACLE) {
|
||||
|
||||
// Cannot insert books for author_id = 2
|
||||
@ -296,7 +296,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
expected.getMessage().toUpperCase().contains("ORA-01402"));
|
||||
}
|
||||
}
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@ -518,13 +518,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
if (context.renderContext() == null)
|
||||
return;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Add Oracle CHECK OPTIONs to INSERT statements, if applicable
|
||||
if (context.configuration().dialect().family() == ORACLE) {
|
||||
patchCheckOption(context, TBook(), TBook_AUTHOR_ID(), 1);
|
||||
patchCheckOption(context, TAuthor(), TAuthor_ID(), 1);
|
||||
}
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -551,7 +551,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
}
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
private <E> void patchCheckOption(
|
||||
final VisitContext context,
|
||||
final Table<?> table,
|
||||
@ -586,7 +586,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
private <E> void pushConditions(VisitContext context, Table<?> table, Field<E> field, E... values) {
|
||||
|
||||
// Check if we're visiting the given table
|
||||
|
||||
@ -386,13 +386,13 @@ public abstract class jOOQAbstractTest<
|
||||
}
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// There are no IF EXISTS clauses in Sybase ASE
|
||||
else if (e.getMessage().contains("doesn't exist") && getDialect() == SQLDialect.ASE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// There is no IF EXISTS clause in CUBRID's DROP VIEW statement
|
||||
else if (getDialect() == CUBRID && sql.trim().startsWith("DROP")) {
|
||||
continue;
|
||||
|
||||
@ -20,13 +20,13 @@
|
||||
<url>http://www.jooq.org/inc/LICENSE.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
<!-- [com] -->
|
||||
<!-- [pro] -->
|
||||
<license>
|
||||
<name>jOOQ License and Maintenance Agreement</name>
|
||||
<url>http://www.jooq.org/eula</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
<!-- [/com] -->
|
||||
<!-- [/pro] -->
|
||||
</licenses>
|
||||
|
||||
<build>
|
||||
|
||||
@ -118,7 +118,7 @@ public enum SQLDialect {
|
||||
// SQL dialects for commercial usage
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
|
||||
// /**
|
||||
// * The MS Access SQL dialect family. ACCESS support will be added in jOOQ 3.3
|
||||
@ -180,7 +180,7 @@ public enum SQLDialect {
|
||||
*/
|
||||
SYBASE("Sybase", true),
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
|
||||
;
|
||||
|
||||
|
||||
@ -245,14 +245,14 @@ abstract class AbstractResultQuery<R extends Record> extends AbstractQuery imple
|
||||
|
||||
// JTDS doesn't seem to implement PreparedStatement.execute()
|
||||
// correctly, at least not for sp_help
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (ctx.configuration().dialect() == ASE) {
|
||||
ctx.resultSet(ctx.statement().executeQuery());
|
||||
}
|
||||
|
||||
// [#1232] Avoid executeQuery() in order to handle queries that may
|
||||
// not return a ResultSet, e.g. SQLite's pragma foreign_key_list(table)
|
||||
else /* [/com] */if (ctx.statement().execute()) {
|
||||
else /* [/pro] */if (ctx.statement().execute()) {
|
||||
ctx.resultSet(ctx.statement().getResultSet());
|
||||
}
|
||||
|
||||
|
||||
@ -244,12 +244,12 @@ public abstract class AbstractRoutine<T> extends AbstractQueryPart implements Ro
|
||||
}
|
||||
|
||||
case H2:
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
|
||||
// Sybase CallableStatement.wasNull() doesn't work :-(
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
return executeSelect();
|
||||
|
||||
// [#773] If JDBC escape syntax is available for functions, use
|
||||
@ -400,7 +400,7 @@ public abstract class AbstractRoutine<T> extends AbstractQueryPart implements Ro
|
||||
|
||||
private final void toSQLEnd(RenderContext context) {
|
||||
switch (context.configuration().dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE:
|
||||
context.sql(";")
|
||||
.formatIndentEnd()
|
||||
@ -408,7 +408,7 @@ public abstract class AbstractRoutine<T> extends AbstractQueryPart implements Ro
|
||||
.keyword("end;");
|
||||
break;
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
default:
|
||||
context.sql(" }");
|
||||
break;
|
||||
@ -417,14 +417,14 @@ public abstract class AbstractRoutine<T> extends AbstractQueryPart implements Ro
|
||||
|
||||
private final void toSQLBegin(RenderContext context) {
|
||||
switch (context.configuration().dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE:
|
||||
context.keyword("begin")
|
||||
.formatIndentStart()
|
||||
.formatSeparator();
|
||||
break;
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
default:
|
||||
context.sql("{ ");
|
||||
break;
|
||||
@ -433,12 +433,12 @@ public abstract class AbstractRoutine<T> extends AbstractQueryPart implements Ro
|
||||
|
||||
private final void toSQLAssign(RenderContext context) {
|
||||
switch (context.configuration().dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE:
|
||||
context.sql("? := ");
|
||||
break;
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
default:
|
||||
context.sql("? = ");
|
||||
break;
|
||||
@ -447,11 +447,11 @@ public abstract class AbstractRoutine<T> extends AbstractQueryPart implements Ro
|
||||
|
||||
private final void toSQLCall(RenderContext context) {
|
||||
switch (context.configuration().dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE:
|
||||
break;
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
default:
|
||||
context.sql("call ");
|
||||
break;
|
||||
@ -461,7 +461,7 @@ public abstract class AbstractRoutine<T> extends AbstractQueryPart implements Ro
|
||||
}
|
||||
|
||||
private final void toSQLOutParam(RenderContext context, Parameter<?> parameter) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
switch (context.configuration().dialect().family()) {
|
||||
case ORACLE:
|
||||
context.visit(parameter);
|
||||
@ -469,12 +469,12 @@ public abstract class AbstractRoutine<T> extends AbstractQueryPart implements Ro
|
||||
break;
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
context.sql("?");
|
||||
}
|
||||
|
||||
private final void toSQLInParam(RenderContext context, Parameter<?> parameter, Field<?> value) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
switch (context.configuration().dialect().family()) {
|
||||
case ORACLE:
|
||||
context.visit(parameter);
|
||||
@ -482,7 +482,7 @@ public abstract class AbstractRoutine<T> extends AbstractQueryPart implements Ro
|
||||
break;
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
context.visit(value);
|
||||
}
|
||||
|
||||
@ -495,14 +495,14 @@ public abstract class AbstractRoutine<T> extends AbstractQueryPart implements Ro
|
||||
context.sql(".");
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// [#2569] In SQL Server, routines always have to be fully qualified
|
||||
else if (getSchema() != null && context.configuration().dialect().family() == SQLSERVER) {
|
||||
context.visit(getSchema());
|
||||
context.sql(".");
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
if (getPackage() != null) {
|
||||
context.visit(getPackage());
|
||||
context.sql(".");
|
||||
@ -536,7 +536,7 @@ public abstract class AbstractRoutine<T> extends AbstractQueryPart implements Ro
|
||||
int sqlType = parameter.getDataType().getDataType(c).getSQLType();
|
||||
|
||||
switch (c.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
|
||||
// For some user defined types Oracle needs to bind
|
||||
// also the type name
|
||||
@ -563,7 +563,7 @@ public abstract class AbstractRoutine<T> extends AbstractQueryPart implements Ro
|
||||
break;
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
default: {
|
||||
statement.registerOutParameter(index, sqlType);
|
||||
break;
|
||||
|
||||
@ -188,7 +188,7 @@ abstract class AbstractStoreQuery<R extends Record> extends AbstractQuery implem
|
||||
protected final void prepare(ExecuteContext ctx) throws SQLException {
|
||||
Connection connection = ctx.connection();
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Just in case, always set Sybase ASE statement mode to return
|
||||
// Generated keys if client code wants to SELECT @@identity afterwards
|
||||
if (ctx.configuration().dialect() == SQLDialect.ASE) {
|
||||
@ -197,7 +197,7 @@ abstract class AbstractStoreQuery<R extends Record> extends AbstractQuery implem
|
||||
}
|
||||
|
||||
// Normal statement preparing if no values should be returned
|
||||
else /* [/com] */if (returning.isEmpty()) {
|
||||
else /* [/pro] */if (returning.isEmpty()) {
|
||||
super.prepare(ctx);
|
||||
return;
|
||||
}
|
||||
@ -213,9 +213,9 @@ abstract class AbstractStoreQuery<R extends Record> extends AbstractQuery implem
|
||||
case SQLITE:
|
||||
// Sybase will select @@identity after the INSERT
|
||||
case CUBRID:
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
|
||||
super.prepare(ctx);
|
||||
return;
|
||||
@ -223,11 +223,11 @@ abstract class AbstractStoreQuery<R extends Record> extends AbstractQuery implem
|
||||
// Some dialects can only return AUTO_INCREMENT values
|
||||
// Other values have to be fetched in a second step
|
||||
// [#1260] TODO CUBRID supports this, but there's a JDBC bug
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
case SQLSERVER:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case H2:
|
||||
case MARIADB:
|
||||
@ -236,10 +236,10 @@ abstract class AbstractStoreQuery<R extends Record> extends AbstractQuery implem
|
||||
return;
|
||||
|
||||
// The default is to return all requested fields directly
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case HSQLDB:
|
||||
default: {
|
||||
List<String> names = new ArrayList<String>();
|
||||
@ -286,9 +286,9 @@ abstract class AbstractStoreQuery<R extends Record> extends AbstractQuery implem
|
||||
// TODO [#832] Fix this. This might be a driver issue. JDBC
|
||||
// Generated keys don't work with jconn3, but they seem to work
|
||||
// with jTDS (which is used for Sybase ASE integration)
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID: {
|
||||
listener.executeStart(ctx);
|
||||
result = ctx.statement().executeUpdate();
|
||||
@ -302,11 +302,11 @@ abstract class AbstractStoreQuery<R extends Record> extends AbstractQuery implem
|
||||
// Some dialects can only retrieve "identity" (AUTO_INCREMENT) values
|
||||
// Additional values have to be fetched explicitly
|
||||
// [#1260] TODO CUBRID supports this, but there's a JDBC bug
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
case SQLSERVER:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case H2:
|
||||
case MARIADB:
|
||||
@ -350,10 +350,10 @@ abstract class AbstractStoreQuery<R extends Record> extends AbstractQuery implem
|
||||
}
|
||||
|
||||
// These dialects have full JDBC support
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case HSQLDB:
|
||||
default: {
|
||||
listener.executeStart(ctx);
|
||||
|
||||
@ -180,7 +180,7 @@ class ArrayTable extends AbstractTable<Record> {
|
||||
|
||||
private final Table<Record> table(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE: {
|
||||
if (array.getDataType().getType().isArray()) {
|
||||
return simulate().as(alias);
|
||||
@ -190,7 +190,7 @@ class ArrayTable extends AbstractTable<Record> {
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case H2: {
|
||||
return new H2ArrayTable().as(alias);
|
||||
}
|
||||
@ -256,7 +256,7 @@ class ArrayTable extends AbstractTable<Record> {
|
||||
}
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
private class OracleArrayTable extends DialectArrayTable {
|
||||
|
||||
/**
|
||||
@ -270,7 +270,7 @@ class ArrayTable extends AbstractTable<Record> {
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
private abstract class DialectArrayTable extends AbstractTable<Record> {
|
||||
|
||||
/**
|
||||
|
||||
@ -70,9 +70,9 @@ class Ascii extends AbstractFunction<Integer> {
|
||||
return function("ascii_val", SQLDataType.INTEGER, string);
|
||||
|
||||
// TODO [#862] [#864] simulate this for some dialects
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case SQLITE:
|
||||
|
||||
|
||||
@ -71,10 +71,10 @@ class Ceil<T extends Number> extends AbstractFunction<T> {
|
||||
case SQLITE:
|
||||
return DSL.round(argument.add(0.499999999999999));
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case SQLSERVER:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case H2:
|
||||
return function("ceiling", getDataType(), argument);
|
||||
|
||||
|
||||
@ -80,14 +80,14 @@ enum CombineOperator {
|
||||
}
|
||||
|
||||
public String toSQL(SQLDialect dialect) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (this == EXCEPT) {
|
||||
if (dialect.family() == SQLDialect.ORACLE) {
|
||||
return "minus";
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,10 +125,10 @@ class CompareCondition extends AbstractCondition {
|
||||
// characters long
|
||||
boolean castRhs = false;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (dialect == DB2 && rhs instanceof Concat)
|
||||
castRhs = true;
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
|
||||
context.keyword(op.toSQL()).sql(" ");
|
||||
if (castRhs) context.keyword("cast").sql("(");
|
||||
|
||||
@ -83,11 +83,11 @@ class Concat extends AbstractFunction<String> {
|
||||
case MYSQL:
|
||||
return function("concat", SQLDataType.VARCHAR, cast);
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case SQLSERVER:
|
||||
return new Expression<String>(ADD, first, others);
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
default:
|
||||
return new Expression<String>(CONCAT, first, others);
|
||||
}
|
||||
|
||||
@ -69,12 +69,12 @@ class ConditionAsField extends AbstractFunction<Boolean> {
|
||||
|
||||
// Some databases don't accept predicates where column expressions
|
||||
// are expected.
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
case ORACLE:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case FIREBIRD:
|
||||
return DSL.decode().when(condition, inline(true)).otherwise(inline(false));
|
||||
@ -88,11 +88,11 @@ class ConditionAsField extends AbstractFunction<Boolean> {
|
||||
case POSTGRES:
|
||||
case SQLITE:
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Unknown (to be evaluated):
|
||||
case ASE:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
return condition;
|
||||
}
|
||||
|
||||
|
||||
@ -70,12 +70,12 @@ class Cosh extends AbstractFunction<BigDecimal> {
|
||||
@Override
|
||||
final Field<BigDecimal> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case HSQLDB:
|
||||
case MARIADB:
|
||||
|
||||
@ -68,12 +68,12 @@ class Cot extends AbstractFunction<BigDecimal> {
|
||||
@Override
|
||||
final Field<BigDecimal> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
return DSL.cos(argument).div(DSL.sin(argument));
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
default:
|
||||
return function("cot", SQLDataType.NUMERIC, argument);
|
||||
}
|
||||
|
||||
@ -65,13 +65,13 @@ class CurrentDate extends AbstractFunction<Date> {
|
||||
@Override
|
||||
final Field<Date> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE:
|
||||
return field("sysdate", SQLDataType.DATE);
|
||||
|
||||
case DB2:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
case HSQLDB:
|
||||
@ -79,13 +79,13 @@ class CurrentDate extends AbstractFunction<Date> {
|
||||
case SQLITE:
|
||||
return field("current_date", SQLDataType.DATE);
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case SQLSERVER:
|
||||
return field("convert(date, current_timestamp)", SQLDataType.DATE);
|
||||
|
||||
case SYBASE:
|
||||
return field("current date", SQLDataType.DATE);
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
}
|
||||
|
||||
return function("current_date", SQLDataType.DATE);
|
||||
|
||||
@ -65,13 +65,13 @@ class CurrentTime extends AbstractFunction<Time> {
|
||||
@Override
|
||||
final Field<Time> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE:
|
||||
return field("sysdate", SQLDataType.TIME);
|
||||
|
||||
case DB2:
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
case HSQLDB:
|
||||
@ -79,13 +79,13 @@ class CurrentTime extends AbstractFunction<Time> {
|
||||
case SQLITE:
|
||||
return field("current_time", SQLDataType.TIME);
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case SQLSERVER:
|
||||
return field("convert(time, current_timestamp)", SQLDataType.TIME);
|
||||
|
||||
case SYBASE:
|
||||
return field("current time", SQLDataType.TIME);
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
}
|
||||
|
||||
return function("current_time", SQLDataType.TIME);
|
||||
|
||||
@ -65,7 +65,7 @@ class CurrentTimestamp extends AbstractFunction<Timestamp> {
|
||||
@Override
|
||||
final Field<Timestamp> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
return function("current_bigdatetime", SQLDataType.TIMESTAMP);
|
||||
|
||||
@ -78,7 +78,7 @@ class CurrentTimestamp extends AbstractFunction<Timestamp> {
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case SQLSERVER:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
case HSQLDB:
|
||||
|
||||
@ -63,7 +63,7 @@ class CurrentUser extends AbstractFunction<String> {
|
||||
@Override
|
||||
final Field<String> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case ORACLE:
|
||||
return field("user", SQLDataType.VARCHAR);
|
||||
@ -72,7 +72,7 @@ class CurrentUser extends AbstractFunction<String> {
|
||||
case INGRES:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
case HSQLDB:
|
||||
|
||||
@ -88,14 +88,14 @@ class DateDiff extends AbstractFunction<Integer> {
|
||||
case SQLITE:
|
||||
return field("({strftime}('%s', {0}) - {strftime}('%s', {1})) / 86400", getDataType(), date1, date2);
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case POSTGRES:
|
||||
return field("{0} - {1}", getDataType(), date1, date2);
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
@ -107,7 +107,7 @@ class DateDiff extends AbstractFunction<Integer> {
|
||||
|
||||
// Fall through to default
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
}
|
||||
|
||||
// Default implementation for equals() and hashCode()
|
||||
|
||||
@ -75,13 +75,13 @@ class Decode<T, Z> extends AbstractFunction<Z> {
|
||||
final Field<Z> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Oracle actually has this function
|
||||
case ORACLE: {
|
||||
return function("decode", getDataType(), getArguments());
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// Other dialects simulate it with a CASE ... WHEN expression
|
||||
default: {
|
||||
CaseConditionStep<Z> when = DSL
|
||||
|
||||
@ -153,7 +153,7 @@ class DefaultBindContext extends AbstractBindContext {
|
||||
stmt.setNull(nextIndex(), sqlType);
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// [#725] For SQL Server, unknown types should be set to null
|
||||
// explicitly, too
|
||||
else if (configuration.dialect().family() == SQLSERVER) {
|
||||
@ -165,7 +165,7 @@ class DefaultBindContext extends AbstractBindContext {
|
||||
stmt.setNull(nextIndex(), Types.VARCHAR);
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// [#729] In the absence of the correct JDBC type, try setObject
|
||||
else {
|
||||
stmt.setObject(nextIndex(), null);
|
||||
@ -288,13 +288,13 @@ class DefaultBindContext extends AbstractBindContext {
|
||||
break;
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Other SQL dialects deal with UUIDs as if they were CHAR(36)
|
||||
// even if they explicitly support them (UNIQUEIDENTIFIER)
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// Most databases don't have such a type. In this case, jOOQ
|
||||
// simulates the type
|
||||
default: {
|
||||
|
||||
@ -1456,7 +1456,7 @@ public class DefaultDSLContext implements DSLContext, Serializable {
|
||||
return select(field).fetchOne(field);
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case INGRES: {
|
||||
Field<BigInteger> field = field("last_identity()", BigInteger.class);
|
||||
return select(field).fetchOne(field);
|
||||
@ -1469,7 +1469,7 @@ public class DefaultDSLContext implements DSLContext, Serializable {
|
||||
return select(field).fetchOne(field);
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
default:
|
||||
throw new SQLDialectNotSupportedException("identity functionality not supported by " + configuration.dialect());
|
||||
}
|
||||
|
||||
@ -496,9 +496,9 @@ public class DefaultDataType<T> implements DataType<T> {
|
||||
}
|
||||
else if (Result.class.isAssignableFrom(type)) {
|
||||
switch (dialect.family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case H2:
|
||||
return -10; // OracleTypes.CURSOR;
|
||||
|
||||
|
||||
@ -531,7 +531,7 @@ class DefaultRenderContext extends AbstractContext<RenderContext> implements Ren
|
||||
sql("`").sql(StringUtils.replace(literal, "`", "``")).sql("`");
|
||||
break;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// T-SQL databases use brackets
|
||||
case ASE:
|
||||
case SQLSERVER:
|
||||
@ -539,13 +539,13 @@ class DefaultRenderContext extends AbstractContext<RenderContext> implements Ren
|
||||
sql("[").sql(StringUtils.replace(literal, "]", "]]")).sql("]");
|
||||
break;
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// Most dialects implement the SQL standard, using double quotes
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
@ -583,7 +583,7 @@ class DefaultRenderContext extends AbstractContext<RenderContext> implements Ren
|
||||
return;
|
||||
|
||||
switch (configuration().dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
checkForceInline(2000);
|
||||
return;
|
||||
@ -596,7 +596,7 @@ class DefaultRenderContext extends AbstractContext<RenderContext> implements Ren
|
||||
checkForceInline(2100);
|
||||
return;
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case SQLITE:
|
||||
checkForceInline(999);
|
||||
return;
|
||||
|
||||
@ -70,10 +70,10 @@ class Degrees extends AbstractFunction<BigDecimal> {
|
||||
@Override
|
||||
final Field<BigDecimal> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case FIREBIRD:
|
||||
case SQLITE:
|
||||
return argument.cast(BigDecimal.class).mul(inline(180)).div(pi());
|
||||
|
||||
@ -76,10 +76,10 @@ class Dual extends AbstractTable<Record> {
|
||||
@Override
|
||||
public final void toSQL(RenderContext context) {
|
||||
switch (context.configuration().dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case SQLSERVER:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case POSTGRES:
|
||||
case SQLITE:
|
||||
break;
|
||||
@ -100,7 +100,7 @@ class Dual extends AbstractTable<Record> {
|
||||
|
||||
// These dialects don't have a DUAL table. But simulation is needed
|
||||
// for queries like SELECT 1 WHERE 1 = 1
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case INGRES:
|
||||
context.keyword("(select 1 as dual) as dual");
|
||||
break;
|
||||
@ -117,7 +117,7 @@ class Dual extends AbstractTable<Record> {
|
||||
.literal("DUMMY");
|
||||
break;
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
context.literal("SYSIBM")
|
||||
.sql(".")
|
||||
|
||||
@ -66,14 +66,14 @@ class Euler extends AbstractFunction<BigDecimal> {
|
||||
@Override
|
||||
final Field<BigDecimal> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
|
||||
@ -156,13 +156,13 @@ class Expression<T> extends AbstractFunction<T> {
|
||||
return function("bin_or", getDataType(), getArguments());
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Oracle has to simulate or/xor
|
||||
else if (BIT_OR == operator && ORACLE == family) {
|
||||
return lhs.sub(bitAnd(lhsAsNumber(), rhsAsNumber())).add(rhsAsNumber());
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// ~(a & b) & (a | b)
|
||||
else if (BIT_XOR == operator && asList(ORACLE, SQLITE).contains(family)) {
|
||||
return (Field<T>) bitAnd(
|
||||
@ -365,7 +365,7 @@ class Expression<T> extends AbstractFunction<T> {
|
||||
return field("{datetime}({0}, {1})", getDataType(), lhs, interval);
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case SYBASE:
|
||||
case SQLSERVER: {
|
||||
@ -422,7 +422,7 @@ class Expression<T> extends AbstractFunction<T> {
|
||||
}
|
||||
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case POSTGRES:
|
||||
default:
|
||||
return new DefaultExpression();
|
||||
@ -446,11 +446,11 @@ class Expression<T> extends AbstractFunction<T> {
|
||||
*/
|
||||
private final Field<T> getNumberExpression(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case FIREBIRD: {
|
||||
if (operator == ADD) {
|
||||
return field("{dateadd}(day, {0}, {1})", getDataType(), rhsAsNumber(), lhs);
|
||||
@ -460,9 +460,9 @@ class Expression<T> extends AbstractFunction<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case HSQLDB: {
|
||||
if (operator == ADD) {
|
||||
return lhs.add(field("{0} day", rhsAsNumber()));
|
||||
@ -498,7 +498,7 @@ class Expression<T> extends AbstractFunction<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Ingres is not working yet
|
||||
case INGRES: {
|
||||
if (operator == ADD) {
|
||||
@ -509,7 +509,7 @@ class Expression<T> extends AbstractFunction<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case POSTGRES: {
|
||||
|
||||
// This seems to be the most reliable way to avoid issues
|
||||
@ -532,9 +532,9 @@ class Expression<T> extends AbstractFunction<T> {
|
||||
}
|
||||
|
||||
// These dialects can add / subtract days using +/- operators
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case H2:
|
||||
default:
|
||||
return new DefaultExpression();
|
||||
|
||||
@ -87,9 +87,9 @@ class Extract extends AbstractFunction<Integer> {
|
||||
throw new SQLDialectNotSupportedException("DatePart not supported: " + datePart);
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
switch (datePart) {
|
||||
case YEAR:
|
||||
@ -108,7 +108,7 @@ class Extract extends AbstractFunction<Integer> {
|
||||
throw new SQLDialectNotSupportedException("DatePart not supported: " + datePart);
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE:
|
||||
switch (datePart) {
|
||||
case YEAR:
|
||||
@ -148,7 +148,7 @@ class Extract extends AbstractFunction<Integer> {
|
||||
}
|
||||
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
case POSTGRES:
|
||||
|
||||
@ -81,21 +81,21 @@ class FieldCondition extends AbstractCondition {
|
||||
case CUBRID:
|
||||
case FIREBIRD:
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// These do
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
return (QueryPartInternal) condition("{0} = {1}", field, inline(true));
|
||||
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Untested yet
|
||||
case ASE:
|
||||
case DB2:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
|
||||
// Native support
|
||||
case DERBY:
|
||||
|
||||
@ -96,11 +96,11 @@ class FieldMapsForInsert extends AbstractQueryPart {
|
||||
switch (context.configuration().dialect().family()) {
|
||||
|
||||
// Some dialects don't support multi-record inserts
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case FIREBIRD:
|
||||
case SQLITE:
|
||||
context.start(INSERT_SELECT);
|
||||
|
||||
@ -213,11 +213,11 @@ class Function<T> extends AbstractField<T> implements
|
||||
else if (term == LIST_AGG && asList(POSTGRES, SYBASE).contains(context.configuration().dialect())) {
|
||||
toSQLStringAgg(context);
|
||||
}
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
else if (term == LIST_AGG && asList(DB2).contains(context.configuration().dialect())) {
|
||||
toSQLXMLAGG(context);
|
||||
}
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
else {
|
||||
toSQLArguments(context);
|
||||
toSQLKeepDenseRankOrderByClause(context);
|
||||
@ -226,7 +226,7 @@ class Function<T> extends AbstractField<T> implements
|
||||
}
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
/**
|
||||
* [#1276] <code>LIST_AGG</code> simulation for DB2
|
||||
*/
|
||||
@ -274,7 +274,7 @@ class Function<T> extends AbstractField<T> implements
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
/**
|
||||
* [#1275] <code>LIST_AGG</code> simulation for Postgres, Sybase
|
||||
*/
|
||||
@ -432,23 +432,23 @@ class Function<T> extends AbstractField<T> implements
|
||||
}
|
||||
|
||||
if (ignoreNulls) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (context.configuration().dialect() == SQLDialect.DB2) {
|
||||
context.sql(", 'IGNORE NULLS'");
|
||||
}
|
||||
else
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
{
|
||||
context.sql(" ").keyword("ignore nulls");
|
||||
}
|
||||
}
|
||||
else if (respectNulls) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
if (context.configuration().dialect() == SQLDialect.DB2) {
|
||||
context.sql(", 'RESPECT NULLS'");
|
||||
}
|
||||
else
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
{
|
||||
context.sql(" ").keyword("respect nulls");
|
||||
}
|
||||
|
||||
@ -74,11 +74,11 @@ class Greatest<T> extends AbstractFunction<T> {
|
||||
// are very welcome
|
||||
// [#1049] TODO Fix this!
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY: {
|
||||
Field<T> first = (Field<T>) getArguments()[0];
|
||||
Field<T> other = (Field<T>) getArguments()[1];
|
||||
|
||||
@ -96,11 +96,11 @@ class InCondition<T> extends AbstractCondition {
|
||||
// [#798] Oracle and some other dialects can only hold 1000 values
|
||||
// in an IN (...) clause
|
||||
switch (context.configuration().dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
case SQLSERVER:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case FIREBIRD: {
|
||||
context.sql("(")
|
||||
.formatIndentStart()
|
||||
|
||||
@ -175,12 +175,12 @@ class InsertQueryImpl<R extends Record> extends AbstractStoreQuery<R> implements
|
||||
|
||||
// Some databases allow for simulating this clause using a
|
||||
// MERGE statement
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
case ORACLE:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case HSQLDB: {
|
||||
context.visit(toMerge(context.configuration()));
|
||||
break;
|
||||
@ -230,12 +230,12 @@ class InsertQueryImpl<R extends Record> extends AbstractStoreQuery<R> implements
|
||||
|
||||
// Some databases allow for simulating this clause using a
|
||||
// MERGE statement
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
case ORACLE:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case HSQLDB: {
|
||||
context.visit(toMerge(context.configuration()));
|
||||
break;
|
||||
@ -283,12 +283,12 @@ class InsertQueryImpl<R extends Record> extends AbstractStoreQuery<R> implements
|
||||
|
||||
// Some databases allow for simulating this clause using a
|
||||
// MERGE statement
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
case ORACLE:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case HSQLDB: {
|
||||
context.visit(toMerge(context.configuration()));
|
||||
break;
|
||||
@ -325,12 +325,12 @@ class InsertQueryImpl<R extends Record> extends AbstractStoreQuery<R> implements
|
||||
|
||||
// Some databases allow for simulating this clause using a
|
||||
// MERGE statement
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
case ORACLE:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case HSQLDB: {
|
||||
context.visit(toMerge(context.configuration()));
|
||||
break;
|
||||
|
||||
@ -235,7 +235,7 @@ class JoinTable extends AbstractTable<Record> implements TableOptionalOnStep, Ta
|
||||
}
|
||||
|
||||
private final boolean simulateCrossJoin(RenderContext context) {
|
||||
return false/* [com] */ || type == CROSS_JOIN && context.configuration().dialect() == ASE/* [/com] */;
|
||||
return false/* [pro] */ || type == CROSS_JOIN && context.configuration().dialect() == ASE/* [/pro] */;
|
||||
}
|
||||
|
||||
private final boolean simulateNaturalJoin(RenderContext context) {
|
||||
|
||||
@ -73,11 +73,11 @@ class Least<T> extends AbstractFunction<T> {
|
||||
// This implementation has O(2^n) complexity. Better implementations
|
||||
// are very welcome
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY: {
|
||||
Field<T> first = (Field<T>) getArguments()[0];
|
||||
Field<T> other = (Field<T>) getArguments()[1];
|
||||
|
||||
@ -124,10 +124,10 @@ class Limit extends AbstractQueryPart {
|
||||
break;
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case SQLSERVER:
|
||||
case SQLSERVER2012:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY: {
|
||||
|
||||
// Casts are not supported here...
|
||||
@ -143,7 +143,7 @@ class Limit extends AbstractQueryPart {
|
||||
break;
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case INGRES: {
|
||||
|
||||
// INGRES doesn't allow bind variables in the
|
||||
@ -207,7 +207,7 @@ class Limit extends AbstractQueryPart {
|
||||
break;
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// A default implementation is necessary for hashCode() and toString()
|
||||
default: {
|
||||
context.castMode(NEVER)
|
||||
@ -229,10 +229,10 @@ class Limit extends AbstractQueryPart {
|
||||
|
||||
// OFFSET .. LIMIT support provided by the following dialects
|
||||
// ----------------------------------------------------------
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case SQLSERVER:
|
||||
case SQLSERVER2012:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY: {
|
||||
context.visit(offsetOrZero);
|
||||
context.visit(numberOfRows);
|
||||
@ -268,7 +268,7 @@ class Limit extends AbstractQueryPart {
|
||||
break;
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// These dialects don't support bind variables at all
|
||||
case ASE:
|
||||
case INGRES: {
|
||||
@ -324,7 +324,7 @@ class Limit extends AbstractQueryPart {
|
||||
break;
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// [#2057] Bind the same values as rendered in toSQL() by default
|
||||
default: {
|
||||
context.visit(numberOfRows);
|
||||
|
||||
@ -76,10 +76,10 @@ class Ln extends AbstractFunction<BigDecimal> {
|
||||
final Field<BigDecimal> getFunction0(Configuration configuration) {
|
||||
if (base == null) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case SQLSERVER:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case H2:
|
||||
return function("log", SQLDataType.NUMERIC, argument);
|
||||
|
||||
@ -89,13 +89,13 @@ class Ln extends AbstractFunction<BigDecimal> {
|
||||
}
|
||||
else {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case H2:
|
||||
case HSQLDB:
|
||||
|
||||
@ -76,14 +76,14 @@ class Lpad extends AbstractFunction<String> {
|
||||
@Override
|
||||
final Field<String> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case SQLSERVER:
|
||||
case SYBASE: {
|
||||
return DSL.concat(DSL.repeat(character, length.sub(DSL.length(field))), field);
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// This beautiful expression was contributed by "Ludo", here:
|
||||
// http://stackoverflow.com/questions/6576343/how-to-simulate-lpad-rpad-with-sqlite
|
||||
case SQLITE: {
|
||||
|
||||
@ -66,11 +66,11 @@ class MD5 extends AbstractFunction<String> {
|
||||
@Override
|
||||
final Field<String> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE:
|
||||
return field("{lower}({rawtohex}({sys}.{dbms_crypto}.{hash}({utl_raw}.{cast_to_raw}({0}), 2)))", SQLDataType.VARCHAR, argument);
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
default:
|
||||
|
||||
@ -941,12 +941,12 @@ implements
|
||||
*/
|
||||
private final QueryPart getStandardMerge(Configuration config) {
|
||||
switch (config.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
case ORACLE:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case HSQLDB: {
|
||||
|
||||
@ -1111,7 +1111,7 @@ implements
|
||||
context.formatIndentEnd()
|
||||
.declareTables(false);
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
switch (context.configuration().dialect().family()) {
|
||||
case SQLSERVER:
|
||||
case SYBASE: {
|
||||
@ -1143,8 +1143,8 @@ implements
|
||||
}
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
boolean onParentheses = false/* [com] */ || context.configuration().dialect().family() == ORACLE/* [/com] */;
|
||||
/* [/pro] */
|
||||
boolean onParentheses = false/* [pro] */ || context.configuration().dialect().family() == ORACLE/* [/pro] */;
|
||||
context.end(MERGE_USING)
|
||||
.formatSeparator()
|
||||
.start(MERGE_ON)
|
||||
@ -1210,14 +1210,14 @@ implements
|
||||
|
||||
context.end(MERGE_WHERE)
|
||||
.end(MERGE_WHEN_NOT_MATCHED_THEN_INSERT);
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
|
||||
switch (context.configuration().dialect().family()) {
|
||||
case SQLSERVER:
|
||||
context.sql(";");
|
||||
break;
|
||||
}
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -243,14 +243,14 @@ class MetaImpl implements Meta, Serializable {
|
||||
types = new String[] { "TABLE", "VIEW" };
|
||||
break;
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// [#2448] Avoid returning Oracle table SYNONYMs.
|
||||
// Note: "MATERIALIZED VIEW" is not included, as they are also
|
||||
// returned as "TABLE" by Oracle JDBC
|
||||
case ORACLE:
|
||||
types = new String[] { "TABLE", "VIEW" };
|
||||
break;
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
}
|
||||
|
||||
List<Table<?>> result = new ArrayList<Table<?>>();
|
||||
|
||||
@ -69,10 +69,10 @@ class Mod<T> extends AbstractFunction<T> {
|
||||
@Override
|
||||
final Field<T> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case SQLSERVER:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case SQLITE:
|
||||
return new Expression<T>(MODULO, arg1, arg2);
|
||||
}
|
||||
|
||||
@ -83,13 +83,13 @@ class Neg<T> extends AbstractField<T> {
|
||||
.visit(field)
|
||||
.sql(" - 1)");
|
||||
}
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
else if (operator == BIT_NOT && dialect == DB2) {
|
||||
context.keyword("bitnot(")
|
||||
.visit(field)
|
||||
.sql(")");
|
||||
}
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
else if (operator == BIT_NOT && dialect == FIREBIRD) {
|
||||
context.keyword("bin_not(")
|
||||
.visit(field)
|
||||
|
||||
@ -68,11 +68,11 @@ class Nvl<T> extends AbstractFunction<T> {
|
||||
@Override
|
||||
final Field<T> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case H2:
|
||||
case HSQLDB:
|
||||
return function("nvl", getDataType(), getArguments());
|
||||
|
||||
@ -70,10 +70,10 @@ class Nvl2<T> extends AbstractFunction<T> {
|
||||
@Override
|
||||
final Field<T> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case H2:
|
||||
case HSQLDB:
|
||||
return function("nvl2", getDataType(), getArguments());
|
||||
|
||||
@ -67,12 +67,12 @@ class Pi extends AbstractFunction<BigDecimal> {
|
||||
@Override
|
||||
final Field<BigDecimal> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
case ORACLE:
|
||||
return DSL.asin(one()).mul(two());
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case SQLITE:
|
||||
return inline(Math.PI, BigDecimal.class);
|
||||
|
||||
|
||||
@ -111,7 +111,7 @@ implements
|
||||
private Table<?> pivot(Configuration configuration) {
|
||||
switch (configuration.dialect()) {
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Oracle has native support for the PIVOT clause
|
||||
case ORACLE:
|
||||
case ORACLE11G:
|
||||
@ -119,7 +119,7 @@ implements
|
||||
return new OraclePivotTable();
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// Some other dialects can simulate it. This implementation is
|
||||
// EXPERIMENTAL and not officially supported
|
||||
default: {
|
||||
@ -219,7 +219,7 @@ implements
|
||||
}
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
/**
|
||||
* The Oracle-specific <code>PIVOT</code> implementation
|
||||
*/
|
||||
@ -270,7 +270,7 @@ implements
|
||||
.declareTables(declareTables);
|
||||
}
|
||||
}
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
|
||||
/**
|
||||
* A base class for dialect-specific implementations of the pivot table
|
||||
|
||||
@ -67,13 +67,13 @@ class Position extends AbstractFunction<Integer> {
|
||||
@Override
|
||||
final Field<Integer> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
return function("locate", SQLDataType.INTEGER, search, in);
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case INGRES:
|
||||
case SYBASE:
|
||||
return function("locate", SQLDataType.INTEGER, in, search);
|
||||
@ -85,7 +85,7 @@ class Position extends AbstractFunction<Integer> {
|
||||
case SQLSERVER:
|
||||
return function("charindex", SQLDataType.INTEGER, search, in);
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
default:
|
||||
return field("{position}({0} {in} {1})", SQLDataType.INTEGER, search, in);
|
||||
}
|
||||
|
||||
@ -70,10 +70,10 @@ class Radians extends AbstractFunction<BigDecimal> {
|
||||
@Override
|
||||
final Field<BigDecimal> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case FIREBIRD:
|
||||
case SQLITE:
|
||||
return argument.cast(BigDecimal.class).mul(pi()).div(inline(180));
|
||||
|
||||
@ -65,12 +65,12 @@ class Rand extends AbstractFunction<BigDecimal> {
|
||||
@Override
|
||||
final Field<BigDecimal> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ORACLE:
|
||||
return field("dbms_random.random", BigDecimal.class);
|
||||
|
||||
case INGRES:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case POSTGRES:
|
||||
case SQLITE:
|
||||
|
||||
@ -73,9 +73,9 @@ class RegexpLike extends AbstractCondition {
|
||||
switch (context.configuration().dialect().family()) {
|
||||
|
||||
// [#620] These databases are compatible with the MySQL syntax
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case CUBRID:
|
||||
case H2:
|
||||
case MARIADB:
|
||||
@ -106,7 +106,7 @@ class RegexpLike extends AbstractCondition {
|
||||
break;
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// [#620] Oracle has its own syntax
|
||||
case ORACLE: {
|
||||
|
||||
@ -115,15 +115,15 @@ class RegexpLike extends AbstractCondition {
|
||||
break;
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// Render the SQL standard for those databases that do not support
|
||||
// regular expressions
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case SQLSERVER:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
default: {
|
||||
|
||||
@ -68,10 +68,10 @@ class Repeat extends AbstractFunction<String> {
|
||||
@Override
|
||||
final Field<String> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case FIREBIRD:
|
||||
return DSL.rpad(string, DSL.length(string).mul(count), string);
|
||||
|
||||
@ -82,12 +82,12 @@ class Repeat extends AbstractFunction<String> {
|
||||
case SQLITE:
|
||||
return DSL.field("replace(substr(quote(zeroblob(({0} + 1) / 2)), 3, {0}), '0', {1})", String.class, count, string);
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case SQLSERVER:
|
||||
return function("replicate", SQLDataType.VARCHAR, string, count);
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
default:
|
||||
return function("repeat", SQLDataType.VARCHAR, string, count);
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ class Replace extends AbstractFunction<String> {
|
||||
|
||||
// [#861] Most dialects don't ship with a two-argument replace function:
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE: {
|
||||
if (args.length == 2) {
|
||||
return function("str_replace", VARCHAR, args[0], args[1], val(null));
|
||||
@ -81,7 +81,7 @@ class Replace extends AbstractFunction<String> {
|
||||
case INGRES:
|
||||
case SQLSERVER:
|
||||
case SYBASE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case FIREBIRD:
|
||||
case HSQLDB:
|
||||
case MARIADB:
|
||||
|
||||
@ -96,7 +96,7 @@ class Round<T extends Number> extends AbstractFunction<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// These dialects have a mandatory decimals argument
|
||||
case ASE:
|
||||
case INGRES:
|
||||
@ -105,7 +105,7 @@ class Round<T extends Number> extends AbstractFunction<T> {
|
||||
return function("round", getDataType(), argument, val(decimals));
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// There's no function round(double precision, integer) in Postgres
|
||||
case POSTGRES: {
|
||||
if (decimals == 0) {
|
||||
|
||||
@ -76,14 +76,14 @@ class Rpad extends AbstractFunction<String> {
|
||||
@Override
|
||||
final Field<String> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case ASE:
|
||||
case SQLSERVER:
|
||||
case SYBASE: {
|
||||
return DSL.concat(field, DSL.repeat(character, length.sub(DSL.length(field))));
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// This beautiful expression was contributed by "Ludo", here:
|
||||
// http://stackoverflow.com/questions/6576343/how-to-simulate-lpad-rpad-with-sqlite
|
||||
case SQLITE: {
|
||||
|
||||
@ -321,14 +321,14 @@ public final class SQLDataType {
|
||||
// TODO [#650] Make this more reliable using a data type registry
|
||||
|
||||
try {
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
Class.forName(ASEDataType.class.getName());
|
||||
Class.forName(DB2DataType.class.getName());
|
||||
Class.forName(IngresDataType.class.getName());
|
||||
Class.forName(OracleDataType.class.getName());
|
||||
Class.forName(SQLServerDataType.class.getName());
|
||||
Class.forName(SybaseDataType.class.getName());
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
Class.forName(CUBRIDDataType.class.getName());
|
||||
Class.forName(DerbyDataType.class.getName());
|
||||
Class.forName(FirebirdDataType.class.getName());
|
||||
|
||||
@ -214,7 +214,7 @@ class SelectQueryImpl<R extends Record> extends AbstractSelect<R> implements Sel
|
||||
if (getLimit().isApplicable()) {
|
||||
switch (context.configuration().dialect()) {
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Oracle knows the ROWNUM pseudo-column. That makes things simple
|
||||
case ORACLE:
|
||||
case ORACLE10G:
|
||||
@ -275,7 +275,7 @@ class SelectQueryImpl<R extends Record> extends AbstractSelect<R> implements Sel
|
||||
break;
|
||||
}
|
||||
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
// By default, render the dialect's limit clause
|
||||
default: {
|
||||
toSQLReferenceLimitDefault(context);
|
||||
@ -305,11 +305,11 @@ class SelectQueryImpl<R extends Record> extends AbstractSelect<R> implements Sel
|
||||
|
||||
// Some dialects don't allow for an OF [table-names] clause
|
||||
// It can be simulated by listing the table's fields, though
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
case DB2:
|
||||
case INGRES:
|
||||
case ORACLE:
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
case DERBY: {
|
||||
forUpdateOfTables.toSQLFieldNames(context);
|
||||
break;
|
||||
@ -371,7 +371,7 @@ class SelectQueryImpl<R extends Record> extends AbstractSelect<R> implements Sel
|
||||
context.visit(getLimit());
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
/**
|
||||
* Simulate the LIMIT / OFFSET clause in the {@link SQLDialect#DB2},
|
||||
* {@link SQLDialect#SQLSERVER2008} and {@link SQLDialect#SYBASE} dialects
|
||||
@ -454,7 +454,7 @@ class SelectQueryImpl<R extends Record> extends AbstractSelect<R> implements Sel
|
||||
.sql(" > ")
|
||||
.visit(getLimit().getLowerRownum());
|
||||
}
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
|
||||
/**
|
||||
* This method renders the main part of a query without the LIMIT clause.
|
||||
@ -486,7 +486,7 @@ class SelectQueryImpl<R extends Record> extends AbstractSelect<R> implements Sel
|
||||
context.keyword("distinct").sql(" ");
|
||||
}
|
||||
|
||||
/* [com] */
|
||||
/* [pro] */
|
||||
// Sybase and SQL Server have leading TOP clauses
|
||||
switch (dialect.family()) {
|
||||
case ASE:
|
||||
@ -528,7 +528,7 @@ class SelectQueryImpl<R extends Record> extends AbstractSelect<R> implements Sel
|
||||
case INGRES: {
|
||||
}
|
||||
}
|
||||
/* [/com] */
|
||||
/* [/pro] */
|
||||
|
||||
context.declareFields(true);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user