From f9d9f5a96733312936aa6b5b45fd25a64b8e8a72 Mon Sep 17 00:00:00 2001 From: James Moger Date: Sat, 14 Jul 2012 17:41:48 -0400 Subject: Fixed unit test for MySQL wrt IN queries --- tests/com/iciql/test/JoinTest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tests') 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 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 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 -- cgit v1.2.3