[ https://issues.apache.org/jira/browse/PHOENIX-2139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14637985#comment-14637985 ]
Hudson commented on PHOENIX-2139: --------------------------------- SUCCESS: Integrated in Phoenix-master #854 (See [https://builds.apache.org/job/Phoenix-master/854/]) PHOENIX-2139 LIKE '%' is not filtering out null columns (jamestaylor: rev a50ead27afa467f6d530052354ac741fb8aa1307) * phoenix-core/src/it/java/org/apache/phoenix/end2end/LikeExpressionIT.java * phoenix-core/src/main/java/org/apache/phoenix/compile/ExpressionCompiler.java PHOENIX-2139 LIKE '%' is not filtering out null columns (jamestaylor: rev 5076052d5a84194554da96894c27a3829ce6e75b) * phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDatabaseMetaData.java > LIKE '%' is not filtering out null columns > ------------------------------------------ > > Key: PHOENIX-2139 > URL: https://issues.apache.org/jira/browse/PHOENIX-2139 > Project: Phoenix > Issue Type: Bug > Reporter: James Taylor > Assignee: James Taylor > Fix For: 4.5.0 > > Attachments: PHOENIX-2139.patch, PHOENIX-2139_v2.patch > > > Found based on PhoenixDatabaseMetaData.getColumns() not filtering when column > name is null. > This test should pass: > {code} > @Test > public void testLikeEverythingExpression() throws Exception { > Connection conn = DriverManager.getConnection(getUrl()); > String ddl = "CREATE TABLE t (k1 VARCHAR, k2 VARCHAR, CONSTRAINT pk > PRIMARY KEY (k1,k2))"; > conn.createStatement().execute(ddl); > conn.createStatement().execute("UPSERT INTO t VALUES('aa','bb')"); > conn.createStatement().execute("UPSERT INTO t VALUES('ab','bc')"); > conn.createStatement().execute("UPSERT INTO t VALUES(null,'cc')"); > conn.createStatement().execute("UPSERT INTO t VALUES('dd',null)"); > conn.commit(); > > ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM t > WHERE k1 LIKE '%'"); > assertTrue(rs.next()); > assertEquals("aa", rs.getString(1)); > assertEquals("bb", rs.getString(2)); > assertTrue(rs.next()); > assertEquals("ab", rs.getString(1)); > assertEquals("bc", rs.getString(2)); > assertTrue(rs.next()); > assertEquals("dd", rs.getString(1)); > assertEquals(null, rs.getString(2)); > assertFalse(rs.next()); > > rs = conn.createStatement().executeQuery("SELECT * FROM t WHERE k2 > LIKE '%'"); > assertTrue(rs.next()); > assertEquals(null, rs.getString(1)); > assertEquals("cc", rs.getString(2)); > assertTrue(rs.next()); > assertEquals("aa", rs.getString(1)); > assertEquals("bb", rs.getString(2)); > assertTrue(rs.next()); > assertEquals("ab", rs.getString(1)); > assertEquals("bc", rs.getString(2)); > assertFalse(rs.next()); > > conn.close(); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)