├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── documentation.yml │ └── feature_request.yml ├── dependabot.yml ├── pull_request_template.md └── workflows │ ├── main.yml │ ├── maven_release.yml │ ├── maven_snapshot.yml │ ├── performance.yml │ ├── pull_request.yml │ ├── release_draft.yml │ └── remove-old-artifacts.yml ├── .gitignore ├── .settings ├── org.eclipse.core.resources.prefs ├── org.eclipse.jdt.core.prefs ├── org.eclipse.jdt.launching.prefs └── org.eclipse.jdt.ui.prefs ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README ├── README.md ├── RELEASE_POLICY.md ├── THIRD-PARTY-LICENSES ├── build.gradle.kts ├── config └── checkstyle │ └── checkstyle.xml ├── docker ├── docker-compose.yml ├── docker-entrypoint-initdb.d │ └── grant-root.sql └── plugins │ ├── auth.dll │ ├── auth.so │ ├── auth_test_plugin.dll │ └── auth_test_plugin.so ├── docs ├── files │ ├── images │ │ ├── connection_plugin_manager_diagram.png │ │ ├── enhanced_failure_monitoring_diagram.png │ │ ├── failover_diagram.png │ │ ├── icon.png │ │ └── texture.png │ ├── jquery.min.js │ ├── masonry.pkgd.min.js │ ├── scripts.js │ └── style.css └── index.html ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle.kts └── src ├── build ├── java │ ├── documentation │ │ ├── ErrorMappingsDocGenerator.java │ │ └── PropertiesDocGenerator.java │ └── instrumentation │ │ ├── AddMethods.java │ │ ├── CommonChecks.java │ │ └── TranslateExceptions.java └── misc │ ├── Product.wxs │ ├── debian.in │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ ├── install │ ├── links │ ├── rules │ ├── source │ │ └── format │ └── watch │ ├── pom-relocation.xml │ ├── pom.xml │ └── rpm.spec.in ├── demo └── java │ ├── customplugins │ ├── ExecutionTimeConnectionPlugin.java │ ├── ExecutionTimeConnectionPluginFactory.java │ ├── MethodCountConnectionPlugin.java │ ├── MethodCountConnectionPluginFactory.java │ ├── README.md │ ├── SampleApplication.java │ └── diagrams │ │ └── connection_plugin_chain.png │ └── demo │ └── x │ └── devapi │ └── DevApiSample.java ├── generated └── java │ └── com │ └── mysql │ └── cj │ └── x │ └── protobuf │ ├── Mysqlx.java │ ├── MysqlxConnection.java │ ├── MysqlxCrud.java │ ├── MysqlxCursor.java │ ├── MysqlxDatatypes.java │ ├── MysqlxExpect.java │ ├── MysqlxExpr.java │ ├── MysqlxNotice.java │ ├── MysqlxPrepare.java │ ├── MysqlxResultset.java │ ├── MysqlxSession.java │ ├── MysqlxSql.java │ └── package-info.java ├── legacy └── java │ └── com │ └── mysql │ └── jdbc │ ├── Driver.java │ ├── SocketFactory.java │ └── SocketFactoryWrapper.java ├── main ├── core-api │ └── java │ │ └── com │ │ └── mysql │ │ └── cj │ │ ├── BindValue.java │ │ ├── CacheAdapter.java │ │ ├── CacheAdapterFactory.java │ │ ├── CancelQueryTask.java │ │ ├── CharsetMapping.java │ │ ├── CharsetSettings.java │ │ ├── Constants.java │ │ ├── DataStoreMetadata.java │ │ ├── MessageBuilder.java │ │ ├── Messages.java │ │ ├── MysqlConnection.java │ │ ├── MysqlType.java │ │ ├── PerConnectionLRUFactory.java │ │ ├── PingTarget.java │ │ ├── PreparedQuery.java │ │ ├── Query.java │ │ ├── QueryAttributesBindings.java │ │ ├── QueryBindings.java │ │ ├── QueryInfo.java │ │ ├── QueryResult.java │ │ ├── QueryReturnType.java │ │ ├── ServerVersion.java │ │ ├── Session.java │ │ ├── TransactionEventHandler.java │ │ ├── WarningListener.java │ │ ├── callback │ │ ├── FidoAuthenticationCallback.java │ │ ├── MysqlCallback.java │ │ ├── MysqlCallbackHandler.java │ │ └── UsernameCallback.java │ │ ├── conf │ │ ├── ConnectionPropertiesTransform.java │ │ ├── ConnectionUrl.java │ │ ├── ConnectionUrlParser.java │ │ ├── DatabaseUrlContainer.java │ │ ├── HostInfo.java │ │ ├── HostsListView.java │ │ ├── PropertyDefinition.java │ │ ├── PropertyDefinitions.java │ │ ├── PropertyKey.java │ │ ├── PropertySet.java │ │ └── RuntimeProperty.java │ │ ├── exceptions │ │ ├── AssertionFailedException.java │ │ ├── CJCommunicationsException.java │ │ ├── CJConnectionFeatureNotAvailableException.java │ │ ├── CJException.java │ │ ├── CJOperationNotSupportedException.java │ │ ├── CJPacketTooBigException.java │ │ ├── CJTimeoutException.java │ │ ├── ClosedOnExpiredPasswordException.java │ │ ├── ConnectionIsClosedException.java │ │ ├── DataConversionException.java │ │ ├── DataReadException.java │ │ ├── DataTruncationException.java │ │ ├── DeadlockTimeoutRollbackMarker.java │ │ ├── ExceptionFactory.java │ │ ├── ExceptionInterceptor.java │ │ ├── ExceptionInterceptorChain.java │ │ ├── FeatureNotAvailableException.java │ │ ├── InvalidConnectionAttributeException.java │ │ ├── MysqlErrorNumbers.java │ │ ├── NumberOutOfRange.java │ │ ├── OperationCancelledException.java │ │ ├── PasswordExpiredException.java │ │ ├── PropertyNotModifiableException.java │ │ ├── RSAException.java │ │ ├── SSLParamsException.java │ │ ├── StatementIsClosedException.java │ │ ├── StreamingNotifiable.java │ │ ├── UnableToConnectException.java │ │ ├── UnsupportedConnectionStringException.java │ │ └── WrongArgumentException.java │ │ ├── interceptors │ │ └── QueryInterceptor.java │ │ ├── log │ │ ├── Jdk14Logger.java │ │ ├── Log.java │ │ ├── NullLogger.java │ │ ├── ProfilerEvent.java │ │ ├── ProfilerEventHandler.java │ │ ├── Slf4JLogger.java │ │ └── StandardLogger.java │ │ ├── protocol │ │ ├── AuthenticationPlugin.java │ │ ├── AuthenticationProvider.java │ │ ├── ColumnDefinition.java │ │ ├── FullReadInputStream.java │ │ ├── InternalDate.java │ │ ├── InternalTime.java │ │ ├── InternalTimestamp.java │ │ ├── Message.java │ │ ├── MessageHeader.java │ │ ├── MessageListener.java │ │ ├── MessageReader.java │ │ ├── MessageSender.java │ │ ├── NetworkResources.java │ │ ├── OutputStreamWatcher.java │ │ ├── PacketReceivedTimeHolder.java │ │ ├── PacketSentTimeHolder.java │ │ ├── Protocol.java │ │ ├── ProtocolEntity.java │ │ ├── ProtocolEntityFactory.java │ │ ├── ProtocolEntityReader.java │ │ ├── ResultBuilder.java │ │ ├── ResultStreamer.java │ │ ├── Resultset.java │ │ ├── ResultsetRow.java │ │ ├── ResultsetRows.java │ │ ├── ResultsetRowsOwner.java │ │ ├── ServerCapabilities.java │ │ ├── ServerSession.java │ │ ├── ServerSessionStateController.java │ │ ├── SocketConnection.java │ │ ├── SocketFactory.java │ │ ├── SocketMetadata.java │ │ ├── ValueDecoder.java │ │ ├── ValueEncoder.java │ │ ├── Warning.java │ │ └── WatchableStream.java │ │ ├── result │ │ ├── Field.java │ │ ├── Row.java │ │ ├── RowList.java │ │ └── ValueFactory.java │ │ └── util │ │ ├── Base64Decoder.java │ │ ├── CacheMap.java │ │ ├── DataTypeUtil.java │ │ ├── DnsSrv.java │ │ ├── EscapeTokenizer.java │ │ ├── ExpiringCache.java │ │ ├── IpAddressUtils.java │ │ ├── LRUCache.java │ │ ├── LazyString.java │ │ ├── LogUtils.java │ │ ├── PerVmServerConfigCacheFactory.java │ │ ├── SaslPrep.java │ │ ├── SearchMode.java │ │ ├── SequentialIdLease.java │ │ ├── StringInspector.java │ │ ├── StringUtils.java │ │ ├── TestUtils.java │ │ ├── TimeUtil.java │ │ └── Util.java ├── core-impl │ └── java │ │ └── com │ │ └── mysql │ │ └── cj │ │ ├── AbstractQuery.java │ │ ├── CancelQueryTaskImpl.java │ │ ├── ClientPreparedQuery.java │ │ ├── CoreSession.java │ │ ├── DataStoreMetadataImpl.java │ │ ├── LicenseConfiguration.java │ │ ├── MysqlxSession.java │ │ ├── NativeCharsetSettings.java │ │ ├── NativeQueryAttributesBindings.java │ │ ├── NativeQueryBindValue.java │ │ ├── NativeQueryBindings.java │ │ ├── NativeSession.java │ │ ├── NoSubInterceptorWrapper.java │ │ ├── ServerPreparedQuery.java │ │ ├── ServerPreparedQueryTestcaseGenerator.java │ │ ├── SimpleQuery.java │ │ ├── admin │ │ └── ServerController.java │ │ ├── conf │ │ ├── AbstractPropertyDefinition.java │ │ ├── AbstractRuntimeProperty.java │ │ ├── BooleanProperty.java │ │ ├── BooleanPropertyDefinition.java │ │ ├── DefaultPropertySet.java │ │ ├── EnumProperty.java │ │ ├── EnumPropertyDefinition.java │ │ ├── IntegerProperty.java │ │ ├── IntegerPropertyDefinition.java │ │ ├── LongProperty.java │ │ ├── LongPropertyDefinition.java │ │ ├── MemorySizeProperty.java │ │ ├── MemorySizePropertyDefinition.java │ │ ├── StringProperty.java │ │ ├── StringPropertyDefinition.java │ │ └── url │ │ │ ├── AwsSingleConnectionUrl.java │ │ │ ├── FailoverConnectionUrl.java │ │ │ ├── FailoverDnsSrvConnectionUrl.java │ │ │ ├── LoadBalanceConnectionUrl.java │ │ │ ├── LoadBalanceDnsSrvConnectionUrl.java │ │ │ ├── ReplicationConnectionUrl.java │ │ │ ├── ReplicationDnsSrvConnectionUrl.java │ │ │ ├── SingleConnectionUrl.java │ │ │ ├── XDevApiConnectionUrl.java │ │ │ └── XDevApiDnsSrvConnectionUrl.java │ │ ├── log │ │ ├── BaseMetricsHolder.java │ │ ├── LogFactory.java │ │ ├── LoggingProfilerEventHandler.java │ │ └── ProfilerEventImpl.java │ │ ├── protocol │ │ ├── AbstractProtocol.java │ │ ├── AbstractSocketConnection.java │ │ ├── ExportControlled.java │ │ ├── NamedPipeSocketFactory.java │ │ ├── ReadAheadInputStream.java │ │ ├── Security.java │ │ ├── SocksProxySocketFactory.java │ │ ├── StandardSocketFactory.java │ │ ├── WatchableOutputStream.java │ │ ├── WatchableWriter.java │ │ ├── WriterWatcher.java │ │ └── result │ │ │ └── AbstractResultsetRow.java │ │ ├── result │ │ ├── AbstractDateTimeValueFactory.java │ │ ├── AbstractNumericValueFactory.java │ │ ├── BigDecimalValueFactory.java │ │ ├── BinaryStreamValueFactory.java │ │ ├── BooleanValueFactory.java │ │ ├── BufferedRowList.java │ │ ├── ByteValueFactory.java │ │ ├── DefaultColumnDefinition.java │ │ ├── DefaultValueFactory.java │ │ ├── DoubleValueFactory.java │ │ ├── DurationValueFactory.java │ │ ├── FloatValueFactory.java │ │ ├── IntegerValueFactory.java │ │ ├── LocalDateTimeValueFactory.java │ │ ├── LocalDateValueFactory.java │ │ ├── LocalTimeValueFactory.java │ │ ├── LongValueFactory.java │ │ ├── OffsetDateTimeValueFactory.java │ │ ├── OffsetTimeValueFactory.java │ │ ├── ShortValueFactory.java │ │ ├── SqlDateValueFactory.java │ │ ├── SqlTimeValueFactory.java │ │ ├── SqlTimestampValueFactory.java │ │ ├── StringValueFactory.java │ │ ├── UtilCalendarValueFactory.java │ │ └── ZonedDateTimeValueFactory.java │ │ └── sasl │ │ ├── ScramSha1SaslClient.java │ │ ├── ScramSha256SaslClient.java │ │ ├── ScramShaSaslClient.java │ │ ├── ScramShaSaslClientFactory.java │ │ └── ScramShaSaslProvider.java ├── doc │ ├── connector-j-overview.html │ └── mysqlx-overview.html ├── protocol-impl │ └── java │ │ └── com │ │ └── mysql │ │ └── cj │ │ └── protocol │ │ ├── a │ │ ├── AbstractRowFactory.java │ │ ├── AbstractValueEncoder.java │ │ ├── BinaryResultsetReader.java │ │ ├── BinaryRowFactory.java │ │ ├── BlobValueEncoder.java │ │ ├── BooleanValueEncoder.java │ │ ├── ByteArrayValueEncoder.java │ │ ├── ClobValueEncoder.java │ │ ├── ColumnDefinitionFactory.java │ │ ├── ColumnDefinitionReader.java │ │ ├── CompressedInputStream.java │ │ ├── CompressedPacketSender.java │ │ ├── DebugBufferingPacketReader.java │ │ ├── DebugBufferingPacketSender.java │ │ ├── DurationValueEncoder.java │ │ ├── InputStreamValueEncoder.java │ │ ├── InstantValueEncoder.java │ │ ├── LocalDateTimeValueEncoder.java │ │ ├── LocalDateValueEncoder.java │ │ ├── LocalTimeValueEncoder.java │ │ ├── MergingColumnDefinitionFactory.java │ │ ├── MultiPacketReader.java │ │ ├── MysqlBinaryValueDecoder.java │ │ ├── MysqlTextValueDecoder.java │ │ ├── NativeAuthenticationProvider.java │ │ ├── NativeCapabilities.java │ │ ├── NativeConstants.java │ │ ├── NativeMessageBuilder.java │ │ ├── NativePacketHeader.java │ │ ├── NativePacketPayload.java │ │ ├── NativeProtocol.java │ │ ├── NativeServerSession.java │ │ ├── NativeServerSessionStateController.java │ │ ├── NativeSocketConnection.java │ │ ├── NativeUtils.java │ │ ├── NullValueEncoder.java │ │ ├── NumberValueEncoder.java │ │ ├── OffsetDateTimeValueEncoder.java │ │ ├── OffsetTimeValueEncoder.java │ │ ├── PacketSplitter.java │ │ ├── ReaderValueEncoder.java │ │ ├── ResultsetFactory.java │ │ ├── ResultsetRowReader.java │ │ ├── SimplePacketReader.java │ │ ├── SimplePacketSender.java │ │ ├── SqlDateValueEncoder.java │ │ ├── SqlTimeValueEncoder.java │ │ ├── SqlTimestampValueEncoder.java │ │ ├── StringValueEncoder.java │ │ ├── TextResultsetReader.java │ │ ├── TextRowFactory.java │ │ ├── TimeTrackingPacketReader.java │ │ ├── TimeTrackingPacketSender.java │ │ ├── TracingPacketReader.java │ │ ├── TracingPacketSender.java │ │ ├── UtilCalendarValueEncoder.java │ │ ├── UtilDateValueEncoder.java │ │ ├── ZonedDateTimeValueEncoder.java │ │ ├── authentication │ │ │ ├── AuthenticationFidoClient.java │ │ │ ├── AuthenticationKerberosClient.java │ │ │ ├── AuthenticationLdapSaslClientPlugin.java │ │ │ ├── AuthenticationOciClient.java │ │ │ ├── AwsIamAuthenticationPlugin.java │ │ │ ├── AwsIamAuthenticationTokenHelper.java │ │ │ ├── AwsIamClearAuthenticationPlugin.java │ │ │ ├── CachingSha2PasswordPlugin.java │ │ │ ├── MysqlClearPasswordPlugin.java │ │ │ ├── MysqlNativePasswordPlugin.java │ │ │ ├── MysqlOldPasswordPlugin.java │ │ │ └── Sha256PasswordPlugin.java │ │ └── result │ │ │ ├── AbstractBufferRow.java │ │ │ ├── AbstractResultsetRows.java │ │ │ ├── BinaryBufferRow.java │ │ │ ├── ByteArrayRow.java │ │ │ ├── NativeResultset.java │ │ │ ├── OkPacket.java │ │ │ ├── ResultsetRowsCursor.java │ │ │ ├── ResultsetRowsStatic.java │ │ │ ├── ResultsetRowsStreaming.java │ │ │ └── TextBufferRow.java │ │ └── x │ │ ├── CompressionAlgorithm.java │ │ ├── CompressionMode.java │ │ ├── CompressionSplittedInputStream.java │ │ ├── CompressionSplittedOutputStream.java │ │ ├── CompressorStreamsFactory.java │ │ ├── ConfinedInputStream.java │ │ ├── ContinuousInputStream.java │ │ ├── ContinuousOutputStream.java │ │ ├── ErrorToFutureCompletionHandler.java │ │ ├── FetchDoneEntity.java │ │ ├── FetchDoneEntityFactory.java │ │ ├── FetchDoneMoreResults.java │ │ ├── FetchDoneMoreResultsFactory.java │ │ ├── FieldFactory.java │ │ ├── MessageConstants.java │ │ ├── Notice.java │ │ ├── NoticeFactory.java │ │ ├── Ok.java │ │ ├── OkBuilder.java │ │ ├── OkFactory.java │ │ ├── ResultMessageListener.java │ │ ├── ReusableOutputStream.java │ │ ├── StatementExecuteOk.java │ │ ├── StatementExecuteOkBuilder.java │ │ ├── StatementExecuteOkFactory.java │ │ ├── SyncFlushDeflaterOutputStream.java │ │ ├── SyncMessageReader.java │ │ ├── SyncMessageSender.java │ │ ├── XAuthenticationProvider.java │ │ ├── XMessage.java │ │ ├── XMessageBuilder.java │ │ ├── XMessageHeader.java │ │ ├── XProtocol.java │ │ ├── XProtocolDecoder.java │ │ ├── XProtocolError.java │ │ ├── XProtocolRow.java │ │ ├── XProtocolRowFactory.java │ │ ├── XProtocolRowInputStream.java │ │ ├── XServerCapabilities.java │ │ ├── XServerSession.java │ │ └── XpluginStatementCommand.java ├── resources │ └── com │ │ └── mysql │ │ └── cj │ │ ├── LocalizedErrorMessages.properties │ │ ├── TlsSettings.properties │ │ ├── configurations │ │ ├── 3-0-Compat.properties │ │ ├── clusterBase.properties │ │ ├── coldFusion.properties │ │ ├── fullDebug.properties │ │ ├── maxPerformance-8-0.properties │ │ ├── maxPerformance.properties │ │ └── solarisMaxPerformance.properties │ │ └── util │ │ └── TimeZoneMapping.properties ├── user-api │ └── java │ │ └── com │ │ └── mysql │ │ └── cj │ │ ├── jdbc │ │ ├── ClientInfoProvider.java │ │ ├── JdbcConnection.java │ │ ├── JdbcPreparedStatement.java │ │ ├── JdbcPropertySet.java │ │ ├── JdbcStatement.java │ │ ├── ParameterBindings.java │ │ ├── ha │ │ │ ├── BalanceStrategy.java │ │ │ ├── LoadBalanceExceptionChecker.java │ │ │ ├── LoadBalancedConnection.java │ │ │ └── ReplicationConnection.java │ │ ├── interceptors │ │ │ └── ConnectionLifecycleInterceptor.java │ │ └── result │ │ │ ├── CachedResultSetMetaData.java │ │ │ └── ResultSetInternalMethods.java │ │ └── xdevapi │ │ ├── AddResult.java │ │ ├── AddStatement.java │ │ ├── Client.java │ │ ├── ClientFactory.java │ │ ├── Collection.java │ │ ├── Column.java │ │ ├── DatabaseObject.java │ │ ├── DbDoc.java │ │ ├── DeleteStatement.java │ │ ├── DocResult.java │ │ ├── Expression.java │ │ ├── FetchResult.java │ │ ├── FilterParams.java │ │ ├── FindStatement.java │ │ ├── InsertResult.java │ │ ├── InsertStatement.java │ │ ├── JsonValue.java │ │ ├── ModifyStatement.java │ │ ├── RemoveStatement.java │ │ ├── Result.java │ │ ├── Row.java │ │ ├── RowResult.java │ │ ├── Schema.java │ │ ├── SelectStatement.java │ │ ├── Session.java │ │ ├── SessionFactory.java │ │ ├── SqlResult.java │ │ ├── SqlStatement.java │ │ ├── Statement.java │ │ ├── Table.java │ │ ├── Type.java │ │ ├── UpdateStatement.java │ │ ├── UpdateType.java │ │ ├── Warning.java │ │ ├── XDevAPIError.java │ │ └── package-info.java └── user-impl │ └── java │ ├── com │ └── mysql │ │ └── cj │ │ ├── jdbc │ │ ├── AbandonedConnectionCleanupThread.java │ │ ├── Blob.java │ │ ├── BlobFromLocator.java │ │ ├── CallableStatement.java │ │ ├── CallableStatementWrapper.java │ │ ├── ClientInfoProviderSP.java │ │ ├── ClientPreparedStatement.java │ │ ├── Clob.java │ │ ├── CommentClientInfoProvider.java │ │ ├── ConnectionGroup.java │ │ ├── ConnectionGroupManager.java │ │ ├── ConnectionImpl.java │ │ ├── ConnectionWrapper.java │ │ ├── DatabaseMetaData.java │ │ ├── DatabaseMetaDataUsingInfoSchema.java │ │ ├── Driver.java │ │ ├── EscapeProcessor.java │ │ ├── EscapeProcessorResult.java │ │ ├── IterateBlock.java │ │ ├── JdbcPropertySetImpl.java │ │ ├── MysqlConnectionPoolDataSource.java │ │ ├── MysqlDataSource.java │ │ ├── MysqlDataSourceFactory.java │ │ ├── MysqlParameterMetadata.java │ │ ├── MysqlPooledConnection.java │ │ ├── MysqlSQLXML.java │ │ ├── MysqlSavepoint.java │ │ ├── MysqlXAConnection.java │ │ ├── MysqlXADataSource.java │ │ ├── MysqlXAException.java │ │ ├── MysqlXid.java │ │ ├── NClob.java │ │ ├── NonRegisteringDriver.java │ │ ├── ParameterBindingsImpl.java │ │ ├── PreparedStatementWrapper.java │ │ ├── ServerPreparedStatement.java │ │ ├── StatementImpl.java │ │ ├── StatementWrapper.java │ │ ├── SuspendableXAConnection.java │ │ ├── WrapperBase.java │ │ ├── admin │ │ │ └── MiniAdmin.java │ │ ├── exceptions │ │ │ ├── CommunicationsException.java │ │ │ ├── ConnectionFeatureNotAvailableException.java │ │ │ ├── MySQLQueryInterruptedException.java │ │ │ ├── MySQLStatementCancelledException.java │ │ │ ├── MySQLTimeoutException.java │ │ │ ├── MySQLTransactionRollbackException.java │ │ │ ├── MysqlDataTruncation.java │ │ │ ├── NotUpdatable.java │ │ │ ├── OperationNotSupportedException.java │ │ │ ├── PacketTooBigException.java │ │ │ ├── SQLError.java │ │ │ └── SQLExceptionsMapping.java │ │ ├── ha │ │ │ ├── BestResponseTimeBalanceStrategy.java │ │ │ ├── ConnectionProxy.java │ │ │ ├── ConnectionProxyLifecycleInterceptor.java │ │ │ ├── FailoverConnectionProxy.java │ │ │ ├── LoadBalancedAutoCommitInterceptor.java │ │ │ ├── LoadBalancedConnectionProxy.java │ │ │ ├── LoadBalancedMySQLConnection.java │ │ │ ├── MultiHostConnectionProxy.java │ │ │ ├── MultiHostMySQLConnection.java │ │ │ ├── NdbLoadBalanceExceptionChecker.java │ │ │ ├── RandomBalanceStrategy.java │ │ │ ├── ReplicationConnectionGroup.java │ │ │ ├── ReplicationConnectionGroupManager.java │ │ │ ├── ReplicationConnectionProxy.java │ │ │ ├── ReplicationMySQLConnection.java │ │ │ ├── SequentialBalanceStrategy.java │ │ │ ├── ServerAffinityStrategy.java │ │ │ ├── StandardLoadBalanceExceptionChecker.java │ │ │ ├── plugins │ │ │ │ ├── AWSSecretsManagerPlugin.java │ │ │ │ ├── AWSSecretsManagerPluginFactory.java │ │ │ │ ├── BasicConnectionProvider.java │ │ │ │ ├── ConnectionPluginManager.java │ │ │ │ ├── DefaultConnectionPlugin.java │ │ │ │ ├── DefaultConnectionPluginFactory.java │ │ │ │ ├── DefaultMonitorService.java │ │ │ │ ├── IConnectionPlugin.java │ │ │ │ ├── IConnectionPluginFactory.java │ │ │ │ ├── IConnectionProvider.java │ │ │ │ ├── ICurrentConnectionProvider.java │ │ │ │ ├── IExecutorServiceInitializer.java │ │ │ │ ├── IMonitor.java │ │ │ │ ├── IMonitorInitializer.java │ │ │ │ ├── IMonitorService.java │ │ │ │ ├── ITransactionContextHandler.java │ │ │ │ ├── Monitor.java │ │ │ │ ├── MonitorConnectionContext.java │ │ │ │ ├── MonitorThreadContainer.java │ │ │ │ ├── NodeMonitoringConnectionPlugin.java │ │ │ │ ├── NodeMonitoringConnectionPluginFactory.java │ │ │ │ ├── NullArgumentMessage.java │ │ │ │ ├── ReaderClusterConnectionPlugin.java │ │ │ │ ├── ReaderClusterConnectionPluginFactory.java │ │ │ │ ├── efm2 │ │ │ │ │ ├── DefaultMonitorService.java │ │ │ │ │ ├── IMonitor.java │ │ │ │ │ ├── IMonitorInitializer.java │ │ │ │ │ ├── IMonitorService.java │ │ │ │ │ ├── Monitor.java │ │ │ │ │ ├── MonitorConnectionContext.java │ │ │ │ │ ├── NodeMonitoringConnectionPlugin.java │ │ │ │ │ └── NodeMonitoringConnectionPluginFactory.java │ │ │ │ └── failover │ │ │ │ │ ├── AuroraTopologyService.java │ │ │ │ │ ├── ClusterAwareHitMissMetricsHolder.java │ │ │ │ │ ├── ClusterAwareMetrics.java │ │ │ │ │ ├── ClusterAwareMetricsContainer.java │ │ │ │ │ ├── ClusterAwareReaderFailoverHandler.java │ │ │ │ │ ├── ClusterAwareTimeMetricsHolder.java │ │ │ │ │ ├── ClusterAwareWriterFailoverHandler.java │ │ │ │ │ ├── FailoverConnectionPlugin.java │ │ │ │ │ ├── FailoverConnectionPluginFactory.java │ │ │ │ │ ├── IClusterAwareMetricsContainer.java │ │ │ │ │ ├── IClusterAwareMetricsReporter.java │ │ │ │ │ ├── IReaderFailoverHandler.java │ │ │ │ │ ├── ITopologyService.java │ │ │ │ │ ├── IWriterFailoverHandler.java │ │ │ │ │ ├── ReaderFailoverResult.java │ │ │ │ │ ├── TopologyServicePropertyKeys.java │ │ │ │ │ └── WriterFailoverResult.java │ │ │ └── util │ │ │ │ ├── ConnectionUtils.java │ │ │ │ ├── RdsUtils.java │ │ │ │ ├── SlidingExpirationCache.java │ │ │ │ └── SlidingExpirationCacheWithCleanupThread.java │ │ ├── integration │ │ │ └── c3p0 │ │ │ │ └── MysqlConnectionTester.java │ │ ├── interceptors │ │ │ ├── ResultSetScannerInterceptor.java │ │ │ ├── ServerStatusDiffInterceptor.java │ │ │ └── SessionAssociationInterceptor.java │ │ ├── jmx │ │ │ ├── LoadBalanceConnectionGroupManager.java │ │ │ ├── LoadBalanceConnectionGroupManagerMBean.java │ │ │ ├── ReplicationGroupManager.java │ │ │ └── ReplicationGroupManagerMBean.java │ │ ├── result │ │ │ ├── CachedResultSetMetaDataImpl.java │ │ │ ├── ResultSetFactory.java │ │ │ ├── ResultSetImpl.java │ │ │ ├── ResultSetMetaData.java │ │ │ └── UpdatableResultSet.java │ │ └── util │ │ │ └── BaseBugReport.java │ │ └── xdevapi │ │ ├── AbstractDataResult.java │ │ ├── AbstractFilterParams.java │ │ ├── AddResultBuilder.java │ │ ├── AddResultImpl.java │ │ ├── AddStatementImpl.java │ │ ├── ClientImpl.java │ │ ├── CollectionImpl.java │ │ ├── ColumnImpl.java │ │ ├── CreateIndexParams.java │ │ ├── DatabaseObjectDescription.java │ │ ├── DbDocFactory.java │ │ ├── DbDocImpl.java │ │ ├── DbDocValueFactory.java │ │ ├── DeleteStatementImpl.java │ │ ├── DocFilterParams.java │ │ ├── DocResultBuilder.java │ │ ├── DocResultImpl.java │ │ ├── ExprParser.java │ │ ├── ExprUnparser.java │ │ ├── ExprUtil.java │ │ ├── FilterableStatement.java │ │ ├── FindStatementImpl.java │ │ ├── InsertParams.java │ │ ├── InsertResultBuilder.java │ │ ├── InsertResultImpl.java │ │ ├── InsertStatementImpl.java │ │ ├── JsonArray.java │ │ ├── JsonLiteral.java │ │ ├── JsonNumber.java │ │ ├── JsonParser.java │ │ ├── JsonString.java │ │ ├── ModifyStatementImpl.java │ │ ├── PreparableStatement.java │ │ ├── RemoveStatementImpl.java │ │ ├── RowFactory.java │ │ ├── RowImpl.java │ │ ├── RowResultBuilder.java │ │ ├── RowResultImpl.java │ │ ├── SchemaImpl.java │ │ ├── SelectStatementImpl.java │ │ ├── SessionImpl.java │ │ ├── SqlMultiResult.java │ │ ├── SqlResultBuilder.java │ │ ├── SqlSingleResult.java │ │ ├── SqlStatementImpl.java │ │ ├── SqlUpdateResult.java │ │ ├── StreamingDocResultBuilder.java │ │ ├── StreamingRowResultBuilder.java │ │ ├── StreamingSqlResultBuilder.java │ │ ├── TableFilterParams.java │ │ ├── TableImpl.java │ │ ├── UpdateParams.java │ │ ├── UpdateResult.java │ │ ├── UpdateResultBuilder.java │ │ ├── UpdateSpec.java │ │ ├── UpdateStatementImpl.java │ │ └── WarningImpl.java │ └── software │ └── aws │ └── rds │ └── jdbc │ └── mysql │ └── Driver.java └── test ├── config ├── docker-entrypoint-initdb.d │ └── grant-root.sql ├── plugins │ ├── auth.dll │ ├── auth.so │ ├── auth_test_plugin.dll │ ├── auth_test_plugin.so │ └── component_query_attributes.so └── ssl-test-certs │ ├── ca-cert-ext.pem │ ├── ca-cert.pem │ ├── ca-key-ext.pem │ ├── ca-key.pem │ ├── ca-truststore │ ├── ca-truststore-ext │ ├── certs_howto.txt │ ├── client-cert-ext.pem │ ├── client-cert.pem │ ├── client-key-ext.pem │ ├── client-key.pem │ ├── client-keystore │ ├── client-keystore-ext │ ├── mykey.pem │ ├── mykey.pub │ ├── server-cert-ext.pem │ ├── server-cert.pem │ ├── server-key-ext.pem │ └── server-key.pem └── java ├── com └── mysql │ └── cj │ ├── CharsetMappingWrapper.java │ ├── ConnectionUrlTest.java │ ├── MessagesTest.java │ ├── ServerVersionTest.java │ ├── jdbc │ ├── NonRegisteringDriverTest.java │ ├── SQLXMLTests.java │ └── ha │ │ ├── ConnectionProxyTest.java │ │ └── plugins │ │ ├── AWSSecretsManagerPluginTest.java │ │ ├── DefaultMonitorServiceTest.java │ │ ├── MonitorConnectionContextTest.java │ │ ├── MonitorTest.java │ │ ├── MultiThreadedDefaultMonitorServiceTest.java │ │ ├── NodeMonitoringConnectionPluginTest.java │ │ └── failover │ │ ├── AuroraTopologyServiceTest.java │ │ ├── ClusterAwareReaderFailoverHandlerTest.java │ │ ├── ClusterAwareTestUtils.java │ │ ├── ClusterAwareWriterFailoverHandlerTest.java │ │ └── FailoverConnectionPluginTest.java │ ├── protocol │ ├── a │ │ ├── CompressedPacketSenderTest.java │ │ ├── DebugBufferingPacketSenderTest.java │ │ ├── MysqlBinaryValueDecoderTest.java │ │ ├── MysqlTextValueDecoderTest.java │ │ ├── PacketSenderTestBase.java │ │ ├── SimplePacketReaderTest.java │ │ └── SimplePacketSenderTest.java │ └── x │ │ ├── CompressionTest.java │ │ ├── SyncMessageReaderTest.java │ │ └── SyncMessageWriterTest.java │ ├── result │ ├── BigDecimalValueFactoryTest.java │ ├── BinaryStreamValueFactoryTest.java │ ├── BooleanValueFactoryTest.java │ ├── ByteValueFactoryTest.java │ ├── CommonAsserts.java │ ├── DoubleValueFactoryTest.java │ ├── FloatValueFactoryTest.java │ ├── IntegerValueFactoryTest.java │ ├── LocalDateTimeValueFactoryTest.java │ ├── LocalDateValueFactoryTest.java │ ├── LocalTimeValueFactoryTest.java │ ├── LongValueFactoryTest.java │ ├── ShortValueFactoryTest.java │ ├── SqlDateValueFactoryTest.java │ ├── SqlTimeValueFactoryTest.java │ ├── SqlTimestampValueFactoryTest.java │ ├── StringValueFactoryTest.java │ └── ZeroDateTimeToNullValueFactoryTest.java │ ├── util │ ├── ConnectionUtilsTest.java │ ├── ExpiringCacheTest.java │ ├── RdsUtilsTests.java │ ├── StringInspectorTest.java │ ├── StringUtilsTest.java │ └── TimeUtilTest.java │ └── xdevapi │ ├── ExprParserTest.java │ └── JsonDocTest.java └── testsuite ├── BaseQueryInterceptor.java ├── BaseTestCase.java ├── BufferingLogger.java ├── InjectedSocketFactory.java ├── JUnitSummary.java ├── MockJndiContextFactory.java ├── TestUtils.java ├── UnreliableSocketFactory.java ├── integration ├── container │ ├── AuroraMysqlFailoverIntegrationTest.java │ ├── AuroraMysqlHardFailureIntegrationTest.java │ ├── AuroraMysqlIntegrationBaseTest.java │ ├── AuroraMysqlIntegrationTest.java │ ├── AuroraMysqlPerformanceForEfm2IntegrationTest.java │ ├── AuroraMysqlPerformanceIntegrationTest.java │ ├── HikariCPIntegrationTest.java │ ├── HikariCPSQLException.java │ ├── IntegrationTestSuite.java │ └── ReplicationFailoverIntegrationTest.java ├── host │ ├── AuroraIntegrationContainerTest.java │ └── CommunityContainerTest.java └── utility │ ├── AuroraTestUtility.java │ ├── ConsoleConsumer.java │ └── ContainerHelper.java ├── perf ├── BasePerfTest.java ├── LoadStorePerfTest.java └── RetrievalPerfTest.java ├── regression ├── BlobRegressionTest.java ├── CachedRowsetTest.java ├── CallableStatementRegressionTest.java ├── CharsetRegressionTest.java ├── ConnectionRegressionTest.java ├── DataSourceRegressionTest.java ├── DateTimeRegressionTest.java ├── EscapeProcessorRegressionTest.java ├── ExceptionSubclassesTest.java ├── MetaDataRegressionTest.java ├── MicroPerformanceRegressionTest.java ├── NonLocalSocketFactory.java ├── NumbersRegressionTest.java ├── PooledConnectionRegressionTest.java ├── ResultSetRegressionTest.java ├── StatementRegressionTest.java ├── StressRegressionTest.java ├── StringRegressionTest.java ├── SubqueriesRegressionTest.java ├── SyntaxRegressionTest.java └── UtilsRegressionTest.java ├── simple ├── AuthenticationTest.java ├── AwsIamAuthenticationHelperTest.java ├── BlobTest.java ├── CallableStatementTest.java ├── CharsetTest.java ├── ConnectionTest.java ├── DataSourceTest.java ├── DateTest.java ├── DateTimeTest.java ├── EscapeProcessingTest.java ├── ExceptionsTest.java ├── MetadataTest.java ├── MiniAdminTest.java ├── MultiHostConnectionTest.java ├── NumbersTest.java ├── QueryAttributesTest.java ├── ReadOnlyCallableStatementTest.java ├── ResultSetTest.java ├── SSLTest.java ├── SaslPrepTest.java ├── SequentialIdLeaseTest.java ├── ServerControllerTest.java ├── SimpleTransformer.java ├── SplitDBdotNameTest.java ├── StatementsTest.java ├── TestLifecycleInterceptor.java ├── TransactionTest.java ├── TraversalTest.java ├── UpdatabilityTest.java ├── UtilsTest.java └── XATest.java └── x ├── devapi ├── AsyncQueryTest.java ├── BaseCollectionTestCase.java ├── BaseTableTestCase.java ├── BindTest.java ├── CollectionAddTest.java ├── CollectionFindTest.java ├── CollectionModifyTest.java ├── CollectionRemoveTest.java ├── CollectionTest.java ├── CompressionTest.java ├── DevApiBaseTestCase.java ├── Ipv6SupportTest.java ├── MetadataTest.java ├── ResultTest.java ├── RowLockingTest.java ├── SchemaTest.java ├── SecureSessionTest.java ├── SessionFailoverTest.java ├── SessionTest.java ├── TableDeleteTest.java ├── TableInsertTest.java ├── TableSelectTest.java ├── TableTest.java ├── TableUpdateTest.java ├── TransactionTest.java └── package-info.java └── internal ├── InternalXBaseTestCase.java ├── MysqlxSessionTest.java ├── XProtocolAsyncTest.java ├── XProtocolAuthTest.java ├── XProtocolTest.java └── package-info.java /.gitattributes: -------------------------------------------------------------------------------- 1 | gradlew text eol=lf -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.yml: -------------------------------------------------------------------------------- 1 | name: "\U0001F4D5 Documentation Issue" 2 | description: Report an issue in the README.md 3 | title: "(short issue description)" 4 | labels: [documentation, needs-triage] 5 | body: 6 | - type: textarea 7 | id: description 8 | attributes: 9 | label: Describe the issue 10 | description: A clear and concise description of the issue. 11 | validations: 12 | required: true 13 | 14 | - type: textarea 15 | id: links 16 | attributes: 17 | label: Links 18 | description: | 19 | Include links to affected documentation page(s). 20 | validations: 21 | required: true 22 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "gradle" 9 | directory: "/" 10 | target-branch: "main" 11 | schedule: 12 | interval: "weekly" 13 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Summary 2 | 3 | 4 | 5 | ### Description 6 | 7 | 8 | 9 | ### Additional Reviewers 10 | 11 | 12 | 13 | ### By submitting this pull request, I confirm that my contribution is made under the terms of the GPLv2 license. 14 | -------------------------------------------------------------------------------- /.github/workflows/maven_release.yml: -------------------------------------------------------------------------------- 1 | name: 'Release to Maven' 2 | 3 | on: 4 | release: 5 | types: 6 | - published 7 | 8 | jobs: 9 | ubuntu-latest-aurora-release-to-maven: 10 | name: 'Build And Release to Maven' 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: 'Clone Repository' 14 | uses: actions/checkout@v4 15 | with: 16 | fetch-depth: 50 17 | - name: 'Set up JDK 8' 18 | uses: actions/setup-java@v4 19 | with: 20 | distribution: 'corretto' 21 | java-version: 8 22 | - name: 'Build Driver' 23 | run: | 24 | ./gradlew --no-parallel --no-daemon -x test build 25 | - name: "Decode Key Ring" 26 | run: | 27 | echo "${{secrets.GPG_SECRET_KEY_FILE}}" > ~/.gradle/secring.gpg.b64 28 | base64 -d ~/.gradle/secring.gpg.b64 > ~/.gradle/secring.gpg 29 | - name: 'Install GPG Secret Key' 30 | id: import_gpg 31 | uses: crazy-max/ghaction-import-gpg@v6 32 | with: 33 | gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} 34 | passphrase: ${{ secrets.GPG_PASSPHRASE }} 35 | - name: 'Publish to Maven' 36 | run: | 37 | ./gradlew --no-parallel --no-daemon publishAllPublicationsToOSSRHRepository -Psigning.keyId=${{secrets.GPG_KEY_ID}} -Psigning.password=${{secrets.GPG_PASSPHRASE}} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg) 38 | env: 39 | MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} 40 | MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} 41 | -------------------------------------------------------------------------------- /.github/workflows/maven_snapshot.yml: -------------------------------------------------------------------------------- 1 | name: 'Snapshot to Maven' 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | workflow_dispatch: 8 | 9 | jobs: 10 | ubuntu-latest-aurora-snapshot-to-maven: 11 | name: 'Build And Upload Snapshot to Maven' 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: 'Clone Repository' 15 | uses: actions/checkout@v4 16 | with: 17 | fetch-depth: 50 18 | - name: 'Set up JDK 8' 19 | uses: actions/setup-java@v4 20 | with: 21 | distribution: 'corretto' 22 | java-version: 8 23 | - name: 'Build Driver' 24 | run: | 25 | ./gradlew --no-parallel --no-daemon -x test build 26 | - name: "Decode Key Ring" 27 | run: | 28 | echo "${{secrets.GPG_SECRET_KEY_FILE}}" > ~/.gradle/secring.gpg.b64 29 | base64 -d ~/.gradle/secring.gpg.b64 > ~/.gradle/secring.gpg 30 | - name: 'Install GPG Secret Key' 31 | id: import_gpg 32 | uses: crazy-max/ghaction-import-gpg@v6 33 | with: 34 | gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} 35 | passphrase: ${{ secrets.GPG_PASSPHRASE }} 36 | - name: 'Upload Snapshot to Maven' 37 | run: | 38 | ./gradlew --no-parallel --no-daemon publishAllPublicationsToOSSRHRepository -Psnapshot=true -Psigning.keyId=${{secrets.GPG_KEY_ID}} -Psigning.password=${{secrets.GPG_PASSPHRASE}} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg) 39 | env: 40 | MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} 41 | MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} 42 | -------------------------------------------------------------------------------- /.github/workflows/performance.yml: -------------------------------------------------------------------------------- 1 | name: Aurora Performance CI 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | permissions: 7 | id-token: write # This is required for requesting the JWT 8 | contents: read # This is required for actions/checkout 9 | 10 | concurrency: 11 | group: environment-perf-${{ github.ref }} 12 | cancel-in-progress: false 13 | 14 | jobs: 15 | ubuntu-latest-aurora-run-performance-integration-tests: 16 | concurrency: PerformanceIntegrationTests 17 | name: 'Run Performance Integration Tests' 18 | runs-on: ubuntu-latest 19 | steps: 20 | - name: 'Clone Repository' 21 | uses: actions/checkout@v4 22 | with: 23 | fetch-depth: 50 24 | - name: 'Set up JDK 8' 25 | uses: actions/setup-java@v4 26 | with: 27 | distribution: 'corretto' 28 | java-version: 8 29 | - name: 'Configure AWS Credentials' 30 | uses: aws-actions/configure-aws-credentials@v4 31 | with: 32 | role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_DEPLOY_ROLE }} 33 | role-session-name: mysql_jdbc_perf_ci 34 | role-duration-seconds: 21600 35 | aws-region: ${{ secrets.AWS_DEFAULT_REGION }} 36 | - name: 'Run Integration Tests' 37 | run: | 38 | ./gradlew --no-parallel --no-daemon test-integration-performance-docker 39 | env: 40 | TEST_DB_CLUSTER_IDENTIFIER: ${{ secrets.TEST_DB_CLUSTER_IDENTIFIER }}-${{ github.run_id }} 41 | TEST_USERNAME: ${{ secrets.TEST_USERNAME }} 42 | TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }} 43 | - name: 'Archive junit results' 44 | if: always() 45 | uses: actions/upload-artifact@v4 46 | with: 47 | name: 'performance-report' 48 | path: build/reports/tests/ 49 | retention-days: 5 50 | -------------------------------------------------------------------------------- /.github/workflows/pull_request.yml: -------------------------------------------------------------------------------- 1 | name: Pull Request CI 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - main 7 | paths-ignore: 8 | - '**/*.md' 9 | 10 | concurrency: 11 | group: environment-${{ github.ref }} 12 | cancel-in-progress: true 13 | 14 | jobs: 15 | ubuntu-latest-aurora-run-community-tests: 16 | name: 'Run Community Tests' 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: 'Clone Repository' 20 | uses: actions/checkout@v4 21 | with: 22 | fetch-depth: 50 23 | - name: 'Set up JDK 8' 24 | uses: actions/setup-java@v4 25 | with: 26 | distribution: 'corretto' 27 | java-version: 8 28 | - name: 'Run Community Tests' 29 | run: | 30 | ./gradlew --no-parallel --no-daemon test-community-docker 31 | - name: 'Archive junit results' 32 | if: always() 33 | uses: actions/upload-artifact@v4 34 | with: 35 | name: 'junit-report' 36 | path: build/reports/tests/ 37 | retention-days: 5 38 | -------------------------------------------------------------------------------- /.github/workflows/remove-old-artifacts.yml: -------------------------------------------------------------------------------- 1 | name: Remove Old Artifacts 2 | 3 | on: 4 | schedule: 5 | # Every day at 1am 6 | - cron: '0 1 * * *' 7 | 8 | jobs: 9 | remove-old-artifacts: 10 | runs-on: ubuntu-latest 11 | timeout-minutes: 10 12 | 13 | steps: 14 | - name: Remove Old Artifacts 15 | uses: c-hive/gha-remove-artifacts@v1 16 | with: 17 | age: '1 week' 18 | skip-tags: true 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /build/ 3 | /buildtest/ 4 | /dist/ 5 | /nbproject/ 6 | /patches/ 7 | *~ 8 | *.lock 9 | *.swp 10 | *.DS_Store 11 | *.diff 12 | *.dot 13 | *.dot.png 14 | *.class 15 | *.iml 16 | .project.elrade 17 | .attach_pid* 18 | .gradle 19 | .idea 20 | hs_err_pid*.log 21 | *.sh 22 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | #Mon Oct 20 17:22:34 CDT 2008 2 | eclipse.preferences.version=1 3 | encoding/=UTF-8 4 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.launching.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning 3 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | 6 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | AWS JDBC Driver for MySQL 2 | 3 | Copyright Amazon.com Inc. or affiliates. 4 | 5 | 6 | 7 | The Amazon Web Services (AWS) JDBC Driver for MySQL is a driver that enables 8 | 9 | applications to take full advantage of the features of clustered MySQL databases. 10 | 11 | It is based on and can be used as a drop-in replacement for the MySQL Connector/J driver 12 | 13 | (https://github.com/mysql/mysql-connector-j) and is compatible with all MySQL deployments. 14 | 15 | 16 | 17 | 18 | The AWS JDBC Driver for MySQL currently enables fast failover for Amazon Aurora with MySQL 19 | 20 | compatibility. Support for additional features of clustered databases, including features 21 | 22 | of Amazon RDS for MySQL and on-premises MySQL deployments, is planned. 23 | 24 | 25 | 26 | License information can be found in the LICENSE file. 27 | 28 | 29 | 30 | This distribution may include materials developed by third parties. 31 | 32 | For license and attribution notices for these materials, please refer to the 33 | 34 | LICENSE file. -------------------------------------------------------------------------------- /docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | 5 | first-mysql: 6 | image: mysql:8.0.21 7 | container_name: first-mysql 8 | restart: always 9 | ports: 10 | - 3306:3306 11 | environment: 12 | MYSQL_ROOT_PASSWORD: root 13 | MYSQL_DATABASE: test 14 | command: 15 | - --local_infile=1 16 | - --max_allowed_packet=40M 17 | - --max-connections=2048 18 | - --secure-file-priv=/var/lib/mysql 19 | - --ssl-key=/home/certdir/server-key.pem 20 | - --ssl-cert=/home/certdir/server-cert.pem 21 | - --ssl-ca=/home/certdir/ca-cert.pem 22 | - --plugin_dir=/home/plugin_dir 23 | volumes: 24 | - ../src/test/config/ssl-test-certs/:/home/certdir 25 | - ./plugins:/home/plugin_dir 26 | - ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d 27 | security_opt: 28 | - seccomp:unconfined 29 | 30 | second-mysql: 31 | image: mysql:8.0.21 32 | container_name: second-mysql 33 | restart: always 34 | ports: 35 | - 3307:3306 36 | environment: 37 | MYSQL_ROOT_PASSWORD: root 38 | MYSQL_DATABASE: test 39 | command: 40 | - --log-error-verbosity=4 41 | - --local_infile=1 42 | - --max_allowed_packet=40M 43 | - --max-connections=2048 44 | - --secure-file-priv=/var/lib/mysql 45 | - --ssl-key=/home/certdir/server-key.pem 46 | - --ssl-cert=/home/certdir/server-cert.pem 47 | - --ssl-ca=/home/certdir/ca-cert.pem 48 | - --plugin_dir=/home/plugin_dir 49 | - --default-authentication-plugin=sha256_password 50 | - --sha256_password_public_key_path=/home/certdir/mykey.pub 51 | - --caching_sha2_password_public_key_path=/home/certdir/mykey.pub 52 | - --sha256_password_private_key_path=/home/certdir/mykey.pem 53 | - --caching_sha2_password_private_key_path=/home/certdir/mykey.pem 54 | volumes: 55 | - ../src/test/config/ssl-test-certs/:/home/certdir 56 | - ./plugins:/home/plugin_dir 57 | - ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d 58 | security_opt: 59 | - seccomp:unconfined 60 | -------------------------------------------------------------------------------- /docker/docker-entrypoint-initdb.d/grant-root.sql: -------------------------------------------------------------------------------- 1 | GRANT PROXY ON ''@'' TO 'root'@'%' WITH GRANT OPTION; 2 | -------------------------------------------------------------------------------- /docker/plugins/auth.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/docker/plugins/auth.dll -------------------------------------------------------------------------------- /docker/plugins/auth.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/docker/plugins/auth.so -------------------------------------------------------------------------------- /docker/plugins/auth_test_plugin.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/docker/plugins/auth_test_plugin.dll -------------------------------------------------------------------------------- /docker/plugins/auth_test_plugin.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/docker/plugins/auth_test_plugin.so -------------------------------------------------------------------------------- /docs/files/images/connection_plugin_manager_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/docs/files/images/connection_plugin_manager_diagram.png -------------------------------------------------------------------------------- /docs/files/images/enhanced_failure_monitoring_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/docs/files/images/enhanced_failure_monitoring_diagram.png -------------------------------------------------------------------------------- /docs/files/images/failover_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/docs/files/images/failover_diagram.png -------------------------------------------------------------------------------- /docs/files/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/docs/files/images/icon.png -------------------------------------------------------------------------------- /docs/files/images/texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/docs/files/images/texture.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /src/build/misc/debian.in/changelog: -------------------------------------------------------------------------------- 1 | @PRODUCT_NAME@@PACKAGE_SUFFIX@ (@MYSQL_CJ_VERSION@@MYSQL_CJ_VERSION_SNAPSHOT@@DEB_VERSION_SUFFIX@@ID_RELEASE@) @CODENAME@; urgency=low 2 | 3 | * For release notes, please refer to https://dev.mysql.com/doc/relnotes/connector-j/8.0/en/ 4 | 5 | -- @MAINTAINER_EMAIL@ @PACKAGE_TIMESTAMP@ 6 | -------------------------------------------------------------------------------- /src/build/misc/debian.in/compat: -------------------------------------------------------------------------------- 1 | 11 2 | -------------------------------------------------------------------------------- /src/build/misc/debian.in/control: -------------------------------------------------------------------------------- 1 | Source: @PRODUCT_NAME@@PACKAGE_SUFFIX@ 2 | Section: database 3 | Priority: optional 4 | Maintainer: Oracle MySQL Product Engineering Team 5 | Standards-Version: 3.9.2 6 | Build-Depends: debhelper (>= 11) 7 | Homepage: http://dev.mysql.com/downloads/connector/j/ 8 | 9 | Package: @PRODUCT_NAME@@PACKAGE_SUFFIX@ 10 | Section: database 11 | Architecture: all 12 | Depends: ${shlibs:Depends}, ${misc:Depends} 13 | Replaces: @PRODUCT_LEGACY_NAME@@PACKAGE_SUFFIX@ (<< 8.0.31) 14 | Breaks: @PRODUCT_LEGACY_NAME@@PACKAGE_SUFFIX@ (<< 8.0.31) 15 | Provides: @PRODUCT_LEGACY_NAME@@PACKAGE_SUFFIX@ 16 | Description: MySQL Connector/J 17 | Standardized MySQL database driver for Java 18 | -------------------------------------------------------------------------------- /src/build/misc/debian.in/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: @PRODUCT@ 3 | Upstream-Contact: MySQL Release Engineering 4 | Source: http://dev.mysql.com/ 5 | 6 | Files: * 7 | Copyright: 2002, 2021, Oracle and/or its affiliates. 8 | License: 9 | For licensing information see the LICENSE file in this distribution. 10 | -------------------------------------------------------------------------------- /src/build/misc/debian.in/install: -------------------------------------------------------------------------------- 1 | @DIR_PACKAGE@/@PRODUCT_NAME@-@VERSION_FULL@.jar usr/share/java 2 | 3 | #legal 4 | @DIR_PACKAGE@/@LIC_FILE@ usr/share/doc/@PRODUCT_NAME@@PACKAGE_SUFFIX@ 5 | @DIR_PACKAGE@/README usr/share/doc/@PRODUCT_NAME@@PACKAGE_SUFFIX@ 6 | @DIR_PACKAGE@/CHANGES usr/share/doc/@PRODUCT_NAME@@PACKAGE_SUFFIX@ 7 | @DIR_PACKAGE@/INFO_SRC usr/share/doc/@PRODUCT_NAME@@PACKAGE_SUFFIX@ 8 | @DIR_PACKAGE@/INFO_BIN usr/share/doc/@PRODUCT_NAME@@PACKAGE_SUFFIX@ 9 | -------------------------------------------------------------------------------- /src/build/misc/debian.in/links: -------------------------------------------------------------------------------- 1 | usr/share/java/@PRODUCT_NAME@-@VERSION_FULL@.jar usr/share/java/@PRODUCT_LEGACY_NAME@@PACKAGE_SUFFIX@-@VERSION_FULL@.jar 2 | -------------------------------------------------------------------------------- /src/build/misc/debian.in/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /src/build/misc/debian.in/watch: -------------------------------------------------------------------------------- 1 | version=3 2 | http://mysql.osuosl.org/Downloads/@PRODUCT_NAME@-(.+)\.tar\.gz 3 | -------------------------------------------------------------------------------- /src/demo/java/customplugins/diagrams/connection_plugin_chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/src/demo/java/customplugins/diagrams/connection_plugin_chain.png -------------------------------------------------------------------------------- /src/generated/java/com/mysql/cj/x/protobuf/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | /** 31 | * Message classes used for serialization with Google Protocol Buffers to support the X Protocol. Classes are generated using protoc like so: 32 | * 33 | *
34 |  * protoc --java_out=PATH/src/generated/java --proto_path=PATH_TO_IMPORTS -I=PATH_TO_MYSQL_REPO/rapid/plugin/x/protocol PATH_TO_MYSQL_REPO/rapid/plugin/x/protocol/*.proto
35 |  * 
36 | * 37 | * @since 6.0 38 | */ 39 | 40 | package com.mysql.cj.x.protobuf; 41 | -------------------------------------------------------------------------------- /src/legacy/java/com/mysql/jdbc/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.jdbc; 31 | 32 | import java.sql.SQLException; 33 | 34 | /** 35 | * Backwards compatibility to support apps that call Class.forName("com.mysql.jdbc.Driver");. 36 | */ 37 | public class Driver extends com.mysql.cj.jdbc.Driver { 38 | public Driver() throws SQLException { 39 | super(); 40 | } 41 | 42 | static { 43 | System.err.println("Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. " 44 | + "The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary."); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/CacheAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj; 31 | 32 | import java.util.Set; 33 | 34 | public interface CacheAdapter { 35 | V get(K key); 36 | 37 | void put(K key, V value); 38 | 39 | void invalidate(K key); 40 | 41 | void invalidateAll(Set keys); 42 | 43 | void invalidateAll(); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/CacheAdapterFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj; 31 | 32 | public interface CacheAdapterFactory { 33 | 34 | CacheAdapter getInstance(Object syncMutex, String url, int cacheMaxSize, int maxKeySize); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/CancelQueryTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj; 31 | 32 | public interface CancelQueryTask { 33 | 34 | boolean cancel(); 35 | 36 | Throwable getCaughtWhileCancelling(); 37 | 38 | void setCaughtWhileCancelling(Throwable caughtWhileCancelling); 39 | 40 | Query getQueryToCancel(); 41 | 42 | void setQueryToCancel(Query queryToCancel); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/DataStoreMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj; 31 | 32 | public interface DataStoreMetadata { 33 | 34 | boolean schemaExists(String schemaName); 35 | 36 | boolean tableExists(String schemaName, String tableName); 37 | 38 | long getTableRowCount(String schemaName, String tableName); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/MessageBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2022, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj; 31 | 32 | import java.util.List; 33 | 34 | import com.mysql.cj.protocol.Message; 35 | 36 | public interface MessageBuilder { 37 | 38 | M buildSqlStatement(String statement); 39 | 40 | M buildSqlStatement(String statement, List args); 41 | 42 | M buildClose(); 43 | 44 | M buildComQuery(M sharedPacket, Session sess, PreparedQuery preparedQuery, QueryBindings bindings, String characterEncoding); 45 | } 46 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/PingTarget.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj; 31 | 32 | public interface PingTarget { 33 | 34 | void doPing() throws Exception; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/QueryResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj; 31 | 32 | public interface QueryResult { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/QueryReturnType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj; 31 | 32 | /** 33 | * The possible return types from executing queries. 34 | */ 35 | public enum QueryReturnType { 36 | PRODUCES_RESULT_SET, MAY_PRODUCE_RESULT_SET, DOES_NOT_PRODUCE_RESULT_SET, NONE; 37 | } 38 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/TransactionEventHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj; 31 | 32 | public interface TransactionEventHandler { 33 | 34 | void transactionBegun(); 35 | 36 | void transactionCompleted(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/WarningListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj; 31 | 32 | /** 33 | * A warning listener is notified of warnings as they happen throughout the driver. They can be queued for consumption by JDBC clients, thrown as exceptions, or 34 | * ignored. 35 | */ 36 | public interface WarningListener { 37 | void warningEncountered(String warning); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/callback/MysqlCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2022, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.callback; 31 | 32 | /** 33 | * Implementations of this interface can be passed to a {@link MysqlCallbackHandler} so that the owner of the callback handler and its caller can share data in 34 | * a way that would otherwise require tighter coupling. 35 | */ 36 | public interface MysqlCallback { 37 | } 38 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/conf/DatabaseUrlContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.conf; 31 | 32 | /** 33 | * Implementors of this class must be able to provide a database URL. 34 | */ 35 | public interface DatabaseUrlContainer { 36 | /** 37 | * Returns the original database URL that produced this connection string. 38 | * 39 | * @return the original database URL 40 | */ 41 | String getDatabaseUrl(); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/conf/HostsListView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.conf; 31 | 32 | /** 33 | * An enumeration that identifies the type of the view intended for getting hosts lists for multi-host connections. 34 | */ 35 | public enum HostsListView { 36 | ALL, SOURCES, REPLICAS; 37 | } 38 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/exceptions/CJOperationNotSupportedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.exceptions; 31 | 32 | public class CJOperationNotSupportedException extends CJException { 33 | 34 | private static final long serialVersionUID = 2619184100062994443L; 35 | 36 | public CJOperationNotSupportedException() { 37 | super(); 38 | } 39 | 40 | public CJOperationNotSupportedException(String message) { 41 | super(message); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/exceptions/DataConversionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.exceptions; 31 | 32 | /** 33 | * Indicates that data could not be converted according to the given request. 34 | */ 35 | public class DataConversionException extends DataReadException { 36 | private static final long serialVersionUID = -863576663404236982L; 37 | 38 | public DataConversionException(String msg) { 39 | super(msg); 40 | setSQLState("22018"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/exceptions/DataReadException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.exceptions; 31 | 32 | /** 33 | * Indicates that data could not be read according to the given request. 34 | */ 35 | public class DataReadException extends CJException { 36 | private static final long serialVersionUID = 1684265521187171525L; 37 | 38 | public DataReadException(Exception cause) { 39 | super(cause); 40 | setSQLState("S1009"); 41 | } 42 | 43 | public DataReadException(String msg) { 44 | super(msg); 45 | setSQLState("S1009"); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/exceptions/DeadlockTimeoutRollbackMarker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.exceptions; 31 | 32 | /** 33 | * Marker interface for exceptions that are caused by deadlock/wait timeout 34 | */ 35 | public interface DeadlockTimeoutRollbackMarker { 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/exceptions/NumberOutOfRange.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.exceptions; 31 | 32 | /** 33 | * Indicates that a number was out of the expected range. 34 | */ 35 | public class NumberOutOfRange extends DataReadException { 36 | private static final long serialVersionUID = -61091413023651438L; 37 | 38 | public NumberOutOfRange(String msg) { 39 | super(msg); 40 | setSQLState("22003"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/exceptions/StreamingNotifiable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.exceptions; 31 | 32 | public interface StreamingNotifiable { 33 | 34 | void setWasStreamingResults(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/log/ProfilerEventHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.log; 31 | 32 | import com.mysql.cj.Query; 33 | import com.mysql.cj.Session; 34 | import com.mysql.cj.protocol.Resultset; 35 | 36 | public interface ProfilerEventHandler { 37 | 38 | void init(Log log); 39 | 40 | void destroy(); 41 | 42 | void consumeEvent(ProfilerEvent evt); 43 | 44 | void processEvent(byte eventType, Session session, Query query, Resultset resultSet, long eventDuration, Throwable eventCreationPoint, String message); 45 | } 46 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/Message.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol; 31 | 32 | /** 33 | * Message is the content of a full single message (native protocol packet or protobuf message), 34 | * independent from on-wire splitting, communicated with the server. 35 | */ 36 | public interface Message { 37 | 38 | /** 39 | * Returns the array of bytes this Buffer is using to read from. 40 | * 41 | * @return byte array being read from 42 | */ 43 | byte[] getByteBuffer(); 44 | 45 | /** 46 | * Returns the current position to write to/ read from 47 | * 48 | * @return the current position to write to/ read from 49 | */ 50 | int getPosition(); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/MessageHeader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol; 31 | 32 | import java.nio.ByteBuffer; 33 | 34 | /** 35 | * Represents the protocol specific message header 36 | */ 37 | public interface MessageHeader { 38 | 39 | ByteBuffer getBuffer(); 40 | 41 | int getMessageSize(); 42 | 43 | byte getMessageSequence(); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/OutputStreamWatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol; 31 | 32 | /** 33 | * Objects that want to be notified of lifecycle events on a WatchableOutputStream should implement this interface, and register themselves with setWatcher() 34 | * on the WatchableOutputStream instance. 35 | */ 36 | public interface OutputStreamWatcher { 37 | /** 38 | * Called when the OutputStream being watched has .close() called 39 | * 40 | * @param out 41 | * {@link WatchableStream} 42 | */ 43 | void streamClosed(WatchableStream out); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/PacketReceivedTimeHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol; 31 | 32 | /** 33 | * Holds the time the last packet was received. 34 | */ 35 | public interface PacketReceivedTimeHolder { 36 | default long getLastPacketReceivedTime() { 37 | return 0; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/ProtocolEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol; 31 | 32 | public interface ProtocolEntity { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/ServerCapabilities.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2021, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol; 31 | 32 | import com.mysql.cj.ServerVersion; 33 | 34 | /** 35 | * Represents server capabilities, retrieved right after creating physical connection and before handshake. 36 | */ 37 | public interface ServerCapabilities { 38 | 39 | int getCapabilityFlags(); 40 | 41 | void setCapabilityFlags(int capabilityFlags); 42 | 43 | ServerVersion getServerVersion(); 44 | 45 | long getThreadId(); 46 | 47 | void setThreadId(long threadId); 48 | 49 | boolean serverSupportsFracSecs(); 50 | 51 | int getServerDefaultCollationIndex(); 52 | } 53 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/Warning.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol; 31 | 32 | public interface Warning { 33 | /** 34 | * Get warning level. 35 | * 36 | * @return Warning level 37 | */ 38 | int getLevel(); 39 | 40 | /** 41 | * Get warning code. 42 | * 43 | * @return Warning code 44 | */ 45 | long getCode(); 46 | 47 | /** 48 | * Get warning message. 49 | * 50 | * @return Warning message 51 | */ 52 | String getMessage(); 53 | } 54 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/WatchableStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol; 31 | 32 | public interface WatchableStream { 33 | 34 | void setWatcher(OutputStreamWatcher watcher); 35 | 36 | int size(); 37 | 38 | byte toByteArray()[]; 39 | 40 | void write(byte b[], int off, int len); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/util/LRUCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.util; 31 | 32 | import java.util.LinkedHashMap; 33 | import java.util.Map.Entry; 34 | 35 | public class LRUCache extends LinkedHashMap { 36 | private static final long serialVersionUID = 1L; 37 | protected int maxElements; 38 | 39 | public LRUCache(int maxSize) { 40 | super(maxSize, 0.75F, true); 41 | this.maxElements = maxSize; 42 | } 43 | 44 | @Override 45 | protected boolean removeEldestEntry(Entry eldest) { 46 | return (size() > this.maxElements); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/util/TestUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.util; 31 | 32 | public class TestUtils { 33 | 34 | public static void dumpTestcaseQuery(String query) { 35 | System.err.println(query); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/core-impl/java/com/mysql/cj/SimpleQuery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj; 31 | 32 | //TODO should not be protocol-specific 33 | 34 | public class SimpleQuery extends AbstractQuery { 35 | 36 | public SimpleQuery(NativeSession sess) { 37 | super(sess); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/core-impl/java/com/mysql/cj/conf/BooleanProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.conf; 31 | 32 | public class BooleanProperty extends AbstractRuntimeProperty { 33 | 34 | private static final long serialVersionUID = 1102859411443650569L; 35 | 36 | protected BooleanProperty(PropertyDefinition propertyDefinition) { 37 | super(propertyDefinition); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/core-impl/java/com/mysql/cj/conf/EnumProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.conf; 31 | 32 | public class EnumProperty> extends AbstractRuntimeProperty { 33 | 34 | private static final long serialVersionUID = -60853080911910124L; 35 | 36 | protected EnumProperty(PropertyDefinition propertyDefinition) { 37 | super(propertyDefinition); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/core-impl/java/com/mysql/cj/conf/StringProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.conf; 31 | 32 | public class StringProperty extends AbstractRuntimeProperty { 33 | 34 | private static final long serialVersionUID = -4141084145739428803L; 35 | 36 | protected StringProperty(PropertyDefinition propertyDefinition) { 37 | super(propertyDefinition); 38 | } 39 | 40 | @Override 41 | public String getStringValue() { 42 | return this.value; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/core-impl/java/com/mysql/cj/protocol/WriterWatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol; 31 | 32 | /** 33 | * Objects that want to be notified of lifecycle events on a WatchableWriter should implement this interface, and register themselves with setWatcher() on the 34 | * WatchableWriter instance. 35 | */ 36 | public interface WriterWatcher { 37 | /** 38 | * Called when the Writer being watched has .close() called 39 | * 40 | * @param out 41 | * WatchableWriter instance 42 | */ 43 | void writerClosed(WatchableWriter out); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/doc/connector-j-overview.html: -------------------------------------------------------------------------------- 1 | 2 |

MySQL Connector/J Reference

3 | 4 |

This is a full documentation of Connector/J.

5 | 6 |

To get started with X DevAPI, check out some of the main classes:

7 | 8 |
    9 |
  • Sessions can be created with {@link com.mysql.cj.xdevapi.SessionFactory}.
  • 10 |
  • Session operations are available on a {@link com.mysql.cj.xdevapi.Session}.
  • 11 |
  • JSON document collections are represented by a {@link com.mysql.cj.xdevapi.Collection}.
  • 12 |
  • Working with JSON documents is done with a {@link com.mysql.cj.xdevapi.DbDoc}.
  • 13 |
14 | 15 |

For an introduction to concepts, refer to the X DevAPI User 16 | Guide.

17 | 18 | -------------------------------------------------------------------------------- /src/main/doc/mysqlx-overview.html: -------------------------------------------------------------------------------- 1 | 2 |

MySQL Connector/J X DevAPI Reference

3 | 4 |

This documentation covers the public classes and interfaces of the Java implementation of the X DevAPI. To get started, check out some of the main 5 | classes:

6 | 7 |
    8 |
  • Sessions can be created with {@link com.mysql.cj.xdevapi.SessionFactory}.
  • 9 |
  • Session operations are available on a {@link com.mysql.cj.xdevapi.Session}.
  • 10 |
  • JSON document collections are represented by a {@link com.mysql.cj.xdevapi.Collection}.
  • 11 |
  • Working with JSON documents is done with a {@link com.mysql.cj.xdevapi.DbDoc}.
  • 12 |
13 | 14 |

For an introduction to concepts, refer to the X DevAPI User 15 | Guide.

16 | 17 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/a/ClobValueEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol.a; 31 | 32 | import java.sql.Clob; 33 | 34 | import com.mysql.cj.BindValue; 35 | import com.mysql.cj.exceptions.ExceptionFactory; 36 | 37 | public class ClobValueEncoder extends ReaderValueEncoder { 38 | 39 | @Override 40 | public byte[] getBytes(BindValue binding) { 41 | try { 42 | return readBytes(((Clob) binding.getValue()).getCharacterStream(), binding); 43 | } catch (Throwable t) { 44 | throw ExceptionFactory.createException(t.getMessage(), t, this.exceptionInterceptor); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/a/authentication/AwsIamAuthenticationPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License, version 2.0 6 | * (GPLv2), as published by the Free Software Foundation, with the 7 | * following additional permissions: 8 | * 9 | * This program is distributed with certain software that is licensed 10 | * under separate terms, as designated in a particular file or component 11 | * or in the license documentation. Without limiting your rights under 12 | * the GPLv2, the authors of this program hereby grant you an additional 13 | * permission to link the program and your derivative works with the 14 | * separately licensed software that they have included with the program. 15 | * 16 | * Without limiting the foregoing grant of rights under the GPLv2 and 17 | * additional permission as to separately licensed software, this 18 | * program is also subject to the Universal FOSS Exception, version 1.0, 19 | * a copy of which can be found along with its FAQ at 20 | * http://oss.oracle.com/licenses/universal-foss-exception. 21 | * 22 | * This program is distributed in the hope that it will be useful, but 23 | * WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 | * See the GNU General Public License, version 2.0, for more details. 26 | * 27 | * You should have received a copy of the GNU General Public License 28 | * along with this program. If not, see 29 | * http://www.gnu.org/licenses/gpl-2.0.html. 30 | */ 31 | 32 | package com.mysql.cj.protocol.a.authentication; 33 | 34 | public class AwsIamAuthenticationPlugin extends MysqlNativePasswordPlugin { 35 | 36 | private final AwsIamAuthenticationTokenHelper helper; 37 | 38 | public AwsIamAuthenticationPlugin(final AwsIamAuthenticationTokenHelper helper) { 39 | this.helper = helper; 40 | } 41 | 42 | @Override 43 | public void setAuthenticationParameters(String user, String password) { 44 | super.setAuthenticationParameters(user, this.helper.getOrGenerateToken(user)); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/a/authentication/AwsIamClearAuthenticationPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License, version 2.0 6 | * (GPLv2), as published by the Free Software Foundation, with the 7 | * following additional permissions: 8 | * 9 | * This program is distributed with certain software that is licensed 10 | * under separate terms, as designated in a particular file or component 11 | * or in the license documentation. Without limiting your rights under 12 | * the GPLv2, the authors of this program hereby grant you an additional 13 | * permission to link the program and your derivative works with the 14 | * separately licensed software that they have included with the program. 15 | * 16 | * Without limiting the foregoing grant of rights under the GPLv2 and 17 | * additional permission as to separately licensed software, this 18 | * program is also subject to the Universal FOSS Exception, version 1.0, 19 | * a copy of which can be found along with its FAQ at 20 | * http://oss.oracle.com/licenses/universal-foss-exception. 21 | * 22 | * This program is distributed in the hope that it will be useful, but 23 | * WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 | * See the GNU General Public License, version 2.0, for more details. 26 | * 27 | * You should have received a copy of the GNU General Public License 28 | * along with this program. If not, see 29 | * http://www.gnu.org/licenses/gpl-2.0.html. 30 | */ 31 | 32 | package com.mysql.cj.protocol.a.authentication; 33 | 34 | public class AwsIamClearAuthenticationPlugin extends MysqlClearPasswordPlugin { 35 | 36 | private final AwsIamAuthenticationTokenHelper helper; 37 | 38 | public AwsIamClearAuthenticationPlugin(final AwsIamAuthenticationTokenHelper helper) { 39 | this.helper = helper; 40 | } 41 | 42 | @Override 43 | public void setAuthenticationParameters(String user, String password) { 44 | super.setAuthenticationParameters(user, this.helper.getOrGenerateToken(user)); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/CompressionMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol.x; 31 | 32 | /** 33 | * The modes by which compression can be made. In message mode each X Protocol message is compressed independently of the others; in stream mode all messages 34 | * are compressed as if they belong to a continuous flow of compressed data. 35 | */ 36 | public enum CompressionMode { 37 | MESSAGE, STREAM; 38 | } 39 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/ContinuousOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol.x; 31 | 32 | import java.io.FilterOutputStream; 33 | import java.io.IOException; 34 | import java.io.OutputStream; 35 | 36 | /** 37 | * An {@link OutputStream} wrapper that can't be closed and flushes data instead when {@link #close()} is called. 38 | */ 39 | public class ContinuousOutputStream extends FilterOutputStream { 40 | protected ContinuousOutputStream(OutputStream out) { 41 | super(out); 42 | } 43 | 44 | /** 45 | * Instead of closing the {@link OutputStream} flushes its data. 46 | */ 47 | @Override 48 | public void close() throws IOException { 49 | flush(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/FetchDoneEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol.x; 31 | 32 | import com.mysql.cj.protocol.ProtocolEntity; 33 | import com.mysql.cj.x.protobuf.MysqlxResultset.FetchDone; 34 | 35 | /** 36 | * ProtocolEntity representing a {@link FetchDone} message. 37 | */ 38 | public class FetchDoneEntity implements ProtocolEntity { 39 | 40 | public FetchDoneEntity() { 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/FetchDoneEntityFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol.x; 31 | 32 | import com.mysql.cj.protocol.ProtocolEntityFactory; 33 | 34 | /** 35 | * Factory producing {@link FetchDoneEntity} from protocol message. 36 | */ 37 | public class FetchDoneEntityFactory implements ProtocolEntityFactory { 38 | 39 | @Override 40 | public FetchDoneEntity createFromMessage(XMessage message) { 41 | return new FetchDoneEntity(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/FetchDoneMoreResults.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol.x; 31 | 32 | import com.mysql.cj.protocol.ProtocolEntity; 33 | 34 | /** 35 | * ProtocolEntity representing a {@link FetchDoneMoreResults} message. 36 | */ 37 | public class FetchDoneMoreResults implements ProtocolEntity { 38 | 39 | public FetchDoneMoreResults() { 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/FetchDoneMoreResultsFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol.x; 31 | 32 | import com.mysql.cj.protocol.ProtocolEntityFactory; 33 | 34 | /** 35 | * Factory producing {@link FetchDoneMoreResults} from protocol message. 36 | */ 37 | public class FetchDoneMoreResultsFactory implements ProtocolEntityFactory { 38 | 39 | @Override 40 | public FetchDoneMoreResults createFromMessage(XMessage message) { 41 | return new FetchDoneMoreResults(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/NoticeFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol.x; 31 | 32 | import com.mysql.cj.protocol.ProtocolEntityFactory; 33 | 34 | /** 35 | * Factory producing {@link Notice} from protocol message. 36 | */ 37 | public class NoticeFactory implements ProtocolEntityFactory { 38 | 39 | @Override 40 | public Notice createFromMessage(XMessage message) { 41 | return Notice.getInstance(message); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/Ok.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol.x; 31 | 32 | import com.mysql.cj.QueryResult; 33 | import com.mysql.cj.protocol.ProtocolEntity; 34 | 35 | /** 36 | * ProtocolEntity representing an OK message. 37 | */ 38 | public class Ok implements ProtocolEntity, QueryResult { 39 | 40 | public Ok() { 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/OkFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol.x; 31 | 32 | import com.mysql.cj.protocol.ProtocolEntityFactory; 33 | 34 | /** 35 | * Factory producing {@link Ok} from protocol message. 36 | */ 37 | public class OkFactory implements ProtocolEntityFactory { 38 | 39 | @Override 40 | public Ok createFromMessage(XMessage message) { 41 | return new Ok(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/StatementExecuteOkFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol.x; 31 | 32 | import com.mysql.cj.protocol.ProtocolEntityFactory; 33 | 34 | /** 35 | * Factory producing {@link StatementExecuteOk} from protocol message. 36 | */ 37 | public class StatementExecuteOkFactory implements ProtocolEntityFactory { 38 | 39 | @Override 40 | public StatementExecuteOk createFromMessage(XMessage message) { 41 | return new StatementExecuteOk(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/SyncFlushDeflaterOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol.x; 31 | 32 | import java.io.OutputStream; 33 | import java.util.zip.Deflater; 34 | import java.util.zip.DeflaterOutputStream; 35 | 36 | /** 37 | * Wrapper around {@link DeflaterOutputStream} that enables sync flush by default. 38 | */ 39 | public class SyncFlushDeflaterOutputStream extends DeflaterOutputStream { 40 | public SyncFlushDeflaterOutputStream(OutputStream out) { 41 | super(out, new Deflater(), true); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/XProtocolRowFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.protocol.x; 31 | 32 | import com.mysql.cj.protocol.ProtocolEntityFactory; 33 | import com.mysql.cj.x.protobuf.MysqlxResultset.Row; 34 | 35 | /** 36 | * Factory producing an {@link XProtocolRow} from protocol message. 37 | */ 38 | public class XProtocolRowFactory implements ProtocolEntityFactory { 39 | 40 | @Override 41 | public XProtocolRow createFromMessage(XMessage message) { 42 | return new XProtocolRow(Row.class.cast(message.getMessage())); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/resources/com/mysql/cj/configurations/3-0-Compat.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Settings to maintain Connector/J 3.0.x compatibility 3 | # (as much as it can be) 4 | # 5 | 6 | emptyStringsConvertToZero=true 7 | jdbcCompliantTruncation=false 8 | noDatetimeStringSync=true 9 | nullCatalogMeansCurrent=true 10 | transformedBitIsBoolean=false 11 | dontTrackOpenResources=true 12 | zeroDateTimeBehavior=CONVERT_TO_NULL 13 | useServerPrepStmts=false 14 | autoClosePStmtStreams=true 15 | processEscapeCodesForPrepStmts=false 16 | populateInsertRowWithDefaultValues=false -------------------------------------------------------------------------------- /src/main/resources/com/mysql/cj/configurations/clusterBase.properties: -------------------------------------------------------------------------------- 1 | # Basic properties for clusters 2 | autoReconnect=true 3 | failOverReadOnly=false 4 | -------------------------------------------------------------------------------- /src/main/resources/com/mysql/cj/configurations/coldFusion.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Properties for optimal usage in ColdFusion 3 | # 4 | 5 | # 6 | # CF's pool tends to be "chatty" like DBCP 7 | # 8 | 9 | alwaysSendSetIsolation=false 10 | useLocalSessionState=true 11 | 12 | # 13 | # CF's pool seems to loose connectivity on page restart 14 | # 15 | 16 | autoReconnect=true 17 | -------------------------------------------------------------------------------- /src/main/resources/com/mysql/cj/configurations/fullDebug.properties: -------------------------------------------------------------------------------- 1 | # Settings for 'max-debug' style situations 2 | profileSQL=true 3 | gatherPerfMetrics=true 4 | useUsageAdvisor=true 5 | logSlowQueries=true 6 | explainSlowQueries=true -------------------------------------------------------------------------------- /src/main/resources/com/mysql/cj/configurations/maxPerformance-8-0.properties: -------------------------------------------------------------------------------- 1 | # 2 | # A configuration that maximizes performance, while 3 | # still staying JDBC-compliant and not doing anything that 4 | # would be "dangerous" to run-of-the-mill J2EE applications 5 | # 6 | # Note that because we're caching things like callable statements 7 | # and the server configuration, this bundle isn't appropriate 8 | # for use with servers that get config'd dynamically without 9 | # restarting the application using this configuration bundle. 10 | 11 | cachePrepStmts=true 12 | cacheCallableStmts=true 13 | 14 | cacheServerConfiguration=true 15 | 16 | # 17 | # Reduces amount of calls to database to set 18 | # session state. "Safe" as long as application uses 19 | # Connection methods to set current database, autocommit 20 | # and transaction isolation 21 | # 22 | 23 | useLocalSessionState=true 24 | elideSetAutoCommits=true 25 | alwaysSendSetIsolation=false 26 | 27 | # Can cause high-GC pressure if timeouts are used on every 28 | # query 29 | enableQueryTimeouts=false 30 | 31 | # Bypass connection attribute handling during connection 32 | # setup 33 | connectionAttributes=none 34 | 35 | # INFORMATION_SCHEMA in MySQL 8.0 is more efficient because 36 | # of integration with data dictionary 37 | useInformationSchema=true 38 | 39 | -------------------------------------------------------------------------------- /src/main/resources/com/mysql/cj/configurations/maxPerformance.properties: -------------------------------------------------------------------------------- 1 | # 2 | # A configuration that maximizes performance, while 3 | # still staying JDBC-compliant and not doing anything that 4 | # would be "dangerous" to run-of-the-mill J2EE applications 5 | # 6 | # Note that because we're caching things like callable statements 7 | # and the server configuration, this bundle isn't appropriate 8 | # for use with servers that get config'd dynamically without 9 | # restarting the application using this configuration bundle. 10 | 11 | cachePrepStmts=true 12 | cacheCallableStmts=true 13 | 14 | cacheServerConfiguration=true 15 | 16 | # 17 | # Reduces amount of calls to database to set 18 | # session state. "Safe" as long as application uses 19 | # Connection methods to set current database, autocommit 20 | # and transaction isolation 21 | # 22 | 23 | useLocalSessionState=true 24 | elideSetAutoCommits=true 25 | alwaysSendSetIsolation=false 26 | 27 | # Can cause high-GC pressure if timeouts are used on every 28 | # query 29 | enableQueryTimeouts=false 30 | 31 | # Bypass connection attribute handling during connection 32 | # setup 33 | connectionAttributes=none 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/mysql/cj/configurations/solarisMaxPerformance.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Solaris has pretty high syscall overhead, so these configs 3 | # remove as many syscalls as possible. 4 | # 5 | 6 | # Reduce recv() syscalls 7 | 8 | useUnbufferedInput=false 9 | useReadAheadInput=false 10 | 11 | # Reduce number of calls to getTimeOfDay() 12 | 13 | maintainTimeStats=false -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/jdbc/JdbcPropertySet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.jdbc; 31 | 32 | import java.sql.DriverPropertyInfo; 33 | import java.sql.SQLException; 34 | import java.util.List; 35 | 36 | import com.mysql.cj.conf.PropertySet; 37 | 38 | public interface JdbcPropertySet extends PropertySet { 39 | /** 40 | * Exposes all ConnectionPropertyInfo instances as DriverPropertyInfo 41 | * 42 | * @return a {@link List} of all ConnectionPropertyInfo instances, as DriverPropertyInfo 43 | * 44 | * @throws SQLException 45 | * if an error occurs 46 | */ 47 | List exposeAsDriverPropertyInfo() throws SQLException; 48 | } 49 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/jdbc/ha/LoadBalancedConnection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.jdbc.ha; 31 | 32 | import java.sql.SQLException; 33 | 34 | import com.mysql.cj.jdbc.JdbcConnection; 35 | 36 | public interface LoadBalancedConnection extends JdbcConnection { 37 | 38 | boolean addHost(String host) throws SQLException; 39 | 40 | void removeHost(String host) throws SQLException; 41 | 42 | void removeHostWhenNotInUse(String host) throws SQLException; 43 | 44 | void ping(boolean allConnections) throws SQLException; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/jdbc/result/CachedResultSetMetaData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.jdbc.result; 31 | 32 | import java.sql.ResultSetMetaData; 33 | 34 | import com.mysql.cj.protocol.ColumnDefinition; 35 | 36 | public interface CachedResultSetMetaData extends ColumnDefinition { 37 | 38 | ResultSetMetaData getMetadata(); 39 | 40 | void setMetadata(java.sql.ResultSetMetaData metadata); 41 | } 42 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/AddResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.xdevapi; 31 | 32 | import java.util.List; 33 | 34 | /** 35 | * A result from the collection.add() statement. 36 | */ 37 | public interface AddResult extends Result { 38 | 39 | /** 40 | * Get a list of document ids generated in the server for the documents added by collection.add(). 41 | * 42 | * @return all generated document ids 43 | */ 44 | List getGeneratedIds(); 45 | } 46 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/DocResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.xdevapi; 31 | 32 | /** 33 | * A sequence of documents retrieved from a find query. 34 | */ 35 | public interface DocResult extends FetchResult, Result { 36 | } 37 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/InsertResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.xdevapi; 31 | 32 | /** 33 | * A result from the table.insert() statement. 34 | */ 35 | public interface InsertResult extends Result { 36 | 37 | /** 38 | * Get the auto-increment value if one was generated from a row insert statement. 39 | * 40 | * @return auto-increment value 41 | */ 42 | Long getAutoIncrementValue(); 43 | } 44 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/JsonValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.xdevapi; 31 | 32 | /** 33 | * Common interface for classes representing standard JSON object, array, number, string and 'true', 'false' and 'null' literals 34 | * and non-standard extensions like mysqlx.expr() expressions. 35 | */ 36 | public interface JsonValue { 37 | 38 | /** 39 | * Get a human readable "pretty" JSON string. 40 | * 41 | * @return human readable "pretty" JSON string 42 | */ 43 | default String toFormattedString() { 44 | return toString(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/RowResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.xdevapi; 31 | 32 | import java.util.List; 33 | 34 | /** 35 | * A result exposing a set of rows from a SELECT query. 36 | */ 37 | public interface RowResult extends FetchResult, Result { 38 | /** 39 | * Count of columns. 40 | * 41 | * @return count 42 | */ 43 | int getColumnCount(); 44 | 45 | /** 46 | * Metadata. 47 | * 48 | * @return list of result {@link Column} objects 49 | */ 50 | List getColumns(); 51 | 52 | /** 53 | * Names of columns. 54 | * 55 | * @return list of result column names 56 | */ 57 | List getColumnNames(); 58 | } 59 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/SqlStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.xdevapi; 31 | 32 | /** 33 | * A statement representing a raw SQL command. 34 | */ 35 | public interface SqlStatement extends Statement { 36 | } 37 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/Type.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.xdevapi; 31 | 32 | /** 33 | * Column type. 34 | */ 35 | public enum Type { 36 | BIT, TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT, FLOAT, DECIMAL, DOUBLE, JSON, STRING, BYTES, TIME, DATE, DATETIME, TIMESTAMP, SET, ENUM, GEOMETRY, 37 | } 38 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/UpdateType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.xdevapi; 31 | 32 | /** 33 | * Update operation type. 34 | */ 35 | public enum UpdateType { 36 | // these must mirror exactly the names of UpdateOperation.UpdateType in mysqlx_crud.proto 37 | SET, ITEM_REMOVE, ITEM_SET, ITEM_REPLACE, ITEM_MERGE, ARRAY_INSERT, ARRAY_APPEND, MERGE_PATCH 38 | } 39 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/Warning.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.xdevapi; 31 | 32 | /** 33 | * A warning generated during statement execution. 34 | */ 35 | public interface Warning extends com.mysql.cj.protocol.Warning { 36 | } 37 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | /** 31 | * Java classes for X DevAPI support. 32 | * 33 | * @since 6.0 34 | */ 35 | 36 | package com.mysql.cj.xdevapi; 37 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/jdbc/EscapeProcessorResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.jdbc; 31 | 32 | /** 33 | * Wraps output from EscapeProcessor, to help prevent multiple passes over the query string, to detect characters such as '@' (defining/using a variable), 34 | * which are used further up the call stack to handle failover. 35 | */ 36 | class EscapeProcessorResult { 37 | boolean callingStoredFunction = false; 38 | 39 | String escapedSql; 40 | 41 | byte usesVariables = StatementImpl.USES_VARIABLES_FALSE; 42 | } 43 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/jdbc/NClob.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.jdbc; 31 | 32 | import com.mysql.cj.exceptions.ExceptionInterceptor; 33 | 34 | /** 35 | * Simplistic implementation of java.sql.NClob for MySQL Connector/J 36 | */ 37 | public class NClob extends Clob implements java.sql.NClob { 38 | 39 | NClob(ExceptionInterceptor exceptionInterceptor) { 40 | super(exceptionInterceptor); 41 | } 42 | 43 | public NClob(String charDataInit, ExceptionInterceptor exceptionInterceptor) { 44 | super(charDataInit, exceptionInterceptor); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/jdbc/ha/plugins/IConnectionPluginFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License, version 2.0 6 | * (GPLv2), as published by the Free Software Foundation, with the 7 | * following additional permissions: 8 | * 9 | * This program is distributed with certain software that is licensed 10 | * under separate terms, as designated in a particular file or component 11 | * or in the license documentation. Without limiting your rights under 12 | * the GPLv2, the authors of this program hereby grant you an additional 13 | * permission to link the program and your derivative works with the 14 | * separately licensed software that they have included with the program. 15 | * 16 | * Without limiting the foregoing grant of rights under the GPLv2 and 17 | * additional permission as to separately licensed software, this 18 | * program is also subject to the Universal FOSS Exception, version 1.0, 19 | * a copy of which can be found along with its FAQ at 20 | * http://oss.oracle.com/licenses/universal-foss-exception. 21 | * 22 | * This program is distributed in the hope that it will be useful, but 23 | * WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 | * See the GNU General Public License, version 2.0, for more details. 26 | * 27 | * You should have received a copy of the GNU General Public License 28 | * along with this program. If not, see 29 | * http://www.gnu.org/licenses/gpl-2.0.html. 30 | */ 31 | 32 | package com.mysql.cj.jdbc.ha.plugins; 33 | 34 | import com.mysql.cj.conf.PropertySet; 35 | import com.mysql.cj.log.Log; 36 | 37 | import java.sql.SQLException; 38 | 39 | /** 40 | * Interface for connection plugin factories. This class implements ways to initialize a 41 | * connection plugin. 42 | */ 43 | public interface IConnectionPluginFactory { 44 | IConnectionPlugin getInstance(ICurrentConnectionProvider currentConnectionProvider, PropertySet propertySet, IConnectionPlugin nextPlugin, Log logger) 45 | throws SQLException; 46 | } 47 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/jdbc/ha/plugins/ICurrentConnectionProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License, version 2.0 6 | * (GPLv2), as published by the Free Software Foundation, with the 7 | * following additional permissions: 8 | * 9 | * This program is distributed with certain software that is licensed 10 | * under separate terms, as designated in a particular file or component 11 | * or in the license documentation. Without limiting your rights under 12 | * the GPLv2, the authors of this program hereby grant you an additional 13 | * permission to link the program and your derivative works with the 14 | * separately licensed software that they have included with the program. 15 | * 16 | * Without limiting the foregoing grant of rights under the GPLv2 and 17 | * additional permission as to separately licensed software, this 18 | * program is also subject to the Universal FOSS Exception, version 1.0, 19 | * a copy of which can be found along with its FAQ at 20 | * http://oss.oracle.com/licenses/universal-foss-exception. 21 | * 22 | * This program is distributed in the hope that it will be useful, but 23 | * WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 | * See the GNU General Public License, version 2.0, for more details. 26 | * 27 | * You should have received a copy of the GNU General Public License 28 | * along with this program. If not, see 29 | * http://www.gnu.org/licenses/gpl-2.0.html. 30 | */ 31 | 32 | package com.mysql.cj.jdbc.ha.plugins; 33 | 34 | import com.mysql.cj.conf.HostInfo; 35 | import com.mysql.cj.jdbc.JdbcConnection; 36 | 37 | /** 38 | * Interface for retrieving the current active {@link JdbcConnection} and its {@link HostInfo}. 39 | */ 40 | public interface ICurrentConnectionProvider { 41 | JdbcConnection getCurrentConnection(); 42 | 43 | HostInfo getCurrentHostInfo(); 44 | 45 | void setCurrentConnection(JdbcConnection connection, HostInfo info); 46 | } 47 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/jdbc/ha/plugins/IExecutorServiceInitializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License, version 2.0 6 | * (GPLv2), as published by the Free Software Foundation, with the 7 | * following additional permissions: 8 | * 9 | * This program is distributed with certain software that is licensed 10 | * under separate terms, as designated in a particular file or component 11 | * or in the license documentation. Without limiting your rights under 12 | * the GPLv2, the authors of this program hereby grant you an additional 13 | * permission to link the program and your derivative works with the 14 | * separately licensed software that they have included with the program. 15 | * 16 | * Without limiting the foregoing grant of rights under the GPLv2 and 17 | * additional permission as to separately licensed software, this 18 | * program is also subject to the Universal FOSS Exception, version 1.0, 19 | * a copy of which can be found along with its FAQ at 20 | * http://oss.oracle.com/licenses/universal-foss-exception. 21 | * 22 | * This program is distributed in the hope that it will be useful, but 23 | * WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 | * See the GNU General Public License, version 2.0, for more details. 26 | * 27 | * You should have received a copy of the GNU General Public License 28 | * along with this program. If not, see 29 | * http://www.gnu.org/licenses/gpl-2.0.html. 30 | */ 31 | 32 | package com.mysql.cj.jdbc.ha.plugins; 33 | 34 | import java.util.concurrent.ExecutorService; 35 | 36 | /** 37 | * Interface for passing a specific {@link ExecutorService} to use by the {@link MonitorThreadContainer}. 38 | */ 39 | @FunctionalInterface 40 | public interface IExecutorServiceInitializer { 41 | ExecutorService createExecutorService(); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/jdbc/ha/plugins/IMonitorInitializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License, version 2.0 6 | * (GPLv2), as published by the Free Software Foundation, with the 7 | * following additional permissions: 8 | * 9 | * This program is distributed with certain software that is licensed 10 | * under separate terms, as designated in a particular file or component 11 | * or in the license documentation. Without limiting your rights under 12 | * the GPLv2, the authors of this program hereby grant you an additional 13 | * permission to link the program and your derivative works with the 14 | * separately licensed software that they have included with the program. 15 | * 16 | * Without limiting the foregoing grant of rights under the GPLv2 and 17 | * additional permission as to separately licensed software, this 18 | * program is also subject to the Universal FOSS Exception, version 1.0, 19 | * a copy of which can be found along with its FAQ at 20 | * http://oss.oracle.com/licenses/universal-foss-exception. 21 | * 22 | * This program is distributed in the hope that it will be useful, but 23 | * WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 | * See the GNU General Public License, version 2.0, for more details. 26 | * 27 | * You should have received a copy of the GNU General Public License 28 | * along with this program. If not, see 29 | * http://www.gnu.org/licenses/gpl-2.0.html. 30 | */ 31 | 32 | package com.mysql.cj.jdbc.ha.plugins; 33 | 34 | import com.mysql.cj.conf.HostInfo; 35 | import com.mysql.cj.conf.PropertySet; 36 | 37 | /** 38 | * Interface for initialize a new {@link Monitor}. 39 | */ 40 | @FunctionalInterface 41 | public interface IMonitorInitializer { 42 | IMonitor createMonitor(HostInfo hostInfo, PropertySet propertySet, IMonitorService monitorService); 43 | } 44 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/jdbc/ha/plugins/ITransactionContextHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License, version 2.0 6 | * (GPLv2), as published by the Free Software Foundation, with the 7 | * following additional permissions: 8 | * 9 | * This program is distributed with certain software that is licensed 10 | * under separate terms, as designated in a particular file or component 11 | * or in the license documentation. Without limiting your rights under 12 | * the GPLv2, the authors of this program hereby grant you an additional 13 | * permission to link the program and your derivative works with the 14 | * separately licensed software that they have included with the program. 15 | * 16 | * Without limiting the foregoing grant of rights under the GPLv2 and 17 | * additional permission as to separately licensed software, this 18 | * program is also subject to the Universal FOSS Exception, version 1.0, 19 | * a copy of which can be found along with its FAQ at 20 | * http://oss.oracle.com/licenses/universal-foss-exception. 21 | * 22 | * This program is distributed in the hope that it will be useful, but 23 | * WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 | * See the GNU General Public License, version 2.0, for more details. 26 | * 27 | * You should have received a copy of the GNU General Public License 28 | * along with this program. If not, see 29 | * http://www.gnu.org/licenses/gpl-2.0.html. 30 | */ 31 | 32 | package com.mysql.cj.jdbc.ha.plugins; 33 | 34 | public interface ITransactionContextHandler { 35 | /** 36 | * Called when the driver has been told by the server that a transaction is now in progress (when 37 | * one has not been currently in progress). 38 | */ 39 | void transactionBegun(); 40 | 41 | /** 42 | * Called when the driver has been told by the server that a transaction has completed, and no 43 | * transaction is currently in progress. 44 | */ 45 | void transactionCompleted(); 46 | } 47 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/jdbc/ha/plugins/efm2/IMonitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License, version 2.0 6 | * (GPLv2), as published by the Free Software Foundation, with the 7 | * following additional permissions: 8 | * 9 | * This program is distributed with certain software that is licensed 10 | * under separate terms, as designated in a particular file or component 11 | * or in the license documentation. Without limiting your rights under 12 | * the GPLv2, the authors of this program hereby grant you an additional 13 | * permission to link the program and your derivative works with the 14 | * separately licensed software that they have included with the program. 15 | * 16 | * Without limiting the foregoing grant of rights under the GPLv2 and 17 | * additional permission as to separately licensed software, this 18 | * program is also subject to the Universal FOSS Exception, version 1.0, 19 | * a copy of which can be found along with its FAQ at 20 | * http://oss.oracle.com/licenses/universal-foss-exception. 21 | * 22 | * This program is distributed in the hope that it will be useful, but 23 | * WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 | * See the GNU General Public License, version 2.0, for more details. 26 | * 27 | * You should have received a copy of the GNU General Public License 28 | * along with this program. If not, see 29 | * http://www.gnu.org/licenses/gpl-2.0.html. 30 | */ 31 | 32 | package com.mysql.cj.jdbc.ha.plugins.efm2; 33 | 34 | /** 35 | * Interface for monitors. This class uses background threads to monitor servers with one 36 | * or more connections for more efficient failure detection during method execution. 37 | */ 38 | public interface IMonitor extends AutoCloseable, Runnable { 39 | void startMonitoring(MonitorConnectionContext context); 40 | 41 | boolean canDispose(); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/jdbc/ha/plugins/efm2/IMonitorInitializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License, version 2.0 6 | * (GPLv2), as published by the Free Software Foundation, with the 7 | * following additional permissions: 8 | * 9 | * This program is distributed with certain software that is licensed 10 | * under separate terms, as designated in a particular file or component 11 | * or in the license documentation. Without limiting your rights under 12 | * the GPLv2, the authors of this program hereby grant you an additional 13 | * permission to link the program and your derivative works with the 14 | * separately licensed software that they have included with the program. 15 | * 16 | * Without limiting the foregoing grant of rights under the GPLv2 and 17 | * additional permission as to separately licensed software, this 18 | * program is also subject to the Universal FOSS Exception, version 1.0, 19 | * a copy of which can be found along with its FAQ at 20 | * http://oss.oracle.com/licenses/universal-foss-exception. 21 | * 22 | * This program is distributed in the hope that it will be useful, but 23 | * WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 | * See the GNU General Public License, version 2.0, for more details. 26 | * 27 | * You should have received a copy of the GNU General Public License 28 | * along with this program. If not, see 29 | * http://www.gnu.org/licenses/gpl-2.0.html. 30 | */ 31 | 32 | package com.mysql.cj.jdbc.ha.plugins.efm2; 33 | 34 | import com.mysql.cj.conf.HostInfo; 35 | import com.mysql.cj.conf.PropertySet; 36 | import com.mysql.cj.log.Log; 37 | 38 | /** 39 | * Interface for initialize a new {@link Monitor}. 40 | */ 41 | @FunctionalInterface 42 | public interface IMonitorInitializer { 43 | IMonitor createMonitor( 44 | HostInfo hostInfo, 45 | PropertySet propertySet, 46 | final int failureDetectionTimeMillis, 47 | final int failureDetectionIntervalMillis, 48 | final int failureDetectionCount); 49 | } 50 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/jdbc/result/CachedResultSetMetaDataImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.jdbc.result; 31 | 32 | import com.mysql.cj.result.DefaultColumnDefinition; 33 | 34 | public class CachedResultSetMetaDataImpl extends DefaultColumnDefinition implements CachedResultSetMetaData { 35 | 36 | /** Cached ResultSetMetaData */ 37 | java.sql.ResultSetMetaData metadata; 38 | 39 | @Override 40 | public java.sql.ResultSetMetaData getMetadata() { 41 | return this.metadata; 42 | } 43 | 44 | @Override 45 | public void setMetadata(java.sql.ResultSetMetaData metadata) { 46 | this.metadata = metadata; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/xdevapi/AddResultBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.xdevapi; 31 | 32 | /** 33 | * Result builder producing an {@link AddResult} instance. 34 | */ 35 | public class AddResultBuilder extends UpdateResultBuilder { 36 | 37 | @Override 38 | public AddResult build() { 39 | return new AddResultImpl(this.statementExecuteOkBuilder.build()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/xdevapi/AddResultImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.xdevapi; 31 | 32 | import java.util.List; 33 | 34 | import com.mysql.cj.protocol.x.StatementExecuteOk; 35 | 36 | /** 37 | * A result from the collection.add() statement. 38 | */ 39 | public class AddResultImpl extends UpdateResult implements AddResult { 40 | /** 41 | * Constructor. 42 | * 43 | * @param ok 44 | * the response from the server 45 | */ 46 | public AddResultImpl(StatementExecuteOk ok) { 47 | super(ok); 48 | } 49 | 50 | @Override 51 | public List getGeneratedIds() { 52 | return this.ok.getGeneratedIds(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/xdevapi/InsertResultBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.xdevapi; 31 | 32 | /** 33 | * Result builder producing an {@link InsertResult} instance. 34 | */ 35 | public class InsertResultBuilder extends UpdateResultBuilder { 36 | 37 | @Override 38 | public InsertResult build() { 39 | return new InsertResultImpl(this.statementExecuteOkBuilder.build()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/xdevapi/InsertResultImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.xdevapi; 31 | 32 | import com.mysql.cj.protocol.x.StatementExecuteOk; 33 | 34 | /** 35 | * A result from a statement that doesn't return a set of rows. 36 | */ 37 | public class InsertResultImpl extends UpdateResult implements InsertResult { 38 | 39 | /** 40 | * Create a new result. 41 | * 42 | * @param ok 43 | * the response from the server 44 | */ 45 | public InsertResultImpl(StatementExecuteOk ok) { 46 | super(ok); 47 | } 48 | 49 | @Override 50 | public Long getAutoIncrementValue() { 51 | return this.ok.getLastInsertId(); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/xdevapi/JsonLiteral.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.xdevapi; 31 | 32 | /** 33 | * Represents JSON true, false and null literals. 34 | */ 35 | public enum JsonLiteral implements JsonValue { 36 | 37 | TRUE("\u0074\u0072\u0075\u0065"), FALSE("\u0066\u0061\u006c\u0073\u0065"), NULL("\u006E\u0075\u006C\u006C"); 38 | 39 | public final String value; 40 | 41 | private JsonLiteral(String val) { 42 | this.value = val; 43 | } 44 | 45 | @Override 46 | public String toString() { 47 | return this.value; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/test/config/docker-entrypoint-initdb.d/grant-root.sql: -------------------------------------------------------------------------------- 1 | GRANT PROXY ON ''@'' TO 'root'@'%' WITH GRANT OPTION; 2 | -------------------------------------------------------------------------------- /src/test/config/plugins/auth.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/src/test/config/plugins/auth.dll -------------------------------------------------------------------------------- /src/test/config/plugins/auth.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/src/test/config/plugins/auth.so -------------------------------------------------------------------------------- /src/test/config/plugins/auth_test_plugin.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/src/test/config/plugins/auth_test_plugin.dll -------------------------------------------------------------------------------- /src/test/config/plugins/auth_test_plugin.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/src/test/config/plugins/auth_test_plugin.so -------------------------------------------------------------------------------- /src/test/config/plugins/component_query_attributes.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/src/test/config/plugins/component_query_attributes.so -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/ca-cert-ext.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEGzCCAwOgAwIBAgIUFkSKT1xCWg2PSu8fZs6OlZps+WIwDQYJKoZIhvcNAQEL 3 | BQAwgZwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRcwFQYDVQQH 4 | DA5SZWR3b29kIFNob3JlczEPMA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNR 5 | TDEdMBsGA1UEAwwUTXlTUUwgQ29ubmVjdG9yL0ogQ0ExHzAdBgkqhkiG9w0BCQEW 6 | EG15c3FsQG9yYWNsZS5jb20wHhcNMjAwNjAzMjMyNTMwWhcNMzAwNjAxMjMyNTMw 7 | WjCBnDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFzAVBgNVBAcM 8 | DlJlZHdvb2QgU2hvcmVzMQ8wDQYDVQQKDAZPcmFjbGUxDjAMBgNVBAsMBU15U1FM 9 | MR0wGwYDVQQDDBRNeVNRTCBDb25uZWN0b3IvSiBDQTEfMB0GCSqGSIb3DQEJARYQ 10 | bXlzcWxAb3JhY2xlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB 11 | AMkV8+jk2aOxHxnNOu86Ejlqd28i6BcfXtjXz9c7sEDrKJStrOzSHI94wka7HEYe 12 | r3lcMf5rBO3/hNGcL6YLzkpZVKfttR/lvqsihxatLgZ0mFHp2onXd7yPkK3Ana6q 13 | xmHCQ1ASAq4sFXCmNN7Zo6u5Y48pg1ZEMCyGlz3Stu9jov4/YrXY8r3bvnda+B9S 14 | FNJenl8ynSxy6ynnpgk9y9wKFbM2wj2BjGbpirvgr+wmPsmbgExzUrED2YsJpkof 15 | nxlWBuxPnpx7cJ6zGdDQLagbfZ5ortHRSFMcYVMIpGJr9eGjf7u4sE9/UVx4gp/f 16 | p6jQKlOG2FxjQLyvjstu7BsCAwEAAaNTMFEwHQYDVR0OBBYEFC6X3Chl98Mi25O5 17 | xl08SCvAaeL/MB8GA1UdIwQYMBaAFC6X3Chl98Mi25O5xl08SCvAaeL/MA8GA1Ud 18 | EwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAIs+qEZxZUcjdYSIbXMxbppf 19 | r522fQ1yAzVgb/k2SaRR8gRTMW2/u6iazIrTRCuy2UyCY0cSw/I6j+H7rKEikhLl 20 | Nu2whzIQKUCoO1b8EKYrtX0djmxTTo/G/AgjygmlxEWMI1v2GpiaD+rOXXMvfFGC 21 | sNfQ2Bbi1mw8V/ZHShb53Bdpzs5H5NNF75Lz0SIiLxmi6fXoHXXmUHtE5dkfRmko 22 | a4/V8WcyMDOJQK/TSnsG3ug3Mg6Lkdu8uwXZcyEJ3eX40xjLyrNpq+evVHI4jM/W 23 | 93ak/JebSNWMyMY9USETkDT0nWxvcKm5stMH6WKW+7cf4TQdGNKWwbzE4GMwQnw= 24 | -----END CERTIFICATE----- 25 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/ca-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEDTCCAvWgAwIBAgIJAIiYHFajCcAZMA0GCSqGSIb3DQEBCwUAMIGcMQswCQYD 3 | VQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEXMBUGA1UEBwwOUmVkd29vZCBT 4 | aG9yZXMxDzANBgNVBAoMBk9yYWNsZTEOMAwGA1UECwwFTXlTUUwxHTAbBgNVBAMM 5 | FE15U1FMIENvbm5lY3Rvci9KIENBMR8wHQYJKoZIhvcNAQkBFhBteXNxbEBvcmFj 6 | bGUuY29tMB4XDTE3MDMwNDAwMDM0M1oXDTI3MDMwMjAwMDM0M1owgZwxCzAJBgNV 7 | BAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRcwFQYDVQQHDA5SZWR3b29kIFNo 8 | b3JlczEPMA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDEdMBsGA1UEAwwU 9 | TXlTUUwgQ29ubmVjdG9yL0ogQ0ExHzAdBgkqhkiG9w0BCQEWEG15c3FsQG9yYWNs 10 | ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDLkHXpKMO4oUI0 11 | S64R4D2MIFtS9xXX4BK7jDW/VefKh87k9kLBPqKPb7NKqdCFcJk/JBrfvgQwb63U 12 | FH2TX3NYSQ/4gXG/UZoUMG9EK8KZ7gpKvrbgBSYAyOhE+dLrE7HYCesmS3Y4Owib 13 | 0QJx8IozDQm/JencKk7swfT6sSBvPb/rvAegiOoxb7S2EW0zWlIw4P9kPmu8X4IW 14 | 6u79gW1HyOAIi0wKFbqgXwTHaz+VtqjRglYi0U48H2xqw5IpVhZg9Di1VzeZESkD 15 | RVPNoFhhlX0xYfl3/+ZoNRVJDQHE6qXSfkDLePzw81Bl+OwO2CYZ0EXwW0bzgk9u 16 | HXuvuKrpAgMBAAGjUDBOMB0GA1UdDgQWBBSaoJ8RI8gbLGSrUwrrCbqvZR3i6DAf 17 | BgNVHSMEGDAWgBSaoJ8RI8gbLGSrUwrrCbqvZR3i6DAMBgNVHRMEBTADAQH/MA0G 18 | CSqGSIb3DQEBCwUAA4IBAQCHl2ezisRplspyEyqEH4uvBbBr1zGDXKn6BtPufXws 19 | 4S+itxrw16sGI3RmYheyYuZPM+9PlwFMsWRJtfxZc4svZRr/s9IoHHQiV/KBILfu 20 | 5JDxY1UwZcGHZ0b8XlgeBOxnq15z7YaU7+pPAVmpxmnehJCK8s+y5TlM2S2OEvYP 21 | I2swAXDE5Gzwq1Y/VExQZhRQL5LXGiNjZV+VHeLO3Vf5HrKUsKSTnq5kvdIwWELz 22 | o3NqS88gr36lBzh3aqX3/rxS0QdR4iecoG+ztO5ZS5mFpgqP+2aNAano/8cQ7jIQ 23 | 8cm4akxWarBQRLik2lB+kwsxiyGF+k8NjVUAIUh70U7H 24 | -----END CERTIFICATE----- 25 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/ca-key-ext.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpgIBAAKCAQEAyRXz6OTZo7EfGc067zoSOWp3byLoFx9e2NfP1zuwQOsolK2s 3 | 7NIcj3jCRrscRh6veVwx/msE7f+E0ZwvpgvOSllUp+21H+W+qyKHFq0uBnSYUena 4 | idd3vI+QrcCdrqrGYcJDUBICriwVcKY03tmjq7ljjymDVkQwLIaXPdK272Oi/j9i 5 | tdjyvdu+d1r4H1IU0l6eXzKdLHLrKeemCT3L3AoVszbCPYGMZumKu+Cv7CY+yZuA 6 | THNSsQPZiwmmSh+fGVYG7E+enHtwnrMZ0NAtqBt9nmiu0dFIUxxhUwikYmv14aN/ 7 | u7iwT39RXHiCn9+nqNAqU4bYXGNAvK+Oy27sGwIDAQABAoIBAQCeQ832JnB5WoWM 8 | 7C+Pa9g+ImKgMQwUbtdaufjWgR8G6U7GPi9VMUXTUgsuWkQ1mB8p2Htsr9RwcWSb 9 | CV+jQ7V4ZPixNvEQiuVXklRab7FC2W+tQO6FAPY3jZMkfe5dNAHxnVEXayV66i1x 10 | vQ7tusQL+1y1p8m8Eu0Ljl7pBLiAjjgNJKDCalgo9EeYlWB4DOKLsiF24E5GKUqB 11 | X3zXAKvi5zzYMejhkZFLQE2dekshRP88O35+bw3ozw238HAKyoMAYeVf2jVwktUW 12 | 30jHW4yru5Af2W2030EWoh4nUDfZUk7jvw8zquhltMm/Ca/qSvKjq6kOTXu+7U6U 13 | sIJHBqxhAoGBAPNHE1uKUzu0KV1yVXkc3jTYnknoCCE6iu/0dC6L9PcR4td7wTmq 14 | WAqfUUv8dfwR2mAmyvULIWwaiWv7IcPnt4amXe+biukE4vzOoa74i9cgxXu5A8od 15 | zUwBq07mk01UABQy63LJHB9kDeo6XeTNZjM7a3vFJgDKc3pc78JvGnkxAoGBANOa 16 | BoXIWYu5RKIFhyBRLNDSCdZPKi5AMh3Er2oi5QJztf87sFm2EK6vuCnLc+Qhcj8f 17 | MgZiXwlJCOKgRKyGKGaIl/zIwKxEhHKsN8slHQuVvhp+9qz/CFQYcyM9ye4GdHTq 18 | pfNVrIMZdu83aIRcmi04F+obsu+ZZVZoQCDk2WcLAoGBAKqIRDWC/V14qRZsMyY2 19 | 6jy5LBw6nphMZWBXR6npScp3qz/J7GTz18t6ao6NZldQXHfSOasUJlWVNIeQ/tZI 20 | 9AlbTbXMns9BMaxtXEE+0Sf4PPbBdrqTsXl6Ig+o6dDm9TczioBoIWKPzIFIcNEW 21 | enGnUWztgfpD8DbyNs9g+nnBAoGBAKDOo/hVit+pe2QaCVfg+Mr1ZC5u2SJu/Ocs 22 | ixaA0EMtxnjiVqHGwCTRO4bfrAIJ/PXFclHxvkGjNFJt8+KczeUmF0MvGWWRaIpx 23 | ILGMUed09BTUugg8hIrMTevRUD1IwIX9sQIc8M5ssrsXA6Hbcfu9bkcmp7R4gc/J 24 | yDp3UFSDAoGBAKPlusGAGwoM+Rk1fUiNHLF3uzi69OoeKFqeq9mUmGpkXs7fB1HJ 25 | b1/XaTQSMMt35JFlHbiQIG/iINNHL92IO1X2jUswB1P0gyPhv/KTcQ4VRXU+l846 26 | rq26BAfo/dxUd761PNj0XyIjYhddgbkbeF1lxnLqNZJ80rW0JXPa76qz 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/ca-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpAIBAAKCAQEAy5B16SjDuKFCNEuuEeA9jCBbUvcV1+ASu4w1v1XnyofO5PZC 3 | wT6ij2+zSqnQhXCZPyQa374EMG+t1BR9k19zWEkP+IFxv1GaFDBvRCvCme4KSr62 4 | 4AUmAMjoRPnS6xOx2AnrJkt2ODsIm9ECcfCKMw0JvyXp3CpO7MH0+rEgbz2/67wH 5 | oIjqMW+0thFtM1pSMOD/ZD5rvF+CFuru/YFtR8jgCItMChW6oF8Ex2s/lbao0YJW 6 | ItFOPB9sasOSKVYWYPQ4tVc3mREpA0VTzaBYYZV9MWH5d//maDUVSQ0BxOql0n5A 7 | y3j88PNQZfjsDtgmGdBF8FtG84JPbh17r7iq6QIDAQABAoIBAQCAQDGphl9ZUW/u 8 | lsfCx26/fBtNeBKxAaGLu9iZBbyVo168blK8gYPVruBc6ARSLhC+8TZlRMhK4/G2 9 | rno3gWmgc9e2D4fkq7rRgXp4jsF6Tbj6QpHhLh01XV7JJkS2ip//prAaXmzLHJZd 10 | 5R8PPicz5sD/RxnB9n3nOIPp9fKjYjlikzESEn+BaimTFGTX2X2w/exrzDpT6jd5 11 | hTBg/v4UAs/+5v/M6646VPctz+Mc9Db1b2EH35Nv3kXHX2ts3ChRzjgKEDbEBT/q 12 | d6yb+3zd8sdZJqxWQtWMAN6BGwzSJZ3//zaqyY8K7YNEHwHJWAjjlRG1PcgQRgZc 13 | zcKVfKOpAoGBAPlu+strrwUBJD9AA1FgUQBMmCtvS1L5e4VQSqyR1g62ok3VBnJ/ 14 | olUREbMVoSJK0Kjuz+Hzrs4t6md8i1AC4zwOly/JKqWsuPXb6sCNNEi6SB6zrg4p 15 | 9CmUIp99QdpZV5Gqkk2kK/nyMHuwIbuZRLBoEpzAFmPghU+ajalKcemzAoGBANDs 16 | WiSZ6iRa9AHY69kC2V8eoRueZJTl1Kb7MsRo3vJ4GNHA5g/qbkSzDndPwpgfalvV 17 | nOZLYOCBw/HpNxAjjLMgELaVi6LsG9yA7BiXjpcUFykFsc1KdHhTOFoIS+E9mspq 18 | Otj26gwuPNJkzePJjPLAbD8KszCvoDFr8iI1EdLzAoGBAPcS5GAdcYdegx4X9XFl 19 | G7dVJ6JWouE0+RKr3twjtUprxEeejL1cCluDBepDsZH7U8cSj16899mJh9gseP6v 20 | bZEuzrlp5dGoTqpSxa0n8bNculWXHAExs4aAEu+yrklwGBrVQAiiZ2E1cqsCY9ek 21 | 0XKAFHeqmkMiwkqAyHP5pu6bAoGAYe85PkkMEei00xzdScflH4qbGPhBy+6EpZXB 22 | MYK7Z8vWTpTvA2zwLbIFyPYRkP/A+rWCrA2Ppw4NTRv2nNEdRmZ0jzJA16l4Uf/5 23 | LHn29GkNhkROGZ6aREE2fDXBZB9drR7o4QW1puoRxspMHUhAkxaSZ2bboqnhHOmu 24 | Ak0AQvMCgYAEBbYfB6PmIvPL458OL3DSc+CGyp+SMep9d5WJrSjjersO55nn3/LL 25 | lxV+zdN6gR7jQn0xtn7rHp/IpPFBc7FUqcTPFnc9YrIrBaS5yvhmv94yOf+4MCq0 26 | 7FYG2XRl9QRl+FSsxHFl8m/sl38GdIl7CQvafc2BXozdwTrzSjTSuA== 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/ca-truststore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/src/test/config/ssl-test-certs/ca-truststore -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/ca-truststore-ext: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/src/test/config/ssl-test-certs/ca-truststore-ext -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/client-cert-ext.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDsjCCApoCAQEwDQYJKoZIhvcNAQELBQAwgZwxCzAJBgNVBAYTAlVTMRMwEQYD 3 | VQQIDApDYWxpZm9ybmlhMRcwFQYDVQQHDA5SZWR3b29kIFNob3JlczEPMA0GA1UE 4 | CgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDEdMBsGA1UEAwwUTXlTUUwgQ29ubmVj 5 | dG9yL0ogQ0ExHzAdBgkqhkiG9w0BCQEWEG15c3FsQG9yYWNsZS5jb20wHhcNMjAw 6 | NjAzMjMzMDE5WhcNMzAwNjAxMjMzMDE5WjCBoDELMAkGA1UEBhMCVVMxEzARBgNV 7 | BAgMCkNhbGlmb3JuaWExFzAVBgNVBAcMDlJlZHdvb2QgU2hvcmVzMQ8wDQYDVQQK 8 | DAZPcmFjbGUxDjAMBgNVBAsMBU15U1FMMSEwHwYDVQQDDBhNeVNRTCBDb25uZWN0 9 | b3IvSiBDbGllbnQxHzAdBgkqhkiG9w0BCQEWEG15c3FsQG9yYWNsZS5jb20wggEi 10 | MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDcO3YhUeTcyj8F3R6OqRrcLLKx 11 | h3FW6bGZL5jSO+GkMLoSWasN8wlaUGz7TJ3bmYmr1XZ8aBWVKlZVzN3vdIaOMd0/ 12 | ceoG1oiyLNHfsqo3bdA0RNMzEDj1sts8i8Ucs+sa5mI+vS7RY7gqYeybLRGYRGWu 13 | 5CTIVbTsI5BS3RS3Ekb4WcdFTFfZvEvLWSNn7ssyDdCpE6vywIwwmymk8+5L7tye 14 | xGhHQYx3Dl65yZMdgXl0b78TrJia7TIospTHRLS2cZewQCdT4Wb694JHqp1esJWP 15 | ay/xe2IACQ7H8Uco1yU1yIx1mF6YaAoyk5LKkTD9sCZgxmSoD6EhpcnhwgSbAgMB 16 | AAEwDQYJKoZIhvcNAQELBQADggEBABZNcp/PAWOQPHMjSErsqTVUpI6O2VYX8EYZ 17 | lLFb5cy7oDaTlH4vo1Fn/jCDZ7bcWuGIYVzu0xurXtowSq5xvcaxtVVzPWZobTth 18 | USrInathbupk6h2zkOjMzwS6nd86+VwI6rr6RflR5nS/T85+r19/68OtHLIcJTkP 19 | x8A03X1PzoIZh57cKcRLNabtOstk7ErnC9rXJaO8dbq9WDWkrWpQGekz4pJB2oh0 20 | CZADcrIedPRaLJ8X3ghm6ucmmCCrhKUrYYPev2O9oq9lk9Pv8ryhTWnxWjB1Ckye 21 | /Puyla0a/YDYZffWBJsunUuw7P9rnnMtKyi3/SsBOpGsxhtmSYk= 22 | -----END CERTIFICATE----- 23 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/client-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDsjCCApoCAQEwDQYJKoZIhvcNAQELBQAwgZwxCzAJBgNVBAYTAlVTMRMwEQYD 3 | VQQIDApDYWxpZm9ybmlhMRcwFQYDVQQHDA5SZWR3b29kIFNob3JlczEPMA0GA1UE 4 | CgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDEdMBsGA1UEAwwUTXlTUUwgQ29ubmVj 5 | dG9yL0ogQ0ExHzAdBgkqhkiG9w0BCQEWEG15c3FsQG9yYWNsZS5jb20wHhcNMTcw 6 | MzA0MDAwNzA3WhcNMjcwMzAyMDAwNzA3WjCBoDELMAkGA1UEBhMCVVMxEzARBgNV 7 | BAgMCkNhbGlmb3JuaWExFzAVBgNVBAcMDlJlZHdvb2QgU2hvcmVzMQ8wDQYDVQQK 8 | DAZPcmFjbGUxDjAMBgNVBAsMBU15U1FMMSEwHwYDVQQDDBhNeVNRTCBDb25uZWN0 9 | b3IvSiBDbGllbnQxHzAdBgkqhkiG9w0BCQEWEG15c3FsQG9yYWNsZS5jb20wggEi 10 | MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCluIoIzfZDPJYrHet8kbyeG+rp 11 | 8GLVDcZ0n0EOHqkviSSpi2iEkxolpWXVBN6DddP0jE9Pitpf8dyfEnRUeEYQrU21 12 | da788gaA17mZZsfP36QRW3Jz2tekodlYtKSeo4Gl+IPIyBjeQG9sqSpQe9oyruJV 13 | LUmz9euPtJj1UqhTBVDAW9NgCGgfqAEw0Hos+H8+/LRia/9O8VThVTzlPaiJylli 14 | xxin4/JkFiQj+R7CDyhNfnY/9kY0XoeVemjkOWCMAstSqjQzevRtVdXeduzsL6fq 15 | g4tKgqOXaWUT9g2XC1807qExmo4o13X9v9fXCNv4R+vwzofYp0DSmbHUrBPhAgMB 16 | AAEwDQYJKoZIhvcNAQELBQADggEBAJg0npMHVfOXDDGbqQzRaqNY51id6/0tagRa 17 | FQfVNjaLDWI5WDDw+LRGxgiBEthbWP/dPWjiZrEr0LQFIvDcAqEtZNNcoAQEMr28 18 | tuOmVad0Es/lMf1xxghBkn8XjVwUUmLpW+WEfI1NvSdrsn70e04A0LXj88zxa2eJ 19 | smUU2ML7dAfvb+EYhLB5jnlO/ARQ8eMwHiN/lsEntX8iEDwhID+7gFubgmIkxyjM 20 | LsqgqayvTvQ/WvWSCk73oVqSRhlN30N/ses7TUDWyUvZTJorrekIiMCwNFJ6gPCU 21 | OlWO3mCFgt47XlCzLMfqfOKxDxGkcxW+S4nU0m7FbRPf7rMmBxk= 22 | -----END CERTIFICATE----- 23 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/client-key-ext.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpQIBAAKCAQEA3Dt2IVHk3Mo/Bd0ejqka3CyysYdxVumxmS+Y0jvhpDC6Elmr 3 | DfMJWlBs+0yd25mJq9V2fGgVlSpWVczd73SGjjHdP3HqBtaIsizR37KqN23QNETT 4 | MxA49bLbPIvFHLPrGuZiPr0u0WO4KmHsmy0RmERlruQkyFW07COQUt0UtxJG+FnH 5 | RUxX2bxLy1kjZ+7LMg3QqROr8sCMMJsppPPuS+7cnsRoR0GMdw5eucmTHYF5dG+/ 6 | E6yYmu0yKLKUx0S0tnGXsEAnU+Fm+veCR6qdXrCVj2sv8XtiAAkOx/FHKNclNciM 7 | dZhemGgKMpOSypEw/bAmYMZkqA+hIaXJ4cIEmwIDAQABAoIBAQDUZHQUxkoVtOb6 8 | 3LlvlB7XYDQlih4AV/hzZ7fWaPG/y05oDBovpcfLVe0EnmtPMc/X7FIMwMSvytjg 9 | fmc7XAG4eNaLLW0pkxTZ4Oe2+TO3qSw2fHnCsU59hjRxO8qpV8rRcoYlQ4Y3Yhhm 10 | p3HsZZamZrA57sSagC2v3sx9XcFwm2HaGE5iKQSst883GV/IZWPdfT9WohbwxZe5 11 | TuMDvA9bj7u1WXxzw1xcs4pv1u3UqZMY29tEmnkiz2125Ju8ADMYjgsJS1TDcwn4 12 | xHrKVItQrXmfOh8EvXneo0ROlBwSVIHNA7CPoZJKtmOjZ1VOwV2Q//OzhO6wysFx 13 | xJhMIC9hAoGBAPAWNY9Cnx2YlJbhATChixpNBtQXiiufPE3sG+U9ZGxC06b5yoeW 14 | V5q0d9ejy/B5y1UhlqQEIoYm47Rf0n4gJxymWnoq3C279x6mXxBR+KwATufDcxvm 15 | HTRyAFqjNOZSlknM5v4n6hmAQWhLIv/vRLzNulZ4maCQ6pp72AJN/KAVAoGBAOrU 16 | XIiFnqJ866XihA2pi8XAIcfRH0tFWrNYFyOJifRa3N59/YxTI+mxBqVFldNToT4w 17 | BOG0nAQsrvCk2dtBb2pOhrqpgqLW29uBdrclHp2qr/zXT6eQUMCl2HngGsYR/Ge5 18 | itbKrtREEgfioc6huU97OeuhPfquuFZTFj2WCY3vAoGBALytt4nOoZ1wu9WXHohJ 19 | bDhPMH6dwUhm682RMJsHlFRAcHVY+YF09YPvL/+YCj4CeXl93BUp6rfi+DBY3eOh 20 | ARvS4GgCJucKQTslJLB+ux7xXxFk2KGkRm9g6EZS3M/lN5boIOC8HY3M7Zo48liQ 21 | gUSfqUErphA50yV1Dl1BTLfBAoGBAKZE9LvJeFfugV90MjIGQSwkbQaxICpIkf74 22 | OXH1GZPFnit/I75uw7fcmyr8SShXR4zjrSEuo2UlSjyjTIm9HCk2LpkOGqw323Xh 23 | hfAJPVM/nto0jXbEbRjqlIs+zVY/N+staYvJ+N3c0LN6mTzYL4CCbLFU+rB7c5PT 24 | wqSajmtLAoGAJ84BpcZUYul9A7uDfQluVqQsp1fRS92FP4Yq7qVVccz9es2NosN9 25 | b8ZVpRdqxEvx8RvKPjXrl9VBqW7YuUvRrH7DRw+vmixeqnsLmCq6fGUeP75rTFPH 26 | EcUdNhwYMjpZWxNxOLcA34QLYZopkNVp/loQ8Dy5wntWfPZzKVwVHNI= 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/client-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpAIBAAKCAQEApbiKCM32QzyWKx3rfJG8nhvq6fBi1Q3GdJ9BDh6pL4kkqYto 3 | hJMaJaVl1QTeg3XT9IxPT4raX/HcnxJ0VHhGEK1NtXWu/PIGgNe5mWbHz9+kEVty 4 | c9rXpKHZWLSknqOBpfiDyMgY3kBvbKkqUHvaMq7iVS1Js/Xrj7SY9VKoUwVQwFvT 5 | YAhoH6gBMNB6LPh/Pvy0Ymv/TvFU4VU85T2oicpZYscYp+PyZBYkI/kewg8oTX52 6 | P/ZGNF6HlXpo5DlgjALLUqo0M3r0bVXV3nbs7C+n6oOLSoKjl2llE/YNlwtfNO6h 7 | MZqOKNd1/b/X1wjb+Efr8M6H2KdA0pmx1KwT4QIDAQABAoIBADV0tXHpngpKPNZj 8 | rFZeXE1UDA6yL+8xplZwGHgJg+GFh4H5Khm5qbGDDLoN/AjDtT8pE1xBGffg+J2H 9 | QmcM9OzkOjDSaUPGfjqJW6ET+lgfd7jxmpWsferpGkb23jMd4vA6nafig8MNXePb 10 | HX8gtF2s8+0t0pxuMzIDu2NG6mz8wQ3/V4vrbOM/AV5oXysfWei1NyU8z0DDHBd6 11 | GrriUvKUPmSXWR1uO6LKMO0+TxCZlAFHN0K7Ej1LU5nw3nzGaHkggvmch7od1qXr 12 | 7C6Hlf1I2iX2x7l14P99rQrj0JLZtm0aB3HHAymfNk0yrzkEraaUgkTccSfknfaq 13 | iD4ZBwECgYEA0SMQXt4ZyOVGYFPxegQF8BW/7S/FRdoQS94t5NJ04uZgWo0VMYII 14 | Pl05r3QLn4+86ZB5Pzg6lsC0d/GpsHxPoHXl9+LTlXkGWoorLGbMA1L+P7ZrUwP0 15 | tx/tDioc6mwautExV/VcIJm5j1c6PbpsEBCRBDCu9meVcKl18UAl2qkCgYEAytrz 16 | 6Dy5qxyXui3jcBvKPtk6ETs5uxWekQvMNB6jmN6qKlKle1yaJwIwWwV671iUjPst 17 | UN+AJGELdgZJOzg9AHeoIpvgGQ2bMp5NwTimvY6M6kbH4za+bgZAXZdYoqB5ReZG 18 | 5QR1+eEL+r9oVvqcCaAYc3r30uDxMPNRZR6oKnkCgYEAkvyO6+4ztyOVU+yLolMj 19 | jTrsGprhjpeVrozoOpPD/RknjVztEU+v1Y0WFv97j9ipUIru/ITbgMrNzCM4PUcR 20 | e9iBGbj9NmfKFGZZs6pIJun0sfjW85CrNO2mYbctfYEfRD/06zoSVwNUDK+kym+0 21 | tZG/Km/A+IOS34zqzPVl5YkCgYEAiDLOBKWQ+6Qs8yIQTJs8BUqQRDWBo2z2k+hZ 22 | 6LyRlvgZRGVNGjCoh3xevx5E1iKhSq7yVBRb0xEdQtchoBM4UfIE/4esxOVvyGKl 23 | ThAdU7Q8RKfVWWbOIM0ttikBp98azaW4/9co5ucExgxxn8SPs568C/0KG5pQFk+n 24 | 3L7ipfECgYBAoVUMbq8WbT9GQr2lIs4P3/tDX7PZ3YgoN2+txoVi16Xzxcy1YUBE 25 | gd9prvNpOULwlXd7/Ip3riXkypU7tKXmsu8WloucOO+cHSpGXKzt0I8bbHYYx46N 26 | 2GZb7oVya/0nv9vWuPF94eKAd//qA/FyCgQexDG/F7fT44uf5Vw0Vw== 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/client-keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/src/test/config/ssl-test-certs/client-keystore -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/client-keystore-ext: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awslabs/aws-mysql-jdbc/dc3d7d4cccccb212747e2d87a68a70986234e3c1/src/test/config/ssl-test-certs/client-keystore-ext -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/mykey.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXQIBAAKBgQDBzoqQuwZ9/eKMOU0OXWJ4ISj+2YEk8l4OmBoC9Y2wNEe4Pcjz 3 | mCF/f9aZDyH6znh0G6gmb/yrTvuNLYkTUgiFNm0yJ2rSzlgmJZHkWykRkjKr4V04 4 | iAaHdU4ORre7Ms9eln7k8CeVQFpCjM51HOLkp8IhnAVrkOhSbHI4vxprbQIDAQAB 5 | AoGBAJbMD3L3ouCLmCfFOhiwPrr8CjrpoBvQXbD7VlnxGDL/KsLHiEFJoN7k6GQl 6 | qynMV1r4XgiyYCYnCYHa6WpYDPnHI59pq4P7UUkO8hC54FVSbnZvNLnveRa4hmYv 7 | d/7uRGEygJ0ifrHaaAztLHx5MgpMveJ4FTeQK0bjnOvTk0FBAkEA4v2QFc6em3bF 8 | 5CIvtmo44dpeX/89dzShGLheIAMlgrq2a7ZYi5L7G4NQH+nUKErObtqjGnhtZNjp 9 | 6El2B+LVfQJBANqTTz9bAIVJhnLpJz39YNXgtHQFuSNeqwI1b3XW5X037+2G1Fu5 10 | vEqc4rSn+auzqnPhvWaHL6e9s+BgxRUxELECQQCFLGLGiIzBhTOhHvWDPlrVFzrb 11 | c3JqZ7REPpbqjS4KvuSb2UWlzbwJbkcqEhPo98qZeyjKNPFpg2HoaIEZK1o5AkA6 12 | fDA4Q6FgCMxw8vINJD9E+1tNsDpZvHsFnEa2wUmmt9D7PZiU8p3vWQtQS6ICz5BM 13 | cZq8VG/r8lavMzWI9hgBAkBz92TmpDXjqsa9pJ2reqjc9EwvBwH0d4Up8jKrUotc 14 | qFNXFtt+UCBRM358LYNHJlEmorc/EM9Tx89YeNGwSgXU 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/mykey.pub: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBzoqQuwZ9/eKMOU0OXWJ4ISj+ 3 | 2YEk8l4OmBoC9Y2wNEe4PcjzmCF/f9aZDyH6znh0G6gmb/yrTvuNLYkTUgiFNm0y 4 | J2rSzlgmJZHkWykRkjKr4V04iAaHdU4ORre7Ms9eln7k8CeVQFpCjM51HOLkp8Ih 5 | nAVrkOhSbHI4vxprbQIDAQAB 6 | -----END PUBLIC KEY----- 7 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/server-cert-ext.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDsjCCApoCAQEwDQYJKoZIhvcNAQELBQAwgZwxCzAJBgNVBAYTAlVTMRMwEQYD 3 | VQQIDApDYWxpZm9ybmlhMRcwFQYDVQQHDA5SZWR3b29kIFNob3JlczEPMA0GA1UE 4 | CgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDEdMBsGA1UEAwwUTXlTUUwgQ29ubmVj 5 | dG9yL0ogQ0ExHzAdBgkqhkiG9w0BCQEWEG15c3FsQG9yYWNsZS5jb20wHhcNMjAw 6 | NjAzMjMyNzUxWhcNMzAwNjAxMjMyNzUxWjCBoDELMAkGA1UEBhMCVVMxEzARBgNV 7 | BAgMCkNhbGlmb3JuaWExFzAVBgNVBAcMDlJlZHdvb2QgU2hvcmVzMQ8wDQYDVQQK 8 | DAZPcmFjbGUxDjAMBgNVBAsMBU15U1FMMSEwHwYDVQQDDBhNeVNRTCBDb25uZWN0 9 | b3IvSiBTZXJ2ZXIxHzAdBgkqhkiG9w0BCQEWEG15c3FsQG9yYWNsZS5jb20wggEi 10 | MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCTHer68cds/M3Q7Z5VTn3cgDc2 11 | XKUZV4u7nXQF/lT/W7HPtpP+cJpRRbWXpwbO4whjY6vaXYvwSh9vrrfOYp7eqg9W 12 | yGQjVV3GoCJdIp+JJVG9wdYbWcWlFDNdHPOrtbkDRq9DjDlqDA9P7CM5BwykSoG1 13 | YakxjeMJWYiHLWCTJRhzE4YZ7+H/2yDwwpcgES9JwEjrEnevjR9ygCJlC05ofkwL 14 | CG6PDYdOagxcY70fW5q6U2fpBfS1WqkUZtxs5cPf7F+kdRUXPfLi2c6eAjTZVJEl 15 | JCajrGH6+f/d4pP/4ial0+nBhpZbxwccjHnhFb3YZLJprz0g3q9cBU1xMkuvAgMB 16 | AAEwDQYJKoZIhvcNAQELBQADggEBAEcoIY6hiQ9Pw3axZIY1k70Hj2EFrjtrCZNz 17 | IaOTuosQvZXAhyLU1YViU//KdR6JwI4orLZJWrSQkoAJrp38nlaiQIjqOCz2kEkE 18 | 70Cs1KWSJ9PSmQG5+JfpK+q7rFLu62MwsswRdWxXImnXrp0+pAKjGffBtuM0r51s 19 | z2nyZEpJM82h4JoFbfYm7G/7LGSiZYFEYMuVuR1N/IkAkLa6pYJuzP8CQX9BV0sb 20 | hhVCyG2xaRRk7l3OrGGUGLpGaGZAUoQtsmTrL0v533qCl0FpKAe8oL3TGP5qGgJY 21 | 1nZOplN4foXOvjKEBm+cf0gI2vQ7FzSROZ0GsY3WCLZwnwLGZkU= 22 | -----END CERTIFICATE----- 23 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/server-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEUjCCAzqgAwIBAgIBATANBgkqhkiG9w0BAQsFADCBnDELMAkGA1UEBhMCVVMx 3 | EzARBgNVBAgMCkNhbGlmb3JuaWExFzAVBgNVBAcMDlJlZHdvb2QgU2hvcmVzMQ8w 4 | DQYDVQQKDAZPcmFjbGUxDjAMBgNVBAsMBU15U1FMMR0wGwYDVQQDDBRNeVNRTCBD 5 | b25uZWN0b3IvSiBDQTEfMB0GCSqGSIb3DQEJARYQbXlzcWxAb3JhY2xlLmNvbTAe 6 | Fw0yMDA3MDgxMDUxNTNaFw0zMDA3MDYxMDUxNTNaMIGgMQswCQYDVQQGEwJVUzET 7 | MBEGA1UECAwKQ2FsaWZvcm5pYTEXMBUGA1UEBwwOUmVkd29vayBTaG9yZXMxDzAN 8 | BgNVBAoMBk9yYWNsZTEOMAwGA1UECwwFTXlTUUwxITAfBgNVBAMMGE15U1FMIENv 9 | bm5lY3Rvci9KIFNlcnZlcjEfMB0GCSqGSIb3DQEJARYQbXlzcWxAb3JhY2xlLmNv 10 | bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJw8ZFOmkBrUmAwPtmWS 11 | tdfWR6GTw1mfzWEDKwz3wHiyqkZ2tBLxVSs+bou7d9ig+v+t7d2zsc2I4IArK5rv 12 | sbheZ/qhjxrFekGAgfJHuY2J9sdhP208Lv3DSf+9GYyCMbccSNbFEWNkE4TvwHs/ 13 | cekr0+UjH1eJ476WLjiuDTZwUlR5X/uVPKWDr2lGzMt+CCIOTygMqj6pi11Cr0Pj 14 | +IUK96NwBg+tOknD8Z7bl979Fl8WNPl6SGhhQ6FLtfZCz7U5FKEybYrRYgVfd5DG 15 | ke6y76VOaN9YFpS7VvSB5b+OkZ1WtNgo7Iao5PqT7Nks5T9gr2jNZVJjWz1+hIvp 16 | EM8CAwEAAaOBmDCBlTCBkgYDVR0RBIGKMIGHghdidWc5OTc2Ny5teXNxbC5zYW4x 17 | LnRzdIIQKi5teXNxbC5zYW4yLnRzdIITYnVnKi5teXNxbC5zYW4zLnRzdIIVKjk5 18 | NzY3Lm15c3FsLnNhbjQudHN0ghNidWc5OTc2Ny4qLnNhbjUudHN0ggpidWc5OTc2 19 | Ny4qggEqhwQJCQdDhwRjBwYHMA0GCSqGSIb3DQEBCwUAA4IBAQAHjmQ6bUvc2gLp 20 | 0OnGTTx22yfTK5xfClKQod5qCow20TZZJKmRa8vbXzPnXYi2eyn+NFqXtzI1BSc1 21 | 3DN+A3l/yyfvm3nnbRVqTdHTNNKWFuXdrdSaKY3pVUbTT+ZV4rx/dDBI94lQQ7lV 22 | SvEITgzda3JmloICZiIFuKgZ3pnJwGh7yakqKTZOC9w2G7zQjwC129L8gczimd9C 23 | 0NB7Ux5Lxz8KG5ggk6EgXtSjrw5kz9bLKbrBxqeTbt6hIijzdg/DN9ARswFxmEW5 24 | gRE9efLrjyuO7ceZ9Qdw7PEsbClf5Hq5FeOrlNeew3AnKMUPFRddVJF+cOemhZvE 25 | 6ancGoGh 26 | -----END CERTIFICATE----- 27 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/server-key-ext.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEAkx3q+vHHbPzN0O2eVU593IA3NlylGVeLu510Bf5U/1uxz7aT 3 | /nCaUUW1l6cGzuMIY2Or2l2L8Eofb663zmKe3qoPVshkI1VdxqAiXSKfiSVRvcHW 4 | G1nFpRQzXRzzq7W5A0avQ4w5agwPT+wjOQcMpEqBtWGpMY3jCVmIhy1gkyUYcxOG 5 | Ge/h/9sg8MKXIBEvScBI6xJ3r40fcoAiZQtOaH5MCwhujw2HTmoMXGO9H1uaulNn 6 | 6QX0tVqpFGbcbOXD3+xfpHUVFz3y4tnOngI02VSRJSQmo6xh+vn/3eKT/+ImpdPp 7 | wYaWW8cHHIx54RW92GSyaa89IN6vXAVNcTJLrwIDAQABAoIBAHoBH7RI+ogKB22z 8 | AdHhLEPHGQK+RjUEA1/uLiAiUb8L/iQyV/10yKWJ2BUScXT1lylFqWmIltsJvZRT 9 | Ix/HbdVe1yWzPkiHLSPh/V2brw5/opBpxfQcuOo0HHyl2/aU2AA9iG/ORHcL1U8E 10 | mBldHUDKgVM40KXF83j3hWAFY8fig8dsq8cCEGHZjSVFk4NqCk2kYvgq/yZD+CZe 11 | K+drgTSvTymLY1RRz3VPQlPVP1aJjimjUIXIQHsVH+eYq0mt3fpDDiq2hpjctJr/ 12 | kct9gASxtzkIwX1h6UJY6OI6Uc9PUEQDn+s1YYp3Me8imsG2QHFchQV4z0oUy/kc 13 | g0PI7fECgYEAwobACHdRbmDzP9ePJn7giMT9YwS8UuMuJUfXjNeuH7rDxjMnRlYB 14 | 2O4NdVNbgheiE15tQRdSRse1ND3D8+oLIy9I0ruMQwqqnMZqAD1lOnrMRC0jblpy 15 | nUX+OVF7YILHHUEa0hv5wGJwW/0hEqqN/rduxL8kl8f9yMeQhdqpXsMCgYEAwZu5 16 | DlzaH5wbtK1he7jk2Hxrxmxq5AbnfJJsSGQ1fbvilEV290tmkgjVSUFPz5TzlWFf 17 | 8CgcnL06KZzqK2nRieHuWyIlCgJiy6HbfL6TaL9Y7P1t1/T0EEuT3M21kceKXodr 18 | QHFOyhYMbJkLSX/feAZ023wb7vkXXCNG5BfDaKUCgYAkTc+zBMmuxus+4/T0Y0N2 19 | YwVDIJQhCAMJtCG3SF1X0JxO9icDSnPnz221kswGOHDoGnxbZIXXbdgUmt5iPDC9 20 | 7UozAguIS4pR3fnUd6DXzCkpJB9zre+sCG8MtXdIKMAOZqMhyVTQIc8Ea/ZrLGd5 21 | vTQwBdhHd2yWtx/yyz9GzwKBgQC4xzqzLoMvL/pxUhh70Fb5FqZ11fuebch45/ZY 22 | kOtMeQkiobmNA3V9YtjM9XyKjYp8w1ahCmdkYGUmWhBUJsZJZkvqxoe7KdPIrU2h 23 | nPFrQ1RHuwge2DYnZzpTvjDQVTUGSxBdjMa5sJli/B39pAFPuDnHUIgIZ8uXsEN0 24 | Zgml0QKBgGCkWamKqDlFlPbVN+wJRIuMwAB6mNLYqL+loRd4VnYMK7crEZdbdOTK 25 | gZFUwfhvDm+6bHbza8dqSImeOUkFAi9vetycb9sXvNVtmmXNyGIGezPkL4bApJ80 26 | cKK7k/MU71+t+e9/r3s+o4PGJ8joaTFZgqzId3nuQ7iy8PIPJRlv 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/server-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEAnDxkU6aQGtSYDA+2ZZK119ZHoZPDWZ/NYQMrDPfAeLKqRna0 3 | EvFVKz5ui7t32KD6/63t3bOxzYjggCsrmu+xuF5n+qGPGsV6QYCB8ke5jYn2x2E/ 4 | bTwu/cNJ/70ZjIIxtxxI1sURY2QThO/Aez9x6SvT5SMfV4njvpYuOK4NNnBSVHlf 5 | +5U8pYOvaUbMy34IIg5PKAyqPqmLXUKvQ+P4hQr3o3AGD606ScPxntuX3v0WXxY0 6 | +XpIaGFDoUu19kLPtTkUoTJtitFiBV93kMaR7rLvpU5o31gWlLtW9IHlv46RnVa0 7 | 2Cjshqjk+pPs2SzlP2CvaM1lUmNbPX6Ei+kQzwIDAQABAoIBAGGepn1SBJaPIVXf 8 | 93Kt4asz+1vtDNGSNOyZ4yteHkgMMrKGduujGTlE8COlBjQ4Gbzp+0dcgQtQrB3J 9 | W5yaiiwN6OBEVDtBCquk1Q0CXeEfRC++BriFM0Nh43nEuRL/QnsMVELFraCxpjSY 10 | 7WbU9KLhvKteb7XttXyfL9BAiIbrW5TrHQ9FPfADg6pmckHoQnNkE4S1CQq1z/4w 11 | erlyeTNFa/ExAsrPsmjMp/6bur4zdW4t+5GpB2DZf+4P4pEIHJGRwNzU/Eq0TlNs 12 | TTmhlba6X/gSMNm0vYEXnNItb+ItiOsGqoLCzUzaAN7jvdsqAiVaiRvObtBLj76/ 13 | 17INnOECgYEA0E2ZHzVg9MaMUhC9dwHawGbbqeZfnAC89J9Hapt0WDtMuulsA+V8 14 | C2Ek4Rxpe62DuXdcvYSSuL3VJ4oWffkKngll5m+SiCSuuaDT9KAJ01sklIsGDAWE 15 | E0gYWg1sqsj5UE2r7O5TzfRnitglDwyNY87KYvxX7jI6mpHCPSHbblECgYEAwAKy 16 | DaIS6gtOfXLhXfzV+Qslsulcf4FRdI06XFVhmXziW6spdl2qVuKTWAiKK69zTRQD 17 | 2cXVxMf+VEvF7btyllNBYEdU1NcX3gCqCmb1LRqngIQkL0oPlXVaZnN5q17tXAPO 18 | Oxd3waefIqBjWJ03qc37oQzuCAXBiYKlUFLVJR8CgYAmgNF29VTwqeqyGKoM32jh 19 | +6FK7Gxr168VwINg7084J+3s9syig77EE7bPbYMJ+27Hz4py9ZhxUZWe82Vo76nI 20 | wI/3YlRBmhY59cJ4C0UFrmk6k+AQRMy/C6qEqsqVXwTGlTTcXMlc3nptLbrb50QT 21 | WNwMI/zU6K/wdlTjG+kFoQKBgG79X+UHib1mOcHENUe6Dgm+itUnlcNSgj5IILMc 22 | 26T4jnQEtZvpOrysjhV2IkBsU877QdqRRCdSn84kWs43612/1GuN8Bh0GSTH54LJ 23 | zvF6ldZxC+WV/voa8t2D5JHN9pCY1o5L23rCpPdEFQk1H+b03X5T1ggnI5+UOHD8 24 | 4J5rAoGBAJ2x4bRSj/vBgiNUvyvTv6JQoH1hCvDNEYT4TUr8XzMjVcS5voqokAQc 25 | mGseepXn6OU+JDW7N/DvgNStkgN6Gj1J/aTwPerC7exkMr4c6YOudjZUZJnOjUj4 26 | qHfAGQ5Vwo7fc9S6ymaxzAw5bFNHhZd4P3D1qzpU4804r8CMExUM 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /src/test/java/com/mysql/cj/result/BinaryStreamValueFactoryTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package com.mysql.cj.result; 31 | 32 | import static org.junit.jupiter.api.Assertions.assertEquals; 33 | 34 | import org.junit.jupiter.api.Test; 35 | 36 | import com.mysql.cj.conf.DefaultPropertySet; 37 | 38 | public class BinaryStreamValueFactoryTest extends CommonAsserts { 39 | @Test 40 | public void testBasics() { 41 | BinaryStreamValueFactory vf = new BinaryStreamValueFactory(new DefaultPropertySet()); 42 | assertEquals("java.io.InputStream", vf.getTargetTypeName()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/test/java/testsuite/integration/container/HikariCPSQLException.java: -------------------------------------------------------------------------------- 1 | package testsuite.integration.container; 2 | 3 | import com.zaxxer.hikari.SQLExceptionOverride; 4 | 5 | import java.sql.SQLException; 6 | 7 | public class HikariCPSQLException implements SQLExceptionOverride { 8 | public Override adjudicate(final SQLException sqlException) { 9 | String sqlState = sqlException.getSQLState(); 10 | if (sqlState.equalsIgnoreCase("08S02") || 11 | sqlState.equalsIgnoreCase("08007")) { 12 | return Override.DO_NOT_EVICT; 13 | } else { 14 | return Override.CONTINUE_EVICT; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/testsuite/regression/NonLocalSocketFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package testsuite.regression; 31 | 32 | import com.mysql.cj.Session; 33 | import com.mysql.cj.protocol.StandardSocketFactory; 34 | 35 | public class NonLocalSocketFactory extends StandardSocketFactory { 36 | 37 | @Override 38 | public boolean isLocallyConnected(Session sess) { 39 | String processHost = "www.oracle.com:3306"; 40 | return isLocallyConnected(sess, processHost); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/testsuite/simple/SimpleTransformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | package testsuite.simple; 31 | 32 | import java.util.Properties; 33 | 34 | import com.mysql.cj.conf.ConnectionPropertiesTransform; 35 | import com.mysql.cj.conf.PropertyKey; 36 | 37 | /** 38 | * Used for testing the ConnectionPropertiesTransform functionality. 39 | */ 40 | public class SimpleTransformer implements ConnectionPropertiesTransform { 41 | 42 | public Properties transformProperties(Properties props) { 43 | props.setProperty(PropertyKey.HOST.getKeyName(), "albequerque"); 44 | 45 | return props; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/test/java/testsuite/x/devapi/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | /** 31 | * Dev API test suite. 32 | */ 33 | 34 | package testsuite.x.devapi; 35 | -------------------------------------------------------------------------------- /src/test/java/testsuite/x/internal/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2020, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under 5 | * the terms of the GNU General Public License, version 2.0, as published by the 6 | * Free Software Foundation. 7 | * 8 | * This program is also distributed with certain software (including but not 9 | * limited to OpenSSL) that is licensed under separate terms, as designated in a 10 | * particular file or component or in included license documentation. The 11 | * authors of MySQL hereby grant you an additional permission to link the 12 | * program and your derivative works with the separately licensed software that 13 | * they have included with MySQL. 14 | * 15 | * Without limiting anything contained in the foregoing, this file, which is 16 | * part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 17 | * version 1.0, a copy of which can be found at 18 | * http://oss.oracle.com/licenses/universal-foss-exception. 19 | * 20 | * This program is distributed in the hope that it will be useful, but WITHOUT 21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 23 | * for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License along with 26 | * this program; if not, write to the Free Software Foundation, Inc., 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | */ 29 | 30 | /** 31 | * Tests for internal components of the X Protocol and X DevAPI features. 32 | */ 33 | 34 | package testsuite.x.internal; 35 | --------------------------------------------------------------------------------