import java.sql.SQLException;


public class Bug11874 extends testsuite.BaseTestCase
{
   public Bug11874(String name)
   {
      super(name);
   }

   public void setUp() throws Exception
   {
      super.setUp();
      dropTable("Test"); 
      createTable("Test","(i smallint unsigned)");  
      stmt.executeUpdate("insert into Test values (1)");  
   }

   public void testSmallint() throws SQLException
   {
     pstmt = conn.prepareStatement("select i from Test");
     rs = pstmt.executeQuery();
     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(Bug11874.class);      
   }

}


