MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:markm Date:February 3 2010 6:28pm
Subject:bzr push into connector-j/branches/branch_5_1 branch (markm:895 to 897)
View as plain text  
  897 markm@stripped	2010-02-03
      Bumped version #.

    modified:
      build.xml
  896 markm@stripped	2010-02-03
      - NO_INDEX_USED and NO_GOOD_INDEX used were only being set when profileSQL was set to "true", and in some cases their values were reversed.

    modified:
      CHANGES
      src/com/mysql/jdbc/MysqlIO.java
      src/testsuite/regression/StatementRegressionTest.java
  895 markm@stripped	2010-01-28
      License updates

    modified:
      build.xml
      src/com/mysql/jdbc/AssertionFailedException.java
      src/com/mysql/jdbc/BalanceStrategy.java
      src/com/mysql/jdbc/BestResponseTimeBalanceStrategy.java
      src/com/mysql/jdbc/Blob.java
      src/com/mysql/jdbc/BlobFromLocator.java
      src/com/mysql/jdbc/Buffer.java
      src/com/mysql/jdbc/BufferRow.java
      src/com/mysql/jdbc/ByteArrayRow.java
      src/com/mysql/jdbc/CachedResultSetMetaData.java
      src/com/mysql/jdbc/CallableStatement.java
      src/com/mysql/jdbc/CharsetMapping.java
      src/com/mysql/jdbc/Clob.java
      src/com/mysql/jdbc/CommunicationsException.java
      src/com/mysql/jdbc/CompressedInputStream.java
      src/com/mysql/jdbc/Connection.java
      src/com/mysql/jdbc/ConnectionFeatureNotAvailableException.java
      src/com/mysql/jdbc/ConnectionImpl.java
      src/com/mysql/jdbc/ConnectionLifecycleInterceptor.java
      src/com/mysql/jdbc/ConnectionProperties.java
      src/com/mysql/jdbc/ConnectionPropertiesImpl.java
      src/com/mysql/jdbc/ConnectionPropertiesTransform.java
      src/com/mysql/jdbc/Constants.java
      src/com/mysql/jdbc/DatabaseMetaData.java
      src/com/mysql/jdbc/DatabaseMetaDataUsingInfoSchema.java
      src/com/mysql/jdbc/Driver.java
      src/com/mysql/jdbc/EscapeProcessor.java
      src/com/mysql/jdbc/EscapeProcessorResult.java
      src/com/mysql/jdbc/EscapeTokenizer.java
      src/com/mysql/jdbc/ExceptionInterceptor.java
      src/com/mysql/jdbc/ExportControlled.java
      src/com/mysql/jdbc/Extension.java
      src/com/mysql/jdbc/Field.java
      src/com/mysql/jdbc/IterateBlock.java
      src/com/mysql/jdbc/JDBC4CallableStatement.java
      src/com/mysql/jdbc/JDBC4ClientInfoProvider.java
      src/com/mysql/jdbc/JDBC4ClientInfoProviderSP.java
      src/com/mysql/jdbc/JDBC4CommentClientInfoProvider.java
      src/com/mysql/jdbc/JDBC4Connection.java
      src/com/mysql/jdbc/JDBC4DatabaseMetaData.java
      src/com/mysql/jdbc/JDBC4DatabaseMetaDataUsingInfoSchema.java
      src/com/mysql/jdbc/JDBC4MysqlSQLXML.java
      src/com/mysql/jdbc/JDBC4NClob.java
      src/com/mysql/jdbc/JDBC4PreparedStatement.java
      src/com/mysql/jdbc/JDBC4ResultSet.java
      src/com/mysql/jdbc/JDBC4ServerPreparedStatement.java
      src/com/mysql/jdbc/JDBC4UpdatableResultSet.java
      src/com/mysql/jdbc/LicenseConfiguration.java
      src/com/mysql/jdbc/LoadBalancingConnectionProxy.java
      src/com/mysql/jdbc/Messages.java
      src/com/mysql/jdbc/MiniAdmin.java
      src/com/mysql/jdbc/MysqlDataTruncation.java
      src/com/mysql/jdbc/MysqlDefs.java
      src/com/mysql/jdbc/MysqlErrorNumbers.java
      src/com/mysql/jdbc/MysqlIO.java
      src/com/mysql/jdbc/MysqlParameterMetadata.java
      src/com/mysql/jdbc/MysqlSavepoint.java
      src/com/mysql/jdbc/NamedPipeSocketFactory.java
      src/com/mysql/jdbc/NonRegisteringDriver.java
      src/com/mysql/jdbc/NonRegisteringReplicationDriver.java
      src/com/mysql/jdbc/NotImplemented.java
      src/com/mysql/jdbc/NotUpdatable.java
      src/com/mysql/jdbc/OperationNotSupportedException.java
      src/com/mysql/jdbc/OutputStreamWatcher.java
      src/com/mysql/jdbc/PacketTooBigException.java
      src/com/mysql/jdbc/ParameterBindings.java
      src/com/mysql/jdbc/PingTarget.java
      src/com/mysql/jdbc/PreparedStatement.java
      src/com/mysql/jdbc/RandomBalanceStrategy.java
      src/com/mysql/jdbc/ReplicationConnection.java
      src/com/mysql/jdbc/ReplicationDriver.java
      src/com/mysql/jdbc/ResultSetImpl.java
      src/com/mysql/jdbc/ResultSetInternalMethods.java
      src/com/mysql/jdbc/ResultSetMetaData.java
      src/com/mysql/jdbc/ResultSetRow.java
      src/com/mysql/jdbc/RowData.java
      src/com/mysql/jdbc/RowDataCursor.java
      src/com/mysql/jdbc/RowDataDynamic.java
      src/com/mysql/jdbc/RowDataStatic.java
      src/com/mysql/jdbc/SQLError.java
      src/com/mysql/jdbc/Security.java
      src/com/mysql/jdbc/ServerPreparedStatement.java
      src/com/mysql/jdbc/SingleByteCharsetConverter.java
      src/com/mysql/jdbc/SocketFactory.java
      src/com/mysql/jdbc/StandardSocketFactory.java
      src/com/mysql/jdbc/Statement.java
      src/com/mysql/jdbc/StatementImpl.java
      src/com/mysql/jdbc/StatementInterceptor.java
      src/com/mysql/jdbc/StreamingNotifiable.java
      src/com/mysql/jdbc/StringUtils.java
      src/com/mysql/jdbc/TimeUtil.java
      src/com/mysql/jdbc/UpdatableResultSet.java
      src/com/mysql/jdbc/Util.java
      src/com/mysql/jdbc/WatchableOutputStream.java
      src/com/mysql/jdbc/WatchableWriter.java
      src/com/mysql/jdbc/WriterWatcher.java
      src/com/mysql/jdbc/exceptions/DeadlockTimeoutRollbackMarker.java
      src/com/mysql/jdbc/exceptions/MySQLDataException.java
      src/com/mysql/jdbc/exceptions/MySQLIntegrityConstraintViolationException.java
      src/com/mysql/jdbc/exceptions/MySQLInvalidAuthorizationSpecException.java
      src/com/mysql/jdbc/exceptions/MySQLNonTransientConnectionException.java
      src/com/mysql/jdbc/exceptions/MySQLNonTransientException.java
      src/com/mysql/jdbc/exceptions/MySQLStatementCancelledException.java
      src/com/mysql/jdbc/exceptions/MySQLSyntaxErrorException.java
      src/com/mysql/jdbc/exceptions/MySQLTimeoutException.java
      src/com/mysql/jdbc/exceptions/MySQLTransactionRollbackException.java
      src/com/mysql/jdbc/exceptions/MySQLTransientConnectionException.java
      src/com/mysql/jdbc/exceptions/MySQLTransientException.java
      src/com/mysql/jdbc/exceptions/jdbc4/CommunicationsException.java
      src/com/mysql/jdbc/exceptions/jdbc4/MySQLDataException.java
      src/com/mysql/jdbc/exceptions/jdbc4/MySQLIntegrityConstraintViolationException.java
      src/com/mysql/jdbc/exceptions/jdbc4/MySQLInvalidAuthorizationSpecException.java
      src/com/mysql/jdbc/exceptions/jdbc4/MySQLNonTransientConnectionException.java
      src/com/mysql/jdbc/exceptions/jdbc4/MySQLNonTransientException.java
      src/com/mysql/jdbc/exceptions/jdbc4/MySQLSyntaxErrorException.java
      src/com/mysql/jdbc/exceptions/jdbc4/MySQLTimeoutException.java
      src/com/mysql/jdbc/exceptions/jdbc4/MySQLTransactionRollbackException.java
      src/com/mysql/jdbc/exceptions/jdbc4/MySQLTransientConnectionException.java
      src/com/mysql/jdbc/exceptions/jdbc4/MySQLTransientException.java
      src/com/mysql/jdbc/integration/c3p0/MysqlConnectionTester.java
      src/com/mysql/jdbc/integration/jboss/ExtendedMysqlExceptionSorter.java
      src/com/mysql/jdbc/integration/jboss/MysqlValidConnectionChecker.java
      src/com/mysql/jdbc/interceptors/ResultSetScannerInterceptor.java
      src/com/mysql/jdbc/interceptors/ServerStatusDiffInterceptor.java
      src/com/mysql/jdbc/jdbc2/optional/CallableStatementWrapper.java
      src/com/mysql/jdbc/jdbc2/optional/ConnectionWrapper.java
      src/com/mysql/jdbc/jdbc2/optional/JDBC4CallableStatementWrapper.java
      src/com/mysql/jdbc/jdbc2/optional/JDBC4ConnectionWrapper.java
      src/com/mysql/jdbc/jdbc2/optional/JDBC4MysqlPooledConnection.java
      src/com/mysql/jdbc/jdbc2/optional/JDBC4MysqlXAConnection.java
      src/com/mysql/jdbc/jdbc2/optional/JDBC4PreparedStatementWrapper.java
      src/com/mysql/jdbc/jdbc2/optional/JDBC4StatementWrapper.java
      src/com/mysql/jdbc/jdbc2/optional/JDBC4SuspendableXAConnection.java
      src/com/mysql/jdbc/jdbc2/optional/MysqlConnectionPoolDataSource.java
      src/com/mysql/jdbc/jdbc2/optional/MysqlDataSource.java
      src/com/mysql/jdbc/jdbc2/optional/MysqlDataSourceFactory.java
      src/com/mysql/jdbc/jdbc2/optional/MysqlPooledConnection.java
      src/com/mysql/jdbc/jdbc2/optional/MysqlXAConnection.java
      src/com/mysql/jdbc/jdbc2/optional/MysqlXADataSource.java
      src/com/mysql/jdbc/jdbc2/optional/MysqlXAException.java
      src/com/mysql/jdbc/jdbc2/optional/MysqlXid.java
      src/com/mysql/jdbc/jdbc2/optional/PreparedStatementWrapper.java
      src/com/mysql/jdbc/jdbc2/optional/StatementWrapper.java
      src/com/mysql/jdbc/jdbc2/optional/WrapperBase.java
      src/com/mysql/jdbc/log/CommonsLogger.java
      src/com/mysql/jdbc/log/Jdk14Logger.java
      src/com/mysql/jdbc/log/Log.java
      src/com/mysql/jdbc/log/Log4JLogger.java
      src/com/mysql/jdbc/log/LogFactory.java
      src/com/mysql/jdbc/log/LogUtils.java
      src/com/mysql/jdbc/log/NullLogger.java
      src/com/mysql/jdbc/log/StandardLogger.java
      src/com/mysql/jdbc/profiler/LoggingProfilerEventHandler.java
      src/com/mysql/jdbc/profiler/ProfilerEvent.java
      src/com/mysql/jdbc/profiler/ProfilerEventHandler.java
      src/com/mysql/jdbc/profiler/ProfilerEventHandlerFactory.java
      src/com/mysql/jdbc/util/BaseBugReport.java
      src/com/mysql/jdbc/util/ErrorMappingsDocGenerator.java
      src/com/mysql/jdbc/util/LRUCache.java
      src/com/mysql/jdbc/util/PropertiesDocGenerator.java
      src/com/mysql/jdbc/util/ReadAheadInputStream.java
      src/com/mysql/jdbc/util/ResultSetUtil.java
      src/com/mysql/jdbc/util/ServerController.java
      src/com/mysql/jdbc/util/TimezoneDump.java
      src/com/mysql/jdbc/util/VersionFSHierarchyMaker.java
      src/org/gjt/mm/mysql/Driver.java
      src/testsuite/BaseTestCase.java
      src/testsuite/UnreliableSocketFactory.java
      src/testsuite/perf/BasePerfTest.java
      src/testsuite/perf/LoadStorePerfTest.java
      src/testsuite/perf/RetrievalPerfTest.java
      src/testsuite/regression/AppletRegressionTest.java
      src/testsuite/regression/BlobRegressionTest.java
      src/testsuite/regression/CachedRowsetTest.java
      src/testsuite/regression/CallableStatementRegressionTest.java
      src/testsuite/regression/ConnectionRegressionTest.java
      src/testsuite/regression/DataSourceRegressionTest.java
      src/testsuite/regression/EscapeProcessorRegressionTest.java
      src/testsuite/regression/MetaDataRegressionTest.java
      src/testsuite/regression/MicroPerformanceRegressionTest.java
      src/testsuite/regression/NumbersRegressionTest.java
      src/testsuite/regression/PooledConnectionRegressionTest.java
      src/testsuite/regression/ResultSetRegressionTest.java
      src/testsuite/regression/StatementRegressionTest.java
      src/testsuite/regression/StressRegressionTest.java
      src/testsuite/regression/StringRegressionTest.java
      src/testsuite/regression/SubqueriesRegressionTest.java
      src/testsuite/simple/BlobTest.java
      src/testsuite/simple/CallableStatementTest.java
      src/testsuite/simple/CharsetTests.java
      src/testsuite/simple/ConnectionTest.java
      src/testsuite/simple/DataSourceTest.java
      src/testsuite/simple/DateTest.java
      src/testsuite/simple/EscapeProcessingTest.java
      src/testsuite/simple/MetadataTest.java
      src/testsuite/simple/MiniAdminTest.java
      src/testsuite/simple/NumbersTest.java
      src/testsuite/simple/ResultSetTest.java
      src/testsuite/simple/SSLTest.java
      src/testsuite/simple/ServerControllerTest.java
      src/testsuite/simple/SimpleTransformer.java
      src/testsuite/simple/StatementsTest.java
      src/testsuite/simple/TransactionTest.java
      src/testsuite/simple/TraversalTest.java
      src/testsuite/simple/UpdatabilityTest.java
      src/testsuite/simple/XATest.java
      src/testsuite/simple/jdbc4/StatementsTest.java
=== modified file 'CHANGES'
--- a/CHANGES	2010-01-20 18:42:47 +0000
+++ b/CHANGES	2010-02-03 18:10:25 +0000
@@ -3,6 +3,9 @@
 
 nn-nn-10 - Version 5.1.12
 
+    - NO_INDEX_USED and NO_GOOD_INDEX used were only being set when profileSQL 
+      was set to "true", and in some cases their values were reversed.
+
 01-20-10 - Version 5.1.11
  
     - Fix for BUG#50288 - NullPointerException possible during invalidateCurrentConnection() for load-balanced

=== modified file 'build.xml'
--- a/build.xml	2010-01-28 23:59:15 +0000
+++ b/build.xml	2010-02-03 18:14:42 +0000
@@ -33,7 +33,7 @@
 
 	<property name="major_version" value="5"/>
 	<property name="minor_version" value="1"/>
-	<property name="subminor_version" value="11"/>
+	<property name="subminor_version" value="12"/>
 	<property name="version_status" value=""/>
 
 	<property name="version" value="${major_version}.${minor_version}.${subminor_version}${version_status}"/>

=== modified file 'src/com/mysql/jdbc/MysqlIO.java'
--- a/src/com/mysql/jdbc/MysqlIO.java	2010-01-28 23:59:15 +0000
+++ b/src/com/mysql/jdbc/MysqlIO.java	2010-02-03 18:10:25 +0000
@@ -2209,7 +2209,7 @@ class MysqlIO {
 
 	    		ProfilerEventHandler eventSink = ProfilerEventHandlerFactory.getInstance(this.connection);
 
-	    		if (this.queryBadIndexUsed) {
+	    		if (this.queryBadIndexUsed && this.profileSql) {
 	    			eventSink.consumeEvent(new ProfilerEvent(
 	    					ProfilerEvent.TYPE_SLOW_QUERY, "", catalog, //$NON-NLS-1$
 	    					this.connection.getId(),
@@ -2223,7 +2223,7 @@ class MysqlIO {
 	    							+profileQueryToLog));
 	    		}
 
-	    		if (this.queryNoIndexUsed) {
+	    		if (this.queryNoIndexUsed && this.profileSql) {
 	    			eventSink.consumeEvent(new ProfilerEvent(
 	    					ProfilerEvent.TYPE_SLOW_QUERY, "", catalog, //$NON-NLS-1$
 	    					this.connection.getId(),
@@ -2237,7 +2237,7 @@ class MysqlIO {
 	    							+profileQueryToLog));
 	    		}
 	    		
-	    		if (this.serverQueryWasSlow) {
+	    		if (this.serverQueryWasSlow && this.profileSql) {
 	    			eventSink.consumeEvent(new ProfilerEvent(
 	    					ProfilerEvent.TYPE_SLOW_QUERY, "", catalog, //$NON-NLS-1$
 	    					this.connection.getId(),
@@ -2682,14 +2682,12 @@ class MysqlIO {
     }
 
 	private void setServerSlowQueryFlags() {
-		if (this.profileSql) {
-		    this.queryNoIndexUsed = (this.serverStatus &
-		        SERVER_QUERY_NO_GOOD_INDEX_USED) != 0;
-		    this.queryBadIndexUsed = (this.serverStatus &
-		        SERVER_QUERY_NO_INDEX_USED) != 0;
-		    this.serverQueryWasSlow = (this.serverStatus & 
-		    	SERVER_QUERY_WAS_SLOW) != 0;
-		}
+	    this.queryBadIndexUsed = (this.serverStatus &
+	        SERVER_QUERY_NO_GOOD_INDEX_USED) != 0;
+	    this.queryNoIndexUsed = (this.serverStatus &
+	        SERVER_QUERY_NO_INDEX_USED) != 0;
+	    this.serverQueryWasSlow = (this.serverStatus & 
+	    	SERVER_QUERY_WAS_SLOW) != 0;
 	}
 
     private void checkForOutstandingStreamingData() throws SQLException {

=== modified file 'src/testsuite/regression/StatementRegressionTest.java'
--- a/src/testsuite/regression/StatementRegressionTest.java	2010-01-28 23:59:15 +0000
+++ b/src/testsuite/regression/StatementRegressionTest.java	2010-02-03 18:10:25 +0000
@@ -79,6 +79,7 @@ import com.mysql.jdbc.SQLError;
 import com.mysql.jdbc.ServerPreparedStatement;
 import com.mysql.jdbc.StatementImpl;
 import com.mysql.jdbc.StatementInterceptor;
+import com.mysql.jdbc.StatementInterceptorV2;
 import com.mysql.jdbc.exceptions.MySQLStatementCancelledException;
 import com.mysql.jdbc.exceptions.MySQLTimeoutException;
 
@@ -6355,4 +6356,66 @@ public class StatementRegressionTest ext
 			closeMemberJDBCResources();
 		}
 	}
+	
+	public void testReversalOfScanFlags() throws Exception {
+		createTable("testReversalOfScanFlags", "(field1 int)");
+		this.stmt.executeUpdate("INSERT INTO testReversalOfScanFlags VALUES (1),(2),(3)");
+		
+		Connection scanningConn = getConnectionWithProps(
+				"statementInterceptors=" + ScanDetectingInterceptor.class.getName());
+		
+		try {
+			ScanDetectingInterceptor.watchForScans = true;
+			scanningConn.createStatement().executeQuery("SELECT field1 FROM testReversalOfScanFlags");
+			assertTrue(ScanDetectingInterceptor.hasSeenScan);
+			assertFalse(ScanDetectingInterceptor.hasSeenBadIndex);
+		} finally {
+			scanningConn.close();
+		}
+		
+	}
+	public static class ScanDetectingInterceptor implements StatementInterceptorV2 {
+		static boolean watchForScans = false;
+		static boolean hasSeenScan = false;
+		static boolean hasSeenBadIndex = false;
+		
+		public void destroy() {
+			
+		}
+
+		public boolean executeTopLevelOnly() {
+			return false;
+		}
+
+		public void init(com.mysql.jdbc.Connection conn, Properties props)
+				throws SQLException {
+			
+		}
+
+		public ResultSetInternalMethods postProcess(String sql,
+				com.mysql.jdbc.Statement interceptedStatement,
+				ResultSetInternalMethods originalResultSet,
+				com.mysql.jdbc.Connection connection, int warningCount,
+				boolean noIndexUsed, boolean noGoodIndexUsed,
+				SQLException statementException) throws SQLException {
+			if (watchForScans) {
+				if (noIndexUsed) {
+					hasSeenScan = true;
+				} 
+				
+				if (noGoodIndexUsed) {
+					hasSeenBadIndex = true;
+				}
+			}
+			
+			return null;
+		}
+
+		public ResultSetInternalMethods preProcess(String sql,
+				com.mysql.jdbc.Statement interceptedStatement,
+				com.mysql.jdbc.Connection connection) throws SQLException {
+			return null;
+		}
+		
+	}
 }


Attachment: [text/bzr-bundle] bzr/markm@sun.com-20100203181442-4jt502ospcdbhprr.bundle
Thread
bzr push into connector-j/branches/branch_5_1 branch (markm:895 to 897) markm3 Feb