[#2492] Various MS Access fixes

This commit is contained in:
Lukas Eder 2014-02-12 14:14:19 +01:00
parent 42ec8ca9bc
commit 39b5d650a6
7 changed files with 48 additions and 13 deletions

View File

@ -363,18 +363,32 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
assertEquals(3, create().fetchCount(selectDistinct(TBook_ID(), TBook_TITLE()).from(TBook()).where(TBook_ID().in(1, 2, 3))));
// Ingres doesn't allow for LIMIT .. OFFSET in nested selects or derived tables.
if (!asList().contains(dialect().family())) {
assertEquals(2, create().fetchCount(selectFrom(TBook()).limit(2)));
assertEquals(2, create().fetchCount(selectFrom(TBook()).limit(2).offset(1)));
}
assertEquals(2, create().fetchCount(
select(TBook_TITLE()).from(TBook()).where(TBook_ID().eq(1))
.union(
select(inline("abc")))));
}
@Test
public void testFetchCountWithLimitOffset() throws Exception {
/* [pro] xx
xxxxxx xxxxxxxxxxxxxxxxxxxx x
xxxx xxxxxxx
xxxx xxxx
xxxx xxxxxxx
xxxxxxxxxxxxxxxxxxxx xxxxxxx xxxxx xx xxxxxx xxxxxxxx
xxxxxxx
x
xx [/pro] */
// Some databases don't allow for LIMIT .. OFFSET in nested selects or derived tables.
if (!asList().contains(dialect().family())) {
assertEquals(2, create().fetchCount(selectFrom(TBook()).limit(2)));
assertEquals(2, create().fetchCount(selectFrom(TBook()).limit(2).offset(1)));
}
}
@Test
public void testCountDistinct() throws Exception {

View File

@ -783,7 +783,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
Field<Double> f7b = sqlite || ingres ? inline(10.0) : trunc(11.111, -1);
Record r2 =
create().select(f1b, f2b, f3b, f4b, f6b, f6b, f7b)
create().select(f1b, f2b, f3b, f4b, f5b, f6b, f7b)
.fetchOne();
assertEquals("-1.0", r2.getValue(f1b, String.class));

View File

@ -170,9 +170,8 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
.groupBy(VLibrary_AUTHOR())
// MySQL seems to have a bug with fully qualified view names in the
// having clause. TODO: Fully analyse this issue
// https://sourceforge.net/apps/trac/jooq/ticket/277
.having("v_library.author like ?", "Paulo%")
// having clause. TODO: [#277] Fully analyse this issue
.having("count(*) >= ?", 2)
.fetch();
assertEquals(1, result4.size());

View File

@ -451,6 +451,16 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
@Test
public void testLimitDistinct() throws Exception {
/* [pro] xx
xx xxxxxxxxxx xx xxxxxxxxxxxxxxxxx xx
xxxxxxxxx xx xxxxxxxxxxxxxxx x
xxxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxx xx xxxxxx xxxxxxxxxx
xxxxxxx
x
xx [/pro] */
assertEquals(asList(1, 2),
create().selectDistinct(TBookToBookStore_BOOK_ID())
.from(TBookToBookStore())
@ -473,14 +483,12 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
.limit(2)
.offset(1)
.fetch(TBook_AUTHOR_ID()));
throw new RuntimeException("#2580: Add more test cases!");
}
@Test
public void testLimitAliased() throws Exception {
/* [pro] xx
xx xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x
xx xxxxxxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x
xxxxxxxxxxxxxxxxxxxx xxxxxx xx xxxxxx xxxxxxxx
xxxxxxx
x
@ -620,6 +628,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
/* [pro] xx
xx xxxx xxxxxx xxxx xx xxx xxxxxxxxx xx xxxxxx
xx xxxxxxxxxx xx xxxxxxxxxxxxxxxxx xx
xxxxxxxxx xx xxxxxxxxxxxxxxxxx xx
xxxxxxxxx xx xxxxxxxxxxxxxxx x
xxxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxx xx xxxxxx xxxxxxxxxx

View File

@ -2105,6 +2105,11 @@ public abstract class jOOQAbstractTest<
new AggregateWindowFunctionTests(this).testFetchCount();
}
@Test
public void testFetchCountWithLimitOffset() throws Exception {
new AggregateWindowFunctionTests(this).testFetchCountWithLimitOffset();
}
@Test
public void testCountDistinct() throws Exception {
new AggregateWindowFunctionTests(this).testCountDistinct();

View File

@ -413,6 +413,13 @@ class DefaultRenderContext extends AbstractContext<RenderContext> implements Ren
switch (configuration().dialect().family()) {
/* [pro] xx
xxxx xxxxxxx
xx xxxxxxxxxxx xxxx xxxxx xxxx xxx xxxxx xxxxx xx xx xxx xxxx xxxxxxxxx xxx xx xxxxxx
xx xxxxx xxxxxxx xxxx xxxxxx xx xxxx xx xxx xxxx xxxx
xxxxxxxxxxxxxxxxxxxxxx
xxxxxxx
xxxx xxxx
xxxxxxxxxxxxxxxxxxxxxxx
xxxxxxx

View File

@ -105,6 +105,7 @@ class Values<R extends Record> extends AbstractTable<R> {
xxxx xxxxxxx
xxxx xxxxxxx
xxxx xxxxxxx
xxxx xxxxxxx
xx [/pro] */
case FIREBIRD:
case MARIADB: