import java.sql.SQLException; import java.util.Properties; public class Bug15617 extends testsuite.BaseTestCase { public Bug15617(String name) { super(name); } public void setUp() throws Exception { super.setUp(); Properties props = new Properties(); props.setProperty("useUnicode", "true"); props.setProperty("characterEncoding", "UTF-8"); this.conn = getConnectionWithProps(props); this.stmt = conn.createStatement(); dropTable("TA"); createTable("TA","(FA decimal(15,2) default NULL) engine=myisam charset=utf8"); stmt.executeUpdate("insert into TA values (12345678),(22345678),(22345678)"); } public void testSmallint() throws SQLException { rs = stmt.executeQuery("select distinct format(FA,0) as abc from TA"); while (rs.next()) { System.out.println(rs.getString("abc")); } // assertTrue("retieved 0 records (must retrieve 1 record)",rs.next()); // Integer i = rs.getInt(1); // System.out.println(i); // assertEquals("We must fetch 1 but fetched "+i,i,1,0); } public static void main(String args[]) throws Exception { junit.textui.TestRunner.run(Bug15617.class); } }