Index: ../../Sourcecode/Mysql/mysql-connector-java-5.1.6/src/com/mysql/jdbc/StatementImpl.java =================================================================== --- ../../Sourcecode/Mysql/mysql-connector-java-5.1.6/src/com/mysql/jdbc/StatementImpl.java Fri Oct 10 08:39:57 CEST 2008 +++ ../../Sourcecode/Mysql/mysql-connector-java-5.1.6/src/com/mysql/jdbc/StatementImpl.java Fri Oct 10 08:39:57 CEST 2008 @@ -1798,6 +1798,7 @@ long beginAt = getLastInsertID(); int numKeys = getUpdateCount(); + int increment = getAutoIncrementIncrement(); if (this.results != null) { String serverInfo = this.results.getServerInfo(); @@ -1814,8 +1815,9 @@ if ((beginAt > 0) && (numKeys > 0)) { for (int i = 0; i < numKeys; i++) { byte[][] row = new byte[1][]; - row[0] = Long.toString(beginAt++).getBytes(); + row[0] = Long.toString(beginAt).getBytes(); rowSet.add(new ByteArrayRow(row)); + beginAt += increment; } } } @@ -1828,6 +1830,10 @@ return gkRs; } + private int getAutoIncrementIncrement() throws SQLException { + return connection.getServerVariableAsInt("auto_increment_increment", 1); + } + /** * Returns the id used when profiling *