[#1520] Handle SQL Server's and Sybase ASE's limitations of 2100 or 2000

maximum bind values per query
This commit is contained in:
Lukas Eder 2012-06-30 08:34:16 +02:00
parent f969ebd565
commit e202d6dd75

View File

@ -41,6 +41,7 @@ import static org.jooq.SQLDialect.ASE;
import static org.jooq.SQLDialect.DB2;
import static org.jooq.SQLDialect.DERBY;
import static org.jooq.SQLDialect.MYSQL;
import static org.jooq.conf.StatementType.STATIC_STATEMENT;
import static org.jooq.impl.Factory.castNull;
import static org.jooq.impl.Factory.concat;
import static org.jooq.impl.Factory.count;
@ -62,6 +63,7 @@ import org.jooq.Result;
import org.jooq.SQLDialect;
import org.jooq.TableRecord;
import org.jooq.UpdatableRecord;
import org.jooq.conf.Settings;
import org.jooq.test.BaseTest;
import org.jooq.test.jOOQAbstractTest;
@ -321,6 +323,14 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, I, IPK, T658,
.where(TBook_ID().notIn(Collections.nCopies(1950, 1)))
.fetchOne(count));
// [#1520] Any database should be able to handle lots of inlined
// variables, including SQL Server and Sybase ASE
assertEquals(3, (int) create(new Settings().withStatementType(STATIC_STATEMENT))
.select(count)
.from(TBook())
.where(TBook_ID().notIn(Collections.nCopies(3000, 1)))
.fetchOne(count));
// [#1515] Check correct splitting of NOT IN
List<Integer> list = new ArrayList<Integer>();
list.addAll(Collections.nCopies(1000, 1));