diff options
author | James Moger <james.moger@gmail.com> | 2012-07-14 17:41:48 -0400 |
---|---|---|
committer | James Moger <james.moger@gmail.com> | 2012-07-14 17:41:48 -0400 |
commit | f9d9f5a96733312936aa6b5b45fd25a64b8e8a72 (patch) | |
tree | acb1749059a57b39ebc9eceea50ae581882bd946 | |
parent | 7699e743dffadd764dec68d0737ba90dd2d16896 (diff) | |
download | iciql-f9d9f5a96733312936aa6b5b45fd25a64b8e8a72.tar.gz iciql-f9d9f5a96733312936aa6b5b45fd25a64b8e8a72.zip |
Fixed unit test for MySQL wrt IN queries
-rw-r--r-- | tests/com/iciql/test/JoinTest.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/com/iciql/test/JoinTest.java b/tests/com/iciql/test/JoinTest.java index 3e36eff..0e5e39d 100644 --- a/tests/com/iciql/test/JoinTest.java +++ b/tests/com/iciql/test/JoinTest.java @@ -22,6 +22,7 @@ import java.util.Arrays; import java.util.List; import org.junit.After; +import org.junit.Assume; import org.junit.Before; import org.junit.Test; @@ -98,9 +99,15 @@ public class JoinTest { final UserNote n = new UserNote(); QueryWhere<UserId> q = db.from(u).where(u.id).in(db.from(n).where(n.userId).exceeds(0).subQuery(n.userId)); - assertEquals("SELECT * FROM UserId WHERE id in (SELECT userId FROM UserNote WHERE userId > 0 )", q.toSQL()); List<UserId> notes = q.select(); assertEquals(3, notes.size()); + + // do not test MySQL on this statement because the databases + if (IciqlSuite.isMySQL(db)) { + assertEquals("SELECT * FROM UserId WHERE `id` in (SELECT `userId` FROM UserNote WHERE `userId` > 0 )", q.toSQL()); + } else { + assertEquals("SELECT * FROM UserId WHERE id in (SELECT userId FROM UserNote WHERE userId > 0 )", q.toSQL()); + } } @IQTable |