Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mysql/mysql-connector-j
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5.1.30
Choose a base ref
...
head repository: mysql/mysql-connector-j
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5.1.31
Choose a head ref
  • 17 commits
  • 38 files changed
  • 3 contributors

Commits on Mar 10, 2014

  1. Post-release changes.

    soklakov committed Mar 10, 2014
    Copy the full SHA
    91779b0 View commit details

Commits on Apr 1, 2014

  1. Fix for Bug#72006, Avoid creation of a character array in PreparedSta…

    …tement$ParseInfo.
    
    Fix for Bug#72008, Avoid useless object creation in StringUtils#getBytes-methods.
    fjssilva committed Apr 1, 2014
    Copy the full SHA
    97a992a View commit details

Commits on Apr 2, 2014

  1. Copy the full SHA
    a641b49 View commit details
  2. Fix for Bug#72000, java.lang.ArrayIndexOutOfBoundsException on java.s…

    …ql.ResultSet.getInt(String)
    fjssilva committed Apr 2, 2014
    Copy the full SHA
    45906c7 View commit details
  3. Copy the full SHA
    c993ba3 View commit details

Commits on Apr 15, 2014

  1. Copy the full SHA
    49f6a8c View commit details
  2. Fix for Bug#72326 (18598665), Typo in fullDebug.properties - gatherPe…

    …rMetrics should be gatherPerfMetrics
    soklakov committed Apr 15, 2014
    Copy the full SHA
    e32bb37 View commit details

Commits on Apr 16, 2014

  1. Fix for Bug#72301 (18549472), Fabric driver swallows exceptions throw…

    …n during connection creation using JDBC4
    Jess Balint committed Apr 16, 2014
    Copy the full SHA
    1b7ef73 View commit details

Commits on Apr 23, 2014

  1. Copy the full SHA
    59a904b View commit details

Commits on May 12, 2014

  1. Copy the full SHA
    8def602 View commit details

Commits on May 14, 2014

  1. Copy the full SHA
    bca70dd View commit details
  2. Copy the full SHA
    919d1ab View commit details

Commits on May 15, 2014

  1. Added support for sha256_password authentication with RSA encryption.

    Fix for Bug#71753 (18260918), Bad SSL socket transform.
    soklakov committed May 15, 2014
    Copy the full SHA
    2e697d6 View commit details

Commits on May 16, 2014

  1. Test cases updated to comply with MySQL 5.7.4 new STRICT_MODE behavio…

    …r and no longer supported IGNORE clause in ALTER TABLE statement.
    fjssilva committed May 16, 2014
    Copy the full SHA
    1e26c04 View commit details

Commits on May 19, 2014

  1. Fix for Bug#61213 (18009254), ON DUPLICATE KEY UPDATE breaks generate…

    …d key list when extended INSERT is used
    soklakov committed May 19, 2014
    Copy the full SHA
    2d550b2 View commit details
  2. Fix for Bug#66947 (16004987), Calling ServerPreparedStatement.close()…

    … twice corrupts cached statements.
    soklakov committed May 19, 2014
    Copy the full SHA
    d0b030f View commit details

Commits on May 20, 2014

  1. New version, 5.1.31

    soklakov committed May 20, 2014
    Copy the full SHA
    481d4d5 View commit details
Showing with 3,004 additions and 1,487 deletions.
  1. +38 −0 CHANGES
  2. +3 −1 build.xml
  3. +12 −0 src/com/mysql/fabric/jdbc/FabricMySQLConnectionProxy.java
  4. +1 −1 src/com/mysql/fabric/jdbc/FabricMySQLDriver.java
  5. +20 −1 src/com/mysql/jdbc/ConnectionImpl.java
  6. +8 −0 src/com/mysql/jdbc/ConnectionProperties.java
  7. +51 −0 src/com/mysql/jdbc/ConnectionPropertiesImpl.java
  8. +85 −12 src/com/mysql/jdbc/ExportControlled.java
  9. +31 −0 src/com/mysql/jdbc/LoadBalancedMySQLConnection.java
  10. +0 −1 src/com/mysql/jdbc/LoadBalancingConnectionProxy.java
  11. +9 −2 src/com/mysql/jdbc/LocalizedErrorMessages.properties
  12. +8 −0 src/com/mysql/jdbc/MySQLConnection.java
  13. +351 −304 src/com/mysql/jdbc/MysqlErrorNumbers.java
  14. +19 −28 src/com/mysql/jdbc/MysqlIO.java
  15. +10 −10 src/com/mysql/jdbc/PreparedStatement.java
  16. +4 −10 src/com/mysql/jdbc/ProfilerEventHandlerFactory.java
  17. +16 −0 src/com/mysql/jdbc/ReplicationConnection.java
  18. +518 −508 src/com/mysql/jdbc/SQLError.java
  19. +6 −5 src/com/mysql/jdbc/Security.java
  20. +3 −0 src/com/mysql/jdbc/ServerPreparedStatement.java
  21. +280 −259 src/com/mysql/jdbc/StringUtils.java
  22. +15 −7 src/com/mysql/jdbc/Util.java
  23. +123 −14 src/com/mysql/jdbc/authentication/Sha256PasswordPlugin.java
  24. +1 −1 src/com/mysql/jdbc/configs/fullDebug.properties
  25. +16 −0 src/com/mysql/jdbc/jdbc2/optional/ConnectionWrapper.java
  26. +93 −0 src/com/mysql/jdbc/util/Base64Decoder.java
  27. +4 −4 src/doc/sources/errorMapToDocbook.xsl
  28. +9 −3 src/testsuite/BaseTestCase.java
  29. +557 −77 src/testsuite/regression/ConnectionRegressionTest.java
  30. +38 −34 src/testsuite/regression/MetaDataRegressionTest.java
  31. +253 −114 src/testsuite/regression/ResultSetRegressionTest.java
  32. +102 −28 src/testsuite/regression/StatementRegressionTest.java
  33. +45 −5 src/testsuite/regression/StringRegressionTest.java
  34. +137 −13 src/testsuite/regression/SyntaxRegressionTest.java
  35. +52 −45 src/testsuite/simple/DateTest.java
  36. +65 −0 src/testsuite/simple/StringUtilsTest.java
  37. +15 −0 src/testsuite/ssl-test-certs/mykey.pem
  38. +6 −0 src/testsuite/ssl-test-certs/mykey.pub
38 changes: 38 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# Changelog
# $Id$
06-09-14 - Version 5.1.31

- Fix for Bug#66947 (16004987), Calling ServerPreparedStatement.close() twice corrupts cached statements.

- Fix for Bug#61213 (18009254), ON DUPLICATE KEY UPDATE breaks generated key list when extended INSERT is used

- Test cases updated to comply with MySQL 5.7.4 new STRICT_MODE behavior and no longer supported IGNORE clause in
ALTER TABLE statement.

- Added support for sha256_password authentication with RSA encryption.

- Fix for Bug#71753 (18260918), Bad SSL socket transform.

- Added tests for changes in GET DIAGNOSTIC syntax introduced in MySQL 5.7.0.

- Fix for Bug#67803 (16708231), XA commands sent twice to MySQL server.
Thanks to Andrej Golovnin for his contribution.

- Fix for Bug#55680 (16737192), MySQL Connector/J memory leak

- Fix for Bug#72326 (18598665), Typo in fullDebug.properties - gatherPerMetrics should be gatherPerfMetrics

- Fix for Bug#72023 (18403456), Avoid byte array creation in MysqlIO#unpackBinaryResultSetRow.
Thanks to Andrej Golovnin for his contribution.

- Fix for Bug#72000 (18402873), java.lang.ArrayIndexOutOfBoundsException on java.sql.ResultSet.getInt(String).

- Fix for Bug#71850 (18318197), init() is called twice on exception interceptors

- Fix for Bug#72008 (18389973), Avoid useless object creation in StringUtils#getBytes-methods.
Thanks to Andrej Golovnin for his contribution.

- Fix for Bug#72006 (18403199), Avoid creation of a character array in PreparedStatement$ParseInfo.
Thanks to Andrej Golovnin for his contribution.
Additionally, unneeded StringBuffer replaced by StringBuilder instances in StringUtils.

- Fix for Bug#72301 (18549472), Fabric driver swallows exceptions thrown during connection creation using JDBC4

03-28-14 - Version 5.1.30

- Fix for Bug#71679 (18236388), Avoid iterator creation when invoking statement interceptors in MysqlIO.
4 changes: 3 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@

<property name="major_version" value="5"/>
<property name="minor_version" value="1"/>
<property name="subminor_version" value="30"/>
<property name="subminor_version" value="31"/>
<property name="version_status" value=""/>

<property name="version" value="${major_version}.${minor_version}.${subminor_version}${version_status}"/>
@@ -965,6 +965,7 @@ and the full path to the rt.jar from Java-6 with the property &quot;com.mysql.jd

<java classname="com.mysql.jdbc.util.PropertiesDocGenerator"
output="${properties-xml}" classpath="${buildDir}/${fullProdName}"/>
<copy file="${properties-xml}" tofile="${buildDir}/${fullProdName}/docs/sources/connPropsToDocbook.xml"/>
<tempfile property="docsPropXslTempfile" suffix="xsl"/>
<copy file="${buildDir}/${fullProdName}/doc/sources/connPropsToDocbook.xsl" tofile="${docsPropXslTempfile}"/>

@@ -979,6 +980,7 @@ and the full path to the rt.jar from Java-6 with the property &quot;com.mysql.jd

<java classname="com.mysql.jdbc.util.ErrorMappingsDocGenerator"
output="${errorsMapping-xml}" classpath="${buildDir}/${fullProdName}"/>
<copy file="${errorsMapping-xml}" tofile="${buildDir}/${fullProdName}/docs/sources/errorMapToDocbook.xml"/>
<tempfile property="docsErrorXslTempfile" suffix="xsl"/>
<copy file="${buildDir}/${fullProdName}/doc/sources/errorMapToDocbook.xsl" tofile="${docsErrorXslTempfile}"/>

12 changes: 12 additions & 0 deletions src/com/mysql/fabric/jdbc/FabricMySQLConnectionProxy.java
Original file line number Diff line number Diff line change
@@ -68,6 +68,7 @@
import com.mysql.jdbc.StatementImpl;
import com.mysql.jdbc.StatementInterceptorV2;
import com.mysql.jdbc.log.Log;
import com.mysql.jdbc.profiler.ProfilerEventHandler;

/**
* A proxy to a set of MySQL servers managed by MySQL Fabric.
@@ -2789,4 +2790,15 @@ public SQLWarning getWarnings() {
public String nativeSQL(String sql) {
return null;
}

public ProfilerEventHandler getProfilerEventHandlerInstance() {
return null;
}

public void setProfilerEventHandlerInstance(ProfilerEventHandler h) {
}

public void decachePreparedStatement(ServerPreparedStatement pstmt)
throws SQLException {
}
}
2 changes: 1 addition & 1 deletion src/com/mysql/fabric/jdbc/FabricMySQLDriver.java
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ public Connection connect(String url, Properties info) throws SQLException {
return (Connection) com.mysql.jdbc.Util.handleNewInstance(jdbc4proxy,
new Object[] { parsedProps }, null);
} catch (Exception e) {
throw new SQLException(e.getMessage());
throw (SQLException) new SQLException(e.getMessage()).initCause(e);
}
}

21 changes: 20 additions & 1 deletion src/com/mysql/jdbc/ConnectionImpl.java
Original file line number Diff line number Diff line change
@@ -1217,6 +1217,8 @@ private boolean canHandleAsServerPreparedStatementNoCache(String sql)
}

canHandleAsStatement = !foundLimitWithPlaceholder;
} else if (StringUtils.startsWithIgnoreCaseAndWs(sql, "XA ")) {
canHandleAsStatement = false;
} else if (StringUtils.startsWithIgnoreCaseAndWs(sql, "CREATE TABLE")) {
canHandleAsStatement = false;
} else if (StringUtils.startsWithIgnoreCaseAndWs(sql, "DO")) {
@@ -3524,7 +3526,6 @@ private void initializeDriverProperties(Properties info)

if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
this.exceptionInterceptor.init(this, info);
}

this.usePlatformCharsetConverters = getUseJvmCharsetConverters();
@@ -4769,6 +4770,16 @@ public void recachePreparedStatement(ServerPreparedStatement pstmt) throws SQLEx
}
}

public void decachePreparedStatement(ServerPreparedStatement pstmt) throws SQLException {
synchronized (getConnectionMutex()) {
if (pstmt.isPoolable()) {
synchronized (this.serverSideStatementCache) {
this.serverSideStatementCache.remove(pstmt.originalSql);
}
}
}
}

/**
* DOCUMENT ME!
*
@@ -6112,4 +6123,12 @@ public int getNetworkTimeout() throws SQLException {
return getSocketTimeout();
}
}

public ProfilerEventHandler getProfilerEventHandlerInstance() {
return this.eventSink;
}

public void setProfilerEventHandlerInstance(ProfilerEventHandler h) {
this.eventSink = h;
}
}
8 changes: 8 additions & 0 deletions src/com/mysql/jdbc/ConnectionProperties.java
Original file line number Diff line number Diff line change
@@ -1739,4 +1739,12 @@ public abstract void setJdbcCompliantTruncationForReads(

String getConnectionAttributes() throws SQLException;

public abstract String getServerRSAPublicKeyFile();

public abstract void setServerRSAPublicKeyFile(String serverRSAPublicKeyFile) throws SQLException;

public abstract boolean getAllowPublicKeyRetrieval();

public abstract void setAllowPublicKeyRetrieval(boolean allowPublicKeyRetrieval) throws SQLException;

}
51 changes: 51 additions & 0 deletions src/com/mysql/jdbc/ConnectionPropertiesImpl.java
Original file line number Diff line number Diff line change
@@ -105,6 +105,7 @@ void initializeFrom(String extractedValue, ExceptionInterceptor exceptionInterce
} else {
this.valueAsObject = this.defaultValue;
}
this.updateCount++;
}

/**
@@ -116,6 +117,7 @@ boolean isRangeBased() {

void setValue(boolean valueFlag) {
this.valueAsObject = Boolean.valueOf(valueFlag);
this.updateCount++;
}
}

@@ -145,6 +147,8 @@ static abstract class ConnectionProperty implements Serializable {

String description;

int updateCount = 0;

public ConnectionProperty() {}

ConnectionProperty(String propertyNameToSet, Object defaultValueToSet,
@@ -203,6 +207,10 @@ Object getValueAsObject() {
return this.valueAsObject;
}

int getUpdateCount() {
return this.updateCount;
}

abstract boolean hasValueConstraints();

void initializeFrom(Properties extractFrom, ExceptionInterceptor exceptionInterceptor) throws SQLException {
@@ -243,6 +251,7 @@ void setOrder(int order) {

void setValueAsObject(Object obj) {
this.valueAsObject = obj;
this.updateCount++;
}

void storeTo(Reference ref) {
@@ -409,6 +418,7 @@ void initializeFrom(String extractedValue, ExceptionInterceptor exceptionInterce
} else {
this.valueAsObject = this.defaultValue;
}
this.updateCount++;
}

/**
@@ -433,6 +443,7 @@ void setValue(int intValue, String valueAsString, ExceptionInterceptor exception
}

this.valueAsObject = Integer.valueOf(intValue);
this.updateCount++;
}
}

@@ -473,6 +484,7 @@ void setValue(long longValue, String valueAsString, ExceptionInterceptor excepti
}
}
this.valueAsObject = Long.valueOf(longValue);
this.updateCount++;
}

long getValueAsLong() {
@@ -497,6 +509,7 @@ void initializeFrom(String extractedValue, ExceptionInterceptor exceptionInterce
} else {
this.valueAsObject = this.defaultValue;
}
this.updateCount++;
}
}

@@ -618,6 +631,7 @@ void initializeFrom(String extractedValue, ExceptionInterceptor exceptionInterce
} else {
this.valueAsObject = this.defaultValue;
}
this.updateCount++;
}

/**
@@ -629,6 +643,7 @@ boolean isRangeBased() {

void setValue(String valueFlag) {
this.valueAsObject = valueFlag;
this.updateCount++;
}
}

@@ -1866,6 +1881,16 @@ protected static DriverPropertyInfo[] exposeAsDriverPropertyInfo(
Messages.getString("ConnectionProperties.detectCustomCollations"),
"5.1.29", MISC_CATEGORY, Integer.MIN_VALUE);

private StringConnectionProperty serverRSAPublicKeyFile = new StringConnectionProperty(
"serverRSAPublicKeyFile", null, //$NON-NLS-1$
Messages.getString("ConnectionProperties.serverRSAPublicKeyFile"), "5.1.31",
SECURITY_CATEGORY, Integer.MIN_VALUE);

private BooleanConnectionProperty allowPublicKeyRetrieval = new BooleanConnectionProperty(
"allowPublicKeyRetrieval", false,
Messages.getString("ConnectionProperties.allowPublicKeyRetrieval"), "5.1.31",
SECURITY_CATEGORY, Integer.MIN_VALUE);

protected DriverPropertyInfo[] exposeAsDriverPropertyInfoInternal(
Properties info, int slotsToReserve) throws SQLException {
initializeProperties(info);
@@ -4805,4 +4830,30 @@ public boolean getDetectCustomCollations() {
return this.detectCustomCollations.getValueAsBoolean();
}

public String getServerRSAPublicKeyFile() {
return this.serverRSAPublicKeyFile.getValueAsString();
}

public void setServerRSAPublicKeyFile(String serverRSAPublicKeyFile) throws SQLException {
if (this.serverRSAPublicKeyFile.getUpdateCount() > 0) {
throw SQLError.createSQLException(
Messages.getString("ConnectionProperties.dynamicChangeIsNotAllowed", new Object[]{"'serverRSAPublicKeyFile'"}),
SQLError.SQL_STATE_ILLEGAL_ARGUMENT, null);
}
this.serverRSAPublicKeyFile.setValue(serverRSAPublicKeyFile);
}

public boolean getAllowPublicKeyRetrieval() {
return this.allowPublicKeyRetrieval.getValueAsBoolean();
}

public void setAllowPublicKeyRetrieval(boolean allowPublicKeyRetrieval) throws SQLException {
if (this.allowPublicKeyRetrieval.getUpdateCount() > 0) {
throw SQLError.createSQLException(
Messages.getString("ConnectionProperties.dynamicChangeIsNotAllowed", new Object[]{"'allowPublicKeyRetrieval'"}),
SQLError.SQL_STATE_ILLEGAL_ARGUMENT, null);
}
this.allowPublicKeyRetrieval.setValue(allowPublicKeyRetrieval);
}

}
Loading