/** * OnDuplicateKey not returning correct number */ package testsuite.simple; import java.sql.CallableStatement; import java.util.Properties; import testsuite.BaseTestCase; /** * @author Tonci * */ public class TestBug40439 extends BaseTestCase { public TestBug40439(String name) { super(name); // TODO Auto-generated constructor stub } public void testBug40439() throws Exception { System.out.println("java.vm.version : " + System.getProperty("java.vm.version")); System.out.println("java.vm.vendor : " + System.getProperty("java.vm.vendor")); System.out.println("java.runtime.version : " + System.getProperty("java.runtime.version")); System.out.println("os.name : " + System.getProperty("os.name")); System.out.println("os.version : " + System.getProperty("os.version ")); System.out.println("sun.management.compiler : " + System.getProperty("sun.management.compiler")); try { this.conn.setAutoCommit(false); createTable("bug40439_values", "(id INT PRIMARY KEY, data VARCHAR(100), ordr INT)"); assertEquals(1, this.stmt.executeUpdate("INSERT INTO bug40439_values (id,data, ordr) values (0,'a',0)")); this.pstmt = this.conn.prepareStatement("INSERT INTO bug40439_values (id,data, ordr) values (?,?,?)"); for (int k = 1; k <= 10; k++) { this.pstmt.setInt(1, k); this.pstmt.setString(2, "toto"); this.pstmt.setInt(3, k); this.pstmt.addBatch(); } this.pstmt.executeBatch(); this.conn.commit(); this.pstmt.close(); this.conn.close(); } finally { closeMemberJDBCResources(); } } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub junit.textui.TestRunner.run(TestBug40439.class); } }