From: Date: November 17 2006 2:46pm Subject: Connector/J commit: r6040 - in branches/branch_5_0/connector-j: . src/com/mysql/jdbc src/testsuite/regression List-Archive: http://lists.mysql.com/commits/15493 X-Bug: 24360 Message-Id: <200611171346.kAHDkUAo030452@bk-internal.mysql.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified: branches/branch_5_0/connector-j/CHANGES branches/branch_5_0/connector-j/src/com/mysql/jdbc/MysqlIO.java branches/branch_5_0/connector-j/src/testsuite/regression/StatementRegressionTest.java Log: Fixed BUG#24360 .setFetchSize() breaks prepared SHOW and other commands. Modified: branches/branch_5_0/connector-j/CHANGES =================================================================== --- branches/branch_5_0/connector-j/CHANGES 2006-11-17 01:02:01 UTC (rev 6039) +++ branches/branch_5_0/connector-j/CHANGES 2006-11-17 13:46:28 UTC (rev 6040) @@ -15,6 +15,8 @@ - Usage advisor now detects "empty" result sets and doesn't report on columns not referenced in them. + - Fixed BUG#24360 .setFetchSize() breaks prepared SHOW and other commands. + 10-20-06 - Version 5.0.4 - Fixed BUG#21379 - column names don't match metadata in cases Modified: branches/branch_5_0/connector-j/src/com/mysql/jdbc/MysqlIO.java =================================================================== --- branches/branch_5_0/connector-j/src/com/mysql/jdbc/MysqlIO.java 2006-11-17 01:02:01 UTC (rev 6039) +++ branches/branch_5_0/connector-j/src/com/mysql/jdbc/MysqlIO.java 2006-11-17 13:46:28 UTC (rev 6040) @@ -392,6 +392,7 @@ // if (this.connection.versionMeetsMinimum(5, 0, 2) + && this.connection.getUseCursorFetch() && isBinaryEncoded && callingStatement != null && callingStatement.getFetchSize() != 0 Modified: branches/branch_5_0/connector-j/src/testsuite/regression/StatementRegressionTest.java =================================================================== --- branches/branch_5_0/connector-j/src/testsuite/regression/StatementRegressionTest.java 2006-11-17 01:02:01 UTC (rev 6039) +++ branches/branch_5_0/connector-j/src/testsuite/regression/StatementRegressionTest.java 2006-11-17 13:46:28 UTC (rev 6040) @@ -3494,5 +3494,35 @@ closeMemberJDBCResources(); } } - + + /** + * Tests fix for BUG#24360 .setFetchSize() breaks prepared + * SHOW and other commands. + * + * @throws Exception if the test fails + */ + public void testBug24360() throws Exception { + if (!versionMeetsMinimum(5, 0)) { + return; + } + + Connection c = null; + + Properties props = new Properties(); + props.setProperty("useServerPrepStmts", "true"); + + try { + c = getConnectionWithProps(props); + + this.pstmt = c.prepareStatement("SHOW PROCESSLIST"); + this.pstmt.setFetchSize(5); + this.pstmt.execute(); + } finally { + closeMemberJDBCResources(); + + if (c != null) { + c.close(); + } + } + } }