import testsuite.BaseTestCase; import java.sql.DatabaseMetaData; import java.sql.ResultSet; import com.mysql.jdbc.Driver; public class bug31187 extends BaseTestCase { public bug31187(String name) { super(name); } public static void main(String[] args) { junit.textui.TestRunner.run(bug31187.class); } public void testBug29893() throws Exception { try { this.stmt.executeUpdate("drop database if exists bug31187_1"); this.stmt.executeUpdate("drop database if exists bug31187_2"); this.stmt.executeUpdate("drop database if exists bug31187_3"); this.stmt.executeUpdate("create database bug31187_1"); this.stmt.executeUpdate("create database bug31187_2"); this.stmt.executeUpdate("create database bug31187_3"); this.stmt.executeUpdate("create table bug31187_1.test1(id int)"); this.stmt.executeUpdate("create table bug31187_2.test1(id int)"); this.stmt.executeUpdate("create table bug31187_3.test1(id int)"); this.stmt.executeUpdate("create table bug31187_2.test2(id int)"); this.stmt.executeUpdate("create table bug31187_3.test2(id int)"); DatabaseMetaData dmd = this.conn.getMetaData(); ResultSet rs = dmd.getColumns(null, null, "test2", "%"); while (rs.next()) { assertEquals("Wrong table name:", rs.getString(3), "test2"); } } finally { closeMemberJDBCResources(); } } }