From 26955567795820b7cf8858b5c7badb061675088d Mon Sep 17 00:00:00 2001 From: ackelcn Date: Wed, 24 Jun 2020 12:32:11 +0800 Subject: [PATCH] adding comments with issue numbers. --- .../apache/derbyBuild/ClassSizeCrawler.java | 4 + .../org/apache/derbyBuild/ElementFacade.java | 1 + .../org/apache/derbyBuild/GeneratorBase.java | 7 + .../org/apache/derbyBuild/JarDriftTest.java | 1 + .../org/apache/derbyBuild/JiraConnector.java | 1 + .../org/apache/derbyBuild/JiraIssue.java | 6 + .../org/apache/derbyBuild/MessageBuilder.java | 21 ++ .../apache/derbyBuild/MessageBundleTest.java | 9 + .../org/apache/derbyBuild/MessageVetter.java | 2 + .../derbyBuild/ODBCMetadataGenerator.java | 10 + .../apache/derbyBuild/ReleaseNoteReader.java | 4 + .../derbyBuild/ReleaseNotesGenerator.java | 24 ++ .../derbyBuild/ReleaseNotesTransformer.java | 9 + .../derbyBuild/SecurityPolicyGenerator.java | 1 + .../derbyBuild/javadoc/DiskLayoutTaglet.java | 2 + .../derbyBuild/javadoc/EndFormatTaglet.java | 1 + .../derbyBuild/javadoc/FormatIdTaglet.java | 1 + .../derbyBuild/javadoc/PurposeTaglet.java | 1 + .../derbyBuild/javadoc/UpgradeTaglet.java | 1 + .../apache/derbyBuild/maintversion2props.java | 2 + .../org/apache/derbyBuild/propertyconfig.java | 1 + .../org/apache/derbyBuild/splitmessages.java | 41 +++ .../derbyPreBuild/ReleaseProperties.java | 6 + java/demo/nserverdemo/NsSample.java | 5 + .../SimpleNetworkClientSample.java | 7 + .../SimpleNetworkServerSample.java | 4 + java/demo/simple/SimpleApp.java | 5 + java/demo/toursdb/insertMaps.java | 3 + .../vtis/example/ApacheServerLogVTI.java | 3 + .../vtis/example/DerbyJiraReportVTI.java | 3 + .../vtis/example/PropertyFileVTI.java | 3 + .../workingwithderby/WwdClientExample.java | 1 + java/demo/workingwithderby/WwdEmbedded.java | 2 + java/demo/workingwithderby/WwdUtils.java | 3 +- .../derby/client/BasicClientDataSource.java | 4 + ...ientConnectionPoolDataSourceInterface.java | 1 + .../derby/client/ClientDataSourceFactory.java | 4 + .../derby/client/ClientPooledConnection.java | 26 ++ .../derby/client/ClientXAConnection.java | 4 + .../client/ClientXADataSourceInterface.java | 4 + .../org/apache/derby/client/ClientXid.java | 2 + .../org/apache/derby/client/am/Agent.java | 16 + .../apache/derby/client/am/AsciiStream.java | 5 + .../client/am/BlobLocatorInputStream.java | 10 + .../client/am/BlobLocatorOutputStream.java | 7 + .../derby/client/am/BlobOutputStream.java | 4 + .../client/am/ByteArrayCombinerStream.java | 4 + .../client/am/CachingLogicalConnection.java | 5 + .../client/am/CallableLocatorProcedures.java | 53 +++ .../apache/derby/client/am/ClientBlob.java | 61 ++++ .../client/am/ClientCallableStatement.java | 40 ++ .../client/am/ClientCallableStatement42.java | 5 + .../apache/derby/client/am/ClientClob.java | 96 +++++ .../derby/client/am/ClientConnection.java | 184 ++++++++++ .../client/am/ClientDatabaseMetaData.java | 119 ++++++ .../client/am/ClientJDBCObjectFactory.java | 30 ++ .../client/am/ClientParameterMetaData.java | 1 + .../client/am/ClientPreparedStatement.java | 189 ++++++++++ .../client/am/ClientPreparedStatement42.java | 4 + .../derby/client/am/ClientResultSet.java | 284 +++++++++++++++ .../derby/client/am/ClientSavepoint.java | 2 + .../derby/client/am/ClientStatement.java | 137 +++++++ .../apache/derby/client/am/ClientTypes.java | 8 + .../client/am/ClobLocatorInputStream.java | 10 + .../client/am/ClobLocatorOutputStream.java | 5 + .../derby/client/am/ClobLocatorReader.java | 11 + .../derby/client/am/ClobLocatorWriter.java | 4 + .../derby/client/am/ClobOutputStream.java | 7 + .../apache/derby/client/am/ClobWriter.java | 9 + .../client/am/CloseFilterInputStream.java | 7 + .../derby/client/am/ColumnMetaData.java | 37 ++ .../apache/derby/client/am/Configuration.java | 11 + .../derby/client/am/CrossConverters.java | 133 +++++++ .../org/apache/derby/client/am/Cursor.java | 85 +++++ .../org/apache/derby/client/am/DateTime.java | 23 ++ .../apache/derby/client/am/DateTimeValue.java | 3 + .../org/apache/derby/client/am/Decimal.java | 8 + .../derby/client/am/DisconnectException.java | 1 + .../derby/client/am/EncryptionManager.java | 3 + .../derby/client/am/ExceptionFormatter.java | 12 + .../derby/client/am/FailedProperties40.java | 4 + .../derby/client/am/LOBStateTracker.java | 8 + .../org/apache/derby/client/am/Lob.java | 20 + .../org/apache/derby/client/am/LogWriter.java | 36 ++ .../client/am/LogicalCallableStatement.java | 4 + .../client/am/LogicalCallableStatement42.java | 1 + .../derby/client/am/LogicalConnection.java | 51 +++ .../client/am/LogicalDatabaseMetaData.java | 4 + .../client/am/LogicalPreparedStatement.java | 5 + .../client/am/LogicalPreparedStatement42.java | 1 + .../client/am/LogicalStatementEntity.java | 16 + .../derby/client/am/MaterialStatement.java | 1 + .../apache/derby/client/am/ProductLevel.java | 1 + .../derby/client/am/SQLExceptionFactory.java | 1 + .../org/apache/derby/client/am/Section.java | 3 + .../derby/client/am/SectionManager.java | 1 + .../org/apache/derby/client/am/SqlCode.java | 2 + .../apache/derby/client/am/SqlException.java | 28 ++ .../apache/derby/client/am/SqlWarning.java | 2 + .../org/apache/derby/client/am/Sqlca.java | 30 ++ .../client/am/StatementCacheInteractor.java | 48 +++ .../client/am/StatementCallbackInterface.java | 2 + ...UpdateSensitiveBlobLocatorInputStream.java | 4 + ...UpdateSensitiveClobLocatorInputStream.java | 2 + .../am/UpdateSensitiveClobLocatorReader.java | 3 + .../UpdateSensitiveLOBLocatorInputStream.java | 3 + .../org/apache/derby/client/am/Utils.java | 4 + .../org/apache/derby/client/am/Version.java | 8 + .../apache/derby/client/am/XaException.java | 3 + .../am/stmtcache/JDBCStatementCache.java | 8 + .../client/am/stmtcache/StatementKey.java | 5 + .../am/stmtcache/StatementKeyFactory.java | 8 + .../apache/derby/client/net/CcsidManager.java | 2 + .../net/ClientJDBCObjectFactoryImpl.java | 29 ++ .../net/ClientJDBCObjectFactoryImpl42.java | 4 + .../apache/derby/client/net/CodePoint.java | 5 + .../derby/client/net/CodePointNameTable.java | 3 + .../derby/client/net/ConnectionReply.java | 3 + .../net/ConnectionRequestInterface.java | 1 + .../derby/client/net/EbcdicCcsidManager.java | 4 + .../derby/client/net/EncodedInputStream.java | 5 + .../org/apache/derby/client/net/NetAgent.java | 37 ++ .../client/net/NetCallableStatement.java | 4 + .../derby/client/net/NetConfiguration.java | 1 + .../derby/client/net/NetConnection.java | 86 +++++ .../derby/client/net/NetConnectionReply.java | 61 ++++ .../client/net/NetConnectionRequest.java | 20 + .../apache/derby/client/net/NetCursor.java | 45 +++ .../derby/client/net/NetDatabaseMetaData.java | 1 + .../apache/derby/client/net/NetLogWriter.java | 5 + .../derby/client/net/NetPackageReply.java | 2 + .../derby/client/net/NetPackageRequest.java | 7 + .../client/net/NetPreparedStatement.java | 6 + .../apache/derby/client/net/NetResultSet.java | 8 + .../derby/client/net/NetResultSet42.java | 1 + .../derby/client/net/NetResultSetReply.java | 10 + .../derby/client/net/NetResultSetRequest.java | 10 + .../org/apache/derby/client/net/NetSqlca.java | 5 + .../apache/derby/client/net/NetSqldta.java | 3 + .../apache/derby/client/net/NetStatement.java | 6 + .../derby/client/net/NetStatementReply.java | 52 +++ .../derby/client/net/NetStatementRequest.java | 92 +++++ .../derby/client/net/NetXACallInfo.java | 6 + .../derby/client/net/NetXAConnection.java | 17 + .../client/net/NetXAConnectionReply.java | 11 + .../client/net/NetXAConnectionRequest.java | 7 + .../derby/client/net/NetXAResource.java | 65 ++++ .../derby/client/net/OpenSocketAction.java | 6 + .../client/net/PublicBufferOutputStream.java | 1 + .../org/apache/derby/client/net/Reply.java | 33 ++ .../org/apache/derby/client/net/Request.java | 106 ++++++ .../derby/client/net/ResultSetReply.java | 3 + .../client/net/ResultSetReplyInterface.java | 1 + .../client/net/ResultSetRequestInterface.java | 2 + .../derby/client/net/StatementReply.java | 2 + .../client/net/StatementRequestInterface.java | 2 + .../org/apache/derby/client/net/Typdef.java | 6 + .../derby/client/net/Utf8CcsidManager.java | 3 + .../shared/common/drda/NaiveTrustManager.java | 3 + ...IntegrityConstraintViolationException.java | 1 + .../common/error/ErrorStringBuilder.java | 1 + .../shared/common/error/ExceptionFactory.java | 4 + .../shared/common/error/ExceptionUtil.java | 1 + .../shared/common/error/MessageUtils.java | 3 + .../common/error/PassThroughException.java | 1 + .../derby/shared/common/error/PublicAPI.java | 1 + .../common/error/SQLWarningFactory.java | 1 + .../common/error/StandardException.java | 22 ++ .../shared/common/i18n/MessageService.java | 7 + .../derby/shared/common/i18n/MessageUtil.java | 8 + .../derby/shared/common/info/JVMInfo.java | 11 + .../common/info/ProductVersionHolder.java | 7 + .../shared/common/reference/Attribute.java | 6 + .../shared/common/reference/ClassName.java | 1 + .../shared/common/reference/EngineType.java | 2 +- .../common/reference/JDBC40Translation.java | 1 + .../shared/common/reference/MessageId.java | 31 ++ .../derby/shared/common/reference/Module.java | 3 + .../shared/common/reference/ModuleUtil.java | 4 + .../shared/common/reference/Property.java | 36 ++ .../shared/common/reference/SQLState.java | 178 +++++++++ .../shared/common/sanity/AssertFailure.java | 5 + .../shared/common/sanity/SanityManager.java | 4 + .../common/security/SystemPermission.java | 6 + .../derby/shared/common/util/ArrayUtil.java | 6 + .../org/apache/derby/catalog/DefaultInfo.java | 1 + .../derby/catalog/DependableFinder.java | 1 + .../derby/catalog/GetProcedureColumns.java | 14 + .../derby/catalog/Java5SystemProcedures.java | 5 + .../org/apache/derby/catalog/Statistics.java | 3 + .../derby/catalog/SystemProcedures.java | 79 ++++ .../catalog/TriggerNewTransitionRows.java | 1 + .../catalog/TriggerOldTransitionRows.java | 1 + .../apache/derby/catalog/TypeDescriptor.java | 2 + .../org/apache/derby/catalog/UUID.java | 1 + .../derby/catalog/types/BaseTypeIdImpl.java | 8 + .../derby/catalog/types/DefaultInfoImpl.java | 6 + .../catalog/types/IndexDescriptorImpl.java | 24 ++ .../ReferencedColumnsDescriptorImpl.java | 4 + .../derby/catalog/types/RoutineAliasInfo.java | 14 + .../derby/catalog/types/RowMultiSetImpl.java | 1 + .../derby/catalog/types/StatisticsImpl.java | 1 + .../catalog/types/TypeDescriptorImpl.java | 8 + .../types/TypesImplInstanceGetter.java | 2 + .../derby/catalog/types/UDTAliasInfo.java | 1 + .../catalog/types/UserDefinedTypeIdImpl.java | 2 + .../org/apache/derby/database/Database.java | 3 + .../org/apache/derby/diag/ContainedRoles.java | 5 + .../org/apache/derby/diag/DiagUtil.java | 2 + .../org/apache/derby/diag/ErrorLogReader.java | 7 + .../org/apache/derby/diag/ErrorMessages.java | 4 + .../org/apache/derby/diag/LockTable.java | 11 + .../org/apache/derby/diag/SpaceTable.java | 5 + .../org/apache/derby/diag/StatementCache.java | 12 + .../apache/derby/diag/StatementDuration.java | 9 + .../apache/derby/diag/TransactionTable.java | 7 + .../derby/iapi/db/ConsistencyChecker.java | 5 + .../apache/derby/iapi/db/OptimizerTrace.java | 1 + .../apache/derby/iapi/db/PropertyInfo.java | 3 + .../derby/iapi/jdbc/AutoloadedDriver.java | 6 + .../iapi/jdbc/BrokeredCallableStatement.java | 1 + .../jdbc/BrokeredCallableStatement42.java | 1 + .../derby/iapi/jdbc/BrokeredConnection.java | 16 + .../derby/iapi/jdbc/BrokeredConnection42.java | 1 + .../iapi/jdbc/BrokeredPreparedStatement.java | 3 + .../derby/iapi/jdbc/BrokeredStatement.java | 16 + .../iapi/jdbc/CharacterStreamDescriptor.java | 9 + .../derby/iapi/jdbc/DRDAServerStarter.java | 9 + .../org/apache/derby/iapi/jdbc/Driver42.java | 2 + .../jdbc/EmbeddedDataSourceInterface.java | 1 + .../jdbc/EmbeddedXADataSourceInterface.java | 3 + .../derby/iapi/jdbc/EngineConnection.java | 1 + .../derby/iapi/jdbc/FailedProperties40.java | 2 + .../derby/iapi/jdbc/InternalDriver.java | 30 ++ .../org/apache/derby/iapi/jdbc/JDBC.java | 1 + .../org/apache/derby/iapi/jdbc/JDBCBoot.java | 3 + .../derby/iapi/jdbc/ResourceAdapter.java | 3 + .../derby/iapi/security/SecurityUtil.java | 6 + .../iapi/services/cache/CacheManager.java | 2 + .../derby/iapi/services/cache/Cacheable.java | 2 + .../iapi/services/cache/CacheableFactory.java | 1 + .../derby/iapi/services/cache/ClassSize.java | 6 + .../iapi/services/cache/ClassSizeCatalog.java | 1 + .../iapi/services/classfile/Attributes.java | 2 + .../services/classfile/ClassEnumeration.java | 5 + .../services/classfile/ClassFormatOutput.java | 2 + .../iapi/services/classfile/ClassHolder.java | 7 + .../iapi/services/classfile/ClassInput.java | 1 + .../services/classfile/ClassInvestigator.java | 13 + .../iapi/services/classfile/MemberTable.java | 4 + .../iapi/services/compiler/ClassBuilder.java | 1 + .../iapi/services/compiler/MethodBuilder.java | 42 +++ .../iapi/services/context/ContextManager.java | 18 + .../iapi/services/context/ContextService.java | 22 ++ .../iapi/services/context/SystemContext.java | 2 + .../iapi/services/crypto/CipherFactory.java | 1 + .../iapi/services/daemon/Serviceable.java | 1 + .../iapi/services/diag/DiagnosticUtil.java | 3 + .../io/AccessibleByteArrayOutputStream.java | 2 + .../iapi/services/io/ArrayInputStream.java | 6 + .../services/io/CloseFilterInputStream.java | 1 + .../iapi/services/io/CompressedNumber.java | 2 + .../services/io/DebugByteTeeOutputStream.java | 2 + .../io/DynamicByteArrayOutputStream.java | 1 + .../derby/iapi/services/io/FileUtil.java | 12 + .../iapi/services/io/FormatIdInputStream.java | 4 + .../derby/iapi/services/io/Formatable.java | 1 + .../services/io/FormatableArrayHolder.java | 3 + .../iapi/services/io/FormatableBitSet.java | 24 ++ .../iapi/services/io/InputStreamUtil.java | 1 + .../iapi/services/io/LimitInputStream.java | 1 + .../iapi/services/io/StoredFormatIds.java | 9 + .../derby/iapi/services/io/TypedFormat.java | 1 + .../iapi/services/jmx/ManagementService.java | 2 + .../iapi/services/loader/ClassFactory.java | 2 + .../services/loader/ClassFactoryContext.java | 1 + .../derby/iapi/services/loader/ClassInfo.java | 1 + .../iapi/services/loader/ClassInspector.java | 13 + .../services/loader/GeneratedByteCode.java | 2 + .../iapi/services/loader/InstanceGetter.java | 1 + .../derby/iapi/services/locks/Latch.java | 2 + .../iapi/services/locks/LockFactory.java | 8 + .../derby/iapi/services/locks/Lockable.java | 1 + .../iapi/services/locks/ShExLockable.java | 1 + .../derby/iapi/services/memory/LowMemory.java | 1 + .../services/monitor/DerbyObservable.java | 1 + .../iapi/services/monitor/ModuleControl.java | 1 + .../iapi/services/monitor/ModuleFactory.java | 2 + .../derby/iapi/services/monitor/Monitor.java | 29 ++ .../services/monitor/PersistentService.java | 2 + .../services/property/PropertyFactory.java | 2 + .../iapi/services/property/PropertyUtil.java | 14 + .../services/property/PropertyValidation.java | 5 + .../derby/iapi/services/uuid/UUIDFactory.java | 1 + .../derby/iapi/sql/LanguageFactory.java | 2 + .../derby/iapi/sql/ParameterValueSet.java | 5 + .../derby/iapi/sql/PreparedStatement.java | 3 + .../iapi/sql/ResultColumnDescriptor.java | 1 + .../org/apache/derby/iapi/sql/ResultSet.java | 4 + .../org/apache/derby/iapi/sql/Statement.java | 1 + .../apache/derby/iapi/sql/StatementUtil.java | 2 + .../derby/iapi/sql/compile/ASTVisitor.java | 1 + .../iapi/sql/compile/CompilerContext.java | 15 + .../derby/iapi/sql/compile/JoinStrategy.java | 3 + .../derby/iapi/sql/compile/OptTrace.java | 1 + .../derby/iapi/sql/compile/Optimizable.java | 1 + .../sql/compile/OptimizablePredicate.java | 1 + .../iapi/sql/compile/OptimizerFactory.java | 1 + .../derby/iapi/sql/compile/OptimizerPlan.java | 6 + .../derby/iapi/sql/compile/Visitor.java | 1 + .../derby/iapi/sql/conn/Authorizer.java | 1 + .../derby/iapi/sql/conn/ConnectionUtil.java | 2 + .../sql/conn/LanguageConnectionContext.java | 24 ++ .../sql/conn/LanguageConnectionFactory.java | 1 + .../derby/iapi/sql/conn/StatementContext.java | 1 + .../iapi/sql/depend/DependencyManager.java | 1 + .../iapi/sql/dictionary/AliasDescriptor.java | 4 + .../sql/dictionary/CatalogRowFactory.java | 4 + .../dictionary/CheckConstraintDescriptor.java | 1 + .../sql/dictionary/ColPermsDescriptor.java | 7 + .../iapi/sql/dictionary/ColumnDescriptor.java | 42 +++ .../sql/dictionary/ColumnDescriptorList.java | 4 + .../dictionary/ConglomerateDescriptor.java | 7 + .../ConglomerateDescriptorList.java | 8 + .../sql/dictionary/ConstraintDescriptor.java | 20 + .../dictionary/ConstraintDescriptorList.java | 3 + .../derby/iapi/sql/dictionary/DDUtils.java | 21 ++ .../dictionary/DataDescriptorGenerator.java | 1 + .../iapi/sql/dictionary/DataDictionary.java | 30 ++ .../sql/dictionary/DefaultDescriptor.java | 2 + .../sql/dictionary/FileInfoDescriptor.java | 1 + .../ForeignKeyConstraintDescriptor.java | 3 + .../sql/dictionary/GenericDescriptorList.java | 2 + .../iapi/sql/dictionary/IndexLister.java | 6 + .../sql/dictionary/IndexRowGenerator.java | 10 + .../dictionary/KeyConstraintDescriptor.java | 1 + .../iapi/sql/dictionary/PasswordHasher.java | 1 + .../iapi/sql/dictionary/PermDescriptor.java | 1 + .../sql/dictionary/PermissionsDescriptor.java | 2 + .../sql/dictionary/PrivilegedSQLObject.java | 1 + .../ReferencedKeyConstraintDescriptor.java | 7 + .../sql/dictionary/RoleGrantDescriptor.java | 9 + .../dictionary/RoutinePermsDescriptor.java | 8 + .../iapi/sql/dictionary/SPSDescriptor.java | 32 ++ .../iapi/sql/dictionary/SchemaDescriptor.java | 7 + .../sql/dictionary/SequenceDescriptor.java | 2 + .../dictionary/StatementColumnPermission.java | 12 + .../StatementGenericPermission.java | 1 + .../sql/dictionary/StatementPermission.java | 5 + .../dictionary/StatementRolePermission.java | 2 + .../StatementRoutinePermission.java | 5 + .../dictionary/StatementSchemaPermission.java | 7 + .../dictionary/StatementTablePermission.java | 11 + .../iapi/sql/dictionary/TableDescriptor.java | 35 ++ .../sql/dictionary/TablePermsDescriptor.java | 9 + .../sql/dictionary/TriggerDescriptor.java | 15 + .../iapi/sql/dictionary/TupleDescriptor.java | 1 + .../iapi/sql/dictionary/UserDescriptor.java | 2 + .../iapi/sql/dictionary/ViewDescriptor.java | 15 + .../iapi/sql/execute/ExecAggregator.java | 1 + .../sql/execute/ExecPreparedStatement.java | 3 + .../iapi/sql/execute/ExecutionFactory.java | 1 + .../iapi/sql/execute/NoPutResultSet.java | 1 + .../iapi/sql/execute/ResultSetFactory.java | 40 ++ .../iapi/sql/execute/TargetResultSet.java | 1 + .../iapi/store/access/AccessFactory.java | 4 + .../store/access/AccessFactoryGlobals.java | 1 + .../store/access/BackingStoreHashtable.java | 22 ++ .../iapi/store/access/BinaryOrderable.java | 1 + .../iapi/store/access/DiskHashtable.java | 12 + .../derby/iapi/store/access/FileResource.java | 4 + .../derby/iapi/store/access/GlobalXact.java | 3 + .../access/GroupFetchScanController.java | 1 + .../derby/iapi/store/access/Qualifier.java | 12 + .../derby/iapi/store/access/RowCountable.java | 2 + .../store/access/RowLocationRetRowSource.java | 2 + .../derby/iapi/store/access/RowSource.java | 1 + .../derby/iapi/store/access/RowUtil.java | 12 + .../iapi/store/access/ScanController.java | 3 + .../iapi/store/access/SortController.java | 1 + .../derby/iapi/store/access/SpaceInfo.java | 1 + .../store/access/StoreCostController.java | 3 + .../iapi/store/access/StoreCostResult.java | 1 + .../store/access/TransactionController.java | 15 + .../access/conglomerate/Conglomerate.java | 2 + .../access/conglomerate/ScanManager.java | 1 + .../iapi/store/access/conglomerate/Sort.java | 1 + .../conglomerate/TransactionManager.java | 2 + .../derby/iapi/store/access/xa/XAXactId.java | 4 + .../derby/iapi/store/raw/ContainerHandle.java | 8 + .../derby/iapi/store/raw/ContainerKey.java | 1 + .../derby/iapi/store/raw/ContainerLock.java | 2 + .../apache/derby/iapi/store/raw/Loggable.java | 1 + .../org/apache/derby/iapi/store/raw/Page.java | 5 + .../apache/derby/iapi/store/raw/PageKey.java | 1 + .../derby/iapi/store/raw/RawStoreFactory.java | 21 ++ .../apache/derby/iapi/store/raw/RowLock.java | 3 + .../derby/iapi/store/raw/Transaction.java | 4 + .../apache/derby/iapi/store/raw/Undoable.java | 2 + .../iapi/store/raw/data/DataFactory.java | 3 + .../store/raw/data/RawContainerHandle.java | 1 + .../derby/iapi/store/raw/log/LogFactory.java | 3 + .../iapi/store/raw/xact/RawTransaction.java | 1 + .../store/raw/xact/TransactionFactory.java | 4 + .../replication/master/MasterFactory.java | 2 + .../store/replication/slave/SlaveFactory.java | 5 + .../iapi/transaction/TransactionControl.java | 4 + .../derby/iapi/types/BooleanDataValue.java | 1 + .../iapi/types/CharStreamHeaderGenerator.java | 3 + .../iapi/types/ClobStreamHeaderGenerator.java | 12 + .../derby/iapi/types/CollatorSQLChar.java | 5 + .../derby/iapi/types/CollatorSQLClob.java | 8 + .../iapi/types/CollatorSQLLongvarchar.java | 5 + .../derby/iapi/types/CollatorSQLVarchar.java | 5 + .../org/apache/derby/iapi/types/DataType.java | 10 + .../derby/iapi/types/DataTypeDescriptor.java | 21 ++ .../derby/iapi/types/DataTypeUtilities.java | 9 + .../derby/iapi/types/DataValueDescriptor.java | 3 + .../derby/iapi/types/DataValueFactory.java | 7 + .../iapi/types/DataValueFactoryImpl.java | 27 ++ .../derby/iapi/types/DateTimeDataValue.java | 1 + .../derby/iapi/types/DateTimeParser.java | 1 + .../derby/iapi/types/HarmonySerialBlob.java | 4 + .../derby/iapi/types/HarmonySerialClob.java | 3 + .../org/apache/derby/iapi/types/JSQLType.java | 2 + .../org/apache/derby/iapi/types/Like.java | 8 + .../derby/iapi/types/NumberDataType.java | 10 + .../apache/derby/iapi/types/Orderable.java | 1 + .../iapi/types/RawToBinaryFormatStream.java | 2 + .../derby/iapi/types/ReaderToUTF8Stream.java | 18 + .../apache/derby/iapi/types/SQLBinary.java | 16 + .../org/apache/derby/iapi/types/SQLBit.java | 3 + .../org/apache/derby/iapi/types/SQLBlob.java | 7 + .../apache/derby/iapi/types/SQLBoolean.java | 9 + .../org/apache/derby/iapi/types/SQLChar.java | 40 ++ .../org/apache/derby/iapi/types/SQLClob.java | 27 ++ .../org/apache/derby/iapi/types/SQLDate.java | 12 + .../apache/derby/iapi/types/SQLDecimal.java | 17 + .../apache/derby/iapi/types/SQLDouble.java | 7 + .../apache/derby/iapi/types/SQLInteger.java | 2 + .../derby/iapi/types/SQLLongVarbit.java | 1 + .../apache/derby/iapi/types/SQLLongint.java | 4 + .../derby/iapi/types/SQLLongvarchar.java | 3 + .../org/apache/derby/iapi/types/SQLReal.java | 6 + .../org/apache/derby/iapi/types/SQLRef.java | 2 + .../apache/derby/iapi/types/SQLSmallint.java | 2 + .../org/apache/derby/iapi/types/SQLTime.java | 12 + .../apache/derby/iapi/types/SQLTimestamp.java | 24 ++ .../apache/derby/iapi/types/SQLTinyint.java | 2 + .../apache/derby/iapi/types/SQLVarbit.java | 2 + .../apache/derby/iapi/types/SQLVarchar.java | 3 + .../apache/derby/iapi/types/SqlXmlUtil.java | 20 + .../derby/iapi/types/StringDataValue.java | 2 + .../org/apache/derby/iapi/types/TypeId.java | 9 + .../org/apache/derby/iapi/types/UserType.java | 2 + .../types/WorkHorseForCollatorDatatypes.java | 3 + .../org/apache/derby/iapi/types/XML.java | 21 ++ .../apache/derby/iapi/types/XMLDataValue.java | 2 + .../derby/iapi/util/DoubleProperties.java | 5 + .../org/apache/derby/iapi/util/IdUtil.java | 41 +++ .../iapi/util/InterruptDetectedException.java | 1 + .../derby/iapi/util/InterruptStatus.java | 9 + .../apache/derby/iapi/util/PropertyUtil.java | 3 + .../apache/derby/iapi/util/StringUtil.java | 8 + .../org/apache/derby/iapi/util/UTF8Util.java | 7 + .../apache/derby/impl/db/BasicDatabase.java | 42 +++ .../derby/impl/db/DatabaseContextImpl.java | 6 + .../apache/derby/impl/db/SlaveDatabase.java | 22 ++ .../impl/db/StoreClassFactoryContext.java | 1 + .../derby/impl/io/BaseStorageFactory.java | 2 + .../org/apache/derby/impl/io/CPFile.java | 6 + .../org/apache/derby/impl/io/DirFile.java | 6 + .../derby/impl/io/DirRandomAccessFile.java | 1 + .../derby/impl/io/DirStorageFactory.java | 2 + .../apache/derby/impl/io/InputStreamFile.java | 5 + .../org/apache/derby/impl/io/JarDBFile.java | 1 + .../derby/impl/io/JarStorageFactory.java | 2 + .../org/apache/derby/impl/io/URLFile.java | 1 + .../derby/impl/io/VFMemoryStorageFactory.java | 18 + .../derby/impl/io/vfmem/BlockedByteArray.java | 7 + .../apache/derby/impl/io/vfmem/DataStore.java | 22 ++ .../derby/impl/io/vfmem/DataStoreEntry.java | 1 + .../io/vfmem/VirtualRandomAccessFile.java | 2 + .../impl/jdbc/AutoPositioningStream.java | 1 + .../derby/impl/jdbc/BinaryToRawStream.java | 2 + .../derby/impl/jdbc/ClobAsciiStream.java | 3 + .../derby/impl/jdbc/ClobUtf8Writer.java | 4 + .../derby/impl/jdbc/ConnectionChild.java | 5 + .../org/apache/derby/impl/jdbc/EmbedBlob.java | 98 +++++ .../impl/jdbc/EmbedCallableStatement.java | 9 + .../impl/jdbc/EmbedCallableStatement42.java | 4 + .../org/apache/derby/impl/jdbc/EmbedClob.java | 66 ++++ .../derby/impl/jdbc/EmbedConnection.java | 2 + .../impl/jdbc/EmbedConnectionContext.java | 10 + .../impl/jdbc/EmbedDatabaseMetaData.java | 92 +++++ .../impl/jdbc/EmbedParameterSetMetaData.java | 5 + .../impl/jdbc/EmbedPooledConnection.java | 17 + .../impl/jdbc/EmbedPreparedStatement.java | 59 +++ .../impl/jdbc/EmbedPreparedStatement42.java | 2 + .../derby/impl/jdbc/EmbedResultSet.java | 250 +++++++++++++ .../derby/impl/jdbc/EmbedResultSet42.java | 7 + .../impl/jdbc/EmbedResultSetMetaData.java | 12 + .../derby/impl/jdbc/EmbedSavepoint.java | 6 + .../derby/impl/jdbc/EmbedStatement.java | 23 ++ .../derby/impl/jdbc/EmbedXAConnection.java | 5 + .../derby/impl/jdbc/EmbedXAResource.java | 26 ++ .../derby/impl/jdbc/EncryptedLOBFile.java | 4 + .../apache/derby/impl/jdbc/InternalClob.java | 4 + .../org/apache/derby/impl/jdbc/LOBFile.java | 1 + .../derby/impl/jdbc/LOBInputStream.java | 10 + .../derby/impl/jdbc/LOBOutputStream.java | 5 + .../derby/impl/jdbc/LOBStoredProcedure.java | 7 + .../derby/impl/jdbc/LOBStreamControl.java | 44 +++ .../impl/jdbc/PositionedStoreStream.java | 12 + .../derby/impl/jdbc/ResourceAdapterImpl.java | 6 + .../derby/impl/jdbc/SQLExceptionFactory.java | 4 + .../derby/impl/jdbc/StoreStreamClob.java | 12 + .../apache/derby/impl/jdbc/TemporaryClob.java | 23 ++ .../impl/jdbc/TransactionResourceImpl.java | 16 + .../apache/derby/impl/jdbc/UTF8Reader.java | 29 ++ .../derby/impl/jdbc/UpdatableBlobStream.java | 13 + .../org/apache/derby/impl/jdbc/Util.java | 25 ++ .../org/apache/derby/impl/jdbc/Util42.java | 1 + .../derby/impl/jdbc/XAStatementControl.java | 5 + .../derby/impl/jdbc/XATransactionState.java | 21 ++ .../BasicAuthenticationServiceImpl.java | 5 + .../JNDIAuthenticationSchemeBase.java | 1 + .../JNDIAuthenticationService.java | 1 + .../LDAPAuthenticationSchemeImpl.java | 7 + .../NativeAuthenticationServiceImpl.java | 9 + .../SpecificAuthenticationServiceImpl.java | 4 + .../apache/derby/impl/load/ColumnInfo.java | 21 ++ .../org/apache/derby/impl/load/Export.java | 9 + .../derby/impl/load/ExportAbstract.java | 5 + .../derby/impl/load/ExportWriteData.java | 15 + .../impl/load/ExportWriteDataAbstract.java | 2 + .../org/apache/derby/impl/load/Import.java | 33 ++ .../derby/impl/load/ImportAbstract.java | 18 + .../apache/derby/impl/load/ImportBlob.java | 2 + .../apache/derby/impl/load/ImportClob.java | 2 + .../apache/derby/impl/load/ImportLobFile.java | 8 + .../derby/impl/load/ImportReadData.java | 30 ++ .../impl/load/ImportResultSetMetaData.java | 6 + .../org/apache/derby/impl/load/LoadError.java | 8 + .../derby/impl/services/bytecode/BCClass.java | 1 + .../derby/impl/services/bytecode/BCJava.java | 3 + .../impl/services/bytecode/BCMethod.java | 52 +++ .../impl/services/bytecode/CodeChunk.java | 2 + .../impl/services/bytecode/Conditional.java | 10 + .../derby/impl/services/bytecode/GClass.java | 6 + .../derby/impl/services/bytecode/Type.java | 1 + .../impl/services/bytecode/d_BCValidate.java | 6 + .../impl/services/cache/ClockPolicy.java | 3 + .../impl/services/cache/ConcurrentCache.java | 18 + .../impl/services/daemon/BasicDaemon.java | 1 + .../daemon/IndexStatisticsDaemonImpl.java | 55 +++ .../daemon/SingleThreadDaemonFactory.java | 4 + .../impl/services/jce/JCECipherFactory.java | 19 + .../impl/services/jce/JCECipherProvider.java | 2 + .../services/jmx/JMXManagementService.java | 23 ++ .../services/jmxnone/NoManagementService.java | 6 +- .../impl/services/locks/AbstractPool.java | 1 + .../derby/impl/services/locks/ActiveLock.java | 7 + .../services/locks/ConcurrentLockSet.java | 4 + .../derby/impl/services/locks/Control.java | 2 + .../impl/services/locks/D_LockControl.java | 4 + .../derby/impl/services/locks/Deadlock.java | 1 + .../derby/impl/services/locks/Lock.java | 5 + .../impl/services/locks/LockControl.java | 1 + .../derby/impl/services/locks/LockSpace.java | 32 ++ .../derby/impl/services/locks/LockTable.java | 1 + .../impl/services/locks/LockTableVTI.java | 4 + .../impl/services/locks/TableNameInfo.java | 4 + .../derby/impl/services/locks/Timeout.java | 4 + .../impl/services/monitor/BaseMonitor.java | 79 ++++ .../impl/services/monitor/FileMonitor.java | 18 + .../impl/services/monitor/ProtocolKey.java | 1 + .../services/monitor/ServiceBootContext.java | 1 + .../monitor/StorageFactoryService.java | 49 +++ .../impl/services/monitor/TopService.java | 16 + .../services/reflect/DatabaseClasses.java | 8 + .../impl/services/reflect/JarLoader.java | 17 + .../reflect/LoadedGeneratedClass.java | 1 + .../services/reflect/ReflectClassesJava2.java | 8 + .../reflect/ReflectGeneratedClass.java | 1 + .../services/reflect/ReflectLoaderJava2.java | 2 + .../impl/services/reflect/ReflectMethod.java | 1 + .../impl/services/reflect/UpdateLoader.java | 19 + .../stream/BasicHeaderPrintWriter.java | 2 + .../services/stream/RollingFileStream.java | 3 + .../impl/services/stream/SingleStream.java | 17 + .../services/timer/SingletonTimerFactory.java | 2 + .../impl/services/uuid/BasicUUIDFactory.java | 2 + .../org/apache/derby/impl/sql/CursorInfo.java | 2 + .../impl/sql/GenericActivationHolder.java | 5 + .../impl/sql/GenericColumnDescriptor.java | 4 + .../impl/sql/GenericLanguageFactory.java | 4 + .../derby/impl/sql/GenericParameter.java | 5 + .../impl/sql/GenericParameterValueSet.java | 11 + .../impl/sql/GenericPreparedStatement.java | 41 +++ .../impl/sql/GenericResultDescription.java | 10 + .../derby/impl/sql/GenericStatement.java | 33 ++ .../sql/GenericStorablePreparedStatement.java | 2 + .../impl/sql/LanguageDbPropertySetter.java | 3 + .../sql/catalog/CoreDDFinderClassInfo.java | 3 + .../sql/catalog/DDColumnDependableFinder.java | 1 + .../derby/impl/sql/catalog/DD_Version.java | 41 +++ .../impl/sql/catalog/DDdependableFinder.java | 8 + .../sql/catalog/DropDependencyFilter.java | 2 + .../derby/impl/sql/catalog/IndexInfoImpl.java | 10 + .../sql/catalog/PermissionsCacheable.java | 2 + .../catalog/PermissionsCatalogRowFactory.java | 6 + .../sql/catalog/RoleClosureIteratorImpl.java | 5 + .../sql/catalog/SYSALIASESRowFactory.java | 8 + .../impl/sql/catalog/SYSCHECKSRowFactory.java | 4 + .../sql/catalog/SYSCOLPERMSRowFactory.java | 13 + .../sql/catalog/SYSCOLUMNSRowFactory.java | 57 +++ .../catalog/SYSCONGLOMERATESRowFactory.java | 7 + .../sql/catalog/SYSCONSTRAINTSRowFactory.java | 13 + .../sql/catalog/SYSDEPENDSRowFactory.java | 4 + .../impl/sql/catalog/SYSDUMMY1RowFactory.java | 2 + .../impl/sql/catalog/SYSFILESRowFactory.java | 4 + .../sql/catalog/SYSFOREIGNKEYSRowFactory.java | 3 + .../impl/sql/catalog/SYSKEYSRowFactory.java | 3 + .../impl/sql/catalog/SYSPERMSRowFactory.java | 1 + .../impl/sql/catalog/SYSROLESRowFactory.java | 10 + .../catalog/SYSROUTINEPERMSRowFactory.java | 11 + .../sql/catalog/SYSSCHEMASRowFactory.java | 3 + .../sql/catalog/SYSSEQUENCESRowFactory.java | 2 + .../sql/catalog/SYSSTATEMENTSRowFactory.java | 6 + .../sql/catalog/SYSSTATISTICSRowFactory.java | 4 + .../sql/catalog/SYSTABLEPERMSRowFactory.java | 11 + .../impl/sql/catalog/SYSTABLESRowFactory.java | 10 + .../sql/catalog/SYSTRIGGERSRowFactory.java | 4 + .../impl/sql/catalog/SYSVIEWSRowFactory.java | 3 + .../impl/sql/catalog/SequenceGenerator.java | 2 + .../impl/sql/catalog/SequenceUpdater.java | 14 + .../impl/sql/catalog/SystemColumnImpl.java | 3 + .../derby/impl/sql/catalog/TabInfoImpl.java | 45 +++ .../derby/impl/sql/catalog/TableKey.java | 1 + .../catalog/XPLAINResultSetDescriptor.java | 2 + .../XPLAINResultSetTimingsDescriptor.java | 1 + .../catalog/XPLAINScanPropsDescriptor.java | 2 + .../catalog/XPLAINSortPropsDescriptor.java | 2 + .../catalog/XPLAINStatementDescriptor.java | 2 + .../XPLAINStatementTimingsDescriptor.java | 2 + .../impl/sql/compile/AccessPathImpl.java | 1 + .../sql/compile/ActivationClassBuilder.java | 3 + .../impl/sql/compile/AggregateDefinition.java | 1 + .../derby/impl/sql/compile/AggregateNode.java | 52 +++ .../compile/AggregateWindowFunctionNode.java | 3 + .../impl/sql/compile/AllResultColumn.java | 7 + .../impl/sql/compile/AlterTableNode.java | 18 + .../derby/impl/sql/compile/AndNode.java | 15 + .../impl/sql/compile/BaseColumnNode.java | 15 + .../impl/sql/compile/BaseJoinStrategy.java | 2 + .../sql/compile/BaseTableNumbersVisitor.java | 6 + .../impl/sql/compile/BaseTypeCompiler.java | 3 + .../impl/sql/compile/BetweenOperatorNode.java | 16 + .../compile/BinaryArithmeticOperatorNode.java | 11 + .../compile/BinaryComparisonOperatorNode.java | 25 ++ .../sql/compile/BinaryListOperatorNode.java | 28 ++ .../compile/BinaryLogicalOperatorNode.java | 8 + .../impl/sql/compile/BinaryOperatorNode.java | 49 +++ .../compile/BinaryRelationalOperatorNode.java | 57 +++ .../impl/sql/compile/BitConstantNode.java | 3 + .../impl/sql/compile/BitTypeCompiler.java | 1 + .../impl/sql/compile/BooleanConstantNode.java | 7 + .../impl/sql/compile/BooleanTypeCompiler.java | 1 + .../impl/sql/compile/CallStatementNode.java | 18 + .../derby/impl/sql/compile/CastNode.java | 51 +++ .../impl/sql/compile/CharConstantNode.java | 13 + .../impl/sql/compile/CharTypeCompiler.java | 3 + .../sql/compile/CoalesceFunctionNode.java | 25 ++ .../impl/sql/compile/CollectNodesVisitor.java | 6 + .../sql/compile/ColumnDefinitionNode.java | 56 +++ .../impl/sql/compile/ColumnOrdering.java | 8 + .../impl/sql/compile/ColumnReference.java | 85 +++++ .../impl/sql/compile/CompilerContextImpl.java | 50 +++ .../compile/ConcatenationOperatorNode.java | 14 + .../impl/sql/compile/ConditionalNode.java | 35 ++ .../derby/impl/sql/compile/ConstantNode.java | 12 + .../sql/compile/ConstraintDefinitionNode.java | 23 ++ .../impl/sql/compile/CostEstimateImpl.java | 5 + .../impl/sql/compile/CreateAliasNode.java | 21 ++ .../impl/sql/compile/CreateIndexNode.java | 16 + .../impl/sql/compile/CreateRoleNode.java | 2 + .../impl/sql/compile/CreateSchemaNode.java | 6 + .../impl/sql/compile/CreateSequenceNode.java | 8 + .../impl/sql/compile/CreateTableNode.java | 35 ++ .../impl/sql/compile/CreateTriggerNode.java | 27 ++ .../impl/sql/compile/CreateViewNode.java | 28 ++ .../compile/CurrentDatetimeOperatorNode.java | 8 + .../derby/impl/sql/compile/CurrentOfNode.java | 31 ++ .../sql/compile/CurrentRowLocationNode.java | 6 + .../derby/impl/sql/compile/CursorNode.java | 41 +++ .../sql/compile/DB2LengthOperatorNode.java | 7 + .../impl/sql/compile/DDLStatementNode.java | 27 ++ .../DMLModGeneratedColumnsStatementNode.java | 5 +- .../impl/sql/compile/DMLModStatementNode.java | 56 +++ .../impl/sql/compile/DMLStatementNode.java | 28 ++ .../derby/impl/sql/compile/DefaultNode.java | 15 + .../impl/sql/compile/DefaultOptTrace.java | 7 + .../sql/compile/DefaultVTIModDeferPolicy.java | 1 + .../derby/impl/sql/compile/DeleteNode.java | 60 +++ .../derby/impl/sql/compile/DistinctNode.java | 16 + .../derby/impl/sql/compile/DropAliasNode.java | 7 + .../derby/impl/sql/compile/DropIndexNode.java | 3 + .../impl/sql/compile/DropSchemaNode.java | 7 + .../impl/sql/compile/DropSequenceNode.java | 2 + .../derby/impl/sql/compile/DropTableNode.java | 6 + .../impl/sql/compile/DropTriggerNode.java | 1 + .../derby/impl/sql/compile/DropViewNode.java | 4 + .../derby/impl/sql/compile/ExecSPSNode.java | 7 + .../sql/compile/ExpressionClassBuilder.java | 5 + .../impl/sql/compile/ExtractOperatorNode.java | 8 + .../compile/FKConstraintDefinitionNode.java | 10 + .../derby/impl/sql/compile/FromBaseTable.java | 247 +++++++++++++ .../derby/impl/sql/compile/FromList.java | 68 ++++ .../derby/impl/sql/compile/FromSubquery.java | 70 ++++ .../derby/impl/sql/compile/FromTable.java | 59 +++ .../derby/impl/sql/compile/FromVTI.java | 117 ++++++ .../sql/compile/GenerationClauseNode.java | 11 + .../sql/compile/GetCurrentConnectionNode.java | 3 + .../derby/impl/sql/compile/GrantNode.java | 8 + .../derby/impl/sql/compile/GrantRoleNode.java | 2 + .../derby/impl/sql/compile/GroupByColumn.java | 12 + .../derby/impl/sql/compile/GroupByList.java | 21 ++ .../derby/impl/sql/compile/GroupByNode.java | 85 +++++ .../impl/sql/compile/HalfOuterJoinNode.java | 36 ++ .../sql/compile/HasCorrelatedCRsVisitor.java | 6 + .../impl/sql/compile/HasNodeVisitor.java | 8 + .../sql/compile/HasTableFunctionVisitor.java | 2 + .../compile/HasVariantValueNodeVisitor.java | 9 + .../impl/sql/compile/HashJoinStrategy.java | 18 + .../derby/impl/sql/compile/HashTableNode.java | 19 + .../impl/sql/compile/InListOperatorNode.java | 36 ++ .../impl/sql/compile/IndexToBaseRowNode.java | 16 + .../derby/impl/sql/compile/InsertNode.java | 50 +++ .../sql/compile/IntersectOrExceptNode.java | 25 ++ .../apache/derby/impl/sql/compile/IsNode.java | 4 + .../derby/impl/sql/compile/IsNullNode.java | 9 + .../impl/sql/compile/JavaToSQLValueNode.java | 17 + .../derby/impl/sql/compile/JavaValueNode.java | 9 + .../derby/impl/sql/compile/JoinNode.java | 95 +++++ .../impl/sql/compile/LOBTypeCompiler.java | 2 + .../impl/sql/compile/LengthOperatorNode.java | 7 + .../sql/compile/LikeEscapeOperatorNode.java | 46 +++ .../derby/impl/sql/compile/LockTableNode.java | 6 + .../impl/sql/compile/MatchingClauseNode.java | 8 + .../sql/compile/MaterializeResultSetNode.java | 10 + .../sql/compile/MaterializeSubqueryNode.java | 1 + .../compile/MaxMinAggregateDefinition.java | 7 + .../derby/impl/sql/compile/MergeNode.java | 7 + .../impl/sql/compile/MethodCallNode.java | 37 ++ .../compile/MiscellaneousStatementNode.java | 3 + .../impl/sql/compile/ModifyColumnNode.java | 40 ++ .../impl/sql/compile/NOPStatementNode.java | 3 + .../sql/compile/NestedLoopJoinStrategy.java | 6 + .../impl/sql/compile/NewInvocationNode.java | 11 + .../impl/sql/compile/NextSequenceNode.java | 2 + .../sql/compile/NonStaticMethodCallNode.java | 14 + .../sql/compile/NormalizeResultSetNode.java | 18 + .../derby/impl/sql/compile/NotNode.java | 4 + .../impl/sql/compile/NumericConstantNode.java | 17 + .../impl/sql/compile/NumericTypeCompiler.java | 14 + .../derby/impl/sql/compile/OperatorNode.java | 2 + .../sql/compile/OptimizerFactoryImpl.java | 10 + .../derby/impl/sql/compile/OptimizerImpl.java | 77 ++++ .../impl/sql/compile/OptimizerTracer.java | 7 + .../apache/derby/impl/sql/compile/OrNode.java | 18 + .../derby/impl/sql/compile/OrderByColumn.java | 44 +++ .../derby/impl/sql/compile/OrderByList.java | 40 ++ .../derby/impl/sql/compile/OrderByNode.java | 10 + .../derby/impl/sql/compile/OrderedColumn.java | 6 + .../impl/sql/compile/OrderedColumnList.java | 6 + .../derby/impl/sql/compile/ParameterNode.java | 18 + .../impl/sql/compile/ParseException.java | 4 + .../derby/impl/sql/compile/ParserImpl.java | 3 + .../derby/impl/sql/compile/Predicate.java | 56 +++ .../derby/impl/sql/compile/PredicateList.java | 165 +++++++++ .../derby/impl/sql/compile/PrivilegeNode.java | 17 + .../impl/sql/compile/ProjectRestrictNode.java | 80 ++++ .../derby/impl/sql/compile/QueryTreeNode.java | 1 + .../impl/sql/compile/QueryTreeNodeVector.java | 14 + .../sql/compile/ReferencedTablesVisitor.java | 2 + .../impl/sql/compile/RelationalOperator.java | 9 + .../impl/sql/compile/RemapCRsVisitor.java | 2 + .../derby/impl/sql/compile/RenameNode.java | 9 + .../ReplaceAggregatesWithCRVisitor.java | 4 + .../ReplaceWindowFuncCallsWithCRVisitor.java | 6 + .../derby/impl/sql/compile/ResultColumn.java | 169 +++++++++ .../impl/sql/compile/ResultColumnList.java | 307 ++++++++++++++++ .../derby/impl/sql/compile/ResultSetNode.java | 142 ++++++++ .../derby/impl/sql/compile/RevokeNode.java | 8 + .../impl/sql/compile/RevokeRoleNode.java | 8 + .../impl/sql/compile/RoutineDesignator.java | 3 + .../derby/impl/sql/compile/RowCountNode.java | 7 + .../sql/compile/RowNumberFunctionNode.java | 1 + .../impl/sql/compile/RowOrderingImpl.java | 30 ++ .../impl/sql/compile/RowResultSetNode.java | 69 ++++ .../impl/sql/compile/SQLToJavaValueNode.java | 12 + .../derby/impl/sql/compile/SavepointNode.java | 5 + .../ScrollInsensitiveResultSetNode.java | 8 + .../derby/impl/sql/compile/SelectNode.java | 218 +++++++++++ .../impl/sql/compile/SetConstraintsNode.java | 1 + .../impl/sql/compile/SetOperatorNode.java | 56 +++ .../derby/impl/sql/compile/SetRoleNode.java | 4 + .../derby/impl/sql/compile/SetSchemaNode.java | 7 + .../compile/SetTransactionIsolationNode.java | 5 + .../sql/compile/SimpleStringOperatorNode.java | 8 + .../sql/compile/SingleChildResultSetNode.java | 32 ++ .../impl/sql/compile/SpecialFunctionNode.java | 21 ++ .../derby/impl/sql/compile/StatementNode.java | 11 + .../StaticClassFieldReferenceNode.java | 6 + .../sql/compile/StaticMethodCallNode.java | 76 ++++ .../derby/impl/sql/compile/SubqueryList.java | 20 + .../derby/impl/sql/compile/SubqueryNode.java | 95 +++++ .../compile/SubstituteExpressionVisitor.java | 4 + .../compile/SumAvgAggregateDefinition.java | 6 + .../impl/sql/compile/TableElementList.java | 91 +++++ .../impl/sql/compile/TableElementNode.java | 8 + .../derby/impl/sql/compile/TableName.java | 9 + .../impl/sql/compile/TableOperatorNode.java | 52 +++ .../impl/sql/compile/TablePrivilegesNode.java | 11 + .../impl/sql/compile/TernaryOperatorNode.java | 59 +++ .../impl/sql/compile/TestConstraintNode.java | 6 + .../sql/compile/TimestampOperatorNode.java | 6 + .../sql/compile/TransactionStatementNode.java | 3 + .../sql/compile/TriggerReferencingStruct.java | 2 + .../sql/compile/TypeCompilerFactoryImpl.java | 14 + .../impl/sql/compile/UCode_CharStream.java | 2 + .../compile/UnaryArithmeticOperatorNode.java | 17 + .../compile/UnaryComparisonOperatorNode.java | 10 + .../UnaryDateTimestampOperatorNode.java | 8 + .../sql/compile/UnaryLogicalOperatorNode.java | 4 + .../impl/sql/compile/UnaryOperatorNode.java | 33 ++ .../derby/impl/sql/compile/UnionNode.java | 35 ++ .../sql/compile/UntypedNullConstantNode.java | 6 + .../derby/impl/sql/compile/UpdateNode.java | 67 ++++ .../sql/compile/UserAggregateDefinition.java | 9 + .../sql/compile/UserDefinedTypeCompiler.java | 2 + .../sql/compile/UserTypeConstantNode.java | 15 + .../impl/sql/compile/VTIDeferModPolicy.java | 5 + .../derby/impl/sql/compile/ValueNode.java | 56 +++ .../derby/impl/sql/compile/ValueNodeList.java | 52 +++ .../impl/sql/compile/VarbitConstantNode.java | 4 + .../VerifyAggregateExpressionsVisitor.java | 5 + .../impl/sql/compile/VirtualColumnNode.java | 23 ++ .../sql/compile/WindowDefinitionNode.java | 4 + .../impl/sql/compile/WindowFunctionNode.java | 11 + .../derby/impl/sql/compile/WindowList.java | 1 + .../derby/impl/sql/compile/WindowNode.java | 2 + .../impl/sql/compile/WindowReferenceNode.java | 2 + .../impl/sql/compile/WindowResultSetNode.java | 30 ++ .../derby/impl/sql/compile/XMLOptTrace.java | 29 ++ .../impl/sql/conn/GenericAuthorizer.java | 9 + .../GenericLanguageConnectionContext.java | 133 +++++++ .../GenericLanguageConnectionFactory.java | 1 + .../sql/conn/GenericStatementContext.java | 20 + .../impl/sql/conn/SQLSessionContextImpl.java | 10 + .../derby/impl/sql/conn/TempTableInfo.java | 1 + .../sql/depend/BasicDependencyManager.java | 44 +++ .../sql/execute/AggregateSortObserver.java | 1 + .../impl/sql/execute/AggregatorInfoList.java | 1 + .../AlterConstraintConstantAction.java | 4 + .../sql/execute/AlterTableConstantAction.java | 167 +++++++++ .../derby/impl/sql/execute/AnyResultSet.java | 1 + .../sql/execute/AutoincrementCounter.java | 1 + .../derby/impl/sql/execute/AvgAggregator.java | 4 + .../impl/sql/execute/BaseActivation.java | 1 + .../sql/execute/BaseExpressionActivation.java | 1 + .../sql/execute/BasicNoPutResultSetImpl.java | 3 + .../impl/sql/execute/BasicSortObserver.java | 6 + .../sql/execute/BulkTableScanResultSet.java | 9 + .../sql/execute/CallStatementResultSet.java | 3 + .../impl/sql/execute/CardinalityCounter.java | 3 + .../derby/impl/sql/execute/ColumnInfo.java | 9 + .../sql/execute/ConstantActionActivation.java | 1 + .../sql/execute/ConstraintConstantAction.java | 13 + .../impl/sql/execute/ConstraintInfo.java | 1 + .../execute/CreateAliasConstantAction.java | 11 + .../CreateConstraintConstantAction.java | 24 ++ .../execute/CreateIndexConstantAction.java | 43 +++ .../sql/execute/CreateRoleConstantAction.java | 9 + .../execute/CreateSchemaConstantAction.java | 2 + .../execute/CreateSequenceConstantAction.java | 1 + .../execute/CreateTableConstantAction.java | 17 + .../execute/CreateTriggerConstantAction.java | 4 + .../sql/execute/CreateViewConstantAction.java | 7 + .../impl/sql/execute/CurrentOfResultSet.java | 7 + .../impl/sql/execute/CursorActivation.java | 1 + .../impl/sql/execute/DDLConstantAction.java | 33 ++ .../execute/DDLSingleTableConstantAction.java | 9 + .../impl/sql/execute/DMLVTIResultSet.java | 5 + .../DMLWriteGeneratedColumnsResultSet.java | 6 +- .../impl/sql/execute/DMLWriteResultSet.java | 8 + .../execute/DeferredConstraintsMemory.java | 39 ++ .../sql/execute/DeleteCascadeResultSet.java | 14 + .../impl/sql/execute/DeleteResultSet.java | 24 ++ .../impl/sql/execute/DeleteVTIResultSet.java | 5 + .../impl/sql/execute/DependentResultSet.java | 13 + .../DistinctGroupedAggregateResultSet.java | 2 + .../DistinctScalarAggregateResultSet.java | 10 + .../sql/execute/DistinctScanResultSet.java | 7 + .../sql/execute/DropAliasConstantAction.java | 1 + .../execute/DropConstraintConstantAction.java | 2 + .../sql/execute/DropRoleConstantAction.java | 1 + .../sql/execute/DropSchemaConstantAction.java | 4 + .../execute/DropStatisticsConstantAction.java | 1 + .../sql/execute/DropTableConstantAction.java | 3 + .../sql/execute/DropViewConstantAction.java | 1 + .../apache/derby/impl/sql/execute/FKInfo.java | 25 ++ .../impl/sql/execute/ForeignKeyRIChecker.java | 3 + .../execute/GenericAggregateResultSet.java | 5 + .../impl/sql/execute/GenericAggregator.java | 3 + .../execute/GenericConstantActionFactory.java | 27 ++ .../sql/execute/GenericExecutionContext.java | 3 + .../sql/execute/GenericExecutionFactory.java | 6 + .../sql/execute/GenericPrivilegeInfo.java | 1 + .../impl/sql/execute/GenericRIChecker.java | 5 + .../sql/execute/GenericResultSetFactory.java | 83 +++++ .../sql/execute/GenericTriggerExecutor.java | 5 + .../sql/execute/GrantRoleConstantAction.java | 8 + .../execute/GroupedAggregateResultSet.java | 12 + .../impl/sql/execute/HashJoinResultSet.java | 2 + .../execute/HashLeftOuterJoinResultSet.java | 2 + .../impl/sql/execute/HashScanResultSet.java | 12 + .../impl/sql/execute/HashTableResultSet.java | 8 + .../derby/impl/sql/execute/IndexChanger.java | 35 ++ .../impl/sql/execute/IndexColumnOrder.java | 3 + .../impl/sql/execute/IndexConstantAction.java | 2 + .../execute/IndexRowToBaseRowResultSet.java | 5 + .../sql/execute/InsertConstantAction.java | 4 + .../impl/sql/execute/InsertResultSet.java | 138 +++++++ .../impl/sql/execute/InsertVTIResultSet.java | 7 + .../InternalTriggerExecutionContext.java | 9 + .../derby/impl/sql/execute/JarUtil.java | 13 + .../derby/impl/sql/execute/JoinResultSet.java | 8 + .../sql/execute/LastIndexKeyResultSet.java | 8 + .../sql/execute/MaterializedResultSet.java | 6 + .../impl/sql/execute/MaxMinAggregator.java | 1 + .../impl/sql/execute/MergeJoinResultSet.java | 5 + .../derby/impl/sql/execute/MiscResultSet.java | 1 + .../execute/MultiProbeTableScanResultSet.java | 3 + .../sql/execute/NestedLoopJoinResultSet.java | 5 + .../NestedLoopLeftOuterJoinResultSet.java | 5 + .../impl/sql/execute/NoPutResultSetImpl.java | 11 + .../impl/sql/execute/NoRowsResultSetImpl.java | 11 + .../impl/sql/execute/NormalizeResultSet.java | 4 + .../derby/impl/sql/execute/OnceResultSet.java | 1 + .../derby/impl/sql/execute/PrivilegeInfo.java | 2 + .../sql/execute/ProjectRestrictResultSet.java | 19 + .../derby/impl/sql/execute/RIBulkChecker.java | 10 + .../derby/impl/sql/execute/RISetChecker.java | 6 + .../RealResultSetStatisticsFactory.java | 17 + .../sql/execute/ReferencedKeyRIChecker.java | 12 + .../sql/execute/RevokeRoleConstantAction.java | 7 + .../sql/execute/RoutinePrivilegeInfo.java | 5 + .../impl/sql/execute/RowChangerImpl.java | 8 + .../impl/sql/execute/RowCountResultSet.java | 5 + .../derby/impl/sql/execute/RowResultSet.java | 2 + .../impl/sql/execute/RowTriggerExecutor.java | 1 + .../derby/impl/sql/execute/RowUtil.java | 4 + .../sql/execute/ScalarAggregateResultSet.java | 5 + .../derby/impl/sql/execute/ScanResultSet.java | 7 + .../execute/ScrollInsensitiveResultSet.java | 27 ++ .../execute/SetConstraintsConstantAction.java | 7 + .../impl/sql/execute/SetOpResultSet.java | 12 + .../sql/execute/SetRoleConstantAction.java | 8 + .../sql/execute/SetSchemaConstantAction.java | 4 + .../derby/impl/sql/execute/SortResultSet.java | 7 + .../sql/execute/StatementTriggerExecutor.java | 1 + .../derby/impl/sql/execute/SumAggregator.java | 1 + .../impl/sql/execute/TablePrivilegeInfo.java | 6 + .../impl/sql/execute/TableScanResultSet.java | 23 ++ .../sql/execute/TemporaryRowHolderImpl.java | 37 ++ .../execute/TemporaryRowHolderResultSet.java | 24 ++ .../sql/execute/TriggerEventActivator.java | 6 + .../derby/impl/sql/execute/TriggerInfo.java | 3 + .../impl/sql/execute/UnionResultSet.java | 5 + .../sql/execute/UniqueIndexSortObserver.java | 10 + ...ueWithDuplicateNullsIndexSortObserver.java | 12 + .../sql/execute/UpdateConstantAction.java | 18 + .../impl/sql/execute/UpdateResultSet.java | 97 +++++ .../impl/sql/execute/UpdateVTIResultSet.java | 7 + .../sql/execute/UserDefinedAggregator.java | 1 + .../derby/impl/sql/execute/VTIResultSet.java | 15 + .../ValidateCheckConstraintResultSet.java | 1 + .../derby/impl/sql/execute/ValueRow.java | 5 + .../impl/sql/execute/WindowResultSet.java | 3 + .../execute/WriteCursorConstantAction.java | 2 + .../rts/RealAnyResultSetStatistics.java | 1 + .../RealBasicNoPutResultSetStatistics.java | 5 + .../RealDeleteCascadeResultSetStatistics.java | 1 + .../rts/RealDeleteResultSetStatistics.java | 1 + .../rts/RealDeleteVTIResultSetStatistics.java | 1 + ...RealDistinctScalarAggregateStatistics.java | 1 + .../rts/RealDistinctScanStatistics.java | 3 + .../rts/RealGroupedAggregateStatistics.java | 2 + .../execute/rts/RealHashJoinStatistics.java | 2 + .../rts/RealHashLeftOuterJoinStatistics.java | 3 + .../execute/rts/RealHashScanStatistics.java | 5 + .../execute/rts/RealHashTableStatistics.java | 3 + .../rts/RealIndexRowToBaseRowStatistics.java | 1 + .../rts/RealInsertResultSetStatistics.java | 1 + .../rts/RealInsertVTIResultSetStatistics.java | 1 + .../rts/RealJoinResultSetStatistics.java | 4 + .../rts/RealLastIndexKeyScanStatistics.java | 1 + .../RealMaterializedResultSetStatistics.java | 2 + .../rts/RealNestedLoopJoinStatistics.java | 4 + ...RealNestedLoopLeftOuterJoinStatistics.java | 3 + .../rts/RealNoRowsResultSetStatistics.java | 2 + .../rts/RealNormalizeResultSetStatistics.java | 1 + .../rts/RealOnceResultSetStatistics.java | 1 + .../rts/RealProjectRestrictStatistics.java | 3 + .../execute/rts/RealRowCountStatistics.java | 1 + .../rts/RealRowResultSetStatistics.java | 1 + .../rts/RealScalarAggregateStatistics.java | 2 + ...lScrollInsensitiveResultSetStatistics.java | 1 + .../rts/RealSetOpResultSetStatistics.java | 4 + .../sql/execute/rts/RealSortStatistics.java | 2 + .../execute/rts/RealTableScanStatistics.java | 9 + .../rts/RealUnionResultSetStatistics.java | 3 + .../rts/RealUpdateResultSetStatistics.java | 2 + .../rts/RealWindowResultSetStatistics.java | 1 + .../execute/rts/RunTimeStatisticsImpl.java | 7 + .../xplain/XPLAINSystemTableVisitor.java | 7 + .../impl/sql/execute/xplain/XPLAINUtil.java | 4 + .../access/BackingStoreHashTableFromScan.java | 1 + .../store/access/CacheableConglomerate.java | 2 + .../store/access/PropertyConglomerate.java | 14 + .../impl/store/access/RAMAccessManager.java | 27 ++ .../impl/store/access/RAMTransaction.java | 60 +++ .../derby/impl/store/access/btree/BTree.java | 10 + .../store/access/btree/BTreeController.java | 21 ++ .../access/btree/BTreeCostController.java | 3 + .../store/access/btree/BTreeForwardScan.java | 3 + .../access/btree/BTreeLockingPolicy.java | 2 + .../impl/store/access/btree/BTreeMaxScan.java | 3 + .../store/access/btree/BTreePostCommit.java | 15 + .../impl/store/access/btree/BTreeScan.java | 50 +++ .../store/access/btree/BranchControlRow.java | 15 + .../impl/store/access/btree/BranchRow.java | 2 + .../impl/store/access/btree/ControlRow.java | 16 + .../store/access/btree/D_BTreeController.java | 6 + .../store/access/btree/LeafControlRow.java | 7 + .../impl/store/access/btree/OpenBTree.java | 7 + .../impl/store/access/btree/index/B2I.java | 15 + .../access/btree/index/B2IController.java | 2 + .../store/access/btree/index/B2IFactory.java | 7 + .../access/btree/index/B2IForwardScan.java | 1 + .../access/btree/index/B2IRowLocking3.java | 5 + .../store/access/btree/index/B2IUndo.java | 5 + .../access/conglomerate/ConglomerateUtil.java | 2 + .../conglomerate/GenericConglomerate.java | 1 + .../GenericConglomerateController.java | 14 + .../conglomerate/GenericScanController.java | 41 +++ .../access/conglomerate/OpenConglomerate.java | 5 + .../OpenConglomerateScratchSpace.java | 6 + .../access/conglomerate/RowPosition.java | 3 + .../access/conglomerate/TemplateRow.java | 11 + .../store/access/heap/D_HeapController.java | 3 + .../derby/impl/store/access/heap/Heap.java | 27 ++ .../store/access/heap/HeapCompressScan.java | 4 + .../access/heap/HeapConglomerateFactory.java | 4 + .../store/access/heap/HeapController.java | 9 + .../store/access/heap/HeapRowLocation.java | 1 + .../impl/store/access/heap/HeapScan.java | 5 + .../access/sort/ExternalSortFactory.java | 4 + .../impl/store/access/sort/MergeInserter.java | 6 + .../impl/store/access/sort/MergeScan.java | 2 + .../store/access/sort/MergeScanRowSource.java | 3 + .../impl/store/access/sort/MergeSort.java | 21 ++ .../derby/impl/store/access/sort/Scan.java | 3 + .../impl/store/access/sort/SortBuffer.java | 5 + .../access/sort/SortBufferRowSource.java | 3 + .../store/access/sort/SortBufferScan.java | 1 + .../impl/store/access/sort/SortScan.java | 1 + .../UniqueWithDuplicateNullsMergeSort.java | 3 + .../apache/derby/impl/store/raw/RawStore.java | 145 ++++++++ .../impl/store/raw/data/AllocExtent.java | 1 + .../derby/impl/store/raw/data/AllocPage.java | 6 + .../store/raw/data/AllocPageOperation.java | 1 + .../impl/store/raw/data/BaseContainer.java | 13 + .../store/raw/data/BaseContainerHandle.java | 9 + .../store/raw/data/BaseDataFileFactory.java | 64 ++++ .../derby/impl/store/raw/data/BasePage.java | 24 ++ .../data/BufferedByteHolderInputStream.java | 1 + .../derby/impl/store/raw/data/CachedPage.java | 32 ++ .../raw/data/ChainAllocPageOperation.java | 1 + .../raw/data/CompressSpacePageOperation.java | 2 + .../data/CompressSpacePageOperation10_2.java | 1 + .../raw/data/ContainerActionOnCommit.java | 1 + .../store/raw/data/CopyRowsOperation.java | 1 + .../store/raw/data/D_BaseContainerHandle.java | 1 + .../impl/store/raw/data/D_DiagnosticUtil.java | 9 + .../impl/store/raw/data/DeleteOperation.java | 1 + .../raw/data/EncryptContainerOperation.java | 1 + .../store/raw/data/EncryptOrDecryptData.java | 14 + .../impl/store/raw/data/FileContainer.java | 1 + .../store/raw/data/InitPageOperation.java | 1 + .../store/raw/data/InputStreamContainer.java | 10 + .../impl/store/raw/data/InsertOperation.java | 1 + .../raw/data/InvalidatePageOperation.java | 1 + .../store/raw/data/LoggableAllocActions.java | 1 + .../store/raw/data/LogicalPageOperation.java | 2 + .../store/raw/data/LogicalUndoOperation.java | 1 + .../impl/store/raw/data/MemByteHolder.java | 9 + .../store/raw/data/OverflowInputStream.java | 9 + .../store/raw/data/PageBasicOperation.java | 4 + .../store/raw/data/PhysicalPageOperation.java | 1 + .../store/raw/data/PhysicalUndoOperation.java | 2 + .../impl/store/raw/data/PurgeOperation.java | 1 + .../impl/store/raw/data/RAFContainer.java | 73 ++++ .../impl/store/raw/data/RAFContainer4.java | 42 +++ .../derby/impl/store/raw/data/RFResource.java | 12 + .../derby/impl/store/raw/data/RawField.java | 1 + .../derby/impl/store/raw/data/RecordId.java | 2 + .../raw/data/SetReservedSpaceOperation.java | 1 + .../store/raw/data/StoredFieldHeader.java | 1 + .../derby/impl/store/raw/data/StoredPage.java | 12 + .../store/raw/data/StreamFileContainer.java | 17 + .../raw/data/StreamFileContainerHandle.java | 2 + .../impl/store/raw/data/TempRAFContainer.java | 1 + .../store/raw/data/UpdateFieldOperation.java | 1 + .../impl/store/raw/data/UpdateOperation.java | 2 + .../store/raw/log/CheckpointOperation.java | 1 + .../derby/impl/store/raw/log/FileLogger.java | 4 + .../impl/store/raw/log/FlushedScanHandle.java | 1 + .../impl/store/raw/log/LogAccessFile.java | 34 ++ .../store/raw/log/LogAccessFileBuffer.java | 2 + .../derby/impl/store/raw/log/LogCounter.java | 1 + .../derby/impl/store/raw/log/LogRecord.java | 2 + .../derby/impl/store/raw/log/LogToFile.java | 135 +++++++ .../derby/impl/store/raw/log/ReadOnly.java | 2 + .../apache/derby/impl/store/raw/log/Scan.java | 7 + .../impl/store/raw/xact/GlobalXactId.java | 2 + .../impl/store/raw/xact/InternalXact.java | 2 + .../impl/store/raw/xact/TransactionTable.java | 22 ++ .../store/raw/xact/TransactionTableEntry.java | 2 + .../derby/impl/store/raw/xact/Xact.java | 2 + .../impl/store/raw/xact/XactContext.java | 2 + .../impl/store/raw/xact/XactFactory.java | 29 ++ .../derby/impl/store/raw/xact/XactId.java | 1 + .../store/raw/xact/XactXAResourceManager.java | 4 + .../store/replication/ReplicationLogger.java | 2 + .../replication/buffer/LogBufferElement.java | 2 + .../buffer/ReplicationLogBuffer.java | 9 + .../master/AsynchronousLogShipper.java | 18 + .../replication/master/MasterController.java | 28 ++ .../net/ReplicationMessageReceive.java | 21 ++ .../net/ReplicationMessageTransmit.java | 16 + .../replication/net/SocketConnection.java | 1 + .../replication/slave/ReplicationLogScan.java | 2 + .../replication/slave/SlaveController.java | 28 ++ .../org/apache/derby/io/StorageFactory.java | 1 + .../org/apache/derby/mbeans/Management.java | 2 + .../org/apache/derby/mbeans/Version.java | 2 + .../apache/derby/osgi/EmbeddedActivator.java | 1 + .../derby/security/DatabasePermission.java | 2 + .../org/apache/derby/vti/ForeignTableVTI.java | 7 + .../org/apache/derby/vti/IQualifyable.java | 1 + .../org/apache/derby/vti/StringColumnVTI.java | 7 + .../derby/vti/UpdatableVTITemplate.java | 5 + .../apache/derby/vti/VTIMetaDataTemplate.java | 1 + .../org/apache/derby/vti/VTITemplate.java | 3 + .../org/apache/derby/vti/XmlVTI.java | 9 + .../derby/optional/api/LuceneUtils.java | 1 + .../derby/optional/api/SimpleJsonUtils.java | 7 + .../derby/optional/api/SimpleJsonVTI.java | 1 + .../derby/optional/dump/DataFileVTI.java | 2 + .../derby/optional/dump/RawDBReader.java | 25 ++ .../derby/optional/json/SimpleJsonTool.java | 6 + .../optional/lucene/DerbyIndexInput.java | 3 + .../optional/lucene/DerbyIndexOutput.java | 1 + .../derby/optional/lucene/DerbyLuceneDir.java | 13 + .../optional/lucene/LuceneListIndexesVTI.java | 24 +- .../derby/optional/lucene/LuceneQueryVTI.java | 43 +++ .../derby/optional/lucene/LuceneSupport.java | 99 +++++ .../org/apache/derby/run/run.java | 3 + .../org/apache/derby/drda/NetServlet.java | 83 +++++ .../derby/drda/NetworkServerControl.java | 27 ++ .../apache/derby/impl/drda/AppRequester.java | 15 + .../apache/derby/impl/drda/CcsidManager.java | 3 + .../derby/impl/drda/CharacterEncodings.java | 4 + .../apache/derby/impl/drda/ClientThread.java | 12 + .../org/apache/derby/impl/drda/CodePoint.java | 3 + .../derby/impl/drda/CodePointNameTable.java | 3 + .../derby/impl/drda/ConsistencyToken.java | 3 + .../org/apache/derby/impl/drda/DDMReader.java | 62 ++++ .../org/apache/derby/impl/drda/DDMWriter.java | 114 ++++++ .../derby/impl/drda/DRDAConnThread.java | 220 +++++++++++ .../impl/drda/DRDAProtocolException.java | 14 + .../impl/drda/DRDAProtocolExceptionInfo.java | 3 + .../apache/derby/impl/drda/DRDAResultSet.java | 12 + .../apache/derby/impl/drda/DRDAStatement.java | 4 + .../apache/derby/impl/drda/DRDAString.java | 4 + .../derby/impl/drda/DRDAXAProtocol.java | 15 + .../org/apache/derby/impl/drda/DRDAXid.java | 2 + .../org/apache/derby/impl/drda/Database.java | 13 + .../derby/impl/drda/DecryptionManager.java | 3 + .../apache/derby/impl/drda/DssConstants.java | 1 + .../org/apache/derby/impl/drda/DssTrace.java | 7 + .../derby/impl/drda/EXTDTAInputStream.java | 34 ++ .../impl/drda/EXTDTAReaderInputStream.java | 1 + .../derby/impl/drda/EbcdicCcsidManager.java | 7 + .../derby/impl/drda/FdocaConstants.java | 5 + ...LayerBStreamedEXTDTAReaderInputStream.java | 4 + .../impl/drda/NetworkServerControlImpl.java | 18 + .../impl/drda/NetworkServerMBeanImpl.java | 26 ++ .../org/apache/derby/impl/drda/Pkgnamcsn.java | 2 + .../derby/impl/drda/ReEncodedInputStream.java | 2 + .../org/apache/derby/impl/drda/SQLTypes.java | 9 + .../org/apache/derby/impl/drda/Session.java | 9 + .../apache/derby/impl/drda/SignedBinary.java | 1 + .../drda/StandardEXTDTAReaderInputStream.java | 5 + .../derby/impl/drda/Utf8CcsidManager.java | 5 + .../apache/derby/impl/drda/XADatabase.java | 9 + .../org/apache/derby/impl/drda/memCheck.java | 1 + .../harness/BackgroundStreamDrainer.java | 1 + .../functionTests/harness/CopySuppFiles.java | 2 + .../functionTests/harness/FileCompare.java | 5 + .../functionTests/harness/HandleResult.java | 4 + .../harness/JavaVersionHolder.java | 7 + .../functionTests/harness/MultiTest.java | 6 + .../functionTests/harness/NetServer.java | 25 ++ .../harness/ProcessStreamResult.java | 6 + .../functionTests/harness/RunClass.java | 1 + .../functionTests/harness/RunList.java | 32 ++ .../functionTests/harness/RunSuite.java | 16 + .../functionTests/harness/RunTest.java | 114 ++++++ .../functionTests/harness/Sed.java | 33 ++ .../functionTests/harness/SimpleDiff.java | 4 + .../functionTests/harness/SkipTest.java | 1 + .../functionTests/harness/SpecialFlags.java | 1 + .../functionTests/harness/SysInfoLog.java | 3 + .../functionTests/harness/currentjvm.java | 1 + .../functionTests/harness/dbcleanup.java | 6 + .../functionTests/harness/ibm13.java | 1 + .../functionTests/harness/ibm14.java | 1 + .../functionTests/harness/ibm15.java | 1 + .../functionTests/harness/ibm16.java | 1 + .../functionTests/harness/ibm17.java | 1 + .../functionTests/harness/ibm18.java | 1 + .../functionTests/harness/j9_13.java | 1 + .../functionTests/harness/j9_22.java | 1 + .../functionTests/harness/j9_foundation.java | 1 + .../harness/j9_foundation11.java | 4 + .../functionTests/harness/j9dee15.java | 1 + .../functionTests/harness/jdk110.java | 1 + .../functionTests/harness/jdk13.java | 2 + .../functionTests/harness/jdk14.java | 1 + .../functionTests/harness/jdk15.java | 1 + .../functionTests/harness/jdk16.java | 1 + .../functionTests/harness/jdk17.java | 1 + .../functionTests/harness/jdk18.java | 1 + .../functionTests/harness/jdk19.java | 1 + .../functionTests/harness/jvm.java | 12 + .../functionTests/harness/shutdown.java | 1 + .../functionTests/suites/AllPackages.java | 11 + .../functionTests/suites/EncryptionSuite.java | 3 + .../functionTests/suites/XMLSuite.java | 4 + .../SerializeDataSources.java | 7 + .../AbstractCompatibilityTest.java | 2 + .../ClientCompatibilityRunControl.java | 2 + .../ClientCompatibilitySuite.java | 1 + .../tests/compatibility/JDBCDriverTest.java | 11 + .../VersionCombinationConfigurator.java | 6 + .../VersionedNetworkServerTestSetup.java | 4 + .../tests/compatibility/_Suite.java | 5 + .../tests/demo/CheckToursDBTest.java | 4 + .../functionTests/tests/demo/_Suite.java | 1 + .../tests/derbynet/BadConnectionTest.java | 3 + .../derbynet/ByteArrayCombinerStreamTest.java | 16 + .../tests/derbynet/CheckSecurityManager.java | 1 + .../ClientSideSystemPropertiesTest.java | 2 + .../tests/derbynet/DRDAProtocolTest.java | 3 + .../tests/derbynet/DerbyNetAutoStartTest.java | 7 + .../tests/derbynet/DerbyNetNewServerTest.java | 3 + .../derbynet/GetCurrentPropertiesTest.java | 7 + .../derbynet/NSSecurityMechanismTest.java | 36 ++ .../tests/derbynet/NSinSameJVMTest.java | 1 + .../tests/derbynet/NetHarnessJavaTest.java | 1 + .../tests/derbynet/NetIjTest.java | 7 + .../derbynet/NetworkServerControlApiTest.java | 19 + ...NetworkServerControlClientCommandTest.java | 5 + .../tests/derbynet/OutBufferedStreamTest.java | 4 +- .../tests/derbynet/PrepareStatementTest.java | 9 + .../tests/derbynet/ProtocolTest.java | 3 + .../tests/derbynet/RuntimeInfoTest.java | 8 + .../functionTests/tests/derbynet/SSLTest.java | 3 + .../tests/derbynet/SecureServerTest.java | 35 ++ .../tests/derbynet/ServerPropertiesTest.java | 34 ++ .../ShutDownDBWhenNSShutsDownTest.java | 12 + .../tests/derbynet/SqlExceptionTest.java | 3 + .../derbynet/SuicideOfStreamingTest.java | 2 + .../tests/derbynet/SysinfoTest.java | 11 + .../derbynet/Utf8CcsidManagerClientTest.java | 3 + .../tests/derbynet/Utf8CcsidManagerTest.java | 1 + .../functionTests/tests/derbynet/_Suite.java | 25 ++ .../tests/derbynet/dblook_test_net.java | 2 + .../tests/engine/ErrorStreamTest.java | 24 ++ .../tests/engine/LockInterruptTest.java | 4 + .../tests/engine/ModuleLoadingTest.java | 3 + .../tests/engine/ReadMeFilesTest.java | 1 + .../RestrictiveFilePermissionsTest.java | 23 ++ ...utdownWithoutDeregisterPermissionTest.java | 1 + .../functionTests/tests/engine/_Suite.java | 2 + .../tests/i18n/DefaultLocale.java | 3 + .../tests/i18n/I18NImportExport.java | 1 + .../tests/i18n/JapanCodeConversionTest.java | 1 + .../i18n/LocalizedAttributeScriptTest.java | 4 + .../i18n/LocalizedDisplayScriptTest.java | 5 + .../tests/i18n/UrlLocaleTest.java | 15 + .../functionTests/tests/i18n/_Suite.java | 4 + .../functionTests/tests/jdbc4/AbortTest.java | 3 + .../tests/jdbc4/BlobClobTestSetup.java | 3 + .../tests/jdbc4/BlobSetMethodsTest.java | 2 + .../functionTests/tests/jdbc4/BlobTest.java | 22 ++ .../tests/jdbc4/CallableStatementTest.java | 28 ++ .../functionTests/tests/jdbc4/ClobTest.java | 22 ++ .../tests/jdbc4/ConnectionMethodsTest.java | 18 + .../tests/jdbc4/ConnectionTest.java | 23 ++ .../tests/jdbc4/DataSourceTest.java | 10 + .../tests/jdbc4/Derby2017LayerBTest.java | 4 + .../tests/jdbc4/Derby3650Test.java | 2 + .../tests/jdbc4/Driver40Test.java | 1 + .../tests/jdbc4/Driver40UnbootedTest.java | 3 + .../jdbc4/JDBC4FromJDBC3DataSourceTest.java | 2 + .../tests/jdbc4/LobSortTest.java | 3 + .../tests/jdbc4/LobStreamTest.java | 22 ++ .../tests/jdbc4/LoginTimeoutTest.java | 11 + .../jdbc4/ParameterMetaDataWrapperTest.java | 5 + .../tests/jdbc4/PreparedStatementTest.java | 44 +++ .../tests/jdbc4/PreparedStatementTest42.java | 16 + .../tests/jdbc4/ResultSetMetaDataTest.java | 5 + .../tests/jdbc4/ResultSetTest.java | 58 +++ .../tests/jdbc4/RowIdNotImplementedTest.java | 3 + .../tests/jdbc4/SetObjectUnsupportedTest.java | 6 + .../tests/jdbc4/StatementEventsTest.java | 14 + .../tests/jdbc4/StatementTest.java | 37 ++ .../tests/jdbc4/StatementTestSetup.java | 2 + .../tests/jdbc4/TestDbMetaData.java | 20 + .../tests/jdbc4/TestJDBC40Exception.java | 4 + .../tests/jdbc4/UnsupportedVetter.java | 50 +++ .../tests/jdbc4/VerifySignatures.java | 18 + .../functionTests/tests/jdbc4/Wrapper41.java | 4 + .../tests/jdbc4/Wrapper41Conn.java | 5 + .../tests/jdbc4/Wrapper41DataSource.java | 5 + .../tests/jdbc4/Wrapper41Driver.java | 7 + .../tests/jdbc4/Wrapper41Test.java | 41 +++ .../functionTests/tests/jdbc4/XA40Test.java | 12 + .../functionTests/tests/jdbc4/_Suite.java | 15 + .../tests/jdbcapi/AuthenticationTest.java | 44 +++ .../tests/jdbcapi/AutoGenJDBC30Test.java | 14 + .../tests/jdbcapi/AutoloadTest.java | 31 ++ .../tests/jdbcapi/BLOBDataModelSetup.java | 9 + .../functionTests/tests/jdbcapi/BLOBTest.java | 28 ++ .../tests/jdbcapi/BatchUpdateTest.java | 60 +++ .../tests/jdbcapi/BlobClob4BlobTest.java | 81 +++++ .../jdbcapi/BlobStoredProcedureTest.java | 8 + .../jdbcapi/BlobUpdatableStreamTest.java | 3 + .../tests/jdbcapi/CacheSessionDataTest.java | 9 + .../tests/jdbcapi/CallableTest.java | 12 + .../tests/jdbcapi/CharacterStreamsTest.java | 6 + .../ClientConnectionPoolDataSourceTest.java | 6 + .../jdbcapi/ClobStoredProcedureTest.java | 5 + .../functionTests/tests/jdbcapi/ClobTest.java | 13 + .../jdbcapi/ClobUpdatableReaderTest.java | 8 + .../tests/jdbcapi/ClosedObjectTest.java | 30 ++ .../jdbcapi/Compat_BlobClob4BlobTest.java | 1 + .../tests/jdbcapi/ConcurrencyTest.java | 81 +++++ .../tests/jdbcapi/ConcurrentAutoloadTest.java | 2 + .../tests/jdbcapi/DMDBugsTest.java | 1 + .../tests/jdbcapi/DSCreateShutdownDBTest.java | 9 + .../jdbcapi/DataSourcePropertiesTest.java | 21 ++ .../jdbcapi/DataSourceReferenceTest.java | 13 + .../jdbcapi/DataSourceSerializationTest.java | 23 ++ .../tests/jdbcapi/DataSourceTest.java | 23 ++ .../tests/jdbcapi/DatabaseMetaDataTest.java | 188 ++++++++++ .../tests/jdbcapi/DboPowersTest.java | 28 ++ .../tests/jdbcapi/Derby2017LayerATest.java | 6 + .../tests/jdbcapi/Derby5158Test.java | 1 + .../tests/jdbcapi/Derby5165Test.java | 8 + .../jdbcapi/DriverMgrAuthenticationTest.java | 5 + .../tests/jdbcapi/DriverTest.java | 21 ++ .../tests/jdbcapi/HoldabilityTest.java | 81 +++++ .../jdbcapi/InternationalConnectTest.java | 15 + .../InvalidLDAPServerAuthenticationTest.java | 4 + .../tests/jdbcapi/J2EEDataSourceTest.java | 94 +++++ .../jdbcapi/JDBCDriversEmbeddedTest.java | 2 + .../jdbcapi/JDBCDriversPropertyTest.java | 2 + .../tests/jdbcapi/JDBCHarnessJavaTest.java | 2 + .../tests/jdbcapi/LDAPAuthenticationTest.java | 7 + .../tests/jdbcapi/LargeDataLocksTest.java | 9 + .../tests/jdbcapi/LobLengthTest.java | 5 + .../tests/jdbcapi/LobRsGetterTest.java | 7 + .../tests/jdbcapi/LobStreamsTest.java | 31 ++ .../tests/jdbcapi/NullSQLTextTest.java | 3 + .../tests/jdbcapi/ParameterMappingTest.java | 177 +++++++++ .../jdbcapi/ParameterMetaDataJdbc30Test.java | 20 + .../jdbcapi/PoolDSAuthenticationTest.java | 8 + .../jdbcapi/PoolXADSCreateShutdownDBTest.java | 2 + .../tests/jdbcapi/PrepStmtMetaDataTest.java | 9 + .../tests/jdbcapi/PrepStmtNullTest.java | 2 + .../tests/jdbcapi/ProcedureTest.java | 45 +++ .../tests/jdbcapi/RelativeTest.java | 4 + .../tests/jdbcapi/ResultSetCloseTest.java | 3 + .../tests/jdbcapi/ResultSetJDBC30Test.java | 9 + .../tests/jdbcapi/ResultSetMiscTest.java | 8 + .../tests/jdbcapi/ResultSetStreamTest.java | 7 + .../tests/jdbcapi/SURBaseTest.java | 9 + .../tests/jdbcapi/SURDataModelSetup.java | 10 + .../tests/jdbcapi/SURQueryMixTest.java | 23 ++ .../functionTests/tests/jdbcapi/SURTest.java | 172 +++++++++ .../tests/jdbcapi/SURijTest.java | 1 + .../tests/jdbcapi/SavepointJdbc30Test.java | 9 + .../tests/jdbcapi/ScrollResultSetTest.java | 8 + .../tests/jdbcapi/SetQueryTimeoutTest.java | 19 + .../jdbcapi/SetTransactionIsolationTest.java | 2 + .../tests/jdbcapi/StatementJdbc20Test.java | 11 + .../tests/jdbcapi/StatementJdbc30Test.java | 15 + .../tests/jdbcapi/StatementPoolingTest.java | 18 + .../tests/jdbcapi/StreamTest.java | 5 +- .../tests/jdbcapi/URCoveringIndexTest.java | 5 + .../tests/jdbcapi/UpdatableResultSetTest.java | 4 + .../tests/jdbcapi/UpdateXXXTest.java | 5 + .../tests/jdbcapi/Wrapper41DBMD.java | 1 + .../tests/jdbcapi/Wrapper41Statement.java | 1 + .../tests/jdbcapi/Wrapper42DBMD.java | 1 + .../tests/jdbcapi/XADSAuthenticationTest.java | 8 + .../tests/jdbcapi/XAJNDITest.java | 7 + .../functionTests/tests/jdbcapi/XATest.java | 66 ++++ .../tests/jdbcapi/XATransactionTest.java | 13 + .../functionTests/tests/jdbcapi/_Suite.java | 64 ++++ .../tests/jdbcapi/connectionJdbc20.java | 3 + .../tests/jdbcapi/maxfieldsize.java | 1 + .../tests/jdbcapi/metadataMultiConnTest.java | 1 + .../tests/jdbcapi/resultsetJdbc20.java | 2 + .../tests/jdbcapi/rsgetXXXcolumnNames.java | 2 + .../tests/lang/AggBuiltinTest.java | 4 + .../tests/lang/AggregateClassLoadingTest.java | 1 + .../tests/lang/AlterTableTest.java | 106 ++++++ .../tests/lang/AnsiSignatures.java | 1 + .../tests/lang/AnsiSignaturesTest.java | 8 + .../tests/lang/AnsiTrimTest.java | 3 + .../tests/lang/ArithmeticTest.java | 9 + .../tests/lang/AutoIncrementTest.java | 43 +++ .../tests/lang/AwareVTITest.java | 4 + .../functionTests/tests/lang/BigDataTest.java | 2 + .../tests/lang/BooleanValuesTest.java | 31 ++ .../functionTests/tests/lang/Bug5054Test.java | 1 + .../tests/lang/CaseExpressionTest.java | 3 + .../functionTests/tests/lang/CastingTest.java | 26 ++ .../tests/lang/CharUTF8Test.java | 2 + .../tests/lang/CheckConstraintTest.java | 28 ++ .../tests/lang/CoalesceTest.java | 23 ++ .../tests/lang/CollationTest.java | 74 ++++ .../tests/lang/CollationTest2.java | 36 ++ .../tests/lang/ColumnDefaultsTest.java | 15 + .../functionTests/tests/lang/CommentTest.java | 5 + .../tests/lang/CompressTableTest.java | 3 + .../lang/ConcurrentImplicitCreateSchema.java | 1 + .../tests/lang/ConglomerateSharingTest.java | 5 + .../functionTests/tests/lang/ConnectTest.java | 1 + .../lang/ConstraintCharacteristicsTest.java | 132 +++++++ .../tests/lang/CreateTableFromQueryTest.java | 14 + .../tests/lang/CurrentOfTest.java | 16 + .../tests/lang/CurrentSchemaTest.java | 1 + .../functionTests/tests/lang/CursorTest.java | 2 + .../tests/lang/DB2IsolationLevelsTest.java | 1 + .../functionTests/tests/lang/DBInJarTest.java | 2 + .../tests/lang/DBOAccessTest.java | 18 + .../tests/lang/DatabaseClassLoadingTest.java | 23 ++ .../tests/lang/DateTimeTest.java | 2 + .../tests/lang/DeadlockDetectionTest.java | 4 + .../tests/lang/DeadlockModeTest.java | 5 + .../DeclareGlobalTempTableJavaJDBC30Test.java | 2 + .../lang/DeclareGlobalTempTableJavaTest.java | 4 + .../tests/lang/Derby5005Test.java | 2 + .../functionTests/tests/lang/Derby5652.java | 1 + .../tests/lang/Derby6587Test.java | 1 + .../tests/lang/Derby6725GetDatabaseName.java | 1 + .../tests/lang/DistinctTest.java | 4 + .../tests/lang/DropTableTest.java | 2 + .../tests/lang/DummyOptTrace.java | 1 + .../lang/DynamicLikeOptimizationTest.java | 6 + .../tests/lang/ErrorCodeTest.java | 32 ++ .../tests/lang/ErrorMessageTest.java | 2 + .../tests/lang/ExistsWithSubqueriesTest.java | 1 + .../tests/lang/ForBitDataTest.java | 3 + .../tests/lang/ForUpdateTest.java | 3 + .../tests/lang/ForeignKeysDeferrableTest.java | 9 + .../tests/lang/FullCollationTests.java | 1 + .../tests/lang/GeneratedColumnsHelper.java | 2 + .../tests/lang/GeneratedColumnsPermsTest.java | 13 + .../tests/lang/GeneratedColumnsTest.java | 30 ++ .../tests/lang/GetPropertyInfoTest.java | 3 + .../tests/lang/GrantRevokeDDLTest.java | 305 ++++++++++++++++ .../tests/lang/GrantRevokeTest.java | 36 ++ .../tests/lang/GroupByExpressionTest.java | 7 + .../functionTests/tests/lang/GroupByTest.java | 18 + .../tests/lang/HalfCreatedDatabaseTest.java | 2 + .../tests/lang/HoldCursorTest.java | 2 + .../tests/lang/IdentitySequenceTest.java | 12 + .../tests/lang/InListMultiProbeTest.java | 11 + .../tests/lang/InPredicateTest.java | 1 + .../tests/lang/InbetweenTest.java | 30 ++ .../functionTests/tests/lang/JitTest.java | 4 + .../functionTests/tests/lang/JoinTest.java | 11 + .../functionTests/tests/lang/JsonSuite.java | 1 + .../tests/lang/LangHarnessJavaTest.java | 4 + .../tests/lang/LangProcedureTest.java | 74 ++++ .../functionTests/tests/lang/LangScripts.java | 8 + .../lang/LazyDefaultSchemaCreationTest.java | 4 + .../tests/lang/LojReorderTest.java | 1 + .../tests/lang/LuceneBackupTest.java | 2 + .../lang/LuceneCoarseAuthorizationTest.java | 13 + .../tests/lang/LuceneCollationTest.java | 2 + .../tests/lang/LuceneInMemoryTest.java | 4 + .../tests/lang/LuceneJarLoadingTest.java | 2 + .../functionTests/tests/lang/LuceneSuite.java | 6 + .../tests/lang/LuceneSupportPermsTest.java | 70 ++++ .../tests/lang/LuceneSupportTest.java | 20 + .../tests/lang/MathTrigFunctionsTest.java | 56 +++ .../tests/lang/MergeStatementTest.java | 27 ++ .../lang/NativeAuthenticationServiceTest.java | 21 ++ .../tests/lang/NestedCommitTest.java | 2 + .../tests/lang/NestedWhereSubqueryTest.java | 4 +- .../tests/lang/NewOptimizerOverridesTest.java | 12 + .../lang/NoDBInternalsPermissionTest.java | 5 + .../functionTests/tests/lang/NullIfTest.java | 7 + .../lang/NullableUniqueConstraintTest.java | 1 + .../functionTests/tests/lang/NullsTest.java | 2 + .../functionTests/tests/lang/OLAPTest.java | 19 + .../tests/lang/OffsetFetchNextTest.java | 19 + .../tests/lang/OptionalToolsTest.java | 5 + .../OrderByAndOffsetFetchInSubqueries.java | 6 + .../tests/lang/OrderByAndSortAvoidance.java | 35 ++ .../tests/lang/OuterJoinTest.java | 6 + .../tests/lang/PredicatePushdownTest.java | 43 +++ .../tests/lang/PredicateTest.java | 1 + .../tests/lang/PrepareExecuteDDL.java | 4 + .../tests/lang/PrimaryKeyTest.java | 2 + .../tests/lang/ProcedureInTriggerTest.java | 23 ++ .../functionTests/tests/lang/RSMDWrapper.java | 1 + .../tests/lang/RawDBReaderTest.java | 7 + .../tests/lang/ReferentialActionsTest.java | 1 + .../tests/lang/ReleaseCompileLocksTest.java | 7 + .../tests/lang/RenameTableTest.java | 1 + .../ResultSetsFromPreparedStatementTest.java | 13 + .../lang/RolesConferredPrivilegesTest.java | 33 ++ .../functionTests/tests/lang/RolesTest.java | 70 ++++ .../functionTests/tests/lang/RoutineTest.java | 16 + .../lang/RoutinesDefinersRightsTest.java | 6 + .../functionTests/tests/lang/SGVetter.java | 1 + .../tests/lang/SQLAuthorizationPropTest.java | 4 + .../tests/lang/SQLSessionContextTest.java | 6 + .../tests/lang/ScrollCursors1Test.java | 6 + .../tests/lang/ScrollCursors2Test.java | 3 + .../lang/SecurityPolicyReloadingTest.java | 10 + .../tests/lang/SelectivityTest.java | 57 +++ .../tests/lang/SequenceGeneratorTest.java | 7 + .../tests/lang/SequencePermsTest.java | 1 + .../tests/lang/SequenceTest.java | 7 + .../tests/lang/ShutdownDatabaseTest.java | 2 + .../tests/lang/SimpleJsonTest.java | 6 + .../tests/lang/SpillHashTest.java | 2 + .../tests/lang/StalePlansTest.java | 6 + .../tests/lang/StatementPlanCacheTest.java | 4 + .../functionTests/tests/lang/StreamsTest.java | 1 + .../tests/lang/StringArrayVTI.java | 3 + .../tests/lang/SubqueryTest.java | 1 + .../functionTests/tests/lang/SynonymTest.java | 1 + .../tests/lang/SysDiagVTIMappingTest.java | 6 + .../tests/lang/SystemCatalogTest.java | 10 + .../tests/lang/TableFunctionTest.java | 51 +++ .../functionTests/tests/lang/TableVTI.java | 1 + .../functionTests/tests/lang/Test_6496.java | 1 + .../tests/lang/TimeHandlingTest.java | 18 + .../tests/lang/TimestampArithTest.java | 8 + .../tests/lang/TriggerGeneralTest.java | 3 + .../functionTests/tests/lang/TriggerTest.java | 21 ++ .../tests/lang/TriggerWhenClauseTest.java | 1 + .../TruncateTableAndOnlineBackupTest.java | 2 + .../tests/lang/TruncateTableTest.java | 5 + .../tests/lang/UDAPermsTest.java | 3 + .../tests/lang/UDTPermsTest.java | 2 + .../functionTests/tests/lang/UDTTest.java | 18 + .../lang/UnaryArithmeticParameterTest.java | 10 + .../lang/UngroupedAggregatesNegativeTest.java | 1 + .../UniqueConstraintMultiThreadedTest.java | 3 + .../lang/UniqueConstraintSetNullTest.java | 2 + .../tests/lang/UpdatableResultSetTest.java | 28 ++ .../tests/lang/UpdateCursorTest.java | 5 + .../tests/lang/UpdateStatisticsTest.java | 20 + .../tests/lang/UserDefinedAggregatesTest.java | 2 + .../functionTests/tests/lang/UserLobTest.java | 1 + .../functionTests/tests/lang/VTITest.java | 2 + .../functionTests/tests/lang/VarargsTest.java | 1 + .../tests/lang/VetJigsawTest.java | 5 + .../functionTests/tests/lang/ViewsTest.java | 5 + .../tests/lang/WarehouseVTI.java | 2 +- .../tests/lang/XMLBindingTest.java | 4 + .../tests/lang/XMLConcurrencyTest.java | 1 + .../tests/lang/XMLMissingClassesTest.java | 2 + .../tests/lang/XMLOptimizerTraceTest.java | 10 + .../tests/lang/XMLTypeAndOpsTest.java | 30 ++ .../functionTests/tests/lang/XMLXXETest.java | 6 + .../tests/lang/XplainStatisticsTest.java | 85 +++++ .../functionTests/tests/lang/_Suite.java | 50 +++ .../tests/lang/dbManagerLimits.java | 7 + .../functionTests/tests/lang/dbjarUtil.java | 1 + .../tests/lang/largeCodeGen.java | 3 + .../functionTests/tests/lang/outparams.java | 40 ++ .../functionTests/tests/lang/outparams30.java | 1 + .../tests/lang/simpleThread.java | 2 + .../tests/lang/userDefMethods.java | 3 + .../functionTests/tests/lang/wisconsin.java | 14 + .../tests/largedata/Derby5624Test.java | 344 +++++++++--------- .../tests/largedata/Derby6317Test.java | 5 + .../tests/largedata/LobLimitsLiteTest.java | 1 + .../tests/largedata/LobLimitsTest.java | 37 ++ .../functionTests/tests/largedata/_Suite.java | 1 + .../management/CacheManagerMBeanTest.java | 6 + .../tests/management/JDBCMBeanTest.java | 3 + .../management/JMXConnectionDecorator.java | 2 + .../tests/management/JMXConnectionGetter.java | 2 + .../tests/management/JMXTest.java | 3 + .../tests/management/MBeanTest.java | 32 ++ .../tests/management/ManagementMBeanTest.java | 3 + .../management/NetworkServerMBeanTest.java | 2 + .../management/PlatformConnectionGetter.java | 1 + .../management/RemoteConnectionGetter.java | 3 + .../tests/management/VersionMBeanTest.java | 6 + .../tests/management/_Suite.java | 11 + .../tests/memory/BlobMemTest.java | 6 + .../tests/memory/ClobMemTest.java | 10 + .../tests/memory/ConnectionHandling.java | 10 +- .../tests/memory/ConnectionHandlingJunit.java | 10 + .../tests/memory/Derby5730Test.java | 2 + .../tests/memory/MemoryLeakFixesTest.java | 4 + .../tests/memory/MultiByteClobTest.java | 6 + .../tests/memory/RolesDependencyTest.java | 1 + .../tests/memory/TriggerTests.java | 36 ++ .../functionTests/tests/memory/XAMemTest.java | 3 + .../functionTests/tests/memory/_Suite.java | 5 + .../tests/memorydb/BasicInMemoryDbTest.java | 21 ++ .../tests/memorydb/Derby6662Test.java | 3 + .../memorydb/DropWhileConnectingTest.java | 2 + .../tests/memorydb/MemoryDbManager.java | 2 + .../functionTests/tests/memorydb/MogTest.java | 7 + .../functionTests/tests/memorydb/_Suite.java | 3 + .../tests/multi/StressMulti10x1.java | 1 + .../tests/multi/StressMulti50x59.java | 1 + .../tests/multi/StressMultiTest.java | 16 + .../functionTests/tests/nist/NistScripts.java | 4 + .../Derby5937SlaveShutdownTest.java | 1 + .../replicationTests/DestroySlaveDB.java | 1 + .../tests/replicationTests/KillMaster.java | 2 + .../tests/replicationTests/KillSlave.java | 1 + .../replicationTests/ReplicationRun.java | 168 +++++++++ .../ReplicationRun_CleanUp.java | 1 + .../ReplicationRun_Distributed.java | 10 + .../replicationTests/ReplicationRun_Full.java | 12 + .../ReplicationRun_Local.java | 7 + .../ReplicationRun_Local_1.java | 4 + .../ReplicationRun_Local_1Indexing.java | 2 + .../ReplicationRun_Local_3.java | 6 + .../ReplicationRun_Local_3_p1.java | 6 + .../ReplicationRun_Local_3_p2.java | 2 + .../ReplicationRun_Local_3_p3.java | 7 + .../ReplicationRun_Local_3_p4.java | 7 + .../ReplicationRun_Local_3_p5.java | 4 + .../ReplicationRun_Local_3_p6.java | 3 + .../ReplicationRun_Local_Derby4910.java | 2 + .../ReplicationRun_Local_Encrypted_1.java | 2 + .../ReplicationRun_Local_StateTest_part1.java | 20 + ...eplicationRun_Local_StateTest_part1_1.java | 7 + ...eplicationRun_Local_StateTest_part1_2.java | 19 + ...eplicationRun_Local_StateTest_part1_3.java | 5 + .../ReplicationRun_Local_StateTest_part2.java | 18 + .../ReplicationRun_Local_showStateChange.java | 2 + .../replicationTests/ReplicationSuite.java | 9 + .../replicationTests/ReplicationTestRun.java | 2 + .../ReplicationTestRun_Verify.java | 1 + .../replicationTests/ShutdownMaster.java | 1 + .../replicationTests/ShutdownMasterDb.java | 1 + .../ShutdownMasterServer.java | 1 + .../ShutdownMasterServerByOsKill.java | 1 + .../ShutdownMasterServerViaNwSrvCtrl.java | 1 + .../tests/replicationTests/ShutdownSlave.java | 2 + .../replicationTests/ShutdownSlaveDb.java | 1 + .../replicationTests/ShutdownSlaveServer.java | 1 + .../ShutdownSlaveServerByOsKill.java | 1 + .../ShutdownSlaveServerViaNwSrvCtrl.java | 1 + .../replicationTests/SimplePerfTest.java | 9 + .../SimplePerfTest_Verify.java | 4 + ...estPostStartedMasterAndSlave_Failover.java | 1 + ...tPostStartedMasterAndSlave_StopMaster.java | 1 + ...stPostStartedMasterAndSlave_StopSlave.java | 1 + .../TestPostStoppedSlaveServer.java | 1 + .../replicationTests/TestPreInitSlave.java | 1 + .../TestPreStartedMaster.java | 2 + .../TestPreStartedMasterServer.java | 1 + .../replicationTests/TestPreStartedSlave.java | 1 + .../TestPreStartedSlaveServer.java | 1 + .../TestPreStoppedMaster.java | 1 + .../TestPreStoppedMasterServer.java | 1 + .../replicationTests/TestPreStoppedSlave.java | 1 + .../TestPreStoppedSlaveServer.java | 1 + .../tests/replicationTests/Utils.java | 5 + .../functionTests/tests/store/AccessTest.java | 4 + .../AutomaticIndexStatisticsMultiTest.java | 12 + .../store/AutomaticIndexStatisticsTest.java | 15 + .../tests/store/BTreeMaxScanTest.java | 1 + .../tests/store/BackupRestoreTest.java | 1 + .../functionTests/tests/store/BaseTest.java | 12 + .../functionTests/tests/store/Beetle6038.java | 3 + .../tests/store/BootAllTest.java | 8 + .../tests/store/BootLockMinion.java | 3 + .../tests/store/BootLockTest.java | 11 + .../tests/store/ClassLoaderBootTest.java | 7 + .../tests/store/ClobReclamationTest.java | 2 + .../tests/store/CryptoCrashRecoveryTest.java | 6 + .../tests/store/DecryptDatabaseTest.java | 2 + .../tests/store/Derby3625Test.java | 2 + .../tests/store/Derby3980DeadlockTest.java | 4 + .../tests/store/Derby4577Test.java | 3 + .../tests/store/Derby4676Test.java | 2 + .../tests/store/Derby4923Test.java | 2 + .../tests/store/EncryptDatabaseTest.java | 1 + .../tests/store/EncryptionAESTest.java | 4 + .../tests/store/EncryptionKeyAESTest.java | 1 + .../tests/store/EncryptionKeyTest.java | 21 ++ .../tests/store/HoldCursorJDBC30Test.java | 1 + .../tests/store/IndexSplitDeadlockTest.java | 9 + .../tests/store/InterruptResilienceTest.java | 26 ++ .../KeepDisposableStatsPropertyTest.java | 6 + .../tests/store/LiveLockTest.java | 1 + .../tests/store/LockTableVtiTest.java | 1 + .../tests/store/LongColumnTest.java | 2 + .../tests/store/MadhareTest.java | 2 + .../tests/store/MaxLogNumberRecovery.java | 1 + .../tests/store/OCRecoveryTest.java | 5 + .../tests/store/OSReadOnlyTest.java | 17 + .../tests/store/OfflineBackupTest.java | 1 + .../tests/store/OnlineBackup.java | 7 + .../tests/store/OnlineBackupTest1.java | 13 + .../tests/store/OnlineBackupTest3.java | 24 ++ .../tests/store/OnlineCompressTest.java | 31 ++ .../store/PositionedStoreStreamTest.java | 2 + .../tests/store/RecoveryAfterBackup.java | 3 + .../tests/store/RecoveryTest.java | 1 + .../tests/store/RowLockBasicTest.java | 2 + .../store/ServicePropertiesFileTest.java | 5 + .../tests/store/StoreScriptsTest.java | 5 + .../tests/store/StreamingColumnTest.java | 6 + .../tests/store/TableLockBasicTest.java | 7 + .../tests/store/TestDiskHashtable.java | 8 + .../tests/store/TestDurabilityProperty.java | 1 + .../tests/store/UpdateLocksTest.java | 54 +++ .../functionTests/tests/store/_Suite.java | 29 ++ .../tests/store/backupRestore1.java | 9 + .../tests/storetests/st_derby1939.java | 7 + .../tests/storetests/st_derby715.java | 3 + .../tests/storetests/st_reclaim_longcol.java | 15 + .../tools/ConnectWrongSubprotocolTest.java | 4 + .../tests/tools/IJRunScriptTest.java | 3 + .../tests/tools/IjConnNameTest.java | 2 + .../tests/tools/IjSecurityManagerTest.java | 3 + .../tests/tools/ImportExportBaseTest.java | 4 + .../tools/ImportExportBinaryDataTest.java | 15 + .../tests/tools/ImportExportIJTest.java | 3 + .../tests/tools/ImportExportLobTest.java | 33 ++ .../tools/ImportExportProcedureTest.java | 12 + .../tests/tools/ImportExportTest.java | 19 + .../RollBackWrappingWhenFailOnImportTest.java | 3 + .../tests/tools/SysinfoAPITest.java | 2 + .../tests/tools/SysinfoCPCheckTest.java | 15 + .../tests/tools/SysinfoLocaleTest.java | 12 + .../functionTests/tests/tools/Test_6661.java | 2 + .../tests/tools/ToolScripts.java | 10 + .../functionTests/tests/tools/_Suite.java | 15 + .../tests/tools/dblook_test.java | 43 +++ .../tests/tools/derbyrunjartest.java | 10 + .../functionTests/tests/tools/ij2Test.java | 2 + .../functionTests/tests/tools/ij5Test.java | 1 + .../tests/upgradeTests/BasicSetup.java | 34 ++ .../tests/upgradeTests/Changes10_1.java | 3 + .../tests/upgradeTests/Changes10_10.java | 3 + .../tests/upgradeTests/Changes10_11.java | 7 + .../tests/upgradeTests/Changes10_13.java | 4 + .../tests/upgradeTests/Changes10_2.java | 7 + .../tests/upgradeTests/Changes10_3.java | 12 + .../tests/upgradeTests/Changes10_4.java | 6 + .../tests/upgradeTests/Changes10_5.java | 3 + .../tests/upgradeTests/Changes10_6.java | 2 + .../tests/upgradeTests/Changes10_7.java | 3 + .../tests/upgradeTests/Changes10_9.java | 20 + .../tests/upgradeTests/OldVersions.java | 18 + .../tests/upgradeTests/PhaseChanger.java | 14 + .../tests/upgradeTests/UpgradeChange.java | 5 + .../upgradeTests/UpgradeClassLoader.java | 8 + .../tests/upgradeTests/UpgradeRun.java | 35 ++ .../upgradeTests/UpgradeTrajectoryTest.java | 23 ++ .../tests/upgradeTests/Version.java | 3 + .../tests/upgradeTests/_Suite.java | 5 + .../helpers/DisposableIndexStatistics.java | 13 + .../functionTests/util/BigDecimalHandler.java | 10 + .../functionTests/util/CanonTestCase.java | 5 + .../functionTests/util/DerbyJUnitTest.java | 9 + .../functionTests/util/FTFileUtil.java | 5 + .../functionTests/util/HarnessJavaTest.java | 2 + .../functionTests/util/IjTestCase.java | 2 + .../functionTests/util/JarUtil.java | 2 +- .../functionTests/util/ManyMethods.java | 11 + .../util/PrivilegedFileOpsForTests.java | 26 ++ .../functionTests/util/ProcedureTest.java | 11 + .../functionTests/util/PropertyUtil.java | 1 + .../util/ProtocolTestGrammar.java | 2 + .../functionTests/util/SQLStateConstants.java | 2 +- .../functionTests/util/SQLToJUnit.java | 1 + .../functionTests/util/ScriptTestCase.java | 16 + .../DMLInStaticInitializer.java | 2 + .../InsertInStaticInitializer.java | 2 + .../functionTests/util/T_Access.java | 1 + .../util/T_ConsistencyChecker.java | 8 + .../functionTests/util/TestPropertyInfo.java | 1 + .../functionTests/util/TestRoutines.java | 5 + .../functionTests/util/TestUtil.java | 35 ++ .../functionTests/util/Triggers.java | 5 +- .../corruptio/CorruptBaseStorageFactory.java | 1 + .../corruptio/CorruptDiskStorageFactory.java | 3 + .../util/corruptio/CorruptFile.java | 1 + .../corruptio/CorruptRandomAccessFile.java | 3 + .../util/streams/ByteAlphabet.java | 2 + .../util/streams/CharAlphabet.java | 3 + .../util/streams/LoopingAlphabetReader.java | 1 + .../util/streams/LoopingAlphabetStream.java | 3 + .../derbyTesting/junit/BaseJDBCTestCase.java | 68 ++++ .../derbyTesting/junit/BaseJDBCTestSetup.java | 9 +- .../derbyTesting/junit/BaseTestCase.java | 79 ++++ .../junit/ChangeConfigurationSetup.java | 1 + .../derbyTesting/junit/ChangeUserSetup.java | 1 + .../junit/ClassLoaderTestSetup.java | 2 + .../derbyTesting/junit/ClasspathSetup.java | 1 + .../junit/CleanDatabaseTestSetup.java | 15 + .../ConnectionPoolDataSourceConnector.java | 6 + .../apache/derbyTesting/junit/Connector.java | 4 + .../derbyTesting/junit/ConnectorSetup.java | 2 + .../junit/DataSourceConnector.java | 7 + .../junit/DatabasePropertyTestSetup.java | 10 + .../apache/derbyTesting/junit/Decorator.java | 8 + .../org/apache/derbyTesting/junit/Derby.java | 2 + .../derbyTesting/junit/DerbyConstants.java | 1 + .../derbyTesting/junit/DerbyDistribution.java | 9 + .../derbyTesting/junit/DerbyVersion.java | 1 + .../junit/DriverManagerConnector.java | 11 + .../derbyTesting/junit/DropDatabaseSetup.java | 5 + .../apache/derbyTesting/junit/EnvTest.java | 1 + .../derbyTesting/junit/IndexStatsUtil.java | 18 + .../derbyTesting/junit/J2EEDataSource.java | 1 + .../org/apache/derbyTesting/junit/JDBC.java | 74 ++++ .../apache/derbyTesting/junit/JDBCClient.java | 17 + .../derbyTesting/junit/JDBCDataSource.java | 14 + .../derbyTesting/junit/JDBCPerfTestCase.java | 3 + .../derbyTesting/junit/LocaleTestSetup.java | 1 + .../junit/NetworkServerControlWrapper.java | 1 + .../junit/NetworkServerTestSetup.java | 48 +++ .../derbyTesting/junit/ReleaseRepository.java | 2 + .../junit/RuntimeStatisticsParser.java | 33 ++ .../derbyTesting/junit/SQLUtilities.java | 5 + .../junit/SecurityManagerSetup.java | 24 ++ .../derbyTesting/junit/ServerSetup.java | 2 + .../derbyTesting/junit/SpawnedProcess.java | 19 + .../derbyTesting/junit/SupportFilesSetup.java | 13 + .../junit/SystemPropertyTestSetup.java | 4 + .../derbyTesting/junit/TestConfiguration.java | 163 +++++++++ .../apache/derbyTesting/junit/Utilities.java | 1 + .../junit/XADataSourceConnector.java | 4 + .../apache/derbyTesting/junit/XATestUtil.java | 6 + .../org/apache/derbyTesting/junit/XML.java | 8 + .../derbyTesting/perf/basic/_Suite.java | 3 + .../perf/basic/jdbc/BlobAccessTest.java | 3 + .../perf/basic/jdbc/ClobAccessTest.java | 6 + .../perf/basic/jdbc/CountTest.java | 1 + .../perf/basic/jdbc/CoveredIdxScan.java | 3 + .../perf/basic/jdbc/HeapScan.java | 6 + .../perf/basic/jdbc/IndexScanTest.java | 1 + .../perf/basic/jdbc/SelectDistinctTest.java | 1 + .../perf/basic/jdbc/SortTest.java | 1 + .../perf/basic/jdbc/ValuesTest.java | 1 + .../perf/clients/BackToBackLoadGenerator.java | 1 + .../perf/clients/BankAccountFiller.java | 12 + .../derbyTesting/perf/clients/Client.java | 1 + .../perf/clients/PoissonLoadGenerator.java | 1 + .../derbyTesting/perf/clients/Runner.java | 21 ++ .../clients/SequenceGeneratorConcurrency.java | 20 + .../perf/clients/SingleRecordFiller.java | 7 + .../clients/SingleRecordSelectClient.java | 3 + .../clients/SingleRecordUpdateClient.java | 2 + .../perf/clients/WisconsinFiller.java | 2 + .../system/mailjdbc/MailJdbc.java | 1 + .../system/mailjdbc/tasks/Backup.java | 2 + .../system/mailjdbc/tasks/Browse.java | 3 + .../system/mailjdbc/tasks/Purge.java | 2 + .../system/mailjdbc/tasks/Refresh.java | 3 + .../system/mailjdbc/utils/DbTasks.java | 71 ++++ .../system/mailjdbc/utils/ThreadUtils.java | 3 + .../derbyTesting/system/nstest/NsTest.java | 47 +++ .../system/nstest/NsTestError.java | 3 + .../system/nstest/init/DbSetup.java | 11 + .../system/nstest/init/Initializer.java | 7 + .../system/nstest/init/NWServerThread.java | 2 + .../tester/BackupRestoreReEncryptTester.java | 8 + .../system/nstest/tester/Tester1.java | 9 + .../system/nstest/tester/Tester2.java | 7 + .../system/nstest/tester/Tester3.java | 3 + .../system/nstest/tester/TesterObject.java | 21 ++ .../system/nstest/utils/DbUtil.java | 15 + .../system/nstest/utils/MemCheck.java | 3 + .../system/oe/client/Display.java | 1 + .../system/oe/client/Submitter.java | 2 + .../system/oe/direct/Standard.java | 11 + .../system/oe/direct/StatementHelper.java | 3 + .../system/oe/load/SimpleInsert.java | 7 + .../derbyTesting/system/oe/run/Checks.java | 13 + .../derbyTesting/system/oe/run/Populate.java | 3 + .../derbyTesting/system/oe/run/Schema.java | 3 + .../derbyTesting/system/oe/test/OETest.java | 3 + .../system/oe/test/OperationsTester.java | 10 + .../derbyTesting/system/oe/test/_Suite.java | 1 + .../derbyTesting/system/oe/util/OERandom.java | 4 + .../system/optimizer/RunOptimizerTest.java | 5 + .../system/optimizer/query/GenericQuery.java | 5 + .../system/optimizer/utils/DataUtils.java | 6 + .../derbyTesting/system/sttest/Sttest.java | 7 + .../system/sttest/utils/CompressTable.java | 2 + .../system/sttest/utils/Datatypes.java | 23 ++ .../system/sttest/utils/Setup.java | 2 +- .../unitTests/crypto/T_Cipher.java | 8 + .../harness/BasicUnitTestManager.java | 8 + .../unitTests/harness/T_Bomb.java | 4 + .../unitTests/harness/T_Generic.java | 1 + .../unitTests/harness/UnitTestMain.java | 1 + .../unitTests/junit/ArrayInputStreamTest.java | 1 + .../unitTests/junit/AssertFailureTest.java | 4 + .../unitTests/junit/BlockedByteArrayTest.java | 2 + .../junit/CharacterStreamDescriptorTest.java | 6 + .../unitTests/junit/CompressedNumberTest.java | 4 + .../unitTests/junit/DataInputUtilTest.java | 1 + .../unitTests/junit/DerbyVersionTest.java | 3 + .../unitTests/junit/FormatableBitSetTest.java | 41 +++ .../unitTests/junit/InputStreamUtilTest.java | 5 + .../junit/MissingPermissionsTest.java | 15 + .../unitTests/junit/PathUtilTest.java | 1 + .../junit/ReaderToUTF8StreamTest.java | 1 + .../junit/StatementKeyFactoryTest.java | 1 + .../junit/SystemPrivilegesPermissionTest.java | 23 ++ .../unitTests/junit/UTF8UtilTest.java | 9 + .../unitTests/junit/VirtualFileTest.java | 3 + .../derbyTesting/unitTests/junit/_Suite.java | 13 + .../unitTests/services/T_CacheService.java | 4 + .../unitTests/services/T_DaemonService.java | 4 + .../unitTests/services/T_Diagnosticable.java | 1 + .../unitTests/services/T_Key.java | 2 + .../unitTests/services/T_LockFactory.java | 12 + .../unitTests/services/T_UUIDFactory.java | 2 + .../unitTests/services/T_User.java | 9 + .../unitTests/store/T_AccessFactory.java | 46 +++ .../unitTests/store/T_AccessRow.java | 1 + .../unitTests/store/T_ColumnOrderingImpl.java | 1 + .../unitTests/store/T_FileSystemData.java | 4 + .../derbyTesting/unitTests/store/T_Heap.java | 4 + .../unitTests/store/T_QualifierTest.java | 12 + .../unitTests/store/T_RawStoreFactory.java | 10 + .../unitTests/store/T_RecoverBadLog.java | 21 ++ .../unitTests/store/T_RecoverFullLog.java | 9 + .../unitTests/store/T_Recovery.java | 8 + .../unitTests/store/T_SortController.java | 18 + .../unitTests/store/T_StreamFile.java | 4 + .../derbyTesting/unitTests/store/T_TWC.java | 1 + .../derbyTesting/unitTests/store/T_Util.java | 2 + .../derbyTesting/unitTests/store/T_XA.java | 21 ++ .../derbyTesting/unitTests/store/T_b2i.java | 16 + .../derbyTesting/unitTests/util/MsgTrace.java | 2 + .../derby/iapi/tools/i18n/LocalizedInput.java | 3 + .../iapi/tools/i18n/LocalizedOutput.java | 1 + .../iapi/tools/i18n/LocalizedResource.java | 17 + .../derby/impl/tools/dblook/DB_Alias.java | 3 + .../derby/impl/tools/dblook/DB_Check.java | 3 + .../impl/tools/dblook/DB_GrantRevoke.java | 12 + .../derby/impl/tools/dblook/DB_Jar.java | 3 + .../derby/impl/tools/dblook/DB_Key.java | 6 + .../derby/impl/tools/dblook/DB_Table.java | 3 + .../apache/derby/impl/tools/dblook/Logs.java | 1 + .../derby/impl/tools/ij/AttributeHolder.java | 2 + .../derby/impl/tools/ij/ConnectionEnv.java | 7 + .../org/apache/derby/impl/tools/ij/Main.java | 11 + .../derby/impl/tools/ij/ParseException.java | 1 + .../apache/derby/impl/tools/ij/Session.java | 4 + .../derby/impl/tools/ij/StatementFinder.java | 10 + .../apache/derby/impl/tools/ij/URLCheck.java | 5 + .../derby/impl/tools/ij/ijException.java | 2 + .../tools/ij/ijMultipleResultSetResult.java | 5 + .../apache/derby/impl/tools/ij/ijResult.java | 1 + .../derby/impl/tools/ij/ijResultImpl.java | 3 + .../impl/tools/ij/ijResultSetResult.java | 1 + .../derby/impl/tools/ij/ijVectorResult.java | 2 + .../derby/impl/tools/ij/mtTestCase.java | 5 + .../apache/derby/impl/tools/ij/mtTester.java | 2 + .../org/apache/derby/impl/tools/ij/util.java | 17 + .../apache/derby/impl/tools/ij/utilMain.java | 47 +++ .../apache/derby/impl/tools/ij/xaHelper.java | 24 ++ .../impl/tools/optional/DBMDWrapper.java | 1 + .../impl/tools/optional/ForeignDBViews.java | 1 + .../tools/planexporter/AccessDatabase.java | 4 + .../tools/planexporter/CreateHTMLFile.java | 2 + .../tools/planexporter/CreateXMLFile.java | 1 + .../apache/derby/impl/tools/sysinfo/Main.java | 57 +++ .../impl/tools/sysinfo/ZipInfoProperties.java | 1 + ...BasicClientConnectionPoolDataSource40.java | 4 + .../derby/jdbc/BasicClientXADataSource40.java | 4 + ...sicEmbeddedConnectionPoolDataSource40.java | 2 + .../derby/jdbc/BasicEmbeddedDataSource40.java | 5 + .../jdbc/BasicEmbeddedXADataSource40.java | 2 + .../jdbc/ClientConnectionPoolDataSource.java | 7 + .../ClientConnectionPoolDataSource40.java | 2 + .../apache/derby/jdbc/ClientDataSource40.java | 2 + .../apache/derby/jdbc/ClientXADataSource.java | 5 + .../derby/jdbc/ClientXADataSource40.java | 5 + .../EmbeddedConnectionPoolDataSource.java | 4 + .../EmbeddedConnectionPoolDataSource40.java | 4 + .../apache/derby/jdbc/EmbeddedDataSource.java | 9 + .../derby/jdbc/EmbeddedDataSource40.java | 5 + .../org/apache/derby/jdbc/EmbeddedDriver.java | 8 + .../derby/jdbc/EmbeddedXADataSource.java | 9 + .../derby/jdbc/EmbeddedXADataSource40.java | 3 + .../derby/jdbc/ReferenceableDataSource.java | 3 + .../apache/derby/tools/JDBCDisplayUtil.java | 47 +++ .../org/apache/derby/tools/PlanExporter.java | 2 + .../apache/derby/tools/SignatureChecker.java | 30 ++ .../org/apache/derby/tools/dblook.java | 25 ++ .../org/apache/derby/tools/ij.java | 7 + .../org/apache/derby/tools/sysinfo.java | 5 + .../apache/derby/PackagePrivateTestSuite.java | 2 + .../client/am/LogicalStatementEntityTest.java | 15 + .../org/apache/derby/client/am/_Suite.java | 1 + .../impl/jdbc/BiggerStoreStreamClobTest.java | 2 + .../impl/jdbc/BiggerTemporaryClobTest.java | 2 + .../derby/impl/jdbc/InternalClobTest.java | 2 + .../impl/jdbc/SmallStoreStreamClobTest.java | 2 + .../impl/jdbc/SmallTemporaryClobTest.java | 2 + .../derby/impl/jdbc/UTF8ReaderTest.java | 4 + .../org/apache/derby/impl/jdbc/_Suite.java | 2 + .../derby/impl/storeless/EmptyDictionary.java | 23 ++ .../derby/impl/storeless/NoOpTransaction.java | 2 + .../impl/storeless/StorelessDatabase.java | 2 + .../impl/storeless/StorelessService.java | 1 + .../org/osgi/framework/AdminPermission.java | 2 + .../org/osgi/framework/BundlePermission.java | 1 + .../org/osgi/framework/FrameworkUtil.java | 2 + .../org/osgi/framework/PackagePermission.java | 1 + .../org/osgi/framework/ServicePermission.java | 1 + maven2/SetDerbyVersion.java | 8 + .../IJDerbyLaunchConfigurationDelegate.java | 1 + ...erbyServerLaunchConfigurationDelegate.java | 1 + ...erbyServerLaunchConfigurationDelegate.java | 1 + ...sInfoDerbyLaunchConfigurationDelegate.java | 1 + .../ui/popup/actions/AddDerbyNature.java | 1 + .../ui/popup/actions/RemoveDerbyNature.java | 1 + .../ui/properties/DerbyPropertiesPage.java | 2 + tools/l10n/LocCompare.java | 1 + .../derbyBuild/jirasoap/DerbyVersion.java | 4 + .../jirasoap/FilteredIssueLister.java | 15 + .../FilteredIssueListerAntWrapper.java | 1 + 2078 files changed, 26449 insertions(+), 187 deletions(-) diff --git a/java/build/org/apache/derbyBuild/ClassSizeCrawler.java b/java/build/org/apache/derbyBuild/ClassSizeCrawler.java index 5c9e11938c..b4e23aa8db 100644 --- a/java/build/org/apache/derbyBuild/ClassSizeCrawler.java +++ b/java/build/org/apache/derbyBuild/ClassSizeCrawler.java @@ -195,6 +195,7 @@ public static void main( String[] arg) out.print( "package org.apache.derby.iapi.services.cache;\n" + "class ClassSizeCatalogImpl extends ClassSizeCatalog\n" + "{\n" + +//IC see: https://issues.apache.org/jira/browse/DERBY-6856 " public ClassSizeCatalogImpl()\n" + " {\n"); for( Enumeration e = classSizes.keys(); @@ -224,11 +225,13 @@ public static void main( String[] arg) private ClassSizeCrawler( Class[] interfaceList, int interfaceCount, +//IC see: https://issues.apache.org/jira/browse/DERBY-4893 Hashtable classSizes) { this.interfaceList = interfaceList; this.classSizes = classSizes; this.interfaceCount = interfaceCount; +//IC see: https://issues.apache.org/jira/browse/DERBY-6856 verbose = Boolean.parseBoolean( System.getProperty( "verbose", "false")); } @@ -262,6 +265,7 @@ private void crawl( File curDir, StringBuffer className) // Strip off the ".class" suffix String s = filenames[fileIdx].substring( 0, filenames[fileIdx].length() - 6); className.append( s); +//IC see: https://issues.apache.org/jira/browse/DERBY-4893 Class targetClass = null; String targetClassName = className.toString(); try diff --git a/java/build/org/apache/derbyBuild/ElementFacade.java b/java/build/org/apache/derbyBuild/ElementFacade.java index 30ae0be7d1..d8a63029d6 100644 --- a/java/build/org/apache/derbyBuild/ElementFacade.java +++ b/java/build/org/apache/derbyBuild/ElementFacade.java @@ -85,6 +85,7 @@ public String getTextByTagName(String tag) throws Exception { public List getTextListByTagName(String tag) throws Exception { NodeList matchingTags = root.getElementsByTagName(tag); final int length = matchingTags.getLength(); +//IC see: https://issues.apache.org/jira/browse/DERBY-4893 ArrayList tagValues = new ArrayList(); for (int i = 0; i < length; ++i) { tagValues.add(matchingTags.item(i).getFirstChild().getNodeValue()); diff --git a/java/build/org/apache/derbyBuild/GeneratorBase.java b/java/build/org/apache/derbyBuild/GeneratorBase.java index 47b74b2d4e..a693e4a246 100644 --- a/java/build/org/apache/derbyBuild/GeneratorBase.java +++ b/java/build/org/apache/derbyBuild/GeneratorBase.java @@ -162,6 +162,7 @@ public void setOutputFileName(String outputFileName) throws Exception { * Ant mutator to set the id of the release */ public void setReleaseId(String releaseID) throws Exception { +//IC see: https://issues.apache.org/jira/browse/DERBY-4864 this.releaseID = releaseID; } @@ -178,6 +179,7 @@ public void setReleaseId(String releaseID) throws Exception { protected void buildDelta(Element parent) throws Exception { String deltaStatement = +//IC see: https://issues.apache.org/jira/browse/DERBY-4864 "These notes describe the difference between Apache Derby release " + releaseID + " and the preceding release " + previousReleaseID + "."; @@ -289,6 +291,7 @@ public static Element createHeader(Element parent, int headerLevel, Element header = doc.createElement(makeHeaderTag(headerLevel)); Element anchor = doc.createElement(ANCHOR); Element block = doc.createElement(DIVISION); +//IC see: https://issues.apache.org/jira/browse/DERBY-5181 parent.appendChild(header); anchor.setAttribute(NAME, text); @@ -307,6 +310,7 @@ public static Element createHeader(Element parent, int headerLevel, * @throws DOMException */ private static Element wrapTextContentInDiv(Element node) +//IC see: https://issues.apache.org/jira/browse/DERBY-6044 throws DOMException { Document doc = node.getOwnerDocument(); Element div = doc.createElement(DIVISION); @@ -555,6 +559,7 @@ public static Element createTable(Element parent, int borderWidth, parent.appendChild(table); table.setAttribute(BORDER, Integer.toString(borderWidth)); +//IC see: https://issues.apache.org/jira/browse/DERBY-6044 for (String headerText : columnHeadings) { Element headingColumn = insertColumnHeader(headingRow); headingColumn.setTextContent(headerText); @@ -587,6 +592,7 @@ protected void fixWidthOfFirstColumn(Element table) */ public static Element insertRow(Element table) throws Exception { +//IC see: https://issues.apache.org/jira/browse/DERBY-6044 return insertTableElement(table, ROW); } @@ -598,6 +604,7 @@ public static Element insertRow(Element table) */ public static Element insertColumn(Element row) throws Exception { +//IC see: https://issues.apache.org/jira/browse/DERBY-6044 return insertTableElement(row, COLUMN); } diff --git a/java/build/org/apache/derbyBuild/JarDriftTest.java b/java/build/org/apache/derbyBuild/JarDriftTest.java index 26a3e32b5e..2529c51a41 100644 --- a/java/build/org/apache/derbyBuild/JarDriftTest.java +++ b/java/build/org/apache/derbyBuild/JarDriftTest.java @@ -179,6 +179,7 @@ protected static String sanityState() throws Exception { // sanity=[false|true] except for some header/timestamp info). String fs = File.separator; String sanityFileName = +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 topOfTree + fs + "generated" + fs + "java" + fs + "org.apache.derby.commons" + fs + "org" + fs + "apache" + fs + "derby" + fs + "shared" + fs + "common" + fs + "sanity" + fs + "state.properties"; diff --git a/java/build/org/apache/derbyBuild/JiraConnector.java b/java/build/org/apache/derbyBuild/JiraConnector.java index fede36e1aa..5a86b1a934 100644 --- a/java/build/org/apache/derbyBuild/JiraConnector.java +++ b/java/build/org/apache/derbyBuild/JiraConnector.java @@ -71,6 +71,7 @@ public class JiraConnector { public static void main(String[] args) { try{ +//IC see: https://issues.apache.org/jira/browse/DERBY-4014 if (args.length > 0 && args[0].equals("all")) // don't use this too often it is hard on Apache infrastructure. refreshJiraIssues(allJiraListFileName, jira_allBugsSource); diff --git a/java/build/org/apache/derbyBuild/JiraIssue.java b/java/build/org/apache/derbyBuild/JiraIssue.java index 73a7f95e50..425c32176d 100644 --- a/java/build/org/apache/derbyBuild/JiraIssue.java +++ b/java/build/org/apache/derbyBuild/JiraIssue.java @@ -71,6 +71,7 @@ public JiraIssue(String key, String title, List fixVersions, public static List createJiraIssueList(String source) throws IOException { ArrayList jiraIssues = new ArrayList(); +//IC see: https://issues.apache.org/jira/browse/DERBY-4893 BufferedReader in = new BufferedReader(new FileReader(source)); String line; @@ -79,6 +80,7 @@ public static List createJiraIssueList(String source) System.out.println(line); } +//IC see: https://issues.apache.org/jira/browse/DERBY-4893 ArrayList comments = new ArrayList(); int state = STATE_ADD_KEY; String key = null; @@ -164,6 +166,7 @@ public long getReleaseNoteAttachmentID() { * @return true iff this issue has a release note attached */ public boolean hasReleaseNote() { +//IC see: https://issues.apache.org/jira/browse/DERBY-4857 return (releaseNoteAttachmentID != NO_RELEASE_NOTE && releaseNoteAttachmentID != MISSING_RELEASE_NOTE); } @@ -181,6 +184,7 @@ public boolean hasMissingReleaseNote() { * @return true iff issue has version as fixVersion */ public boolean isFixedIn(String version) { +//IC see: https://issues.apache.org/jira/browse/DERBY-4857 return fixVersions.contains(version); } @@ -188,6 +192,7 @@ public boolean isFixedIn(String version) { * @return URL for this Jira issue */ public String getJiraAddress() { +//IC see: https://issues.apache.org/jira/browse/DERBY-4593 return "https://issues.apache.org/jira/browse/DERBY-" + key; } @@ -195,6 +200,7 @@ public String getJiraAddress() { * @return Full URL to the latest release note */ public String getReleaseNoteAddress() { +//IC see: https://issues.apache.org/jira/browse/DERBY-4857 return ATTACHMENT_BASE + releaseNoteAttachmentID + "/" + ATTACHMENT_NAME; } diff --git a/java/build/org/apache/derbyBuild/MessageBuilder.java b/java/build/org/apache/derbyBuild/MessageBuilder.java index bccfa735a2..8dcf6dce78 100644 --- a/java/build/org/apache/derbyBuild/MessageBuilder.java +++ b/java/build/org/apache/derbyBuild/MessageBuilder.java @@ -84,6 +84,7 @@ public class MessageBuilder extends Task "\n" + "\n"; +//IC see: https://issues.apache.org/jira/browse/DERBY-2110 public static final String APACHE_LICENSE = "Licensed to the Apache Software Foundation (ASF) under one or more\n" + @@ -100,6 +101,7 @@ public class MessageBuilder extends Task "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n" + "See the License for the specific language governing permissions and \n" + "limitations under the License.\n"; +//IC see: https://issues.apache.org/jira/browse/DERBY-3547 private static final String REF_GUIDE_NOTES = "\n"; @@ -160,8 +163,10 @@ public XMLWriter() */ public XMLWriter(PrintWriter printWriter) { +//IC see: https://issues.apache.org/jira/browse/DERBY-3547 _vacuous = false; _pw = printWriter; +//IC see: https://issues.apache.org/jira/browse/DERBY-4893 _tagStack = new ArrayList(); } @@ -173,6 +178,7 @@ public XMLWriter(PrintWriter printWriter) public XMLWriter( File file ) throws IOException { +//IC see: https://issues.apache.org/jira/browse/DERBY-3547 this(new PrintWriter(file)); } @@ -214,6 +220,7 @@ public void writeEmptyTag( String tag, String attributes ) if ( _vacuous ) { return; } indent( ); +//IC see: https://issues.apache.org/jira/browse/DERBY-2110 if ( attributes.length() >0) _pw.println( "<" + tag + " " + attributes + "/>"); else @@ -244,6 +251,7 @@ public void beginTag( String tag, String attributes ) if ( _vacuous ) { return; } indent(); +//IC see: https://issues.apache.org/jira/browse/DERBY-2110 if (attributes.length() > 0) _pw.println( "<" + tag + " " + attributes + ">"); else @@ -293,6 +301,7 @@ public void writeTextElement( String tag, String attributes, String text ) if ( _vacuous ) { return; } indent(); +//IC see: https://issues.apache.org/jira/browse/DERBY-2110 if ( attributes.length() > 0 ) _pw.print( "<" + tag + " " + attributes + ">"); else @@ -388,6 +397,7 @@ public void execute() } catch (Exception e) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5885 throw new BuildException( "Could not generate English properties from message descriptors: " + e.getMessage(), e ); } finally @@ -522,10 +532,12 @@ private void processFamily( PrintWriter propertiesPW, XMLWriter ditaWriter, E ditaWriter.beginTag( "table" ); { ditaWriter.writeTextElement( "title", title ); +//IC see: https://issues.apache.org/jira/browse/DERBY-5640 ditaWriter.writeTextElement( "desc", "This table lists the SQLStates and message text for the " + title + " exceptions." ); ditaWriter.beginTag( "tgroup", "cols=\"2\"" ); { +//IC see: https://issues.apache.org/jira/browse/DERBY-5202 ditaWriter.writeEmptyTag( "colspec", "colname=\"col1\" colnum=\"1\" colwidth=\"1*\"" ); ditaWriter.writeEmptyTag( "colspec", "colname=\"col2\" colnum=\"2\" colwidth=\"7.5*\"" ); @@ -569,6 +581,7 @@ private void processMessage( PrintWriter propertiesPW, XMLWriter ditaWriter, String rawText = squeezeText( getFirstChild( message, "text" ) ); String propertyText = escapePropertiesText( rawText ); int parameterCount = countParameters( rawText ); +//IC see: https://issues.apache.org/jira/browse/DERBY-5878 String[] comments = getOptionalSubElements( message, "comment" ); String[] args = getOptionalSubElements( message, "arg" ); @@ -577,6 +590,7 @@ private void processMessage( PrintWriter propertiesPW, XMLWriter ditaWriter, throw new Exception( name + " has " + parameterCount + " parameters but " + args.length + " nested args." ); } +//IC see: https://issues.apache.org/jira/browse/DERBY-2110 String displayText; if (rawText.indexOf('\'')>=0) { @@ -595,8 +609,10 @@ private void processMessage( PrintWriter propertiesPW, XMLWriter ditaWriter, } ditaWriter.endTag(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5878 propertiesPW.println( "" ); +//IC see: https://issues.apache.org/jira/browse/DERBY-5878 if ( comments.length != 0 ) { for ( int i = 0; i < comments.length; i++ ) @@ -612,6 +628,7 @@ private void processMessage( PrintWriter propertiesPW, XMLWriter ditaWriter, propertiesPW.println( "#" ); for ( int i = 0; i < args.length; i++ ) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5878 propertiesPW.println( "# {" + i + "} = " + args[ i ] ); } propertiesPW.println( "#" ); @@ -639,6 +656,7 @@ private String getSQLState( String name ) private String[] getOptionalSubElements( Element message, String subElementTag ) throws Exception { +//IC see: https://issues.apache.org/jira/browse/DERBY-5878 NodeList options = message.getElementsByTagName( subElementTag ); int count = options.getLength(); String[] retval = new String[ count ]; @@ -690,10 +708,12 @@ private String plugInArgs( String message, String[] rawArgs ) int count = rawArgs.length; String[] cookedArgs = new String[ count ]; MessageFormat format = new MessageFormat(message); +//IC see: https://issues.apache.org/jira/browse/DERBY-5420 // add xml angle brackets around the args for ( int i = 0; i < count; i++ ) { +//IC see: https://issues.apache.org/jira/browse/DERBY-2110 cookedArgs[ i ] = "<" + rawArgs[ i ] + ">"; format.setFormatByArgumentIndex(i, null); // use plain string format } @@ -805,6 +825,7 @@ private static String escapePropertiesText( java.lang.String input ) */ private static String escapeTextWithAQuote( java.lang.String input ) { +//IC see: https://issues.apache.org/jira/browse/DERBY-2110 String output = input.replaceAll( "\'", "\'\'" ); return output; diff --git a/java/build/org/apache/derbyBuild/MessageBundleTest.java b/java/build/org/apache/derbyBuild/MessageBundleTest.java index 42a08f022a..15ef861a97 100644 --- a/java/build/org/apache/derbyBuild/MessageBundleTest.java +++ b/java/build/org/apache/derbyBuild/MessageBundleTest.java @@ -49,6 +49,7 @@ public class MessageBundleTest { *

*/ public MessageBundleTest() +//IC see: https://issues.apache.org/jira/browse/DERBY-1458 {} public static void main(String [] args) throws Exception @@ -63,6 +64,7 @@ public static void main(String [] args) throws Exception e.printStackTrace(); } if (failbuild) +//IC see: https://issues.apache.org/jira/browse/DERBY-4341 throw new Exception("Message check failed. \n" + "See error in build output or call ant runmessagecheck."); } @@ -89,6 +91,7 @@ public static void main(String [] args) throws Exception } static void loadClassIds(Class idclass, HashSet set) +//IC see: https://issues.apache.org/jira/browse/DERBY-4893 throws Exception { Field[] fields = idclass.getFields(); @@ -111,6 +114,7 @@ static void loadClassIds(Class idclass, HashSet set) if ( ! set.add(id) ) { +//IC see: https://issues.apache.org/jira/browse/DERBY-1458 failbuild=true; System.err.println("ERROR: The id " + id + " was found twice in " + idclass.getName()); @@ -144,6 +148,7 @@ static void loadMessageBundle(int index) { String key = (String)keys.nextElement(); if ( ! messageBundleIds.add(key) ) { +//IC see: https://issues.apache.org/jira/browse/DERBY-1458 failbuild=true; System.err.println("ERROR: the key " + key + " exists twice in messages_en.properties"); @@ -168,6 +173,8 @@ public void testSQLStateOrphanedIds() throws Exception { // XSAX1: shared SQLState explains; not exposed to users. // 01004: automatically assigned by java.sql.DataTruncation and // never used to generate a message +//IC see: https://issues.apache.org/jira/browse/DERBY-3902 +//IC see: https://issues.apache.org/jira/browse/DERBY-1567 if (!(sqlStateId.equalsIgnoreCase("XCL32.S") || sqlStateId.equalsIgnoreCase("XSAX1") || sqlStateId.equalsIgnoreCase("01004"))) { @@ -195,6 +202,7 @@ public void testMessageIdOrphanedIds() throws Exception { if ( ! messageBundleIds.contains(sqlStateId) ) { // Don't fail out on the first one, we want to catch // all of them. Just note there was a failure and continue +//IC see: https://issues.apache.org/jira/browse/DERBY-1458 failbuild=true; System.err.println("ERROR: Message id " + sqlStateId + " in MessageId.java was not found in" + @@ -223,6 +231,7 @@ public void testMessageBundleOrphanedMessages() throws Exception { // Don't fail out on the first one, we want to catch // all of them. Just note there was a failure and continue +//IC see: https://issues.apache.org/jira/browse/DERBY-1458 failbuild=true; System.err.println("WARNING: Message id " + msgid + " in messages_en.properties is not " + diff --git a/java/build/org/apache/derbyBuild/MessageVetter.java b/java/build/org/apache/derbyBuild/MessageVetter.java index e39d64d95b..a44c5a06a7 100644 --- a/java/build/org/apache/derbyBuild/MessageVetter.java +++ b/java/build/org/apache/derbyBuild/MessageVetter.java @@ -98,6 +98,7 @@ public boolean accept(File pathname) { // needs quoting. LONE_QUOTE_ALLOWED.add("DRDA_Usage8.I"); LONE_QUOTE_ALLOWED.add("DRDA_Usage11.I"); +//IC see: https://issues.apache.org/jira/browse/DERBY-5944 LONE_QUOTE_ALLOWED.add("PE_HelpText"); } @@ -116,6 +117,7 @@ public boolean accept(File pathname) { private MessageVetter(File file) throws IOException { this.file = file; properties = new Properties(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5480 FileInputStream in = new FileInputStream(file); try { properties.load(in); diff --git a/java/build/org/apache/derbyBuild/ODBCMetadataGenerator.java b/java/build/org/apache/derbyBuild/ODBCMetadataGenerator.java index 000c533557..2e8a1b75cb 100644 --- a/java/build/org/apache/derbyBuild/ODBCMetadataGenerator.java +++ b/java/build/org/apache/derbyBuild/ODBCMetadataGenerator.java @@ -193,8 +193,10 @@ public static void main(String [] args) throws IOException { private void initChanges() { changeMap = new HashMap(); +//IC see: https://issues.apache.org/jira/browse/DERBY-4893 changeMap.put("getProcedures", COL_RENAME_CHANGE); +//IC see: https://issues.apache.org/jira/browse/DERBY-6856 changeMap.put("getProcedureColumns", (byte)(COL_RENAME_CHANGE @@ -242,6 +244,7 @@ public void generateODBCQueries(InputStream is) // Note: We use ISO-8859-1 because property files are // defined to be that encoding. +//IC see: https://issues.apache.org/jira/browse/DERBY-675 LineNumberReader reader = new LineNumberReader(new InputStreamReader(is, "ISO-8859-1")); @@ -367,6 +370,7 @@ private void generateODBCQuery(StringBuffer queryText) // Get a list of the column definitions in the subquery, for // use by subsequent operations. +//IC see: https://issues.apache.org/jira/browse/DERBY-4893 ArrayList colDefs = new ArrayList(); pos = getSelectColDefinitions(queryText, colDefs); @@ -759,6 +763,7 @@ else if (queryName.equals("getTypeInfo")) { * clause, for later use by the calling method. */ private int getSelectColDefinitions(StringBuffer queryText, +//IC see: https://issues.apache.org/jira/browse/DERBY-4893 ArrayList colDefList) { @@ -942,6 +947,7 @@ private String getCastInfoForCol(String queryName, { if (queryName.equals("getTypeInfo")) { +//IC see: https://issues.apache.org/jira/browse/DERBY-137 if (colName.equals("DATA_TYPE") || colName.equals("CASE_SENSITIVE") || colName.equals("UNSIGNED_ATTRIBUTE") || @@ -956,6 +962,7 @@ private String getCastInfoForCol(String queryName, else if (queryName.equals("getColumns")) { if (colName.equals("DECIMAL_DIGITS") || colName.equals("NULLABLE") || +//IC see: https://issues.apache.org/jira/browse/DERBY-137 colName.equals("DATA_TYPE") || colName.equals("NUM_PREC_RADIX") || colName.equals("SQL_DATA_TYPE") || @@ -964,6 +971,7 @@ else if (queryName.equals("getColumns")) { return "SMALLINT"; } } +//IC see: https://issues.apache.org/jira/browse/DERBY-137 else if (queryName.equals("getProcedureColumns")) { if (colName.equals("DATA_TYPE")) { return "SMALLINT"; @@ -1013,6 +1021,7 @@ else if (queryName.equals("getIndexInfo")) { * leaves the received column list unchanged. */ private void markNewColPosition(String queryName, +//IC see: https://issues.apache.org/jira/browse/DERBY-4893 ArrayList selectColDefs) { @@ -1256,6 +1265,7 @@ private boolean isBoolean( String colName ) */ private boolean stmtNeedsChange(String queryName, byte changeType) { +//IC see: https://issues.apache.org/jira/browse/DERBY-4893 Byte changeByte = changeMap.get(queryName); if (changeByte == null) // No entry means change is not needed. diff --git a/java/build/org/apache/derbyBuild/ReleaseNoteReader.java b/java/build/org/apache/derbyBuild/ReleaseNoteReader.java index e8f0f3fd41..8adc50d32c 100644 --- a/java/build/org/apache/derbyBuild/ReleaseNoteReader.java +++ b/java/build/org/apache/derbyBuild/ReleaseNoteReader.java @@ -102,6 +102,7 @@ public static void main( String[] args ) Element details = me.getReleaseNoteDetails( doc ); me.forbidBlockQuotes( doc ); +//IC see: https://issues.apache.org/jira/browse/DERBY-5181 // if you get this far, then everything worked @@ -147,6 +148,7 @@ public Element getReleaseNoteSummary( Document releaseNote ) // Element root = releaseNote.getDocumentElement(); Element summaryParagraph = GeneratorBase.getFirstChild( root, GeneratorBase.PARAGRAPH ); +//IC see: https://issues.apache.org/jira/browse/DERBY-3598 return summaryParagraph; } @@ -161,6 +163,7 @@ public Element getReleaseNoteDetails( Document releaseNote ) { Element root = releaseNote.getDocumentElement(); Element details = GeneratorBase.getFirstChild( root, GeneratorBase.BODY ); +//IC see: https://issues.apache.org/jira/browse/DERBY-3598 return details; } @@ -172,6 +175,7 @@ public Element getReleaseNoteDetails( Document releaseNote ) */ private void forbidBlockQuotes( Document releaseNote ) throws Exception { +//IC see: https://issues.apache.org/jira/browse/DERBY-5181 Element root = releaseNote.getDocumentElement(); String errorMessage = "For accessibility reasons, blockquotes are not allowed. Please remove the blockquote tags."; diff --git a/java/build/org/apache/derbyBuild/ReleaseNotesGenerator.java b/java/build/org/apache/derbyBuild/ReleaseNotesGenerator.java index da7beb265c..f9649c3361 100644 --- a/java/build/org/apache/derbyBuild/ReleaseNotesGenerator.java +++ b/java/build/org/apache/derbyBuild/ReleaseNotesGenerator.java @@ -87,6 +87,7 @@ public class ReleaseNotesGenerator extends GeneratorBase { private static final String USAGE = "Usage:\n" + "\n" + +//IC see: https://issues.apache.org/jira/browse/DERBY-4857 " java org.apache.derbyBuild.ReleaseNotesGenerator SUMMARY BUG_LIST OUTPUT_PAMPHLET\n" + "\n" + " where\n" + @@ -99,6 +100,7 @@ public class ReleaseNotesGenerator extends GeneratorBase { "individual JIRAs. Before running this program, make sure that you can\n" + "ping issues.apache.org.\n" + "\n" + +//IC see: https://issues.apache.org/jira/browse/DERBY-4857 "The ReleaseNoteGenerator assumes that the JIRA report contains\n" + "key, title, fix versions and attachment id elements for each Derby\n" + "issue. For each issue in with an attachment id element the\n" + @@ -182,10 +184,12 @@ public void execute() throws BuildException { beginOutput(); buildOverview(); buildNewFeatures(); +//IC see: https://issues.apache.org/jira/browse/DERBY-4857 parseBugsList(); buildFixedBugsList(); buildReleaseNoteIssuesList(); buildEnvironment(); +//IC see: https://issues.apache.org/jira/browse/DERBY-4864 buildReleaseVerification(); replaceVariables(); printOutput(); @@ -212,6 +216,7 @@ public void execute() throws BuildException { * Start the RELEASE_NOTES html docment. */ private void beginOutput() throws Exception { +//IC see: https://issues.apache.org/jira/browse/DERBY-4864 String titleText = "Release Notes for Apache Derby " + releaseID; Element html = outputDoc.createElement(HTML); Element title = createTextElement(outputDoc, "title", titleText); @@ -222,6 +227,7 @@ private void beginOutput() throws Exception { // See http://www.w3.org/TR/WCAG10/#gl-abbreviated-and-foreign // html.setAttribute( "lang", "en" ); +//IC see: https://issues.apache.org/jira/browse/DERBY-5181 outputDoc.appendChild(html); html.appendChild(title); @@ -242,6 +248,7 @@ private void beginOutput() throws Exception { ISSUES_SECTION, ISSUES_SECTION); createSection(body, MAIN_SECTION_LEVEL, toc, BUILD_ENVIRONMENT_SECTION, BUILD_ENVIRONMENT_SECTION); +//IC see: https://issues.apache.org/jira/browse/DERBY-4864 createSection(body, MAIN_SECTION_LEVEL, toc, RELEASE_VERIFICATION_SECTION, RELEASE_VERIFICATION_SECTION); } @@ -258,6 +265,7 @@ private void beginOutput() throws Exception { */ private void buildOverview() throws Exception { // copy the details out of the summary file into the overview section +//IC see: https://issues.apache.org/jira/browse/DERBY-3598 cloneChildren(summary.getElementByTagName(SUM_OVERVIEW), getSection(outputDoc, MAIN_SECTION_LEVEL, OVERVIEW_SECTION)); } @@ -273,6 +281,7 @@ private void buildOverview() throws Exception { */ private void buildNewFeatures() throws Exception { // copy the details out of the summary file into the overview section +//IC see: https://issues.apache.org/jira/browse/DERBY-3598 cloneChildren(summary.getElementByTagName(SUM_NEW_FEATURES), getSection(outputDoc, MAIN_SECTION_LEVEL, NEW_FEATURES_SECTION)); @@ -285,6 +294,7 @@ private void buildNewFeatures() throws Exception { ////////////////////////////////// private void parseBugsList() +//IC see: https://issues.apache.org/jira/browse/DERBY-4857 throws Exception { bugList = JiraIssue.createJiraIssueList(bugListFileName); // Parse the file for the release version and the previous version to @@ -317,6 +327,7 @@ private void parseBugsList() private void buildFixedBugsList() throws Exception { +//IC see: https://issues.apache.org/jira/browse/DERBY-3598 Element bugListSection = getSection(outputDoc, MAIN_SECTION_LEVEL, BUG_FIXES_SECTION ); @@ -333,7 +344,9 @@ private void buildFixedBugsList() // If we don't fix the width of the first column, the string // "DERBY-XXXX" is often broken up at the hyphen by some browsers. fixWidthOfFirstColumn(table); +//IC see: https://issues.apache.org/jira/browse/DERBY-6044 +//IC see: https://issues.apache.org/jira/browse/DERBY-4857 for ( Iterator i=bugList.iterator(); i.hasNext(); ) { JiraIssue issue = (JiraIssue) i.next(); //println("Fixed: "+ issue.getKey()); @@ -359,6 +372,7 @@ private void buildFixedBugsList() * Build the Issues section. */ private void buildReleaseNoteIssuesList() +//IC see: https://issues.apache.org/jira/browse/DERBY-3598 throws Exception { Element issuesSection = getSection(outputDoc, MAIN_SECTION_LEVEL, ISSUES_SECTION); @@ -367,11 +381,13 @@ private void buildReleaseNoteIssuesList() "), Derby release " + releaseID + " introduces the following " + "new features " + "and incompatibilities. These merit your special attention."; +//IC see: https://issues.apache.org/jira/browse/DERBY-6941 String noDetailedReleaseNotes = "No issues required detailed release notes."; boolean deltaStatementPrinted = false; Element toc = createList(issuesSection); +//IC see: https://issues.apache.org/jira/browse/DERBY-4857 for (Iterator i=bugList.iterator(); i.hasNext(); ) { JiraIssue issue = (JiraIssue) i.next(); if (issue.hasReleaseNote()) { @@ -392,6 +408,7 @@ private void buildReleaseNoteIssuesList() getReleaseNoteDetails(releaseNote); } catch (Throwable t) { errors.add(formatError("Unable to read or parse " + +//IC see: https://issues.apache.org/jira/browse/DERBY-4593 "release note for DERBY-" + issue.getKey(), t)); missingReleaseNotes.add(issue); @@ -400,6 +417,7 @@ private void buildReleaseNoteIssuesList() String key = "Note for DERBY-" + issue.getKey(); //println("Release note: "+issue.getKey()+" - "+issue.getTitle()); +//IC see: https://issues.apache.org/jira/browse/DERBY-5204 Element paragraph = outputDoc.createElement(SPAN); paragraph.appendChild(outputDoc.createTextNode(key + ": ")); cloneChildren(summaryText, paragraph); @@ -407,10 +425,12 @@ private void buildReleaseNoteIssuesList() Element issueSection = createSection(issuesSection, ISSUE_DETAIL_LEVEL, toc, key, paragraph); cloneChildren(details, issueSection); +//IC see: https://issues.apache.org/jira/browse/DERBY-4857 } else if (issue.hasMissingReleaseNote()) { missingReleaseNotes.add(issue); } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6941 if (!deltaStatementPrinted) { addParagraph(issuesSection, noDetailedReleaseNotes); } } @@ -458,6 +478,7 @@ private void buildEnvironment() */ private void buildReleaseVerification() throws Exception { // copy the details out of the summary file into the release verification section +//IC see: https://issues.apache.org/jira/browse/DERBY-4864 cloneChildren(summary.getElementByTagName(SUM_RELEASE_VERIFICATION), getSection(outputDoc, MAIN_SECTION_LEVEL, RELEASE_VERIFICATION_SECTION)); } @@ -473,6 +494,7 @@ private void buildReleaseVerification() throws Exception { * Print missing release notes */ private void printMissingReleaseNotes() throws Exception { +//IC see: https://issues.apache.org/jira/browse/DERBY-3598 if (missingReleaseNotes.isEmpty()) { return; } @@ -499,12 +521,14 @@ private boolean parseArgs( String[] args ) throws Exception { if ( (args == null) || (args.length != 3) ) { return false; } +//IC see: https://issues.apache.org/jira/browse/DERBY-4593 int idx = 0; setSummaryFileName( args[ idx++ ] ); setBugListFileName( args[ idx++ ] ); setOutputFileName( args[ idx++ ] ); +//IC see: https://issues.apache.org/jira/browse/DERBY-3598 return true; } diff --git a/java/build/org/apache/derbyBuild/ReleaseNotesTransformer.java b/java/build/org/apache/derbyBuild/ReleaseNotesTransformer.java index d16240ba20..d2db3df462 100644 --- a/java/build/org/apache/derbyBuild/ReleaseNotesTransformer.java +++ b/java/build/org/apache/derbyBuild/ReleaseNotesTransformer.java @@ -67,6 +67,7 @@ public class ReleaseNotesTransformer extends Task " (the \"License\"); you may not use this file except in compliance with\n" + " the License. You may obtain a copy of the License at\n" + "\n" + +//IC see: https://issues.apache.org/jira/browse/DERBY-7010 " https://www.apache.org/licenses/LICENSE-2.0\n" + "\n" + " Unless required by applicable law or agreed to in writing, software\n" + @@ -80,17 +81,20 @@ public class ReleaseNotesTransformer extends Task "\n" + "\n" + "

Distributions

\n" + +//IC see: https://issues.apache.org/jira/browse/DERBY-7010 "

Use the links below to download a distribution of Apache Derby. You should always verify the integrity\n" + " of distribution files downloaded from a mirror.

\n" + "\n" + "

You are currently using [preferred]. If you encounter a\n" + "problem with this mirror, then please select another. If all\n" + "mirrors are failing, there are backup mirrors at the end of the list.\n" + +//IC see: https://issues.apache.org/jira/browse/DERBY-7010 "See status of mirrors.\n" + "

\n" + "\n" + "
\n" + "Other mirrors: ", Long.valueOf(length)); } checkTypeForSetBinaryStream(parameterIndex); +//IC see: https://issues.apache.org/jira/browse/DERBY-3705 checkStreamLength(length); setBinaryStreamX(parameterIndex, x, (int)length); } @@ -996,8 +1053,10 @@ public void setBinaryStream(int parameterIndex, */ public void setBinaryStream(int parameterIndex, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 InputStream x, int length) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-1445 setBinaryStream(parameterIndex,x,(long)length); } @@ -1039,6 +1098,7 @@ public void setAsciiStream(int parameterIndex, synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "setAsciiStream", +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 parameterIndex, "", Long.valueOf(length)); } @@ -1053,6 +1113,7 @@ public void setAsciiStream(int parameterIndex, } checkStreamLength(length); setInput(parameterIndex, +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 new ClientClob(agent_, x, Cursor.ISO_8859_1, (int) length)); } } @@ -1072,8 +1133,10 @@ public void setAsciiStream(int parameterIndex, * @exception SQLException thrown on failure. */ public void setAsciiStream(int parameterIndex, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 InputStream x, int length) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-1445 setAsciiStream(parameterIndex,x,(long)length); } @@ -1085,11 +1148,13 @@ public void setAsciiStream(int parameterIndex, * @throws SQLException Thrown for a negative or too large length. */ private void checkStreamLength(long length) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-3705 if(length > Integer.MAX_VALUE) { throw new SqlException( agent_.logWriter_, new ClientMessageId( SQLState.CLIENT_LENGTH_OUTSIDE_RANGE_FOR_DATATYPE), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 length, Integer.MAX_VALUE ).getSQLException(); @@ -1120,6 +1185,7 @@ private void checkTypeForSetBinaryStream(int parameterIndex) if (!PossibleTypes.POSSIBLE_TYPES_IN_SET_BINARYSTREAM. checkType(paramType)) { PossibleTypes.throw22005Exception(agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Types.VARBINARY, paramType); } @@ -1131,6 +1197,8 @@ private void checkTypeForSetCharacterStream(int parameterIndex) if (!PossibleTypes.POSSIBLE_TYPES_IN_SET_CHARACTERSTREAM. checkType(paramType)) { PossibleTypes.throw22005Exception(agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Types.LONGVARCHAR, paramType); } @@ -1142,6 +1210,7 @@ private void checkTypeForSetBlob(int parameterIndex) if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_BLOB.checkType( paramType ) ){ PossibleTypes.throw22005Exception(agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Types.BLOB, paramType); } @@ -1154,6 +1223,7 @@ private void checkTypeForSetClob(int parameterIndex) if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_CLOB.checkType( paramType ) ){ PossibleTypes.throw22005Exception(agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Types.CLOB, paramType); @@ -1175,8 +1245,12 @@ private void checkTypeForSetClob(int parameterIndex) * @deprecated */ public void setUnicodeStream(int parameterIndex, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 InputStream x, int length) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-253 if (agent_.loggingEnabled()) { agent_.logWriter_.traceDeprecatedEntry(this, "setUnicodeStream", parameterIndex, @@ -1201,6 +1275,7 @@ public void setUnicodeStream(int parameterIndex, * called on a closed PreparedStatement */ public void setCharacterStream(int parameterIndex, Reader x) +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 throws SQLException { synchronized (connection_) { if (agent_.loggingEnabled()) { @@ -1210,6 +1285,7 @@ public void setCharacterStream(int parameterIndex, Reader x) try { checkTypeForSetCharacterStream(parameterIndex); parameterMetaData_.clientParamtertype_[parameterIndex -1] = +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Types.CLOB; if (x == null) { setNull(parameterIndex, Types.LONGVARCHAR); @@ -1235,16 +1311,22 @@ public void setCharacterStream(int parameterIndex, Reader x) */ public void setCharacterStream(int parameterIndex, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Reader x, +//IC see: https://issues.apache.org/jira/browse/DERBY-1445 +//IC see: https://issues.apache.org/jira/browse/DERBY-1445 long length) throws SQLException { try { synchronized (connection_) { if (agent_.loggingEnabled()) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 agent_.logWriter_.traceEntry(this, "setCharacterStream", parameterIndex, x, Long.valueOf(length)); } checkTypeForSetCharacterStream(parameterIndex); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 parameterMetaData_.clientParamtertype_[parameterIndex - 1] = Types.CLOB; @@ -1252,6 +1334,8 @@ public void setCharacterStream(int parameterIndex, setNull(parameterIndex, Types.LONGVARCHAR); return; } +//IC see: https://issues.apache.org/jira/browse/DERBY-3705 +//IC see: https://issues.apache.org/jira/browse/DERBY-3705 checkStreamLength(length); setInput(parameterIndex, new ClientClob(agent_, x, (int)length)); @@ -1276,8 +1360,10 @@ public void setCharacterStream(int parameterIndex, */ public void setCharacterStream(int parameterIndex, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Reader x, int length) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-1445 setCharacterStream(parameterIndex,x,(long)length); } @@ -1309,6 +1395,7 @@ private void setBlobX(int parameterIndex, Blob x) throws SqlException { } public void setClob(int parameterIndex, Clob x) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { synchronized (connection_) { @@ -1382,9 +1469,11 @@ public void setObject(int parameterIndex, Object x) throws SQLException { int paramType = getColumnMetaDataX().getColumnType(parameterIndex); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if ( paramType == Types.JAVA_OBJECT ) { setUDTX( parameterIndex, x ); +//IC see: https://issues.apache.org/jira/browse/DERBY-1938 } else if (x == null) { // DERBY-1938: Allow setting Java null also when the // column type isn't specified explicitly by the @@ -1404,6 +1493,7 @@ public void setObject(int parameterIndex, Object x) throws SQLException { setLong(parameterIndex, ((Long) x).longValue()); } else if (x instanceof byte[]) { setBytes(parameterIndex, (byte[]) x); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } else if (x instanceof BigDecimal) { setBigDecimal(parameterIndex, (BigDecimal) x); } else if (x instanceof Date) { @@ -1480,6 +1570,9 @@ private void setUDTX(int parameterIndex, Object x) throws SqlException, SQLExcep Class targetClass = Class.forName( targetClassName ); if ( targetClass.isInstance( x ) ) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 setInput(parameterIndex, x); return; } @@ -1544,6 +1637,7 @@ private void setObjectX(int parameterIndex, agent_.checkForSupportedDataType(targetJdbcType); if (x == null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 setNullX(parameterIndex, targetJdbcType); return; } @@ -1552,6 +1646,7 @@ private void setObjectX(int parameterIndex, // the targetJdbcType is specified. int inputParameterType = CrossConverters.getInputJdbcType(targetJdbcType); +//IC see: https://issues.apache.org/jira/browse/DERBY-250 parameterMetaData_.clientParamtertype_[parameterIndex - 1] = inputParameterType; x = agent_.crossConverters_.setObject(inputParameterType, x); @@ -1559,6 +1654,7 @@ private void setObjectX(int parameterIndex, try { if (targetJdbcType == Types.DECIMAL || targetJdbcType == Types.NUMERIC) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6856 x = ((BigDecimal) x).setScale(scale, RoundingMode.DOWN); } } catch (ArithmeticException ae) { @@ -1568,6 +1664,7 @@ private void setObjectX(int parameterIndex, new ClientMessageId(SQLState.JAVA_EXCEPTION), new Object[] {ae.getClass().getName(), ae.getMessage()}, ae); } +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { setObject(parameterIndex, x); } catch ( SQLException se ) { @@ -1586,6 +1683,7 @@ public void clearParameters() throws SQLException { } checkForClosedStatement(); if (parameterMetaData_ != null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-3441 Arrays.fill(parameters_, null); Arrays.fill(parameterSet_, false); } @@ -1627,6 +1725,7 @@ boolean executeX() throws SqlException { //--------------------------JDBC 2.0----------------------------- public void addBatch() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { synchronized (connection_) { @@ -1637,6 +1736,7 @@ public void addBatch() throws SQLException { checkThatAllParametersAreSet(); if (parameterTypeList == null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 parameterTypeList = new ArrayList(); } @@ -1654,6 +1754,7 @@ public void addBatch() throws SQLException { // Get a copy of the parameter type data and save it in a list // which will be used later on at the time of batch execution. +//IC see: https://issues.apache.org/jira/browse/DERBY-1292 parameterTypeList.add(parameterMetaData_.clientParamtertype_.clone()); } else { batch_.add(null); @@ -1676,6 +1777,7 @@ public int[] executeBatch() throws SQLException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "executeBatch"); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 long[] updateCounts = null; updateCounts = executeBatchX(false); @@ -1777,12 +1879,14 @@ public void setURL(int parameterIndex, URL x) throws SQLException { agent_.logWriter_.traceEntry(this, "setURL", parameterIndex, x); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.JDBC_METHOD_NOT_IMPLEMENTED)). getSQLException(); } public ParameterMetaData getParameterMetaData() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { synchronized (connection_) { @@ -1793,6 +1897,7 @@ public ParameterMetaData getParameterMetaData() throws SQLException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getParameterMetaData", parameterMetaData); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return (ParameterMetaData) parameterMetaData; } } @@ -1803,8 +1908,10 @@ public ParameterMetaData getParameterMetaData() throws SQLException { } private ClientParameterMetaData getParameterMetaDataX() +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SqlException { ClientParameterMetaData pm = +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 ClientAutoloadedDriver.getFactory(). newParameterMetaData(getColumnMetaDataX()); return pm; @@ -1815,6 +1922,7 @@ private ColumnMetaData getColumnMetaDataX() throws SqlException { return parameterMetaData_ != null ? parameterMetaData_ : +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 ClientAutoloadedDriver.getFactory().newColumnMetaData(agent_.logWriter_, 0); } @@ -1885,6 +1993,7 @@ public void completeDescribeInput(ColumnMetaData parameterMetaData, Sqlca sqlca) // parse out extended describe, so again no problem. if (sqlMode_ != isCall__ && parameterMetaData_ != null) { // 1 means IN parameter +//IC see: https://issues.apache.org/jira/browse/DERBY-3441 Arrays.fill(parameterMetaData_.sqlxParmmode_, (short)1); } @@ -1906,6 +2015,7 @@ public void completeDescribeOutput(ColumnMetaData resultSetMetaData, Sqlca sqlca private void writePrepareDescribeInputOutput() throws SqlException { // Notice that sql_ is passed in since in general ad hoc sql must be passed in for unprepared statements +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 writePrepareDescribeOutput(sql_, getSection()); writeDescribeInput(getSection()); } @@ -1919,6 +2029,7 @@ private void readPrepareDescribeInputOutput() throws SqlException { private void writePrepareDescribeInput() throws SqlException { // performance will be better if we flow prepare with output enable vs. prepare then describe input for callable // Notice that sql_ is passed in since in general ad hoc sql must be passed in for unprepared statements +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 writePrepare(sql_, getSection()); writeDescribeInput(getSection()); } @@ -1980,7 +2091,9 @@ void flowPrepareDescribeInputOutput() throws SqlException { } private void flowExecute(int executeType) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-1234 checkForClosedStatement(); +//IC see: https://issues.apache.org/jira/browse/DERBY-2653 checkAutoGeneratedKeysParameters(); clearWarningsX(); checkForAppropriateSqlMode(executeType, sqlMode_); @@ -1997,6 +2110,9 @@ private void flowExecute(int executeType) throws SqlException { // statements can have the same cursor name as long as their result // sets are not simultaneously open. +//IC see: https://issues.apache.org/jira/browse/DERBY-1036 +//IC see: https://issues.apache.org/jira/browse/DERBY-1183 +//IC see: https://issues.apache.org/jira/browse/DERBY-210 if (sqlMode_ == isQuery__) { checkForDuplicateCursorName(); } @@ -2007,6 +2123,7 @@ private void flowExecute(int executeType) throws SqlException { int numInputColumns; boolean outputExpected; +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { numInputColumns = (parameterMetaData_ != null) ? parameterMetaData_.getColumnCount() : 0; @@ -2016,15 +2133,18 @@ private void flowExecute(int executeType) throws SqlException { { // Generate a SqlException for this, we don't want to throw // SQLException in this internal method +//IC see: https://issues.apache.org/jira/browse/DERBY-842 throw new SqlException(se); } boolean chainAutoCommit = false; boolean commitSubstituted = false; boolean repositionedCursor = false; boolean timeoutSent = false; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientResultSet scrollableRS = null; boolean prepareSentForAutoGeneratedKeys = false; +//IC see: https://issues.apache.org/jira/browse/DERBY-506 if (doWriteTimeout) { timeoutArrayList.set(0, TIMEOUT_STATEMENT + timeout_); writeSetSpecialRegister(timeoutArrayList); @@ -2047,6 +2167,8 @@ private void flowExecute(int executeType) throws SqlException { chainAutoCommit = connection_.willAutoCommitGenerateFlow() && isAutoCommittableStatement_; boolean chainOpenQueryForAutoGeneratedKeys = +//IC see: https://issues.apache.org/jira/browse/DERBY-6742 +//IC see: https://issues.apache.org/jira/browse/DERBY-6753 ((sqlUpdateMode_ == isInsertSql__ || sqlUpdateMode_ == isUpdateSql__) && autoGeneratedKeys_ == RETURN_GENERATED_KEYS); writeExecute(getSection(), @@ -2058,6 +2180,7 @@ private void flowExecute(int executeType) throws SqlException { ); // chain flag if (chainOpenQueryForAutoGeneratedKeys) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 if (preparedStatementForAutoGeneratedKeys_ == null) { preparedStatementForAutoGeneratedKeys_ = prepareAutoGeneratedKeysStatement(connection_); @@ -2086,6 +2209,7 @@ private void flowExecute(int executeType) throws SqlException { break; case isQuery__: +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 writeOpenQuery(getSection(), fetchSize_, resultSetType_, @@ -2096,6 +2220,7 @@ private void flowExecute(int executeType) throws SqlException { case isCall__: writeExecuteCall(outputRegistered_, // if no out/inout parameter, outputExpected = false +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 null, getSection(), fetchSize_, false, // do not suppress ResultSets for regular CALLs @@ -2118,6 +2243,7 @@ null, getSection(), markResultSetsClosed(true); // true means remove from list of commit and rollback listeners +//IC see: https://issues.apache.org/jira/browse/DERBY-506 if (timeoutSent) { readSetSpecialRegister(); // Read response to the EXCSQLSET } @@ -2129,11 +2255,15 @@ null, getSection(), scrollableRS.readPositioningFetch_(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-3426 else { readExecute(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6742 +//IC see: https://issues.apache.org/jira/browse/DERBY-6753 if ((sqlUpdateMode_ == isInsertSql__ || sqlUpdateMode_ == isUpdateSql__) && autoGeneratedKeys_ == RETURN_GENERATED_KEYS) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 if (prepareSentForAutoGeneratedKeys) { preparedStatementForAutoGeneratedKeys_.materialPreparedStatement_.readPrepareDescribeOutput_(); } @@ -2172,6 +2302,9 @@ null, getSection(), // result sets happening during readCloseResultSets above // because ResultSet#markClosed calls // Statement#removeClientCursorNameFromCache. +//IC see: https://issues.apache.org/jira/browse/DERBY-1036 +//IC see: https://issues.apache.org/jira/browse/DERBY-1183 +//IC see: https://issues.apache.org/jira/browse/DERBY-210 setupCursorNameCacheAndMappings(); } break; @@ -2192,6 +2325,7 @@ null, getSection(), if (sqlMode_ == isCall__) { parseStorProcReturnedScrollableRowset(); +//IC see: https://issues.apache.org/jira/browse/DERBY-1364 checkForStoredProcResultSetCount(executeType); // When there are no result sets back, we will commit immediately when autocommit is true. // make sure a commit is not performed when making the call to the sqlca message procedure @@ -2202,6 +2336,7 @@ null, getSection(), // The JDBC spec says that executeUpdate() should return 0 // when no row count is returned. +//IC see: https://issues.apache.org/jira/browse/DERBY-1314 if (executeType == executeUpdateMethod__ && updateCount_ < 0) { updateCount_ = 0; } @@ -2210,11 +2345,13 @@ null, getSection(), if (resultSet_ != null && resultSet_.resultSetHoldability_ != resultSetHoldability_ && sqlMode_ != isCall__) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.UNABLE_TO_OPEN_RESULTSET_WITH_REQUESTED_HOLDABILTY), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 resultSetHoldability_); } } private long[] executeBatchX(boolean supportsQueryBatchRequest) +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 throws SqlException, SQLException { synchronized (connection_) { checkForClosedStatement(); // Per jdbc spec (see Statement.close() javadoc) @@ -2225,11 +2362,14 @@ private long[] executeBatchX(boolean supportsQueryBatchRequest) private long[] executeBatchRequestX(boolean supportsQueryBatchRequest) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SqlException, BatchUpdateException { SqlException chainBreaker = null; int batchSize = batch_.size(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 long[] updateCounts = new long[batchSize]; int numInputColumns; +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { numInputColumns = parameterMetaData_ == null ? 0 : parameterMetaData_.getColumnCount(); } catch ( SQLException se ) { @@ -2245,10 +2385,13 @@ private long[] executeBatchRequestX(boolean supportsQueryBatchRequest) // DRDA request. This is because DRDA uses a 2-byte correlation ID, // and the values 0 and 0xffff are reserved as special values. So // that imposes an upper limit on the batch size we can support: +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 if (batchSize > 65534) +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 throw ClientAutoloadedDriver.getFactory().newBatchUpdateException(agent_.logWriter_, new ClientMessageId(SQLState.TOO_MANY_COMMANDS_FOR_BATCH), new Object[] { 65534 }, updateCounts, null ); +//IC see: https://issues.apache.org/jira/browse/DERBY-6856 // Initialize all the updateCounts to indicate failure // This is done to account for "chain-breaking" errors where we cannot @@ -2258,6 +2401,7 @@ private long[] executeBatchRequestX(boolean supportsQueryBatchRequest) } if (!supportsQueryBatchRequest && sqlMode_ == isQuery__) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 throw ClientAutoloadedDriver.getFactory().newBatchUpdateException(agent_.logWriter_, new ClientMessageId(SQLState.CANNOT_BATCH_QUERIES), (Object [])null, updateCounts, null); } @@ -2271,7 +2415,9 @@ private long[] executeBatchRequestX(boolean supportsQueryBatchRequest) if (sqlMode_ == isQuery__) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 resetResultSetList(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 resultSetList_ = new ClientResultSet[batchSize]; } @@ -2282,6 +2428,7 @@ private long[] executeBatchRequestX(boolean supportsQueryBatchRequest) agent_.beginBatchedWriteChain(this); boolean chainAutoCommit = connection_.willAutoCommitGenerateFlow() && isAutoCommittableStatement_; +//IC see: https://issues.apache.org/jira/browse/DERBY-506 if (doWriteTimeout) { timeoutArrayList.set(0, TIMEOUT_STATEMENT + timeout_); writeSetSpecialRegister(timeoutArrayList); @@ -2291,18 +2438,22 @@ private long[] executeBatchRequestX(boolean supportsQueryBatchRequest) for (int i = 0; i < batchSize; i++) { if (parameterMetaData_ != null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 parameterMetaData_.clientParamtertype_ = parameterTypeList.get(i); parameters_ = (Object[]) batch_.get(i); } if (sqlMode_ != isCall__) { boolean outputExpected; +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { outputExpected = (resultSetMetaData_ != null && resultSetMetaData_.getColumnCount() > 0); } catch ( SQLException se ) { throw new SqlException(se); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 writeExecute(getSection(), parameterMetaData_, parameters_, @@ -2311,11 +2462,13 @@ private long[] executeBatchRequestX(boolean supportsQueryBatchRequest) chainAutoCommit || (i != batchSize - 1)); // more statements to chain } else if (outputRegistered_) // make sure no output parameters are registered { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 throw ClientAutoloadedDriver.getFactory().newBatchUpdateException(agent_.logWriter_, new ClientMessageId(SQLState.OUTPUT_PARAMS_NOT_ALLOWED), (Object [])null, updateCounts, null ); } else { writeExecuteCall(false, // no output expected for batched CALLs +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 null, getSection(), fetchSize_, true, // suppress ResultSets for batch @@ -2342,6 +2495,7 @@ null, getSection(), agent_.flowBatch(this, batchSize); +//IC see: https://issues.apache.org/jira/browse/DERBY-506 if (timeoutSent) { readSetSpecialRegister(); // Read response to the EXCSQLSET } @@ -2376,11 +2530,13 @@ null, getSection(), catch (SqlException e) { // for chain-breaking exception only chainBreaker = e; chainBreaker.setNextException(new SqlException(agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-1350 new ClientMessageId(SQLState.BATCH_CHAIN_BREAKING_EXCEPTION))); } // We need to clear the batch before any exception is thrown from agent_.endBatchedReadChain(). batch_.clear(); parameterTypeList = null; +//IC see: https://issues.apache.org/jira/browse/DERBY-1292 // restore the saved input set, setting it to "current" parameters_ = savedInputs; @@ -2399,6 +2555,9 @@ null, getSection(), public void listenToUnitOfWork() { if (!listenToUnitOfWork_) { listenToUnitOfWork_ = true; +//IC see: https://issues.apache.org/jira/browse/DERBY-210 +//IC see: https://issues.apache.org/jira/browse/DERBY-557 +//IC see: https://issues.apache.org/jira/browse/DERBY-210 connection_.CommitAndRollbackListeners_.put(this,null); } } @@ -2422,17 +2581,20 @@ public void completeLocalRollback(Iterator listenerIterator) { * @return name of java.sql interface */ protected String getJdbcStatementInterfaceName() { +//IC see: https://issues.apache.org/jira/browse/DERBY-1364 return "java.sql.PreparedStatement"; } void checkForValidParameterIndex(int parameterIndex) throws SqlException { if (parameterMetaData_ == null) +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.NO_INPUT_PARAMETERS)); if (parameterIndex < 1 || parameterIndex > parameterMetaData_.columns_) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.LANG_INVALID_PARAM_POSITION), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 parameterIndex, parameterMetaData_.columns_); } } @@ -2447,6 +2609,7 @@ private void checkThatAllParametersAreSet() throws SqlException { if (!parameterSet_[i] && (!parameterRegistered_[i] || parameterMetaData_.sqlxParmmode_[i] == +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientParameterMetaData.parameterModeInOut)) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.LANG_MISSING_PARMS)); @@ -2458,6 +2621,7 @@ private void checkThatAllParametersAreSet() throws SqlException { void checkForValidScale(int scale) throws SqlException { if (scale < 0 || scale > 31) { throw new SqlException(agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 new ClientMessageId(SQLState.BAD_SCALE_VALUE), scale); } } @@ -2466,8 +2630,10 @@ void checkForValidScale(int scale) throws SqlException { * @see org.apache.derby.client.am.Statement#markClosed(boolean) */ protected void markClosed(boolean removeListener){ +//IC see: https://issues.apache.org/jira/browse/DERBY-941 if(pooledConnection_ != null) pooledConnection_.onStatementClose(this); +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 super.markClosed(removeListener); if (parameterMetaData_ != null) { @@ -2479,11 +2645,13 @@ protected void markClosed(boolean removeListener){ // Apparently, the JVM is not smart enough to traverse parameters_[] and null // out its members when the entire array is set to null (parameters_=null;). if (parameters_ != null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-3441 Arrays.fill(parameters_, null); } parameters_ = null; if(removeListener) +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 connection_.CommitAndRollbackListeners_.remove(this); } @@ -2503,6 +2671,7 @@ protected void markClosed(boolean removeListener){ * called on a closed PreparedStatement */ public void setAsciiStream(int parameterIndex, InputStream x) +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 throws SQLException { synchronized (connection_) { if (agent_.loggingEnabled()) { @@ -2511,6 +2680,7 @@ public void setAsciiStream(int parameterIndex, InputStream x) } try { checkTypeForSetAsciiStream(parameterIndex); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 parameterMetaData_.clientParamtertype_[parameterIndex - 1] = Types.CLOB; @@ -2519,6 +2689,7 @@ public void setAsciiStream(int parameterIndex, InputStream x) return; } setInput(parameterIndex, +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 new ClientClob(agent_, x, Cursor.ISO_8859_1)); } catch (SqlException se) { throw se.getSQLException(); @@ -2581,6 +2752,7 @@ public void setClob(int parameterIndex, Reader reader) } catch (SqlException se) { throw se.getSQLException(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 setInput(parameterIndex, new ClientClob(agent_, reader)); } } @@ -2601,8 +2773,10 @@ public void setClob(int parameterIndex, Reader reader, long length) synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "setClob", +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 parameterIndex, reader, Long.valueOf(length)); } +//IC see: https://issues.apache.org/jira/browse/DERBY-1234 try { checkForClosedStatement(); } catch (SqlException se) { @@ -2611,8 +2785,10 @@ public void setClob(int parameterIndex, Reader reader, long length) if(length > Integer.MAX_VALUE) throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.BLOB_TOO_LARGE_FOR_CLIENT), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 length, Integer.MAX_VALUE).getSQLException(); else +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 setInput(parameterIndex, new ClientClob(agent_, reader, (int)length)); } @@ -2637,6 +2813,7 @@ public void setClob(int parameterIndex, Reader reader, long length) * marker in the SQL statement */ public void setBlob(int parameterIndex, InputStream inputStream) +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 throws SQLException { synchronized (connection_) { if (agent_.loggingEnabled()) { @@ -2673,6 +2850,7 @@ public void setBlob(int parameterIndex, InputStream inputStream, long length) synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "setBlob", parameterIndex, +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 inputStream, Long.valueOf(length)); } if(length > Integer.MAX_VALUE) @@ -2717,6 +2895,7 @@ public void setNClob(int parameterIndex, Reader reader, long length) } public void setRowId(int parameterIndex, RowId x) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6213 throw SQLExceptionFactory.notImplemented("setRowId (int, RowId)"); } @@ -2725,6 +2904,7 @@ public void setNClob(int index, NClob value) throws SQLException { } public void setSQLXML(int parameterIndex, SQLXML xmlObject) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SQLException { throw SQLExceptionFactory.notImplemented("setSQLXML (int, SQLXML)"); } @@ -2734,6 +2914,7 @@ public void setSQLXML(int parameterIndex, SQLXML xmlObject) // Beginning of JDBC 4.2 methods public long executeLargeUpdate() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 try { synchronized (connection_) { @@ -2747,6 +2928,9 @@ public long executeLargeUpdate() throws SQLException { return updateValue; } } +//IC see: https://issues.apache.org/jira/browse/DERBY-941 +//IC see: https://issues.apache.org/jira/browse/DERBY-941 +//IC see: https://issues.apache.org/jira/browse/DERBY-941 catch ( SqlException se ) { checkStatementValidity(se); throw se.getSQLException(); @@ -2764,6 +2948,7 @@ public long executeLargeUpdate() throws SQLException { */ private void checkStatementValidity(SqlException sqle) +//IC see: https://issues.apache.org/jira/browse/DERBY-941 throws SQLException { //check if the statement is already closed //This might be caused because the connection associated @@ -2795,6 +2980,7 @@ private PossibleTypes(int[] types){ */ final public static PossibleTypes POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR = new PossibleTypes( new int[] { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Types.BIGINT, Types.LONGVARCHAR , Types.CHAR, @@ -3100,6 +3286,7 @@ static SqlException throw22005Exception( LogWriter logWriter, throw new SqlException( logWriter, new ClientMessageId(SQLState.LANG_DATA_TYPE_GET_MISMATCH) , new Object[]{ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientTypes.getTypeString(valType), ClientTypes.getTypeString(paramType) }, @@ -3114,6 +3301,7 @@ static PossibleTypes getPossibleTypesForNull(int typeOfVariable){ switch(typeOfVariable){ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.SMALLINT: return POSSIBLE_TYPES_FOR_GENERIC_SCALAR_NULL; @@ -3185,6 +3373,7 @@ static PossibleTypes getPossibleTypesForNull(int typeOfVariable){ */ protected void checkStatus() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 try { checkForClosedStatement(); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ClientPreparedStatement42.java b/java/org.apache.derby.client/org/apache/derby/client/am/ClientPreparedStatement42.java index 848b5e76db..ab3bf79594 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/ClientPreparedStatement42.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/ClientPreparedStatement42.java @@ -44,6 +44,7 @@ public class ClientPreparedStatement42 extends ClientPreparedStatement */ public ClientPreparedStatement42 ( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Agent agent, ClientConnection connection, String sql, Section section,ClientPooledConnection cpc ) throws SqlException @@ -73,6 +74,7 @@ public class ClientPreparedStatement42 extends ClientPreparedStatement */ public ClientPreparedStatement42 ( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Agent agent, ClientConnection connection,String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes, ClientPooledConnection cpc @@ -83,6 +85,7 @@ public class ClientPreparedStatement42 extends ClientPreparedStatement } public void setObject +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ( int parameterIndex, Object x, SQLType targetSqlType ) throws SQLException { @@ -111,6 +114,7 @@ public class ClientPreparedStatement42 extends ClientPreparedStatement { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry +//IC see: https://issues.apache.org/jira/browse/DERBY-6856 ( this, "setObject", parameterIndex, x, targetSqlType, scaleOrLength ); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ClientResultSet.java b/java/org.apache.derby.client/org/apache/derby/client/am/ClientResultSet.java index c981cfbaed..46d8a2e268 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/ClientResultSet.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/ClientResultSet.java @@ -226,6 +226,7 @@ public abstract class ClientResultSet implements ResultSet, //---------------------constructors/finalizer--------------------------------- protected ClientResultSet(Agent agent, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientStatement statement, Cursor cursor, int resultSetType, @@ -244,6 +245,7 @@ protected ClientResultSet(Agent agent, fetchDirection_ = statement_.fetchDirection_; suggestedFetchSize_ = statement_.fetchSize_; +//IC see: https://issues.apache.org/jira/browse/DERBY-517 maxRows_ = statement_.maxRows_; // Only set the warning if actual resultSetType returned by the server is less @@ -256,6 +258,7 @@ protected ClientResultSet(Agent agent, new SqlWarning( agent_.logWriter_, new ClientMessageId(SQLState.INVALID_RESULTSET_TYPE), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 statement_.resultSetType_, resultSetType_)); } @@ -278,6 +281,7 @@ protected ClientResultSet(Agent agent, // ---------------------------jdbc 1------------------------------------------ public final boolean next() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { synchronized (connection_) { @@ -310,8 +314,10 @@ boolean nextX() throws SqlException { resetUpdatedColumns(); unuseStreamsAndLOBs(); +//IC see: https://issues.apache.org/jira/browse/DERBY-3844 // for TYPE_FORWARD_ONLY ResultSet, just call cursor.next() +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (resultSetType_ == ResultSet.TYPE_FORWARD_ONLY) { // cursor is null for singleton selects that do not return data. isValidCursorPosition_ = (cursor_ == null) ? false : cursor_.next(); @@ -343,6 +349,7 @@ boolean nextX() throws SqlException { // if (!isValidCursorPosition_ && // We've gone past the end (+100) // cursor_ != null) { if ((!isValidCursorPosition_ && cursor_ != null) || +//IC see: https://issues.apache.org/jira/browse/DERBY-517 (maxRows_ > 0 && cursor_.rowsRead_ > maxRows_)) { isValidCursorPosition_ = false; @@ -363,6 +370,7 @@ boolean nextX() throws SqlException { } try { +//IC see: https://issues.apache.org/jira/browse/DERBY-213 statement_.resultSetCommitting(this); } catch (SqlException sqle) { sqlException = Utils.accumulateSQLException(sqle, sqlException); @@ -412,6 +420,7 @@ boolean nextX() throws SqlException { // maxRows_ will be ignored by sensitive dynamic cursors since we don't know the rowCount if (!openOnClient_) { isValidCursorPosition_ = false; +//IC see: https://issues.apache.org/jira/browse/DERBY-517 } else if (sensitivity_ != sensitivity_sensitive_dynamic__ && maxRows_ > 0 && (firstRowInRowset_ + currentRowInRowset_ > maxRows_)) { isValidCursorPosition_ = false; @@ -421,6 +430,7 @@ boolean nextX() throws SqlException { public void close() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { synchronized (connection_) { @@ -443,18 +453,22 @@ public final void closeX() throws SqlException { if (!openOnClient_) { return; } +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 closeOpenStreams(); // See if there are open locators on the current row, if valid. +//IC see: https://issues.apache.org/jira/browse/DERBY-3571 if (isValidCursorPosition_ && !isOnInsertRow_) { lobState.checkCurrentRow(cursor_); } // NOTE: The preClose_ method must also check for locators if // prefetching of data is enabled for result sets containing LOBs. +//IC see: https://issues.apache.org/jira/browse/DERBY-821 preClose_(); try { if (openOnServer_) { flowCloseAndAutoCommitIfNotAutoCommitted(); } else { +//IC see: https://issues.apache.org/jira/browse/DERBY-213 statement_.resultSetCommitting(this); } } finally { @@ -465,13 +479,16 @@ public final void closeX() throws SqlException { statement_.closeX(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-4869 nullDataForGC(); } /** Close Statement if it is set to closeOnCompletion */ private void closeStatementOnCompletion() { +//IC see: https://issues.apache.org/jira/browse/DERBY-4869 statement_.closeMeOnCompletion(); +//IC see: https://issues.apache.org/jira/browse/DERBY-4869 if ( (outerStatement_ != null) && (outerStatement_ != statement_) ) { outerStatement_.closeMeOnCompletion(); } outerStatement_ = null; } @@ -488,10 +505,12 @@ private void nullDataForGC() { } private void flowCloseAndAutoCommitIfNotAutoCommitted() +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SqlException { agent_.beginWriteChain(statement_); boolean performedAutoCommit = writeCloseAndAutoCommit(); agent_.flow(statement_); +//IC see: https://issues.apache.org/jira/browse/DERBY-213 readCloseAndAutoCommit(performedAutoCommit); agent_.endReadChain(); } @@ -519,6 +538,8 @@ void writeClose() throws SqlException { // close cursor if autoCommit is true. autoCommitted_ = false; if (generatedSection_ == null) { // none call statement result set case +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 writeCursorClose_(statement_.getSection()); } else { // call statement result set(s) case writeCursorClose_(generatedSection_); @@ -552,6 +573,7 @@ public boolean wasNull() throws SQLException { } checkForClosedResultSet("wasNull"); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (wasNull_ == ClientResultSet.WAS_NULL_UNSET) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.WASNULL_INVALID)); @@ -576,12 +598,14 @@ public boolean getBoolean(int column) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getBoolean", column); } checkGetterPreconditions(column, "getBoolean"); boolean result = false; +//IC see: https://issues.apache.org/jira/browse/DERBY-100 if (wasNonNullSensitiveUpdate(column) || isOnInsertRow_) { if (isOnInsertRow_ && updatedColumns_[column - 1] == null) { result = false; @@ -593,6 +617,7 @@ public boolean getBoolean(int column) throws SQLException { } else { result = isNull(column) ? false : cursor_.getBoolean(column); } +//IC see: https://issues.apache.org/jira/browse/DERBY-100 if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getBoolean", result); } @@ -610,12 +635,14 @@ public byte getByte(int column) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getByte", column); } checkGetterPreconditions(column, "getByte"); byte result = 0; +//IC see: https://issues.apache.org/jira/browse/DERBY-100 if (wasNonNullSensitiveUpdate(column) || isOnInsertRow_) { if ((isOnInsertRow_) && (updatedColumns_[column - 1] == null)) { result = 0; @@ -644,17 +671,20 @@ public short getShort(int column) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getShort", column); } checkGetterPreconditions(column, "getShort"); short result = 0; +//IC see: https://issues.apache.org/jira/browse/DERBY-100 if (wasNonNullSensitiveUpdate(column) || isOnInsertRow_) { if (isOnInsertRow_ && updatedColumns_[column - 1] == null) { result = 0; } else { result = ((Short) agent_.crossConverters_.setObject( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Types.SMALLINT, updatedColumns_[column - 1])).shortValue(); } @@ -678,17 +708,20 @@ public int getInt(int column) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getInt", column); } checkGetterPreconditions(column, "getInt"); int result = 0; +//IC see: https://issues.apache.org/jira/browse/DERBY-100 if (wasNonNullSensitiveUpdate(column) || isOnInsertRow_) { if (isOnInsertRow_ && updatedColumns_[column - 1] == null) { result = 0; } else { result = ((Integer) agent_.crossConverters_.setObject( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Types.INTEGER, updatedColumns_[column - 1])).intValue(); } @@ -712,17 +745,20 @@ public long getLong(int column) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getLong", column); } checkGetterPreconditions(column, "getLong"); long result = 0; +//IC see: https://issues.apache.org/jira/browse/DERBY-100 if (wasNonNullSensitiveUpdate(column) || isOnInsertRow_) { if (isOnInsertRow_ && updatedColumns_[column - 1] == null) { result = 0; } else { result = ((Long) agent_.crossConverters_.setObject( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Types.BIGINT, updatedColumns_[column - 1])).longValue(); } @@ -746,17 +782,20 @@ public float getFloat(int column) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getFloat", column); } checkGetterPreconditions(column, "getFloat"); float result = 0; +//IC see: https://issues.apache.org/jira/browse/DERBY-100 if (wasNonNullSensitiveUpdate(column) || isOnInsertRow_) { if ((isOnInsertRow_ && updatedColumns_[column - 1] == null)) { result = 0; } else { result = ((Float) agent_.crossConverters_.setObject( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Types.REAL, updatedColumns_[column - 1])).floatValue(); } @@ -780,17 +819,20 @@ public double getDouble(int column) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getDouble", column); } checkGetterPreconditions(column, "getDouble"); double result = 0; +//IC see: https://issues.apache.org/jira/browse/DERBY-100 if (wasNonNullSensitiveUpdate(column) || isOnInsertRow_) { if (isOnInsertRow_ && updatedColumns_[column - 1] == null) { result = 0; } else { result = ((Double) agent_.crossConverters_.setObject( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Types.DOUBLE, updatedColumns_[column - 1])).doubleValue(); } @@ -815,11 +857,13 @@ public BigDecimal getBigDecimal(int column, int scale) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceDeprecatedEntry(this, "getBigDecimal", column, scale); } checkGetterPreconditions(column, "getBigDecimal"); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 BigDecimal result = null; if (wasNonNullSensitiveUpdate(column)) { result = ((BigDecimal) agent_.crossConverters_.setObject( @@ -849,11 +893,13 @@ public BigDecimal getBigDecimal(int column) throws SQLException { { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getBigDecimal", column); } checkGetterPreconditions(column, "getBigDecimal"); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 BigDecimal result = null; if (wasNonNullSensitiveUpdate(column)) { result = (BigDecimal)agent_.crossConverters_.setObject( @@ -879,6 +925,7 @@ public Date getDate(int column, Calendar cal) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getDate", column); @@ -890,6 +937,7 @@ public Date getDate(int column, Calendar cal) throws SQLException { new ClientMessageId(SQLState.CALENDAR_IS_NULL)); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Date result = null; if (wasNonNullSensitiveUpdate(column)) { result = (Date)agent_.crossConverters_.setObject( @@ -923,6 +971,7 @@ public Time getTime(int column, Calendar cal) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getTime", column, cal); @@ -934,6 +983,7 @@ public Time getTime(int column, Calendar cal) throws SQLException { new ClientMessageId(SQLState.CALENDAR_IS_NULL)); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Time result = null; if (wasNonNullSensitiveUpdate(column)) { result = (Time)agent_.crossConverters_.setObject( @@ -968,6 +1018,7 @@ public Timestamp getTimestamp(int column, Calendar calendar) try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry( @@ -980,6 +1031,7 @@ public Timestamp getTimestamp(int column, Calendar calendar) new ClientMessageId(SQLState.CALENDAR_IS_NULL)); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Timestamp result = null; if (wasNonNullSensitiveUpdate(column)) { result = (Timestamp)agent_.crossConverters_.setObject( @@ -1014,6 +1066,7 @@ public Timestamp getTimestamp(int column) throws SQLException { * @return a calendar initialized to the specified time */ private static Calendar createCalendar(java.util.Date date) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 Calendar cal = Calendar.getInstance(); cal.setTime(date); return cal; @@ -1028,6 +1081,7 @@ private static Calendar createCalendar(java.util.Date date) { * @return a date object that represents the date in {@code cal} */ private Date convertFromDefaultCalendar(Date date, Calendar cal) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 Calendar from = createCalendar(date); cal.clear(); cal.set(from.get(Calendar.YEAR), @@ -1045,6 +1099,7 @@ private Date convertFromDefaultCalendar(Date date, Calendar cal) { * @return a time object that represents the time in {@code cal} */ private Time convertFromDefaultCalendar(Time time, Calendar cal) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 Calendar from = createCalendar(time); cal.clear(); cal.set(1970, Calendar.JANUARY, 1, // normalized date: 1970-01-01 @@ -1063,6 +1118,7 @@ private Time convertFromDefaultCalendar(Time time, Calendar cal) { * @return a timestamp object that represents the timestamp in {@code cal} */ private Timestamp convertFromDefaultCalendar(Timestamp ts, Calendar cal) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 Calendar from = createCalendar(ts); cal.clear(); cal.set(from.get(Calendar.YEAR), @@ -1087,7 +1143,9 @@ public String getString(int column) throws SQLException { } checkGetterPreconditions(column, "getString"); int type = resultSetMetaData_.types_[column - 1]; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (type == ClientTypes.BLOB || type == ClientTypes.CLOB) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5489 checkLOBMultiCall(column); // If the above didn't fail, this is the first getter // invocation, or only getBytes and/or getString have been @@ -1096,6 +1154,7 @@ public String getString(int column) throws SQLException { } String result = null; if (wasNonNullSensitiveUpdate(column)) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 result = (String)agent_.crossConverters_.setObject( Types.CHAR, updatedColumns_[column - 1]); } else { @@ -1118,13 +1177,16 @@ public byte[] getBytes(int column) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getBytes", column); } checkGetterPreconditions(column, "getBytes"); int type = resultSetMetaData_.types_[column - 1]; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (type == ClientTypes.BLOB) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5489 checkLOBMultiCall(column); // If the above didn't fail, this is the first getter // invocation, or only getBytes has been invoked previously. @@ -1133,6 +1195,7 @@ public byte[] getBytes(int column) throws SQLException { } byte[] result = null; if (wasNonNullSensitiveUpdate(column)) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 result = (byte[])agent_.crossConverters_.setObject( Types.BINARY, updatedColumns_[column - 1]); } else { @@ -1155,6 +1218,7 @@ public InputStream getBinaryStream(int column) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getBinaryStream", column); @@ -1163,6 +1227,7 @@ public InputStream getBinaryStream(int column) throws SQLException { checkGetterPreconditions(column, "getBinaryStream"); useStreamOrLOB(column); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 InputStream result = null; if (wasNonNullSensitiveUpdate(column)) { result = new ByteArrayInputStream( @@ -1188,6 +1253,7 @@ public InputStream getAsciiStream(int column) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getAsciiStream", column); @@ -1196,6 +1262,7 @@ public InputStream getAsciiStream(int column) throws SQLException { checkGetterPreconditions(column, "getAsciiStream"); useStreamOrLOB(column); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 InputStream result = null; if (wasNonNullSensitiveUpdate(column)) { @@ -1227,6 +1294,7 @@ public InputStream getAsciiStream(int column) throws SQLException { * @deprecated */ public InputStream getUnicodeStream(int column) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-253 if (agent_.loggingEnabled()) { agent_.logWriter_.traceDeprecatedEntry(this, "getUnicodeStream", column); @@ -1240,6 +1308,7 @@ public Reader getCharacterStream(int column) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getCharacterStream", column); @@ -1248,6 +1317,7 @@ public Reader getCharacterStream(int column) throws SQLException { checkGetterPreconditions(column, "getCharacterStream"); useStreamOrLOB(column); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Reader result = null; if (wasNonNullSensitiveUpdate(column)) { result = new StringReader @@ -1260,6 +1330,7 @@ public Reader getCharacterStream(int column) throws SQLException { agent_.logWriter_.traceExit(this, "getCharacterStream", result); } setWasNull(column); // Placed close to the return to minimize risk of thread interference +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 currentReader = result; return result; } @@ -1274,12 +1345,14 @@ public Blob getBlob(int column) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getBlob", column); } checkGetterPreconditions(column, "getBlob"); useStreamOrLOB(column); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Blob result = null; if (wasNonNullSensitiveUpdate(column)) { result = (Blob) agent_.crossConverters_.setObject(Types.BLOB, @@ -1304,12 +1377,14 @@ public Clob getClob(int column) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getClob", column); } checkGetterPreconditions(column, "getClob"); useStreamOrLOB(column); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Clob result = null; if (wasNonNullSensitiveUpdate(column)) { result = (Clob) agent_.crossConverters_.setObject(Types.CLOB, @@ -1334,11 +1409,13 @@ public Ref getRef(int column) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getRef", column); } checkGetterPreconditions(column, "getRef"); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Ref result = isNull(column) ? null : cursor_.getRef(column); if (true) { throw new SqlException(agent_.logWriter_, @@ -1361,11 +1438,13 @@ public Array getArray(int column) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getArray", column); } checkGetterPreconditions(column, "getArray"); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Array result = isNull(column) ? null : cursor_.getArray(column); if (true) { throw new SqlException(agent_.logWriter_, @@ -1388,6 +1467,7 @@ public Object getObject(int column) throws SQLException { try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getObject", column); @@ -1408,7 +1488,13 @@ public Object getObject(int column) throws SQLException { Object getObjectX(int column) throws SqlException { checkGetterPreconditions(column, "getObject"); int type = resultSetMetaData_.types_[column - 1]; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (type == ClientTypes.BLOB || type == ClientTypes.CLOB) { +//IC see: https://issues.apache.org/jira/browse/DERBY-3844 +//IC see: https://issues.apache.org/jira/browse/DERBY-3844 +//IC see: https://issues.apache.org/jira/browse/DERBY-3844 +//IC see: https://issues.apache.org/jira/browse/DERBY-3844 +//IC see: https://issues.apache.org/jira/browse/DERBY-3844 useStreamOrLOB(column); } Object result = null; @@ -1423,9 +1509,11 @@ Object getObjectX(int column) throws SqlException { // Live life on the edge and run unsynchronized public Object getObject(int column, Map map) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { closeOpenStreams(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getObject", column, map); @@ -1477,6 +1565,7 @@ private boolean wasNullSensitiveUpdate(int column) { } private void setWasNull(int column) { +//IC see: https://issues.apache.org/jira/browse/DERBY-100 if (wasNullSensitiveUpdate(column) || (isOnInsertRow_ && updatedColumns_[column - 1] == null)) { wasNull_ = WAS_NULL; } else { @@ -1495,6 +1584,7 @@ private boolean isNull(int column) { // ------------- Methods for accessing results by column name ---------------- public final boolean getBoolean(String columnName) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { if (agent_.loggingEnabled()) { @@ -1906,6 +1996,7 @@ public final SQLWarning getWarnings() throws SQLException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getWarnings", warnings_); } +//IC see: https://issues.apache.org/jira/browse/DERBY-860 return warnings_ == null ? null : warnings_.getSQLWarning(); } @@ -1947,7 +2038,11 @@ public String getCursorName() throws SQLException { if (generatedSection_ != null) { return "stored procedure generated cursor:" + generatedSection_.getServerCursorName(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-1036 +//IC see: https://issues.apache.org/jira/browse/DERBY-1183 +//IC see: https://issues.apache.org/jira/browse/DERBY-210 if (statement_.cursorName_ == null) {// cursor name is not assigned yet +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 statement_.cursorName_ = statement_.getSection().getServerCursorName(); } if (agent_.loggingEnabled()) { @@ -1970,6 +2065,7 @@ public ResultSetMetaData getMetaData() throws SQLException { } ResultSetMetaData resultSetMetaData = getMetaDataX(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getMetaData", resultSetMetaData); @@ -1990,6 +2086,7 @@ ColumnMetaData getMetaDataX() throws SqlException { public final int findColumn(String columnName) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { synchronized (connection_) { @@ -2018,6 +2115,7 @@ protected final int findColumnX(String columnName, String operation) throws SqlE //-------------------------- Traversal/Positioning --------------------------- public boolean isBeforeFirst() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { if (agent_.loggingEnabled()) { @@ -2049,6 +2147,7 @@ private boolean isBeforeFirstX() throws SqlException { } public boolean isAfterLast() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { if (agent_.loggingEnabled()) { @@ -2077,11 +2176,13 @@ private boolean isAfterLastX() throws SqlException { (firstRowInRowset_ == currentRowInRowset_ && currentRowInRowset_ == lastRowInRowset_ && lastRowInRowset_ == 0 && +//IC see: https://issues.apache.org/jira/browse/DERBY-517 absolutePosition_ == (maxRows_ == 0 ? rowCount_ + 1 : maxRows_ + 1))); } } public boolean isFirst() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { if (agent_.loggingEnabled()) { @@ -2111,6 +2212,7 @@ private boolean isFirstX() { } public boolean isLast() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { if (agent_.loggingEnabled()) { @@ -2141,6 +2243,7 @@ private boolean isLastX() throws SqlException { } public void beforeFirst() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { synchronized (connection_) { @@ -2182,6 +2285,7 @@ private void beforeFirstX() throws SqlException { } public void afterLast() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { synchronized (connection_) { @@ -2222,6 +2326,7 @@ private void afterLastX() throws SqlException { } public boolean first() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { synchronized (connection_) { @@ -2255,6 +2360,7 @@ private boolean firstX() throws SqlException { resetRowsetFlags(); unuseStreamsAndLOBs(); +//IC see: https://issues.apache.org/jira/browse/DERBY-3844 // if first row is not in the current rowset, fetch the first rowset from the server. // rowIsInCurrentRowset with orientation first will always return false for dynamic cursors. @@ -2277,6 +2383,7 @@ private boolean firstX() throws SqlException { } public boolean last() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { synchronized (connection_) { @@ -2304,18 +2411,23 @@ private boolean lastX() throws SqlException { moveToCurrentRowX(); wasNull_ = ClientResultSet.WAS_NULL_UNSET; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 // discard all previous updates when moving the cursor resetUpdatedColumns(); resetRowsetFlags(); unuseStreamsAndLOBs(); +//IC see: https://issues.apache.org/jira/browse/DERBY-3844 // only get the rowCount for static cursors. if (rowCountIsUnknown()) { getRowCount(); } long row = rowCount_; +//IC see: https://issues.apache.org/jira/browse/DERBY-517 if (sensitivity_ != sensitivity_sensitive_dynamic__ && maxRows_ > 0) { if (rowCount_ > maxRows_) { row = maxRows_; @@ -2342,6 +2454,7 @@ private boolean lastX() throws SqlException { } public int getRow() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { synchronized (connection_) { @@ -2365,10 +2478,12 @@ private int getRowX() throws SqlException { checkForClosedResultSet("getRow"); long row; checkThatResultSetIsNotDynamic(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (resultSetType_ == ResultSet.TYPE_FORWARD_ONLY) // for forward-only cursors, getRow() should return 0 if cursor is not on a valid row, // i.e. afterlast. { +//IC see: https://issues.apache.org/jira/browse/DERBY-821 row = (cursor_.allRowsReceivedFromServer() && cursor_.currentRowPositionIsEqualToNextRowPosition()) ? 0 : cursor_.rowsRead_; } else { @@ -2388,12 +2503,14 @@ private int getRowX() throws SqlException { if (row > Integer.MAX_VALUE) { this.accumulateWarning(new SqlWarning(agent_.logWriter_, new ClientMessageId(SQLState.NUMBER_OF_ROWS_TOO_LARGE_FOR_INT), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 row)); } return (int) row; } public boolean absolute(int row) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { synchronized (connection_) { @@ -2427,6 +2544,7 @@ private boolean absoluteX(int row) throws SqlException { resetRowsetFlags(); unuseStreamsAndLOBs(); +//IC see: https://issues.apache.org/jira/browse/DERBY-3844 if (maxRows_ > 0) { // if "row" is positive and > maxRows, fetch afterLast @@ -2435,6 +2553,7 @@ private boolean absoluteX(int row) throws SqlException { afterLastX(); isValidCursorPosition_ = false; return isValidCursorPosition_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } else if (row <= 0 && Math.abs(row) > maxRows_) { beforeFirstX(); isValidCursorPosition_ = false; @@ -2479,6 +2598,7 @@ private boolean absoluteX(int row) throws SqlException { } public boolean relative(int rows) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { synchronized (connection_) { @@ -2510,8 +2630,10 @@ private boolean relativeX(int rows) throws SqlException { // discard all previous updates when moving the cursor. resetUpdatedColumns(); unuseStreamsAndLOBs(); +//IC see: https://issues.apache.org/jira/browse/DERBY-3844 // If the resultset is empty, relative(n) is a null operation +//IC see: https://issues.apache.org/jira/browse/DERBY-276 if (resultSetContainsNoRows()) { isValidCursorPosition_ = false; return isValidCursorPosition_; @@ -2560,6 +2682,7 @@ private boolean relativeX(int rows) throws SqlException { // Ok, now we are on a row and ready to do some real positioning..... resetRowsetFlags(); +//IC see: https://issues.apache.org/jira/browse/DERBY-3844 // currentAbsoluteRowNumber is used for static cursors only. long currentAbsoluteRowNumber = firstRowInRowset_ + currentRowInRowset_; @@ -2569,6 +2692,7 @@ private boolean relativeX(int rows) throws SqlException { // the currentrow number, will fetch beforeFirst anyways. do not need to check // for maxRows. if (sensitivity_ != sensitivity_sensitive_dynamic__ && +//IC see: https://issues.apache.org/jira/browse/DERBY-517 maxRows_ > 0 && rows > 0 && currentAbsoluteRowNumber + rows > maxRows_) { afterLastX(); isValidCursorPosition_ = false; @@ -2583,6 +2707,7 @@ private boolean relativeX(int rows) throws SqlException { long rowNumber = (sensitivity_ == sensitivity_sensitive_dynamic__) ? currentRowInRowset_ + rows : currentAbsoluteRowNumber + rows - absolutePosition_; +//IC see: https://issues.apache.org/jira/browse/DERBY-517 if (maxRows_ < Math.abs(rowNumber) && maxRows_ != 0) { if (rowNumber > 0) { afterLastX(); @@ -2605,6 +2730,7 @@ private boolean relativeX(int rows) throws SqlException { } public boolean previous() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { synchronized (connection_) { @@ -2632,6 +2758,9 @@ private boolean previousX() throws SqlException { moveToCurrentRowX(); wasNull_ = ClientResultSet.WAS_NULL_UNSET; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 // discard all previous updates when moving the cursor. resetUpdatedColumns(); @@ -2660,6 +2789,7 @@ private boolean previousX() throws SqlException { return isValidCursorPosition_; } +//IC see: https://issues.apache.org/jira/browse/DERBY-517 if (sensitivity_ != sensitivity_sensitive_dynamic__ && maxRows_ > 0 && (firstRowInRowset_ + currentRowInRowset_ > maxRows_)) { isValidCursorPosition_ = false; @@ -2669,6 +2799,7 @@ private boolean previousX() throws SqlException { } public void setFetchDirection(int direction) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { synchronized (connection_) { @@ -2679,6 +2810,7 @@ public void setFetchDirection(int direction) throws SQLException { checkThatResultSetTypeIsScrollable(); switch (direction) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ResultSet.FETCH_FORWARD: case ResultSet.FETCH_REVERSE: case ResultSet.FETCH_UNKNOWN: @@ -2687,6 +2819,7 @@ public void setFetchDirection(int direction) throws SQLException { default: throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.INVALID_FETCH_DIRECTION), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 direction); } } @@ -2720,9 +2853,11 @@ public void setFetchSize(int rows) throws SQLException { agent_.logWriter_.traceEntry(this, "setFetchSize", rows); } checkForClosedResultSet("setFetchSize"); +//IC see: https://issues.apache.org/jira/browse/DERBY-3573 if (rows < 0) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.INVALID_FETCH_SIZE), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 rows).getSQLException(); } setFetchSize_(rows); @@ -2786,6 +2921,7 @@ public boolean rowUpdated() throws SQLException { { checkForClosedResultSet("rowUpdated"); checkPositionedOnPlainRow(); +//IC see: https://issues.apache.org/jira/browse/DERBY-1323 boolean rowUpdated = cursor_.getIsRowUpdated(); @@ -2805,6 +2941,7 @@ public boolean rowInserted() throws SQLException { { checkForClosedResultSet("rowInserted"); checkPositionedOnPlainRow(); +//IC see: https://issues.apache.org/jira/browse/DERBY-1323 boolean rowInserted = false; @@ -2827,6 +2964,7 @@ public boolean rowDeleted() throws SQLException { { checkForClosedResultSet("rowDeleted"); checkPositionedOnPlainRow(); +//IC see: https://issues.apache.org/jira/browse/DERBY-1323 boolean rowDeleted = (resultSetType_ == ResultSet.TYPE_SCROLL_INSENSITIVE) ? @@ -2856,6 +2994,7 @@ public void updateNull(int column) throws SQLException { if (!resultSetMetaData_.nullable_[column - 1]) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.LANG_NULL_INTO_NON_NULL), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 column); } updateColumn(column, null); @@ -3095,6 +3234,7 @@ public void updateBinaryStream(int column, { synchronized (connection_) { if (agent_.loggingEnabled()) { +//IC see: https://issues.apache.org/jira/browse/DERBY-1445 agent_.logWriter_.traceEntry(this, "", column, x, length); } checkUpdatePreconditions(column, "updateBinaryStream"); @@ -3117,6 +3257,7 @@ public void updateAsciiStream(int column, agent_.logWriter_.traceEntry(this, "updateAsciiStream", column, x, length); } checkUpdatePreconditions(column, "updateAsciiStream"); +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 updateColumn(column, agent_.crossConverters_.setObjectFromCharacterStream( resultSetMetaData_.types_[column - 1], x, Cursor.ISO_8859_1, length)); } @@ -3181,6 +3322,7 @@ public void updateObject(int column, Object x) throws SQLException { } public void updateNCharacterStream(int columnIndex, Reader x) +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 throws SQLException { throw jdbc3MethodNotSupported(); } @@ -3407,6 +3549,10 @@ public void updateBinaryStream(String columnName, } public void updateAsciiStream(String columnName, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 InputStream x, int length) throws SQLException { try @@ -3423,6 +3569,8 @@ public void updateAsciiStream(String columnName, } public void updateCharacterStream(String columnName, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Reader x, int length) throws SQLException { try @@ -3467,6 +3615,7 @@ public void updateObject(String columnName, Object x) throws SQLException { } public void updateNCharacterStream(String columnName, Reader x) +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 throws SQLException { throw jdbc3MethodNotSupported(); } @@ -3485,6 +3634,7 @@ public void insertRow() throws SQLException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "insertRow"); } +//IC see: https://issues.apache.org/jira/browse/DERBY-100 insertRowX(); } } @@ -3503,6 +3653,7 @@ private void insertRowX() throws SqlException { } // if not on a valid row, then do not accept updateXXX calls +//IC see: https://issues.apache.org/jira/browse/DERBY-100 if (!isValidCursorPosition_) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.CURSOR_INVALID_OPERATION_AT_CURRENT_POSITION)); @@ -3624,7 +3775,9 @@ private boolean updateRowX() throws SqlException { } else { // Check if the original column is null. Calling CrossConverters.setObject on a null // column causes "Data Conversion" Exception. +//IC see: https://issues.apache.org/jira/browse/DERBY-852 Object originalObj; +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { originalObj = getObject(i + 1); } catch ( SQLException se ) { @@ -3650,6 +3803,7 @@ private boolean updateRowX() throws SqlException { } else { positionToCurrentRowAndUpdate(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-1251 } finally { resetUpdatedColumns(); } @@ -3695,6 +3849,7 @@ private void deleteRowX() throws SqlException { if (isOnInsertRow_) { throw new SqlException(agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-1266 new ClientMessageId(SQLState.NO_CURRENT_ROW)); } @@ -3710,9 +3865,11 @@ private void deleteRowX() throws SqlException { positionToCurrentRowAndDelete(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (resultSetType_ == ResultSet.TYPE_FORWARD_ONLY) { cursor_.isUpdateDeleteHole_ = true; } else { +//IC see: https://issues.apache.org/jira/browse/DERBY-1251 if (preparedStatementForDelete_.updateCount_ > 0) { cursor_.isUpdateDeleteHoleCache_.set((int) currentRowInRowset_, @@ -3725,6 +3882,7 @@ private void deleteRowX() throws SqlException { } public void refreshRow() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { synchronized (connection_) { @@ -3743,13 +3901,17 @@ public void refreshRow() throws SQLException { private void refreshRowX() throws SqlException { checkForClosedResultSet("refreshRow"); checkThatResultSetTypeIsScrollable(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 checkForUpdatableResultSet("refreshRow"); if (isBeforeFirstX() || isAfterLastX() || isOnInsertRow_) { throw new SqlException(agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-1266 +//IC see: https://issues.apache.org/jira/browse/DERBY-1266 new ClientMessageId(SQLState.NO_CURRENT_ROW)); } // this method does nothing if ResultSet is TYPE_SCROLL_INSENSITIVE +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (resultSetType_ == ResultSet.TYPE_SCROLL_SENSITIVE) { isValidCursorPosition_ = getRefreshRowset(); try { @@ -3759,6 +3921,9 @@ private void refreshRowX() throws SqlException { } unuseStreamsAndLOBs(); +//IC see: https://issues.apache.org/jira/browse/DERBY-3844 +//IC see: https://issues.apache.org/jira/browse/DERBY-3844 +//IC see: https://issues.apache.org/jira/browse/DERBY-3844 } } @@ -3801,6 +3966,7 @@ public void moveToInsertRow() throws SQLException { checkForClosedResultSet("moveToInsertRow"); checkForUpdatableResultSet("moveToInsertRow"); +//IC see: https://issues.apache.org/jira/browse/DERBY-100 resetUpdatedColumnsForInsert(); // Note that even though we navigate "away" from the current row @@ -3816,6 +3982,7 @@ public void moveToInsertRow() throws SQLException { // the insert row. This is important since attempting to // release locators for a non-valid cursor position will trigger // an error on the server. See DERBY-6228. +//IC see: https://issues.apache.org/jira/browse/DERBY-6228 savedIsValidCursorPosition_ = isValidCursorPosition_; isValidCursorPosition_ = true; } @@ -3852,7 +4019,9 @@ public void moveToCurrentRow() throws SQLException { * @throws SqlException if releasing a LOB locator fails */ private void moveToCurrentRowX() throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-100 if (isOnInsertRow_) { +//IC see: https://issues.apache.org/jira/browse/DERBY-1251 resetUpdatedColumns(); isOnInsertRow_ = false; isOnCurrentRow_ = true; @@ -3860,8 +4029,10 @@ private void moveToCurrentRowX() throws SqlException { updateColumnInfoFromCache(); } // Restore the old value when leaving the insert row. See DERBY-6228. +//IC see: https://issues.apache.org/jira/browse/DERBY-6228 isValidCursorPosition_ = savedIsValidCursorPosition_; } +//IC see: https://issues.apache.org/jira/browse/DERBY-3571 if (isValidCursorPosition_) { // isOnInsertRow must be false here. if (SanityManager.DEBUG) { @@ -3891,6 +4062,7 @@ public Statement getStatement() throws SQLException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getStatement", statement_); } +//IC see: https://issues.apache.org/jira/browse/DERBY-3446 if (statement_.getOwner() != null) { return statement_.getOwner(); } else { @@ -3932,6 +4104,7 @@ public void updateRef(String columnName, Ref x) throws SQLException { * or this method is called on a closed result set */ public void updateBlob(int columnIndex, Blob x) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-2443 synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "updateBlob", @@ -4002,6 +4175,7 @@ public void updateBlob(int columnIndex, InputStream x, long length) updateColumn(columnIndex, agent_.crossConverters_.setObject( resultSetMetaData_.types_[columnIndex -1], +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 new ClientBlob(agent_, x, (int)length))); } catch (SqlException se) { throw se.getSQLException(); @@ -4046,6 +4220,7 @@ public void updateArray(String columnName, Array x) throws SQLException { } boolean repositionScrollableResultSetBeforeJDBC1PositionedUpdateDelete() +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SqlException { boolean repositionedCursor = false; @@ -4053,7 +4228,9 @@ boolean repositionScrollableResultSetBeforeJDBC1PositionedUpdateDelete() long rowToFetch = getRowUncast() - absolutePosition_; // if rowToFetch is zero, already positioned on the current row +//IC see: https://issues.apache.org/jira/browse/DERBY-1361 if (rowToFetch != 0) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 writePositioningFetch_((generatedSection_ == null) ? statement_.getSection() : generatedSection_, scrollOrientation_relative__, rowToFetch); @@ -4072,6 +4249,7 @@ private void flowPositioningFetch(int scrollOrientation, try { agent_.beginWriteChain(statement_); +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 writePositioningFetch_((generatedSection_ == null) ? statement_.getSection() : generatedSection_, scrollOrientation, rowToFetch); @@ -4096,12 +4274,15 @@ private void positionToCurrentRowAndUpdate() throws SqlException { if (resultSetType_ != ResultSet.TYPE_FORWARD_ONLY && (currentRowPosRelativeToAbsoluteRowPos != 0 || (currentRowPosRelativeToAbsoluteRowPos == 0 && cursorUnpositionedOnServer_))) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 writePositioningFetch_((generatedSection_ == null) ? statement_.getSection() : generatedSection_, scrollOrientation_relative__, currentRowPosRelativeToAbsoluteRowPos); } +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { +//IC see: https://issues.apache.org/jira/browse/DERBY-611 writeUpdateRow(false); } catch ( SQLException se ) { throw new SqlException(se); @@ -4147,6 +4328,7 @@ private void update() throws SqlException { agent_.beginWriteChain(statement_); if (isRowsetCursor_) { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { preparedStatementForUpdate_.setInt(updatedColumns_.length + 1, (int) (currentRowInRowset_ + 1)); } catch ( SQLException se ) { @@ -4185,11 +4367,13 @@ private void positionToCurrentRowAndDelete() throws SqlException { if (resultSetType_ != ResultSet.TYPE_FORWARD_ONLY && (currentRowPosRelativeToAbsoluteRowPos != 0 || (currentRowPosRelativeToAbsoluteRowPos == 0 && cursorUnpositionedOnServer_))) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 writePositioningFetch_((generatedSection_ == null) ? statement_.getSection() : generatedSection_, scrollOrientation_relative__, currentRowPosRelativeToAbsoluteRowPos); } +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { writeDeleteRow(); } catch ( SQLException sqle ) { @@ -4201,6 +4385,10 @@ private void positionToCurrentRowAndDelete() throws SqlException { // adjust the absolute position on the client. absolutePosition_ += currentRowPosRelativeToAbsoluteRowPos; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (resultSetType_ != ResultSet.TYPE_FORWARD_ONLY && (currentRowPosRelativeToAbsoluteRowPos != 0 || (currentRowPosRelativeToAbsoluteRowPos == 0 && cursorUnpositionedOnServer_))) { @@ -4248,6 +4436,7 @@ private void delete() throws SqlException { private void setRowsetAfterLastEvent() throws SqlException { firstRowInRowset_ = 0; lastRowInRowset_ = 0; +//IC see: https://issues.apache.org/jira/browse/DERBY-517 absolutePosition_ = (maxRows_ == 0) ? rowCount_ + 1 : maxRows_ + 1; currentRowInRowset_ = 0; rowsReceivedInCurrentRowset_ = 0; @@ -4283,6 +4472,7 @@ public void setValidCursorPosition(boolean isValidCursorPosition) { } private void moveToAfterLast() throws DisconnectException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 flowPositioningFetch(ClientResultSet.scrollOrientation_after__, 0); } @@ -4292,10 +4482,13 @@ private void moveToBeforeFirst() throws DisconnectException { } private void writeInsertRow(boolean chainedWritesFollowingSetLob) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-100 try { preparedStatementForInsert_.materialPreparedStatement_.writeExecute_( +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 preparedStatementForInsert_.getSection(), preparedStatementForInsert_.parameterMetaData_, preparedStatementForInsert_.parameters_, @@ -4312,8 +4505,10 @@ private void writeInsertRow(boolean chainedWritesFollowingSetLob) private void writeUpdateRow(boolean chainedWritesFollowingSetLob) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 preparedStatementForUpdate_.materialPreparedStatement_.writeExecute_(preparedStatementForUpdate_.getSection(), preparedStatementForUpdate_.parameterMetaData_, preparedStatementForUpdate_.parameters_, @@ -4328,9 +4523,14 @@ private void writeUpdateRow(boolean chainedWritesFollowingSetLob) } private void writeDeleteRow() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 try { if (isRowsetCursor_) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 preparedStatementForDelete_.materialPreparedStatement_.writeExecute_(preparedStatementForDelete_.getSection(), preparedStatementForDelete_.parameterMetaData_, preparedStatementForDelete_.parameters_, @@ -4373,12 +4573,14 @@ private void readDeleteRow() throws DisconnectException, SqlException { public void listenToUnitOfWork() { if (!listenToUnitOfWork_) { listenToUnitOfWork_ = true; +//IC see: https://issues.apache.org/jira/browse/DERBY-210 connection_.CommitAndRollbackListeners_.put(this, null); } } public void completeLocalCommit(Iterator listenerIterator) { cursorUnpositionedOnServer_ = true; +//IC see: https://issues.apache.org/jira/browse/DERBY-3571 lobState.discardState(); // Locators released on server side. markAutoCommitted(); if (!cursorHold_) { @@ -4392,6 +4594,7 @@ public void completeLocalCommit(Iterator listenerIterator) { } public void completeLocalRollback(Iterator listenerIterator) { +//IC see: https://issues.apache.org/jira/browse/DERBY-3571 lobState.discardState(); // Locators released on server side. markAutoCommitted(); // all cursors need to be closed at rollback @@ -4445,6 +4648,7 @@ void markClosed(boolean removeListener) { if (removeListener) { connection_.CommitAndRollbackListeners_.remove(this); } +//IC see: https://issues.apache.org/jira/browse/DERBY-4869 closeStatementOnCompletion(); } @@ -4532,6 +4736,7 @@ private String buildInsertString() throws SqlException { int column; boolean foundOneUpdatedColumnAlready = false; +//IC see: https://issues.apache.org/jira/browse/DERBY-100 StringBuffer insertSQL = new StringBuffer("INSERT INTO "); StringBuffer valuesSQL = new StringBuffer("VALUES ("); @@ -4571,6 +4776,7 @@ private String buildUpdateString() throws SqlException { // For Derby, eg update t1 set c1=?, c2=? where current of cursorname boolean foundOneUpdatedColumnAlready = false; +//IC see: https://issues.apache.org/jira/browse/DERBY-5071 StringBuffer updateString = new StringBuffer(64); updateString.append("UPDATE ").append(getTableName()).append(" SET "); @@ -4579,6 +4785,7 @@ private String buildUpdateString() throws SqlException { if (foundOneUpdatedColumnAlready) { updateString.append(","); } +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { updateString.append(Utils.quoteSqlIdentifier( resultSetMetaData_.getColumnName(column))).append(" = ? "); @@ -4594,6 +4801,7 @@ private String buildUpdateString() throws SqlException { return null; } updateString.append(" WHERE CURRENT OF ").append(getServerCursorName()); +//IC see: https://issues.apache.org/jira/browse/DERBY-5071 if (isRowsetCursor_) { updateString.append(" FOR ROW ? OF ROWSET"); @@ -4629,6 +4837,7 @@ private String getTableName() throws SqlException { String tableName = ""; int baseTableColumn = 0; int totalColumns; +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { totalColumns = resultSetMetaData_.getColumnCount(); } catch ( SQLException sqle ) { @@ -4656,14 +4865,17 @@ private String getTableName() throws SqlException { } private String getServerCursorName() throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 return statement_.getSection().getServerCursorName(); } private void getPreparedStatementForInsert() throws SqlException { // each column is associated with a tableName in the extended describe info. String insertString = buildInsertString(); +//IC see: https://issues.apache.org/jira/browse/DERBY-100 try { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 preparedStatementForInsert_ = (ClientPreparedStatement)statement_. connection_.prepareStatement(insertString); } catch ( SQLException sqle ) { @@ -4682,6 +4894,7 @@ private void getPreparedStatementForUpdate() throws SqlException { preparedStatementForUpdate_ = statement_.connection_.preparePositionedUpdateStatement(updateString, statement_.getSection().getPositionedUpdateSection()); +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 } @@ -4691,11 +4904,13 @@ private void getPreparedStatementForDelete() throws SqlException { preparedStatementForDelete_ = statement_.connection_.preparePositionedUpdateStatement(deleteString, +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 statement_.getSection().getPositionedUpdateSection()); // update section } private final void resetUpdatedColumnsForInsert() { // initialize updateColumns with nulls for all columns +//IC see: https://issues.apache.org/jira/browse/DERBY-5012 for (int i = 0; i < resultSetMetaData_.columns_; i++) { updateColumn(i+1, null); columnUpdated_[i] = false; @@ -4704,6 +4919,7 @@ private final void resetUpdatedColumnsForInsert() { private final void resetUpdatedColumns() { if (updatedColumns_ != null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5015 Arrays.fill(updatedColumns_, null); } if (columnUpdated_ != null) { @@ -4723,6 +4939,7 @@ private final void checkGetterPreconditions(int column, String operation) } private final void checkUpdatePreconditions(int column, +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 String operation) throws SqlException { @@ -4750,6 +4967,7 @@ private void checkForValidColumnIndex(int column) throws SqlException { if (column < 1 || column > resultSetMetaData_.columns_) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.LANG_INVALID_COLUMN_POSITION), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 column, resultSetMetaData_.columns_); } } @@ -4767,6 +4985,7 @@ protected final void checkForClosedResultSet(String operation) private final void checkForUpdatableResultSet(String operation) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (resultSetConcurrency_ == ResultSet.CONCUR_READ_ONLY) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.UPDATABLE_RESULTSET_API_DISALLOWED), @@ -4783,6 +5002,7 @@ private final void checkForValidCursorPosition() throws SqlException { private final void checkPositionedOnPlainRow() throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-1323 if (isOnInsertRow_ || !isValidCursorPosition_) { throw new SqlException (agent_.logWriter_, @@ -4792,6 +5012,7 @@ private final void checkPositionedOnPlainRow() throws SqlException { private final void checkThatResultSetTypeIsScrollable() throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (resultSetType_ == ResultSet.TYPE_FORWARD_ONLY) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.CURSOR_MUST_BE_SCROLLABLE)); @@ -4880,6 +5101,7 @@ private void updateColumnInfoFromCache() { // currentRowInRowset_ should never be bigger than the max value of an int, // because we have a driver imposed limit of fetch size 1000. cursor_.columnDataPosition_ = +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 cursor_.columnDataPositionCache_.get((int) currentRowInRowset_); cursor_.columnDataComputedLength_ = cursor_.columnDataLengthCache_.get((int) currentRowInRowset_); @@ -4910,6 +5132,7 @@ protected final void checkAndThrowReceivedQueryTerminatingException() throws Sql } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void parseScrollableRowset() throws SqlException { // modified check from qrydtaReturned to cursor.dataBufferHasUnprocesseData() if (cursor_.dataBufferHasUnprocessedData() && scrollable_) { @@ -4918,6 +5141,7 @@ void parseScrollableRowset() throws SqlException { // This method is only called after open query to parse out the very first rowset // received. +//IC see: https://issues.apache.org/jira/browse/DERBY-821 if (cursor_.allRowsReceivedFromServer() && rowsReceivedInCurrentRowset_ == 0) { setRowsetNoRowsEvent(); @@ -4955,6 +5179,7 @@ protected void getRowCount() throws SqlException { agent_.beginWriteChain(statement_); Section section = (generatedSection_ == null) ? statement_.getSection() : generatedSection_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 // send the first CNTQRY to place cursor after last to retrieve the rowCount_. writePositioningFetch_(section, scrollOrientation_after__, 0); @@ -4981,16 +5206,19 @@ protected void getRowCount() throws SqlException { if (isRowsetCursor_ && sensitivity_ != sensitivity_sensitive_dynamic__ && firstRowInRowset_ != 0) { absolutePosition_ = firstRowInRowset_; } else { +//IC see: https://issues.apache.org/jira/browse/DERBY-517 absolutePosition_ = (maxRows_ == 0) ? rowCount_ + 1 : maxRows_ + 1; } } private void flowGetRowset(int orientation, long rowNumber) throws SqlException { // clear lobs before fetching rows +//IC see: https://issues.apache.org/jira/browse/DERBY-1382 cursor_.clearLobData_(); cursor_.resetDataBuffer(); agent_.beginWriteChain(statement_); +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 writeScrollableFetch_((generatedSection_ == null) ? statement_.getSection() : generatedSection_, fetchSize_, orientation, @@ -5121,6 +5349,7 @@ else if (isAfterLast) { // If afterLast and maxRows > 0, go backward from maxRows and not // from last row in the resultSet +//IC see: https://issues.apache.org/jira/browse/DERBY-517 if (maxRows_ > 0 && orientation == scrollOrientation_relative__ && isAfterLast) { rowNumber += maxRows_ + 1; orientation = scrollOrientation_absolute__; @@ -5133,6 +5362,7 @@ else if (isAfterLast) { // If no row was received but received sqlcode +100, then the cursor is // positioned before first. +//IC see: https://issues.apache.org/jira/browse/DERBY-821 if (rowsReceivedInCurrentRowset_ == 0 && cursor_.allRowsReceivedFromServer()) { isBeforeFirst_ = true; @@ -5158,6 +5388,7 @@ private void adjustPreviousRowset(int orientation, long rowNumber, boolean isAft lastRowInRowset_ = rowsReceivedInCurrentRowset_; absolutePosition_ = (isAfterLastRow) ? lastRowInRowset_ + 1 : lastRowInRowset_; } else { +//IC see: https://issues.apache.org/jira/browse/DERBY-517 if (maxRows_ == 0) lastRowInRowset_ = (isAfterLastRow) ? rowCount_ : firstRowInRowset_ - 1; else @@ -5183,6 +5414,7 @@ private boolean getAbsoluteRowset(long row) throws SqlException { // If no row was received but received sqlcode +100, then the cursor is // positioned after last or before first. +//IC see: https://issues.apache.org/jira/browse/DERBY-821 if ((rowsReceivedInCurrentRowset_ == 0 && cursor_.allRowsReceivedFromServer()) || orientation == scrollOrientation_before__) { @@ -5213,6 +5445,7 @@ private void adjustAbsoluteRowset(long rowNumber) { private boolean getRelativeRowset(long rows) throws SqlException { if (rows == 0 && +//IC see: https://issues.apache.org/jira/browse/DERBY-821 (cursor_.allRowsReceivedFromServer() || absolutePosition_ > rowCount_)) { setRowsetAfterLastEvent(); @@ -5223,6 +5456,7 @@ private boolean getRelativeRowset(long rows) throws SqlException { flowGetRowset(scrollOrientation_relative__, rows); parseRowset_(); +//IC see: https://issues.apache.org/jira/browse/DERBY-821 if (rowsReceivedInCurrentRowset_ == 0 && cursor_.allRowsReceivedFromServer()) { if (rows > 0) { @@ -5254,6 +5488,7 @@ private boolean getFirstRowset() throws SqlException { parseRowset_(); // If no row was received but received sqlcode +100, then no row in the result set +//IC see: https://issues.apache.org/jira/browse/DERBY-821 if (rowsReceivedInCurrentRowset_ == 0 && cursor_.allRowsReceivedFromServer()) { resetRowsetFlags(); @@ -5288,6 +5523,7 @@ private boolean getLastRowset(long row) throws SqlException { // If fetchSize_ is smaller than the total number of rows in the ResultSet, // then fetch one rowset of fetchSize_ number of rows. Otherwise, we will // fetch all rows in the ResultSet, so start fetching from row 1. +//IC see: https://issues.apache.org/jira/browse/DERBY-517 long rowNumber; if (maxRows_ == 0) { rowNumber = (fetchSize_ < row) ? ((-1) * fetchSize_) : 1; @@ -5298,7 +5534,10 @@ private boolean getLastRowset(long row) throws SqlException { } parseRowset_(); +//IC see: https://issues.apache.org/jira/browse/DERBY-821 +//IC see: https://issues.apache.org/jira/browse/DERBY-821 if (rowsReceivedInCurrentRowset_ == 0 && +//IC see: https://issues.apache.org/jira/browse/DERBY-821 cursor_.allRowsReceivedFromServer()) { isAfterLast_ = true; setRowsetAfterLastEvent(); @@ -5317,6 +5556,7 @@ private boolean getLastRowset(long row) throws SqlException { private void adjustLastRowset(long row) { lastRowInRowset_ = row; firstRowInRowset_ = lastRowInRowset_ - rowsReceivedInCurrentRowset_ + 1; +//IC see: https://issues.apache.org/jira/browse/DERBY-517 if (firstRowInRowset_ <= 0) { firstRowInRowset_ = 1; } @@ -5347,6 +5587,7 @@ private void adjustRefreshRowset() { } private void setAbsolutePositionBasedOnAllRowsReceived() { +//IC see: https://issues.apache.org/jira/browse/DERBY-821 absolutePosition_ = (cursor_.allRowsReceivedFromServer()) ? lastRowInRowset_ + 1 : lastRowInRowset_; } @@ -5439,22 +5680,27 @@ private void resetRowsetFlags() { private void resetRowsetSqlca() { if (rowsetSqlca_ != null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5015 Arrays.fill(rowsetSqlca_, null); } } private CloseFilterInputStream createCloseFilterInputStream(InputStream is) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 if(is == null){ return null; } +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 if( currentStream == is ){ return currentStream; } +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 closeOpenStreams(); currentStream = new CloseFilterInputStream(is); @@ -5479,6 +5725,7 @@ private void closeOpenStreams() throws SqlException { } catch (IOException ioe) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.JAVA_EXCEPTION), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 ioe, "java.io.IOException", ioe.getMessage()); } currentStream = null; @@ -5490,6 +5737,7 @@ private void closeOpenStreams() throws SqlException { } catch (IOException ioe) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.JAVA_EXCEPTION), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 ioe, "java.io.IOException", ioe.getMessage()); } currentReader = null; @@ -5505,6 +5753,7 @@ private void closeOpenStreams() throws SqlException { * @throws SQLException if the column has already been accessed */ private void useStreamOrLOB(int columnIndex) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-5489 checkLOBMultiCall(columnIndex); columnUsedFlags_[columnIndex - 1] = true; } @@ -5525,6 +5774,7 @@ private void useStreamOrLOB(int columnIndex) throws SqlException { */ private void checkLOBMultiCall(int columnIndex) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-3844 if (columnUsedFlags_ == null) { columnUsedFlags_ = new boolean[resultSetMetaData_.columns_]; } @@ -5546,6 +5796,7 @@ private void unuseStreamsAndLOBs() { private SQLException jdbc3MethodNotSupported() { +//IC see: https://issues.apache.org/jira/browse/DERBY-842 return new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.JDBC_METHOD_NOT_IMPLEMENTED)). getSQLException(); @@ -5562,6 +5813,7 @@ private SQLException jdbc3MethodNotSupported() * @exception SQLException if a database error occurs */ public final int getHoldability() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-948 if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getHoldability"); } @@ -5615,6 +5867,7 @@ public final boolean isClosed() throws SQLException { * result set */ public void updateAsciiStream(int columnIndex, InputStream x) +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 throws SQLException { synchronized (connection_) { if (agent_.loggingEnabled()) { @@ -5627,6 +5880,7 @@ public void updateAsciiStream(int columnIndex, InputStream x) agent_.crossConverters_.setObjectFromCharacterStream( resultSetMetaData_.types_[columnIndex -1], x, +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 Cursor.ISO_8859_1, CrossConverters.UNKNOWN_LENGTH)); } catch (SqlException se) { @@ -5653,10 +5907,12 @@ public void updateAsciiStream(int columnIndex, InputStream x) * if a database-access error occurs */ public void updateAsciiStream(int columnIndex, InputStream x, +//IC see: https://issues.apache.org/jira/browse/DERBY-1445 long length) throws SQLException { if(length > Integer.MAX_VALUE) throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.CLIENT_LENGTH_OUTSIDE_RANGE_FOR_DATATYPE), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 length, Integer.MAX_VALUE).getSQLException(); else updateAsciiStream(columnIndex,x,(int)length); @@ -5680,6 +5936,7 @@ public void updateAsciiStream(int columnIndex, InputStream x, * result set */ public void updateBinaryStream(int columnIndex, InputStream x) +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 throws SQLException { synchronized (connection_) { if (agent_.loggingEnabled()) { @@ -5721,6 +5978,7 @@ public void updateBinaryStream(int columnIndex, InputStream x, if(length > Integer.MAX_VALUE) throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.CLIENT_LENGTH_OUTSIDE_RANGE_FOR_DATATYPE), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 length, Integer.MAX_VALUE).getSQLException(); else updateBinaryStream(columnIndex,x,(int)length); @@ -5745,6 +6003,7 @@ public void updateBinaryStream(int columnIndex, InputStream x, * result set */ public void updateBlob(int columnIndex, InputStream x) +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 throws SQLException { synchronized (connection_) { if (agent_.loggingEnabled()) { @@ -5756,6 +6015,7 @@ public void updateBlob(int columnIndex, InputStream x) updateColumn(columnIndex, agent_.crossConverters_.setObject( resultSetMetaData_.types_[columnIndex -1], +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 new ClientBlob(agent_, x))); } catch (SqlException se) { throw se.getSQLException(); @@ -5822,6 +6082,7 @@ public void updateCharacterStream(int columnIndex, Reader x, if(length > Integer.MAX_VALUE) throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.CLIENT_LENGTH_OUTSIDE_RANGE_FOR_DATATYPE), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 length, Integer.MAX_VALUE).getSQLException(); else updateCharacterStream(columnIndex,x,(int)length); @@ -5848,6 +6109,7 @@ public void updateCharacterStream(int columnIndex, Reader x, * result set */ public void updateClob(int columnIndex, Reader reader) +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 throws SQLException { synchronized (connection_) { if (agent_.loggingEnabled()) { @@ -5859,6 +6121,7 @@ public void updateClob(int columnIndex, Reader reader) updateColumn(columnIndex, agent_.crossConverters_.setObject( resultSetMetaData_.types_[columnIndex -1], +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 new ClientClob(agent_, reader))); } catch (SqlException se) { throw se.getSQLException(); @@ -5941,6 +6204,7 @@ public void updateAsciiStream(String columnName, InputStream x, * result set */ public void updateBinaryStream(String columnLabel, InputStream x) +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 throws SQLException { try { updateBinaryStream(findColumnX(columnLabel, "updateBinaryStream"), x); @@ -5996,6 +6260,7 @@ public void updateBinaryStream(String columnName, InputStream x, * result set */ public void updateBlob(String columnLabel, InputStream x) +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 throws SQLException { try { updateBlob(findColumnX(columnLabel, "updateBlob"), x); @@ -6126,6 +6391,7 @@ public void updateClob(int columnIndex, Reader x, long length) updateColumn(columnIndex, agent_.crossConverters_.setObject( resultSetMetaData_.types_[columnIndex -1], +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 new ClientClob(agent_, x, (int)length))); } catch (SqlException se) { throw se.getSQLException(); @@ -6240,6 +6506,7 @@ public void updateClob(String columnLabel, Clob x) * @param index 1-based column index */ public final void markLOBAsPublished(int index) { +//IC see: https://issues.apache.org/jira/browse/DERBY-3601 this.lobState.markAsPublished(index); } @@ -6255,6 +6522,7 @@ final void createLOBColumnTracker() { SanityManager.ASSERT(this.lobState == null, "LOB state tracker already initialized."); } +//IC see: https://issues.apache.org/jira/browse/DERBY-3601 if (this.connection_.supportsSessionDataCaching() && this.resultSetMetaData_.hasLobColumns()) { final int columnCount = this.resultSetMetaData_.columns_; @@ -6263,6 +6531,7 @@ final void createLOBColumnTracker() { boolean[] tmpIsBlob = new boolean[columnCount]; for (int i=0; i < columnCount; i++) { int type = this.resultSetMetaData_.types_[i]; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (type == ClientTypes.BLOB || type == ClientTypes.CLOB) { tmpIndexes[lobCount] = i +1; // Convert to 1-based index. tmpIsBlob[lobCount++] = (type == ClientTypes.BLOB); @@ -6273,6 +6542,7 @@ final void createLOBColumnTracker() { boolean[] isBlob = new boolean[lobCount]; System.arraycopy(tmpIndexes, 0, lobIndexes, 0, lobCount); System.arraycopy(tmpIsBlob, 0, isBlob, 0, lobCount); +//IC see: https://issues.apache.org/jira/browse/DERBY-3601 this.lobState = new LOBStateTracker(lobIndexes, isBlob, true); } else { // Use a no-op state tracker to simplify code expecting a tracker. @@ -6281,6 +6551,7 @@ final void createLOBColumnTracker() { } public Reader getNCharacterStream(int columnIndex) +//IC see: https://issues.apache.org/jira/browse/DERBY-6213 throws SQLException { throw SQLExceptionFactory.notImplemented("getNCharacterStream(int)"); } @@ -6464,6 +6735,19 @@ public void updateNClob(String columnName, InputStream x, long length) */ public void updateNClob(String columnName, Reader x, long length) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SQLException { throw SQLExceptionFactory.notImplemented("updateNClob(String,Reader,long)"); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ClientSavepoint.java b/java/org.apache.derby.client/org/apache/derby/client/am/ClientSavepoint.java index 4af629790b..30d6b274e4 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/ClientSavepoint.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/ClientSavepoint.java @@ -26,6 +26,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import java.sql.SQLException; import java.sql.Savepoint; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class ClientSavepoint implements Savepoint { // ----------------- internals ----------------------------------------------- @@ -36,6 +37,7 @@ class ClientSavepoint implements Savepoint { //---------------------constructors/finalizer--------------------------------- // create a named savepoint. +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientSavepoint(Agent agent, String savepointName) { agent_ = agent; savepointName_ = savepointName; diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ClientStatement.java b/java/org.apache.derby.client/org/apache/derby/client/am/ClientStatement.java index 8450b40c2c..bc89968c6f 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/ClientStatement.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/ClientStatement.java @@ -949,6 +949,7 @@ public void setCursorName(String name) throws SQLException { // Per jdbc spec (see Statement.close() javadoc) checkForClosedStatement(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (name == null || name.equals("")) { throw new SqlException(agent_.logWriter_, @@ -1004,6 +1005,7 @@ boolean executeX(String sql) throws SqlException { } public ResultSet getResultSet() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { synchronized (connection_) { @@ -1013,6 +1015,7 @@ public ResultSet getResultSet() throws SQLException { // Per jdbc spec (see Statement.close() javadoc) checkForClosedStatement(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getResultSet", resultSet_); @@ -1040,6 +1043,7 @@ public int getUpdateCount() throws SQLException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getUpdateCount", updateCount_); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 return (int) updateCount_; } } @@ -1051,6 +1055,7 @@ public int getUpdateCount() throws SQLException { // Added by JDBC 4.2 public long getLargeUpdateCount() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 try { synchronized (connection_) { @@ -1060,6 +1065,8 @@ public long getLargeUpdateCount() throws SQLException { // Per jdbc spec (see Statement.close() javadoc) checkForClosedStatement(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getUpdateCount", updateCount_); @@ -1105,6 +1112,7 @@ public void setFetchDirection(int direction) throws SQLException { // Per jdbc spec (see Statement.close() javadoc) checkForClosedStatement(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 switch (direction) { case ResultSet.FETCH_FORWARD: @@ -1115,6 +1123,7 @@ public void setFetchDirection(int direction) throws SQLException { default: throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.INVALID_FETCH_DIRECTION), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 direction); } } @@ -1150,10 +1159,12 @@ public void setFetchSize(int rows) throws SQLException { // Per jdbc spec (see Statement.close() javadoc) checkForClosedStatement(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (rows < 0 || (maxRows_ != 0 && rows > maxRows_)) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.INVALID_ST_FETCH_SIZE), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 rows).getSQLException(); } fetchSize_ = rows; @@ -1236,6 +1247,7 @@ public void clearBatch() throws SQLException { agent_.logWriter_.traceEntry(this, "clearBatch"); } checkForClosedStatement(); +//IC see: https://issues.apache.org/jira/browse/DERBY-3441 batch_.clear(); } } @@ -1252,6 +1264,7 @@ public int[] executeBatch() throws SQLException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "executeBatch"); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 long[] updateCounts = executeBatchX(); if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "executeBatch", updateCounts); @@ -1267,6 +1280,7 @@ public int[] executeBatch() throws SQLException { // Added by JDBC 4.2 public long[] executeLargeBatch() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 try { synchronized (connection_) { @@ -1288,19 +1302,23 @@ public long[] executeLargeBatch() throws SQLException { private long[] executeBatchX() throws SqlException, BatchUpdateException { // Per jdbc spec (see Statement.close() javadoc) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 checkForClosedStatement(); clearWarningsX(); // Per jdbc spec 0.7, and getWarnings() javadoc resultSetList_ = null; // Initialize all the updateCounts to indicate failure // This is done to account for "chain-breaking" errors where we cannot // read any more replies +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 long[] updateCounts = new long[batch_.size()]; +//IC see: https://issues.apache.org/jira/browse/DERBY-3441 Arrays.fill(updateCounts, -3); flowExecuteBatch(updateCounts); return updateCounts; } public Connection getConnection() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { checkForClosedStatement(); @@ -1339,8 +1357,10 @@ public boolean getMoreResults(int current) throws SQLException { private boolean getMoreResultsX(int current) throws SqlException { // Per jdbc spec (see Statement.close() javadoc) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 checkForClosedStatement(); boolean resultIsResultSet; +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 updateCount_ = -1L; if (resultSetList_ == null) { if (resultSet_ != null) { @@ -1351,6 +1371,7 @@ private boolean getMoreResultsX(int current) throws SqlException { } resultIsResultSet = false; } else { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (current == CLOSE_CURRENT_RESULT && resultSetList_[indexOfCurrentResultSet_] != null) { resultSetList_[indexOfCurrentResultSet_].closeX(); @@ -1376,11 +1397,13 @@ private boolean getMoreResultsX(int current) throws SqlException { } public ResultSet getGeneratedKeys() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getGeneratedKeys"); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 checkForClosedStatement(); if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getGeneratedKeys", generatedKeysResultSet_); @@ -1402,6 +1425,7 @@ public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException } autoGeneratedKeys_ = autoGeneratedKeys; int updateValue = (int) executeUpdateX(sql); +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "executeUpdate", updateValue); } @@ -1420,6 +1444,7 @@ public long executeLargeUpdate(String sql, int autoGeneratedKeys) throws SQLExce { synchronized (connection_) { if (agent_.loggingEnabled()) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 agent_.logWriter_.traceEntry(this, "executeLargeUpdate", sql, autoGeneratedKeys); } autoGeneratedKeys_ = autoGeneratedKeys; @@ -1452,6 +1477,7 @@ public int executeUpdate(String sql, int columnIndexes[]) throws SQLException { } int updateValue = (int) executeUpdateX(sql); +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "executeUpdate", updateValue); } @@ -1470,9 +1496,12 @@ public long executeLargeUpdate(String sql, int columnIndexes[]) throws SQLExcept { synchronized (connection_) { if (agent_.loggingEnabled()) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 agent_.logWriter_.traceEntry(this, "executeLargeUpdate", sql, columnIndexes); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (columnIndexes != null && columnIndexes.length > 0) { autoGeneratedKeys_ = ClientStatement.RETURN_GENERATED_KEYS; generatedKeysColumnIndexes_ = columnIndexes.clone(); @@ -1501,7 +1530,10 @@ public int executeUpdate(String sql, String columnNames[]) throws SQLException { agent_.logWriter_.traceEntry(this, "executeUpdate", sql, columnNames); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (columnNames != null && columnNames.length > 0) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 autoGeneratedKeys_ = ClientStatement.RETURN_GENERATED_KEYS; generatedKeysColumnNames_ = columnNames.clone(); } else { @@ -1509,6 +1541,7 @@ public int executeUpdate(String sql, String columnNames[]) throws SQLException { } int updateValue = (int) executeUpdateX(sql); +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "executeUpdate", updateValue); } @@ -1527,10 +1560,14 @@ public long executeLargeUpdate(String sql, String columnNames[]) throws SQLExcep { synchronized (connection_) { if (agent_.loggingEnabled()) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 agent_.logWriter_.traceEntry(this, "executeLargeUpdate", sql, columnNames); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (columnNames != null && columnNames.length > 0) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 autoGeneratedKeys_ = ClientStatement.RETURN_GENERATED_KEYS; generatedKeysColumnNames_ = columnNames.clone(); } else { @@ -1579,10 +1616,12 @@ public boolean execute(String sql, int columnIndexes[]) throws SQLException { agent_.logWriter_.traceEntry(this, "execute", sql, columnIndexes); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (columnIndexes != null && columnIndexes.length > 0) { autoGeneratedKeys_ = ClientStatement.RETURN_GENERATED_KEYS; generatedKeysColumnIndexes_ = columnIndexes.clone(); } else { +//IC see: https://issues.apache.org/jira/browse/DERBY-2653 generatedKeysColumnIndexes_ = null; } @@ -1607,7 +1646,10 @@ public boolean execute(String sql, String columnNames[]) throws SQLException { agent_.logWriter_.traceEntry(this, "execute", sql, columnNames); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (columnNames != null && columnNames.length > 0) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 autoGeneratedKeys_ = ClientStatement.RETURN_GENERATED_KEYS; generatedKeysColumnNames_ = columnNames.clone(); } else { @@ -1652,7 +1694,9 @@ public int getResultSetHoldability() throws SQLException { */ private Section setSpecialRegisterSection_ = null; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void writeSetSpecialRegister(ArrayList sqlsttList) +//IC see: https://issues.apache.org/jira/browse/DERBY-3198 throws SqlException { if (setSpecialRegisterSection_ == null) { setSpecialRegisterSection_ = @@ -1663,6 +1707,7 @@ void writeSetSpecialRegister(ArrayList sqlsttList) sqlsttList); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void readSetSpecialRegister() throws SqlException { if (SanityManager.DEBUG) { SanityManager.ASSERT(setSpecialRegisterSection_ != null); @@ -1693,11 +1738,13 @@ private void readExecuteImmediateForBatch(String sql) throws SqlException { materialStatement_.readExecuteImmediateForBatch_(sql); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void writePrepareDescribeOutput(String sql, Section section) throws SqlException { materialStatement_.writePrepareDescribeOutput_(sql, section); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void readPrepareDescribeOutput() throws SqlException { materialStatement_.readPrepareDescribeOutput_(); } @@ -1712,6 +1759,7 @@ public void completePrepareDescribeOutput(ColumnMetaData resultSetMetaData, } // Used for re-prepares across commit only +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void writePrepare(String sql, Section section) throws SqlException { materialStatement_.writePrepare_(sql, section); } @@ -1728,6 +1776,7 @@ public void completePrepare(Sqlca sqlca) { markPrepared(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void writeOpenQuery(Section section, int fetchSize, int resultSetType) throws SqlException { @@ -1736,6 +1785,7 @@ void writeOpenQuery(Section section, resultSetType); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void readOpenQuery() throws SqlException { materialStatement_.readOpenQuery_(); } @@ -1753,6 +1803,7 @@ public void completeOpenQuery(Sqlca sqlca, ClientResultSet resultSet) { resultSet.resultSetMetaData_.resultSetConcurrency_ = resultSet.resultSetConcurrency_; // Create tracker for LOB locator columns. resultSet.createLOBColumnTracker(); +//IC see: https://issues.apache.org/jira/browse/DERBY-3571 // only cache the Cursor object for a PreparedStatement and if a Cursor object is // not already cached. @@ -1766,6 +1817,7 @@ public void completeOpenQuery(Sqlca sqlca, ClientResultSet resultSet) { return; } resultSet.cursor_.rowsRead_ = fetchedRowBase; +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 // Set fetchSize_ to the default(64) if not set by the user if the resultset is scrollable. // This fetchSize_ is used to check for a complete rowset when rowsets are parsed. @@ -1773,8 +1825,10 @@ public void completeOpenQuery(Sqlca sqlca, ClientResultSet resultSet) { // fetchSize of 64 is sent on behalf of the application, so we need to update the fetchSize_ // here to 64. if (resultSet_.fetchSize_ == 0 && +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 (resultSet_.resultSetType_ == ResultSet.TYPE_SCROLL_INSENSITIVE || resultSet_.resultSetType_ == ResultSet.TYPE_SCROLL_SENSITIVE)) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 resultSet_.setFetchSize_(Configuration.defaultFetchSize); } } @@ -1790,6 +1844,7 @@ public void completeExecuteCallOpenQuery( resultSet.resultSetMetaData_ = resultSetMetaData; // Create tracker for LOB locator columns. resultSet.createLOBColumnTracker(); +//IC see: https://issues.apache.org/jira/browse/DERBY-3571 // The following two assignments should have already happened via prepareEvent(), // but are included here for safety for the time being. @@ -1797,6 +1852,7 @@ public void completeExecuteCallOpenQuery( return; } resultSet.cursor_.rowsRead_ = fetchedRowBase; +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 resultSet.generatedSection_ = generatedSection; @@ -1805,10 +1861,12 @@ public void completeExecuteCallOpenQuery( // fetchSize_ is not set, we do not send any default value. Here since we always send // the fetchSize_, we need to set it to what we sent. if (resultSet.fetchSize_ == 0) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 resultSet.fetchSize_ = Configuration.defaultFetchSize; } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void writeExecuteCall(boolean outputExpected, String procedureName, Section section, @@ -1827,15 +1885,18 @@ void writeExecuteCall(boolean outputExpected, inputs); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void readExecuteCall() throws SqlException { materialStatement_.readExecuteCall_(); } public void completeExecuteCall( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Sqlca sqlca, Cursor singletonParams, ClientResultSet[] resultSets) { completeExecuteCall(sqlca, singletonParams); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 resultSetList_ = resultSets.clone(); if (resultSets != null) { resultSet_ = resultSets[0]; @@ -1871,6 +1932,7 @@ public void completeExecute(Sqlca sqlca) { // sometime for call statement, protocol will return updateCount_, we will always set that to 0 // sqlMode_ is not set for statements, only for prepared statements if (sqlMode_ == isCall__) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 updateCount_ = -1L; } // Sqlcode 466 indicates a call statement has issued and result sets returned. @@ -1896,6 +1958,7 @@ public void setUpdateCount(long updateCount) { * @param owner the owning statement, if any */ protected final void setOwner(Statement owner) { +//IC see: https://issues.apache.org/jira/browse/DERBY-3446 this.owner = owner; } @@ -1904,6 +1967,7 @@ protected final void setOwner(Statement owner) { * * @return The designated owner of this statement, or {@code null} if none. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final Statement getOwner() { return this.owner; } @@ -2026,6 +2090,8 @@ private boolean writeCloseResultSets(int number, boolean allowAutoCommits) if (connection_.autoCommit_ && requiresAutocommit && isAutoCommittableStatement_) { connection_.writeAutoCommit(); if (connection_.isXAConnection_) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return connection_.getXAState() == ClientConnection.XA_T0_NOT_ASSOCIATED; } else { @@ -2044,6 +2110,7 @@ final void readCloseResultSets(boolean allowAutoCommits) throws SqlException { } private void readCloseResultSets(int number, boolean allowAutoCommits) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SqlException { boolean requiredAutocommit = false; if (resultSetList_ != null) { @@ -2141,6 +2208,7 @@ public void completeExecuteSetStatement(Sqlca sqlca) { * added to the list of open statements. */ void markClosed() { +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 markClosed(false); } @@ -2157,7 +2225,9 @@ void markClosed() { */ void markClosed(boolean removeListener) { openOnClient_ = false; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 markResultSetsClosed(false); +//IC see: https://issues.apache.org/jira/browse/DERBY-4869 closeEverythingExceptResultSets( removeListener ); } @@ -2175,6 +2245,7 @@ private void closeEverythingExceptResultSets( boolean removeListener ) removeClientCursorNameFromCache(); markPreparedStatementForAutoGeneratedKeysClosed(); setSection(null); +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 // mark close ResultSetMetaData if (resultSetMetaData_ != null) { @@ -2184,7 +2255,9 @@ private void closeEverythingExceptResultSets( boolean removeListener ) if(removeListener) connection_.openStatements_.remove(this); +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 +//IC see: https://issues.apache.org/jira/browse/DERBY-3198 if (setSpecialRegisterSection_ != null) { setSpecialRegisterSection_.free(); setSpecialRegisterSection_ = null; @@ -2205,6 +2278,7 @@ private void markPreparedStatementForAutoGeneratedKeysClosed() { * from the commit and rollback listeners list in * org.apache.derby.client.am.Connection. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-4869 final void markResultSetsClosed(boolean removeListener) { try { @@ -2239,13 +2313,16 @@ final void markResultSetsClosed(boolean removeListener) private void flowExecute(int executeType, String sql) throws SqlException { // Per jdbc spec (see Statement.close() javadoc) checkForClosedStatement(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 clearWarningsX(); // Per jdbc spec 0.7, and getWarnings() javadoc sql = escape(sql); +//IC see: https://issues.apache.org/jira/browse/DERBY-5806 sqlMode_ = executeType==executeQueryMethod__?isQuery__:isUpdate__; parseSqlAndSetSqlModes(sql); checkAutoGeneratedKeysParameters(); if (sqlMode_ == isUpdate__) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 updateCount_ = 0L; } else { updateCount_ = -1L; @@ -2258,6 +2335,9 @@ private void flowExecute(int executeType, String sql) throws SqlException { // statements can have the same cursor name as long as their result // sets are not simultaneously open. +//IC see: https://issues.apache.org/jira/browse/DERBY-1036 +//IC see: https://issues.apache.org/jira/browse/DERBY-1183 +//IC see: https://issues.apache.org/jira/browse/DERBY-210 if (sqlMode_ == isQuery__) { checkForDuplicateCursorName(); } @@ -2267,6 +2347,7 @@ private void flowExecute(int executeType, String sql) throws SqlException { agent_.beginWriteChain(this); boolean piggybackedAutoCommit = writeCloseResultSets(true); // true means permit auto-commits +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientResultSet scrollableRS = null; Section newSection = null; boolean repositionedCursor = false; @@ -2304,6 +2385,7 @@ private void flowExecute(int executeType, String sql) throws SqlException { newSection = agent_.sectionManager_.getPositionedUpdateSection(cursorName, true); // true means get an execute immediate section if (newSection == null) { throw new SqlException(agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-4777 new ClientMessageId(SQLState.LANG_CURSOR_NOT_FOUND), cursorName); } @@ -2328,13 +2410,17 @@ private void flowExecute(int executeType, String sql) throws SqlException { writeExecuteImmediate(sql, newSection); } +//IC see: https://issues.apache.org/jira/browse/DERBY-3426 else { newSection = agent_.sectionManager_.getDynamicSection(resultSetHoldability_); writeExecuteImmediate(sql, newSection); +//IC see: https://issues.apache.org/jira/browse/DERBY-6742 +//IC see: https://issues.apache.org/jira/browse/DERBY-6753 if ((sqlUpdateMode_ == isInsertSql__ || sqlUpdateMode_ == isUpdateSql__) && autoGeneratedKeys_ == RETURN_GENERATED_KEYS) { // chain a "select from identity_val_local()" to the insert statement +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 if (preparedStatementForAutoGeneratedKeys_ == null) { preparedStatementForAutoGeneratedKeys_ = prepareAutoGeneratedKeysStatement(connection_); @@ -2361,6 +2447,7 @@ private void flowExecute(int executeType, String sql) throws SqlException { readCloseResultSets(true); // true means permit auto-commits +//IC see: https://issues.apache.org/jira/browse/DERBY-506 if (timeoutSent) { readSetSpecialRegister(); // Read response to the EXCSQLSET } @@ -2374,6 +2461,7 @@ private void flowExecute(int executeType, String sql) throws SqlException { markResultSetsClosed(true); // true means remove from list of commit and rollback listeners setSection(newSection); +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 switch (sqlMode_) { case isQuery__: @@ -2394,6 +2482,9 @@ private void flowExecute(int executeType, String sql) throws SqlException { // result sets happening during readCloseResultSets above // because ResultSet#markClosed calls // Statement#removeClientCursorNameFromCache. +//IC see: https://issues.apache.org/jira/browse/DERBY-1036 +//IC see: https://issues.apache.org/jira/browse/DERBY-1183 +//IC see: https://issues.apache.org/jira/browse/DERBY-210 setupCursorNameCacheAndMappings(); } @@ -2407,14 +2498,18 @@ private void flowExecute(int executeType, String sql) throws SqlException { } readExecuteImmediate(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6742 +//IC see: https://issues.apache.org/jira/browse/DERBY-6753 if ((sqlUpdateMode_ == isInsertSql__ || sqlUpdateMode_ == isUpdateSql__) && autoGeneratedKeys_ == RETURN_GENERATED_KEYS) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 if (prepareSentForAutoGeneratedKeys) { preparedStatementForAutoGeneratedKeys_.materialPreparedStatement_.readPrepareDescribeOutput_(); } preparedStatementForAutoGeneratedKeys_.readOpenQuery(); generatedKeysResultSet_ = preparedStatementForAutoGeneratedKeys_.resultSet_; preparedStatementForAutoGeneratedKeys_.resultSet_ = null; +//IC see: https://issues.apache.org/jira/browse/DERBY-4869 generatedKeysResultSet_.outerStatement_ = this; } @@ -2439,12 +2534,14 @@ private void flowExecute(int executeType, String sql) throws SqlException { if (resultSet_ != null && resultSet_.resultSetHoldability_ != resultSetHoldability_ && sqlMode_ != isCall__) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.UNABLE_TO_OPEN_RS_WITH_REQUESTED_HOLDABILITY), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 resultSetHoldability_); } // In the case of executing a call to a stored procedure. if (sqlMode_ == isCall__) { parseStorProcReturnedScrollableRowset(); +//IC see: https://issues.apache.org/jira/browse/DERBY-1364 checkForStoredProcResultSetCount(executeType); // When there is no result sets back, we will commit immediately when autocommit is true. if (connection_.autoCommit_ && resultSet_ == null && resultSetList_ == null) { @@ -2479,6 +2576,7 @@ private void flowExecuteBatch(long[] updateCounts) // net will need to be able to reset the send buffer if (flowSQL) { if (sqlMode_ != isCall__) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 setSection(agent_.sectionManager_.getDynamicSection(resultSetHoldability_)); writeExecuteImmediate(sql, getSection()); } else { @@ -2505,6 +2603,7 @@ private void flowExecuteBatch(long[] updateCounts) invalidSQLCaughtByClient = e; } if (invalidSQLCaughtByClient == null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 updateCount_ = -1L; if (sqlMode_ != isCall__) { readExecuteImmediateForBatch(sql); @@ -2516,6 +2615,7 @@ private void flowExecuteBatch(long[] updateCounts) } } else { agent_.accumulateReadException(invalidSQLCaughtByClient); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 updateCount_ = Statement.EXECUTE_FAILED; invalidSQLCaughtByClient = null; } @@ -2585,6 +2685,7 @@ public void accumulateWarning(SqlWarning e) { if (warnings_ == null) { warnings_ = e; } else { +//IC see: https://issues.apache.org/jira/browse/DERBY-860 warnings_.setNextWarning(e); } } @@ -2600,6 +2701,7 @@ private void markPrepared() { * @return name of java.sql interface */ protected String getJdbcStatementInterfaceName() { +//IC see: https://issues.apache.org/jira/browse/DERBY-1364 return "java.sql.Statement"; } @@ -2644,10 +2746,12 @@ void parseSqlAndSetSqlModes(String sql) throws SqlException { */ private String isolateAnyInitialIdentifier (String sql) { int idx; +//IC see: https://issues.apache.org/jira/browse/DERBY-4748 for (idx = 0; idx < sql.length(); idx++) { char ch = sql.charAt(idx); if (!Character.isLetter(ch)) { // first non-token char found +//IC see: https://issues.apache.org/jira/browse/DERBY-4338 break; } } @@ -2709,6 +2813,7 @@ private String getStatementToken(String sql) throws SqlException { case '-': if (idx == sql.length() - 1) { // no more characters, so this is the token +//IC see: https://issues.apache.org/jira/browse/DERBY-5011 tokenFound = "-"; } else if (sql.charAt(idx + 1) == '-') { state = INSIDE_SIMPLECOMMENT; @@ -2823,6 +2928,7 @@ final void checkForAppropriateSqlMode(int executeType, int sqlMode) throws SqlEx * match the execute type */ private void checkResultSetCount(int executeType) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-1364 switch (executeType) { case executeQueryMethod__: // We'll just rely on finalizers to close the dangling result sets. @@ -2894,6 +3000,7 @@ final void checkForClosedStatement() throws SqlException { if (!openOnClient_) { agent_.checkForDeferredExceptions(); throw new SqlException(agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-1395 new ClientMessageId(SQLState.ALREADY_CLOSED), "Statement"); } else { agent_.checkForDeferredExceptions(); @@ -2922,6 +3029,9 @@ private void checkForInvalidBatchedSql(String sql) throws SqlException { // Two open result sets can not have the same cursor name. protected void checkForDuplicateCursorName() throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-1036 +//IC see: https://issues.apache.org/jira/browse/DERBY-1183 +//IC see: https://issues.apache.org/jira/browse/DERBY-210 if (cursorName_ != null && (connection_.clientCursorNameCache_. containsKey(cursorName_))) { throw new SqlException @@ -2943,6 +3053,7 @@ protected void setupCursorNameCacheAndMappings() { // whenever the result set produced by this statement // is referenced in a positioned update/delete statement. agent_.sectionManager_.mapCursorNameToQuerySection +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 (cursorName_, getSection()); getSection().setClientCursorName(cursorName_); @@ -2951,7 +3062,9 @@ protected void setupCursorNameCacheAndMappings() { cursorName_); } else { // canned cursor name +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 agent_.sectionManager_.mapCursorNameToQuerySection +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 (getSection().getServerCursorName(), getSection()); } @@ -2969,6 +3082,7 @@ String[] extractCursorNameFromWhereCurrentOf(String sql) { if (whereIndex != -1) { String[] whereCurrentOf = {"where", "current", "of"}; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 StringTokenizer st = new StringTokenizer(sql.substring(whereIndex)); @@ -3029,9 +3143,11 @@ void resetCursorNameAndRemoveFromWhereCurrentOfMappings() { if (section_ != null) { agent_.sectionManager_.removeCursorNameToResultSetMapping(cursorName_, getSection().getServerCursorNameForPositionedUpdate()); +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 // remove resultset mapping for other cursors (other than positioned // update statements) - DERBY-210 +//IC see: https://issues.apache.org/jira/browse/DERBY-210 agent_.sectionManager_.removeCursorNameToResultSetMapping(cursorName_, getSection().getServerCursorName()); @@ -3050,6 +3166,7 @@ private void mapCursorNameToResultSet() { if (cursorName_ != null) { agent_.sectionManager_.mapCursorNameToResultSet(cursorName_, resultSet_); } else { +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 agent_.sectionManager_.mapCursorNameToResultSet(getSection().getServerCursorName(), resultSet_); } } @@ -3080,6 +3197,7 @@ String escape(String sql) throws SqlException { // buffer at prepare-time. String cacheCursorAttributesToSendOnPrepare() throws SqlException { StringBuffer cursorAttributes = new StringBuffer(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (resultSetType_ == ResultSet.TYPE_SCROLL_SENSITIVE) { // append "SENSITIVE STATIC SCROLL" cursorAttributes.append(Configuration.cursorAttribute_SensitiveStatic); @@ -3092,6 +3210,7 @@ String cacheCursorAttributesToSendOnPrepare() throws SqlException { } // Default is read-only, forward-only. No attribute needs to be sent. +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (resultSetConcurrency_ == ResultSet.CONCUR_UPDATABLE) { cursorAttributes.append(Configuration.cursorAttribute_ForUpdate); // FOR UPDATE } @@ -3107,15 +3226,18 @@ String cacheCursorAttributesToSendOnPrepare() throws SqlException { } protected static ClientPreparedStatement +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 prepareAutoGeneratedKeysStatement(ClientConnection cc) throws SqlException { String s = "select IDENTITY_VAL_LOCAL() from SYSIBM.SYSDUMMY1"; ClientPreparedStatement cps = cc.newPreparedStatement_(s, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT, Statement.NO_GENERATED_KEYS, +//IC see: https://issues.apache.org/jira/browse/DERBY-2653 null, null); // need a special case for Derby, since the attribute has to go through the wire. // This same special casing for Derby is already in place in method PS.cacheCursorAttributesToSendOnPrepare() as called by prepareStatementX(). @@ -3123,26 +3245,31 @@ String cacheCursorAttributesToSendOnPrepare() throws SqlException { // Maybe just call prepareStatementX() or use some special purpose prepare method like the ones in Connection. // Something more abstract so that we don't have to special case the WITH HOLD thing twice. +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 cps.cursorAttributesToSendOnPrepare_ = Configuration.cursorAttribute_WithHold; cps.materialPreparedStatement_.writePrepareDescribeOutput_(cps.sql_, cps.getSection()); return cps; } void checkAutoGeneratedKeysParameters() throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (autoGeneratedKeys_ != Statement.NO_GENERATED_KEYS && autoGeneratedKeys_ != Statement.RETURN_GENERATED_KEYS) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.INVALID_API_PARAMETER), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 autoGeneratedKeys_, "autoGeneratedKeys", "Statement.execute()/executeQuery()"); } +//IC see: https://issues.apache.org/jira/browse/DERBY-2653 if (sqlUpdateMode_ == isInsertSql__) { if (generatedKeysColumnNames_ != null && generatedKeysColumnNames_.length > 1) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.INVALID_COLUMN_ARRAY_LENGTH), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 generatedKeysColumnNames_.length); } @@ -3169,6 +3296,9 @@ public boolean isQueryMode() { } protected void removeClientCursorNameFromCache() { +//IC see: https://issues.apache.org/jira/browse/DERBY-1036 +//IC see: https://issues.apache.org/jira/browse/DERBY-1183 +//IC see: https://issues.apache.org/jira/browse/DERBY-210 if (cursorName_ != null && connection_.clientCursorNameCache_.containsKey(cursorName_)) { connection_.clientCursorNameCache_.remove(cursorName_); @@ -3182,8 +3312,10 @@ protected void removeClientCursorNameFromCache() { * @param closingRS The ResultSet to be closed * @throws SqlException */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void resultSetCommitting(ClientResultSet closingRS) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-213 resultSetCommitting(closingRS, false); } @@ -3209,6 +3341,7 @@ boolean resultSetCommitting( // If so, then no commit. The last result set to close will close the statement. if (resultSetList_ != null) { for (int i = 0; i < resultSetList_.length; i++) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientResultSet crs = resultSetList_[i]; if (crs == null) continue; @@ -3256,6 +3389,7 @@ private void markAutoCommitted() { public void closeOnCompletion() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-4869 try { checkForClosedStatement(); } catch (SqlException se) { throw se.getSQLException(); } @@ -3295,6 +3429,7 @@ void closeMeOnCompletion() } // if we got here, then the Statement has no open ResultSets left +//IC see: https://issues.apache.org/jira/browse/DERBY-4869 openOnClient_ = false; closeEverythingExceptResultSets( true ); } @@ -3306,6 +3441,7 @@ private boolean isOpen( ClientResultSet rs ) throws SQLException return ( (rs != null) && (!rs.isClosed()) ); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void resetResultSetList() { indexOfCurrentResultSet_ = -1; //reset ResultSetList } @@ -3317,6 +3453,7 @@ void resetResultSetList() { * @return section_ */ public Section getSection() { +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 return section_; } diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ClientTypes.java b/java/org.apache.derby.client/org/apache/derby/client/am/ClientTypes.java index fba2472817..dec35ebc80 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/ClientTypes.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/ClientTypes.java @@ -30,6 +30,7 @@ public class ClientTypes { // -------------------------------- Driver types ------------------------------------------------- final static int BIT = Types.BIT; // -7; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 // Not currently supported as a DERBY column type. Mapped to SMALLINT. //final static int TINYINT = Types.TINYINT; // -6; @@ -61,6 +62,7 @@ public class ClientTypes { public final static int LONGVARCHAR = Types.LONGVARCHAR; // -1; final static int DATE = Types.DATE; // 91; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final static int TIME = Types.TIME; // 92; @@ -84,6 +86,7 @@ private ClientTypes() { static String getTypeString(int type) { +//IC see: https://issues.apache.org/jira/browse/DERBY-839 switch (type ) { case BIGINT: return "BIGINT"; @@ -106,9 +109,11 @@ static String getTypeString(int type) case VARBINARY: return "VARBINARY"; case VARCHAR: return "VARCHAR"; // Types we don't support: +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.ARRAY: return "ARRAY"; case Types.DATALINK: return "DATALINK"; case Types.REF: return "REF"; +//IC see: https://issues.apache.org/jira/browse/DERBY-2438 case Types.ROWID: return "ROWID"; case Types.SQLXML: return "SQLXML"; case Types.STRUCT: return "STRUCT"; @@ -119,6 +124,7 @@ static String getTypeString(int type) static public int mapDERBYTypeToDriverType(boolean isDescribed, int sqlType, long length, int ccsid) { switch (Utils.getNonNullableSqlType(sqlType)) { // mask the isNullable bit +//IC see: https://issues.apache.org/jira/browse/DERBY-499 case DRDAConstants.DB2_SQLTYPE_BOOLEAN: return BOOLEAN; case DRDAConstants.DB2_SQLTYPE_SMALL: @@ -139,6 +145,7 @@ static public int mapDERBYTypeToDriverType(boolean isDescribed, int sqlType, lon } else { return 0; } +//IC see: https://issues.apache.org/jira/browse/DERBY-499 case DRDAConstants.DB2_SQLTYPE_DECIMAL: // can map to either NUMERIC or DECIMAL case DRDAConstants.DB2_SQLTYPE_NUMERIC: // can map to either NUMERIC or DECIMAL return DECIMAL; @@ -170,6 +177,7 @@ static public int mapDERBYTypeToDriverType(boolean isDescribed, int sqlType, lon case DRDAConstants.DB2_SQLTYPE_TIMESTAMP: return TIMESTAMP; case DRDAConstants.DB2_SQLTYPE_CLOB: // large object character SBCS/Mixed +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return ClientTypes.CLOB; case DRDAConstants.DB2_SQLTYPE_BLOB: // large object bytes return Types.BLOB; diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ClobLocatorInputStream.java b/java/org.apache.derby.client/org/apache/derby/client/am/ClobLocatorInputStream.java index 0e135fc18c..be02faecaf 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/ClobLocatorInputStream.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/ClobLocatorInputStream.java @@ -42,6 +42,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more * straight-forward. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class ClobLocatorInputStream extends InputStream { /** @@ -69,8 +70,10 @@ class ClobLocatorInputStream extends InputStream { * @param clob Clob object that contains locator for * the Clob value on the server. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClobLocatorInputStream(ClientConnection connection, ClientClob clob) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-2622 if (SanityManager.DEBUG) { SanityManager.ASSERT(clob.isLocator()); } @@ -91,10 +94,12 @@ class ClobLocatorInputStream extends InputStream { * @param pos the position inside the Clob from which * the reading must begin. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClobLocatorInputStream( ClientConnection connection, ClientClob clob, long pos) throws SqlException{ +//IC see: https://issues.apache.org/jira/browse/DERBY-2763 this(connection, clob); this.currentPos = pos; } @@ -111,6 +116,7 @@ public int read() throws IOException { return -1; } else { // convert byte in range [-128,127] to int in range [0,255] +//IC see: https://issues.apache.org/jira/browse/DERBY-3226 return bytes[0] & 0xff; } } @@ -120,6 +126,7 @@ public int read() throws IOException { */ public int read(byte[] b, int off, int len) throws IOException { if (len == 0) return 0; +//IC see: https://issues.apache.org/jira/browse/DERBY-2604 if ((off < 0) || (len < 0) || (len > b.length - off)) { throw new IndexOutOfBoundsException(); } @@ -145,10 +152,12 @@ public int read(byte[] b, int off, int len) throws IOException { private byte[] readBytes(int len) throws IOException { try { int actualLength +//IC see: https://issues.apache.org/jira/browse/DERBY-2763 = (int )Math.min(len, clob.sqlLength() - currentPos + 1); String resultStr = connection.locatorProcedureCall(). clobGetSubString(clob.getLocator(), currentPos, actualLength); +//IC see: https://issues.apache.org/jira/browse/DERBY-2604 byte[] result = getBytesFromString(resultStr); currentPos += result.length; return result; @@ -174,6 +183,7 @@ private byte[] getBytesFromString(String str) { //converted Byte array that will be returned //to the user byte[] result = new byte[str.length()]; +//IC see: https://issues.apache.org/jira/browse/DERBY-2604 //Iterate through the String to //Convert each character in the diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ClobLocatorOutputStream.java b/java/org.apache.derby.client/org/apache/derby/client/am/ClobLocatorOutputStream.java index 01345779ad..1d3c66afd0 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/ClobLocatorOutputStream.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/ClobLocatorOutputStream.java @@ -36,6 +36,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more * buffering of data is done. Hence, for efficiency #write(byte[]) * should be used instead of #write(int). */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class ClobLocatorOutputStream extends OutputStream { /** @@ -59,6 +60,7 @@ class ClobLocatorOutputStream extends OutputStream { * @param pos the position in the CLOB value at which * to start writing; the first position is 1 */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClobLocatorOutputStream( ClientClob clob, long pos) throws SqlException { @@ -95,6 +97,7 @@ public void write(byte[] b) throws IOException { public void write(byte[] b, int off, int len) throws IOException { if (len == 0) return; if ((off < 0) || (off > b.length) || (len < 0) || +//IC see: https://issues.apache.org/jira/browse/DERBY-2604 (len > b.length - off)) { throw new IndexOutOfBoundsException(); } @@ -126,7 +129,9 @@ public void flush() { */ private void writeBytes(byte[] b) throws IOException { try { +//IC see: https://issues.apache.org/jira/browse/DERBY-2604 String clobStr = new String(b, "ISO-8859-1"); +//IC see: https://issues.apache.org/jira/browse/DERBY-2763 clob.setStringX(currentPos, clobStr, 0, clobStr.length()); currentPos += b.length; } catch (SqlException ex) { diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ClobLocatorReader.java b/java/org.apache.derby.client/org/apache/derby/client/am/ClobLocatorReader.java index 48043870d1..c93b06c362 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/ClobLocatorReader.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/ClobLocatorReader.java @@ -37,6 +37,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more * this. A more efficient skip implementation should also be * straight-forward. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class ClobLocatorReader extends Reader { /** * Connection used to read Clob from server. @@ -76,6 +77,7 @@ class ClobLocatorReader extends Reader { * @param clob Clob object that contains locator for * the Clob value on the server. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClobLocatorReader(ClientConnection connection, ClientClob clob) throws SqlException { if (SanityManager.DEBUG) { @@ -106,8 +108,12 @@ class ClobLocatorReader extends Reader { * retrieved. * @param len The length in characters of the partial value to be retrieved. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClobLocatorReader(ClientConnection connection, ClientClob clob, +//IC see: https://issues.apache.org/jira/browse/DERBY-2604 long pos, long len) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-2622 +//IC see: https://issues.apache.org/jira/browse/DERBY-2604 if (SanityManager.DEBUG) { SanityManager.ASSERT(clob.isLocator()); } @@ -115,10 +121,12 @@ class ClobLocatorReader extends Reader { this.connection = connection; this.clob = clob; this.currentPos = pos; +//IC see: https://issues.apache.org/jira/browse/DERBY-2763 if(len != -1) { this.maxPos = Math.min(clob.sqlLength(), pos + len - 1); } else { +//IC see: https://issues.apache.org/jira/browse/DERBY-2763 this.maxPos = -1; } } @@ -145,6 +153,7 @@ public int read() throws IOException { public int read(char[] c, int off, int len) throws IOException { checkClosed(); if (len == 0) return 0; +//IC see: https://issues.apache.org/jira/browse/DERBY-2604 if ((off < 0) || (len < 0) || (len > c.length - off)) { throw new IndexOutOfBoundsException(); } @@ -207,10 +216,12 @@ private char[] readCharacters(int len) throws IOException { int actualLength = -1; //check if maxPos has been set and calculate actualLength //based on that. +//IC see: https://issues.apache.org/jira/browse/DERBY-2763 if(maxPos != -1) { //maxPos has been set. use maxPos to calculate the //actual length based on the value set for maxPos. actualLength +//IC see: https://issues.apache.org/jira/browse/DERBY-2604 = (int )Math.min(len, maxPos - currentPos + 1); } else { diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ClobLocatorWriter.java b/java/org.apache.derby.client/org/apache/derby/client/am/ClobLocatorWriter.java index 33ad2fa63f..22e6089e3d 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/ClobLocatorWriter.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/ClobLocatorWriter.java @@ -32,6 +32,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more * buffering of data is done. Hence, for efficiency {@code #write(char[])} * should be used instead of {@code #write(int)}. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class ClobLocatorWriter extends Writer { /** * Connection used to read Clob from server. @@ -67,6 +68,7 @@ class ClobLocatorWriter extends Writer { * @param pos the position in the {@code CLOB} value at which * to start writing; the first position is 1 */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClobLocatorWriter( ClientConnection connection, ClientClob clob, @@ -148,6 +150,7 @@ public void write(char[] c, int off, int len) throws IOException { checkClosed(); if (len == 0) return; if ((off < 0) || (off > c.length) || (len < 0) || +//IC see: https://issues.apache.org/jira/browse/DERBY-2604 (len > c.length - off)) { throw new IndexOutOfBoundsException(); } @@ -165,6 +168,7 @@ public void write(char[] c, int off, int len) throws IOException { private void writeCharacters(char[] c, int off, int len) throws IOException { try { +//IC see: https://issues.apache.org/jira/browse/DERBY-2763 clob.setStringX(currentPos, new String(c, off, len), 0, len); currentPos += len; } catch (SqlException ex) { diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ClobOutputStream.java b/java/org.apache.derby.client/org/apache/derby/client/am/ClobOutputStream.java index b023f7f985..a3c3650d7b 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/ClobOutputStream.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/ClobOutputStream.java @@ -25,19 +25,23 @@ Licensed to the Apache Software Foundation (ASF) under one or more import java.io.OutputStream; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class ClobOutputStream extends OutputStream { private ClientClob clob_; private long offset_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClobOutputStream(ClientClob clob, long offset) throws SqlException { clob_ = clob; offset_ = offset; /* +//IC see: https://issues.apache.org/jira/browse/DERBY-796 offset_ starts from 1 while sqlLenth_=0 in the case of a empty Clob hence check from offset_-1 */ +//IC see: https://issues.apache.org/jira/browse/DERBY-2540 if ((offset_-1) > clob_.sqlLength()) { throw new IndexOutOfBoundsException(); } @@ -61,6 +65,7 @@ public void write(byte b[], int off, int len) throws IOException { byte[] newByte = new byte[len]; System.arraycopy(b, off, newByte, 0, len); +//IC see: https://issues.apache.org/jira/browse/DERBY-2540 writeBytes(newByte); } @@ -69,7 +74,9 @@ private void writeBytes(byte b[]) throws IOException { // Since this is an OutputStream returned by Clob.setAsciiStream // use Ascii encoding when creating the String from bytes +//IC see: https://issues.apache.org/jira/browse/DERBY-1519 String str = new String(b, "ISO-8859-1"); +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 clob_.reInitForNonLocator( clob_.string_.substring(0, (int) offset_ - 1).concat(str)); offset_ += b.length; diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ClobWriter.java b/java/org.apache.derby.client/org/apache/derby/client/am/ClobWriter.java index fe2d13b73b..4f5cda8e26 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/ClobWriter.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/ClobWriter.java @@ -25,23 +25,30 @@ Licensed to the Apache Software Foundation (ASF) under one or more import java.io.Writer; import org.apache.derby.shared.common.reference.SQLState; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class ClobWriter extends Writer { private final ClientClob clob_; private long offset_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClobWriter(ClientClob clob, long offset) throws SqlException { clob_ = clob; offset_ = offset; +//IC see: https://issues.apache.org/jira/browse/DERBY-2540 if (offset_ - 1 > clob_.sqlLength()) { throw new SqlException(clob_.agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 new ClientMessageId(SQLState.BLOB_INVALID_OFFSET), offset); } } public void write(int c) { StringBuffer sb = new StringBuffer(clob_.string_.substring(0, (int) offset_ - 1)); +//IC see: https://issues.apache.org/jira/browse/DERBY-1245 +//IC see: https://issues.apache.org/jira/browse/DERBY-1354 sb.append((char)c); +//IC see: https://issues.apache.org/jira/browse/DERBY-2540 updateClob(sb); } @@ -54,6 +61,7 @@ public void write(char cbuf[], int off, int len) { } StringBuffer sb = new StringBuffer(clob_.string_.substring(0, (int) offset_ - 1)); sb.append(cbuf, off, len); +//IC see: https://issues.apache.org/jira/browse/DERBY-2540 updateClob(sb); } @@ -79,6 +87,7 @@ public void close() throws IOException { private void updateClob(StringBuffer sb) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 clob_.reInitForNonLocator(sb.toString()); offset_ = clob_.string_.length() + 1; } diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/CloseFilterInputStream.java b/java/org.apache.derby.client/org/apache/derby/client/am/CloseFilterInputStream.java index 9be27f0cae..1b23266565 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/CloseFilterInputStream.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/CloseFilterInputStream.java @@ -30,12 +30,14 @@ class CloseFilterInputStream extends FilterInputStream { private static final String ALREADY_CLOSED_ERR_MESSAGE = SqlException.getMessageUtil().getTextMessage( +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 MessageId.OBJECT_CLOSED); private boolean closed; public CloseFilterInputStream(InputStream is){ +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 super(is); closed = false; @@ -46,6 +48,7 @@ public int read() throws IOException { if(closed){ +//IC see: https://issues.apache.org/jira/browse/DERBY-839 throw new IOException(ALREADY_CLOSED_ERR_MESSAGE); } @@ -58,6 +61,7 @@ public int read(byte[] b) throws IOException { if(closed){ +//IC see: https://issues.apache.org/jira/browse/DERBY-839 throw new IOException(ALREADY_CLOSED_ERR_MESSAGE); } @@ -72,6 +76,7 @@ public int read(byte[] b, throws IOException{ if(closed){ +//IC see: https://issues.apache.org/jira/browse/DERBY-839 throw new IOException(ALREADY_CLOSED_ERR_MESSAGE); } @@ -84,6 +89,7 @@ public long skip(long n) throws IOException{ if(closed){ +//IC see: https://issues.apache.org/jira/browse/DERBY-839 throw new IOException(ALREADY_CLOSED_ERR_MESSAGE); } @@ -96,6 +102,7 @@ public int available() throws IOException{ if(closed){ +//IC see: https://issues.apache.org/jira/browse/DERBY-839 throw new IOException(ALREADY_CLOSED_ERR_MESSAGE); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ColumnMetaData.java b/java/org.apache.derby.client/org/apache/derby/client/am/ColumnMetaData.java index 40af711231..cbb82fa2b1 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/ColumnMetaData.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/ColumnMetaData.java @@ -95,8 +95,10 @@ public class ColumnMetaData implements ResultSetMetaData { // only used for result set meta data. transient int resultSetConcurrency_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 transient private Hashtable columnNameToIndexCache_; +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 transient private boolean statementClosed_ = false; @@ -109,6 +111,7 @@ private void checkForClosedStatement() throws SqlException { // agent_.checkForDeferredExceptions(); if (statementClosed_) { throw new SqlException(logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 new ClientMessageId (SQLState.LANG_STATEMENT_CLOSED_NO_REASON)); } } @@ -175,6 +178,7 @@ public boolean isAutoIncrement(int column) throws SQLException { { checkForClosedStatement(); checkForValidColumnIndex(column); +//IC see: https://issues.apache.org/jira/browse/DERBY-1355 if( sqlxGenerated_[column - 1] == 2) { return true; } @@ -194,6 +198,7 @@ public boolean isCaseSensitive(int column) throws SQLException { //return true if the SQLTYPE is CHAR, VARCHAR, LOGVARCHAR or CLOB int type = types_[column - 1]; return +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 type == ClientTypes.CHAR || type == ClientTypes.VARCHAR || type == ClientTypes.LONGVARCHAR || @@ -238,6 +243,7 @@ public int isNullable(int column) throws SQLException { checkForClosedStatement(); checkForValidColumnIndex(column); if (nullable_[column - 1]) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return ResultSetMetaData.columnNullable; } else { return ResultSetMetaData.columnNoNulls; @@ -257,6 +263,7 @@ public boolean isSigned(int column) throws SQLException { //return true only if the SQLType is SMALLINT, INT, BIGINT, FLOAT, REAL, DOUBLE, NUMERIC OR DECIMAL int type = types_[column - 1]; return +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 type == ClientTypes.SMALLINT || type == ClientTypes.INTEGER || type == ClientTypes.BIGINT || @@ -279,6 +286,7 @@ public int getColumnDisplaySize(int column) throws SQLException { checkForValidColumnIndex(column); int jdbcType = types_[column - 1]; switch (jdbcType) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.BOOLEAN: return 5; case ClientTypes.INTEGER: @@ -288,6 +296,7 @@ public int getColumnDisplaySize(int column) throws SQLException { case ClientTypes.BIGINT: return 20; case ClientTypes.REAL: +//IC see: https://issues.apache.org/jira/browse/DERBY-3398 return 15; case ClientTypes.DOUBLE: case Types.FLOAT: @@ -300,7 +309,10 @@ public int getColumnDisplaySize(int column) throws SQLException { // 3. precision > scale > 0, 2 should be added to precision for sign and decimal. int scale = getScale(column); int precision = getPrecision(column); +//IC see: https://issues.apache.org/jira/browse/DERBY-836 +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 return (scale == 0) ? (precision + 1) : ((scale == precision) ? (precision + 3) : (precision + 2)); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.CHAR: case ClientTypes.VARCHAR: case ClientTypes.LONGVARCHAR: @@ -313,6 +325,7 @@ public int getColumnDisplaySize(int column) throws SQLException { case ClientTypes.TIMESTAMP: return 29; case ClientTypes.JAVA_OBJECT: +//IC see: https://issues.apache.org/jira/browse/DERBY-2438 return JDBC40Translation.DEFAULT_COLUMN_DISPLAY_SIZE; case ClientTypes.BINARY: case ClientTypes.VARBINARY: @@ -322,6 +335,8 @@ public int getColumnDisplaySize(int column) throws SQLException { // range. In such cases, the size is limited to the max. int value // This behavior is consistent with the same in Embedded mode. int size = (int) (2 * sqlLength_[column - 1]); // eg. "FF" represents just one byte +//IC see: https://issues.apache.org/jira/browse/DERBY-2425 +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 if ( size < 0 ) size = Integer.MAX_VALUE; return size; @@ -414,6 +429,7 @@ public int getPrecision(int column) throws SQLException { int jdbcType = types_[column - 1]; switch (jdbcType) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.BOOLEAN: return 1; case Types.NUMERIC: @@ -445,8 +461,11 @@ public int getPrecision(int column) throws SQLException { case ClientTypes.TIME: return 8; case ClientTypes.TIMESTAMP: +//IC see: https://issues.apache.org/jira/browse/DERBY-4614 +//IC see: https://issues.apache.org/jira/browse/DERBY-4614 return 29; case ClientTypes.JAVA_OBJECT: +//IC see: https://issues.apache.org/jira/browse/DERBY-2438 return JDBC40Translation.UNKNOWN_PRECISION; default: throw new SqlException(logWriter_, @@ -499,6 +518,7 @@ public String getTableName(int column) throws SQLException { * @throws SQLException thrown on failure */ public String getCatalogName(int column) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { checkForClosedStatement(); @@ -538,6 +558,7 @@ public String getColumnTypeName(int column) throws SQLException { int sqlType = sqlType_[column - 1]; switch (sqlType) { +//IC see: https://issues.apache.org/jira/browse/DERBY-499 case DRDAConstants.DB2_SQLTYPE_BOOLEAN: case DRDAConstants.DB2_SQLTYPE_NBOOLEAN: return "BOOLEAN"; @@ -558,6 +579,7 @@ public String getColumnTypeName(int column) throws SQLException { return "CLOB"; case DRDAConstants.DB2_SQLTYPE_VARCHAR: case DRDAConstants.DB2_SQLTYPE_NVARCHAR: +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (jdbcType == ClientTypes.VARBINARY) { return "VARCHAR FOR BIT DATA"; } else { @@ -582,6 +604,7 @@ public String getColumnTypeName(int column) throws SQLException { return "SBCS"; case DRDAConstants.DB2_SQLTYPE_FLOAT: case DRDAConstants.DB2_SQLTYPE_NFLOAT: +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (jdbcType == ClientTypes.DOUBLE) { return "DOUBLE"; } @@ -624,6 +647,7 @@ public boolean isReadOnly(int column) throws SQLException { checkForValidColumnIndex(column); if (sqlxUpdatable_ == null) { // If no extended describe, return resultSet's concurrency +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return resultSetConcurrency_ == ResultSet.CONCUR_READ_ONLY; } @@ -642,6 +666,7 @@ public boolean isWritable(int column) throws SQLException { checkForValidColumnIndex(column); if (sqlxUpdatable_ == null) { // If no extended describe, return resultSet's concurrency +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return resultSetConcurrency_ == ResultSet.CONCUR_UPDATABLE; } @@ -679,6 +704,7 @@ public String getColumnClassName(int column) throws SQLException { int jdbcType = types_[column - 1]; switch (jdbcType) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.BOOLEAN: return "java.lang.Boolean"; case Types.BIT: @@ -728,6 +754,9 @@ public String getColumnClassName(int column) throws SQLException { return sqlUDTclassName_[ column - 1 ]; default: throw new SqlException(logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 new ClientMessageId (SQLState.UNSUPPORTED_TYPE)); } } @@ -743,7 +772,9 @@ public String getColumnClassName(int column) throws SQLException { void checkForValidColumnIndex(int column) throws SqlException { if (column < 1 || column > columns_) { throw new SqlException(logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 new ClientMessageId (SQLState.LANG_INVALID_COLUMN_POSITION), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 column, columns_); } } @@ -784,7 +815,9 @@ private void nullDataForGC() { boolean hasLobColumns() { for (int i = 0; i < columns_; i++) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 switch (Utils.getNonNullableSqlType(sqlType_[i])) { +//IC see: https://issues.apache.org/jira/browse/DERBY-499 case DRDAConstants.DB2_SQLTYPE_BLOB: case DRDAConstants.DB2_SQLTYPE_CLOB: return true; @@ -799,6 +832,7 @@ boolean hasLobColumns() { int findColumnX(String columnName) throws SqlException { // Create cache if it doesn't exist if (columnNameToIndexCache_ == null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 columnNameToIndexCache_ = new Hashtable(); } else { // Check cache for mapping Integer index = columnNameToIndexCache_.get(columnName); @@ -813,17 +847,20 @@ int findColumnX(String columnName) throws SqlException { this.sqlName_[col] != null && this.sqlName_[col].equalsIgnoreCase(columnName)) { // Found it, add it to the cache +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 columnNameToIndexCache_.put(columnName, col + 1); return col + 1; } } throw new SqlException(logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 new ClientMessageId (SQLState.INVALID_COLUMN_NAME), columnName); } // assign ordinal position as the column name if null. private void assignColumnName(int column) { if (columnNameToIndexCache_ == null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 columnNameToIndexCache_ = new Hashtable(); } String columnName = Integer.toString(column); diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/Configuration.java b/java/org.apache.derby.client/org/apache/derby/client/am/Configuration.java index 4b849191d4..78b1b3d9d4 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/Configuration.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/Configuration.java @@ -47,6 +47,7 @@ static ProductVersionHolder getProductVersionHolder() { // for DatabaseMetaData.getDriverName() +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final static String dncDriverName = "Apache Derby Network Client JDBC Driver"; @@ -58,6 +59,7 @@ static ProductVersionHolder getProductVersionHolder() { {0x53, 0x59, 0x53, 0x4c, 0x56, 0x4c, 0x30, 0x31}; public static byte[] getDncPackageConsistencyToken() { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return dncPackageConsistencyToken.clone(); } @@ -68,6 +70,7 @@ public static byte[] getDncPackageConsistencyToken() { {"1.5", "1.6", "1.7", "1.8"}; static String[] getDncCompatibleJREVersions() { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return dncCompatibleJREVersions.clone(); } @@ -91,6 +94,7 @@ static String[] getDncCompatibleJREVersions() { // This is the DERBY default and maps to DERBY's "Cursor Stability". final static int defaultIsolation = Connection.TRANSACTION_READ_COMMITTED; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 // ---------------------------- statement defaults---------------------------- @@ -122,6 +126,7 @@ static String[] getDncCompatibleJREVersions() { } public static SqlException getExceptionOnLoadResources() { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return exceptionsOnLoadResources; } @@ -131,11 +136,13 @@ public static SqlException getExceptionOnLoadResources() { private static void loadProductVersionHolder() throws SqlException { try { dncProductVersionHolder__ = buildProductVersionHolder(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (PrivilegedActionException e) { throw new SqlException(null, new ClientMessageId (SQLState.ERROR_PRIVILEGED_ACTION), e.getException()); } catch (IOException ioe) { +//IC see: https://issues.apache.org/jira/browse/DERBY-1350 throw SqlException.javaException(null, ioe); } } @@ -143,12 +150,15 @@ private static void loadProductVersionHolder() throws SqlException { // Create ProductVersionHolder in security block for Java 2 security. private static ProductVersionHolder buildProductVersionHolder() throws +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 PrivilegedActionException, IOException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return AccessController.doPrivileged( new PrivilegedExceptionAction() { public ProductVersionHolder run() throws IOException { InputStream versionStream = getClass().getResourceAsStream("/" + ProductGenusNames.CLIENT_INFO); +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 return ProductVersionHolder.getProductVersionHolderFromMyEnv(versionStream); } @@ -163,6 +173,7 @@ public ProductVersionHolder run() throws IOException { public static boolean supportsJDBC42() { // use reflection to identify whether we support JDBC42 +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 try { Class.forName("java.sql.SQLType"); return true; diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/CrossConverters.java b/java/org.apache.derby.client/org/apache/derby/client/am/CrossConverters.java index 4783ce64a3..d115685f57 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/CrossConverters.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/CrossConverters.java @@ -66,6 +66,7 @@ final class CrossConverters { public static final int UNKNOWN_LENGTH = Integer.MIN_VALUE; private final static BigDecimal bdMaxByteValue__ = +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 BigDecimal.valueOf(Byte.MAX_VALUE); private final static BigDecimal bdMinByteValue__ = BigDecimal.valueOf(Byte.MIN_VALUE); @@ -115,12 +116,14 @@ final class CrossConverters { final Object setObject(int targetType, boolean source) throws SqlException { short numVal = source ? (short) 1 : 0; switch (targetType) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.BIT: case ClientTypes.BOOLEAN: return Boolean.valueOf(source); case ClientTypes.SMALLINT: return Short.valueOf(numVal); +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 case ClientTypes.INTEGER: return Integer.valueOf(numVal); @@ -159,6 +162,7 @@ final Object setObject(int targetType, byte source) throws SqlException { // In support of PS.setShort() final Object setObject(int targetType, short source) throws SqlException { switch (targetType) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.BIT: case ClientTypes.BOOLEAN: return Boolean.valueOf(source != 0); @@ -209,6 +213,7 @@ final Object setObject(int targetType, int source) throws SqlException { } return Short.valueOf((short) source); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.INTEGER: return Integer.valueOf(source); @@ -240,6 +245,7 @@ final Object setObject(int targetType, int source) throws SqlException { // don't support the BIT/BOOLEAN as underlying DERBY targetTypes. final boolean setBooleanFromObject(Object source, int sourceType) throws SqlException { switch (sourceType) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.SMALLINT: return getBooleanFromShort(((Short) source).shortValue()); case ClientTypes.INTEGER: @@ -266,6 +272,7 @@ final boolean setBooleanFromObject(Object source, int sourceType) throws SqlExce // don't support the BIT/BOOLEAN as underlying DERBY targetTypes. final byte setByteFromObject(Object source, int sourceType) throws SqlException { switch (sourceType) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.SMALLINT: return getByteFromShort(((Short) source).shortValue()); case ClientTypes.INTEGER: @@ -312,6 +319,7 @@ final Object setObject(int targetType, long source) throws SqlException { } return Integer.valueOf((int) source); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.BIGINT: return Long.valueOf(source); @@ -368,6 +376,7 @@ final Object setObject(int targetType, float source) throws SqlException { } return Long.valueOf((long) source); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.REAL: if (Configuration.rangeCheckCrossConverters && // change the check from (source > Float.MAX_VALUE || source < -Float.MIN_VALUE)) @@ -397,6 +406,7 @@ final Object setObject(int targetType, float source) throws SqlException { // | |________________________ //------------------------------------------------------------------------------------- (source == Double.POSITIVE_INFINITY || source == Double.NEGATIVE_INFINITY)) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 throw new OutsideRangeForDataTypeException( agent_.logWriter_, "DOUBLE"); } @@ -404,7 +414,9 @@ final Object setObject(int targetType, float source) throws SqlException { // Convert to Double via String to avoid changing the precision, // which may happen if we cast float to double. return Double.valueOf(String.valueOf(source)); +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.DECIMAL: // Can't use the following commented out line because it changes precision of the result. //return new java.math.BigDecimal (source); @@ -427,6 +439,10 @@ final Object setObject(int targetType, float source) throws SqlException { // In support of PS.setDouble() final Object setObject(int targetType, double source) throws SqlException { switch (targetType) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.BIT: case ClientTypes.BOOLEAN: return Boolean.valueOf(source != 0); @@ -434,10 +450,15 @@ final Object setObject(int targetType, double source) throws SqlException { case ClientTypes.SMALLINT: if (Configuration.rangeCheckCrossConverters && (source > Short.MAX_VALUE || source < Short.MIN_VALUE)) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 throw new OutsideRangeForDataTypeException( agent_.logWriter_, "SMALLINT"); } return Short.valueOf((short) source); +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 case ClientTypes.INTEGER: if (Configuration.rangeCheckCrossConverters && @@ -446,6 +467,9 @@ final Object setObject(int targetType, double source) throws SqlException { agent_.logWriter_, "INTEGER"); } return Integer.valueOf((int) source); +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 case ClientTypes.BIGINT: if (Configuration.rangeCheckCrossConverters && @@ -454,7 +478,10 @@ final Object setObject(int targetType, double source) throws SqlException { agent_.logWriter_, "BIGINT"); } return Long.valueOf((long) source); +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.REAL: if (Configuration.rangeCheckCrossConverters && (source > Float.MAX_VALUE || source < -Float.MAX_VALUE)) { @@ -462,7 +489,10 @@ final Object setObject(int targetType, double source) throws SqlException { agent_.logWriter_, "REAL"); } return Float.valueOf((float) source); +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.DOUBLE: if (Configuration.rangeCheckCrossConverters && // change the check from (source > Double.MAX_VALUE || source < -Double.MIN_VALUE)) @@ -481,6 +511,7 @@ final Object setObject(int targetType, double source) throws SqlException { } return Double.valueOf(source); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.DECIMAL: // Use BigDecimal.valueOf(source) instead of new BigDecimal(source), // as the latter may change the precision. @@ -510,11 +541,14 @@ final Object setObject(int targetType, BigDecimal source) case ClientTypes.SMALLINT: if (Configuration.rangeCheckCrossConverters && (source.compareTo(bdMaxShortValue__) == 1 || source.compareTo(bdMinShortValue__) == -1)) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 throw new OutsideRangeForDataTypeException( agent_.logWriter_, "SMALLINT"); } return Short.valueOf(source.shortValue()); +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.INTEGER: if (Configuration.rangeCheckCrossConverters && (source.compareTo(bdMaxIntValue__) == 1 || source.compareTo(bdMinIntValue__) == -1)) { @@ -522,7 +556,9 @@ final Object setObject(int targetType, BigDecimal source) agent_.logWriter_, "INTEGER"); } return Integer.valueOf(source.intValue()); +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.BIGINT: if (Configuration.rangeCheckCrossConverters && (source.compareTo(bdMaxLongValue__) == 1 || source.compareTo(bdMinLongValue__) == -1)) { @@ -530,15 +566,20 @@ final Object setObject(int targetType, BigDecimal source) agent_.logWriter_, "BIGINT"); } return Long.valueOf(source.longValue()); +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.REAL: if (Configuration.rangeCheckCrossConverters && (source.compareTo(bdMaxFloatValue__) == 1 || source.compareTo(bdMinFloatValue__) == -1)) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 throw new OutsideRangeForDataTypeException( agent_.logWriter_, "REAL"); } return Float.valueOf(source.floatValue()); +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.DOUBLE: if (Configuration.rangeCheckCrossConverters && (source.compareTo(bdMaxDoubleValue__) == 1 || source.compareTo(bdMinDoubleValue__) == -1)) { @@ -546,7 +587,9 @@ final Object setObject(int targetType, BigDecimal source) agent_.logWriter_, "DOUBLE"); } return Double.valueOf(source.doubleValue()); +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.DECIMAL: return source; @@ -601,6 +644,7 @@ final Object setObject(int targetType, Time source) throws SqlException { default: throw new SqlException(agent_.logWriter_, new ClientMessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH), +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 "java.sql.Time", ClientTypes.getTypeString(targetType)); } } @@ -639,6 +683,7 @@ final Object setObject(int targetType, Timestamp source) final Object setObject(int targetDriverType, String source) throws SqlException { try { switch (targetDriverType) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.BIT: case ClientTypes.BOOLEAN: { @@ -652,24 +697,33 @@ final Object setObject(int targetDriverType, String source) throws SqlException } else { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.LANG_FORMAT_EXCEPTION), +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientTypes.getTypeString(targetDriverType)); } } case ClientTypes.SMALLINT: return Short.valueOf(source); +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.INTEGER: return Integer.valueOf(source); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.BIGINT: return Long.valueOf(source); case ClientTypes.REAL: return Float.valueOf(source); +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 case ClientTypes.DOUBLE: return Double.valueOf(source); +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 case ClientTypes.DECIMAL: return new BigDecimal(source); @@ -706,6 +760,7 @@ final Object setObject(int targetDriverType, String source) throws SqlException throw new SqlException(agent_.logWriter_, new ClientMessageId (SQLState.LANG_FORMAT_EXCEPTION), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, ClientTypes.getTypeString(targetDriverType)); } @@ -717,6 +772,7 @@ final Object setObject(int targetDriverType, String source) throws SqlException */ public static int getInputJdbcType(int jdbcType) { switch (jdbcType) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.TINYINT: case Types.SMALLINT: return Types.INTEGER; @@ -738,6 +794,7 @@ public static int getInputJdbcType(int jdbcType) { // In support of PS.setBytes() final Object setObject(int targetType, byte[] source) throws SqlException { switch (targetType) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.BINARY: case ClientTypes.VARBINARY: case ClientTypes.LONGVARBINARY: @@ -793,6 +850,7 @@ private String setStringFromReader(Reader r, int length) if (length != CrossConverters.UNKNOWN_LENGTH && length != totalRead) { throw new SqlException(agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 new ClientMessageId (SQLState.READER_UNDER_RUN)); } return sw.toString(); @@ -804,6 +862,7 @@ private String setStringFromReader(Reader r, int length) // Convert from InputStream source to target type. // In support of PS.setAsciiStream, PS.setUnicodeStream // Note: PS.setCharacterStream() is handled by setObject(Reader) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final Object setObjectFromCharacterStream( int targetType, InputStream source, @@ -835,6 +894,8 @@ final Object setObjectFromCharacterStream( // create a String by reading all of the bytes from inputStream, applying encoding private String setStringFromStream( InputStream is, +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 Charset encoding, int length) throws SqlException { @@ -848,15 +909,18 @@ private String setStringFromStream( baos.write(read); read = is.read(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (IOException e) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.JAVA_EXCEPTION), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, e.getClass().getName(), e.getMessage()); } if (length != CrossConverters.UNKNOWN_LENGTH && length != totalRead) { throw new SqlException(agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 new ClientMessageId (SQLState.READER_UNDER_RUN)); } @@ -865,6 +929,7 @@ private String setStringFromStream( // Convert from Blob source to target type // In support of PS.setBlob() +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final Object setObject(int targetType, Blob source) throws SqlException { switch (targetType) { case ClientTypes.BLOB: @@ -902,6 +967,7 @@ final Object setObjectFromBinaryStream( // create a byte[] by reading all of the bytes from inputStream private byte[] setBytesFromStream(InputStream is, int length) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SqlException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); int totalRead = 0; @@ -914,12 +980,19 @@ private byte[] setBytesFromStream(InputStream is, int length) read = is.read(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 if (length != CrossConverters.UNKNOWN_LENGTH && length != totalRead) { throw new SqlException(agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 new ClientMessageId (SQLState.READER_UNDER_RUN)); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (IOException e) { +//IC see: https://issues.apache.org/jira/browse/DERBY-1350 throw SqlException.javaException(agent_.logWriter_, e); } return baos.toByteArray(); @@ -927,6 +1000,7 @@ private byte[] setBytesFromStream(InputStream is, int length) // Convert from Clob source to target type // In support of PS.setClob() +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final Object setObject(int targetType, Clob source) throws SqlException { switch (targetType) { case ClientTypes.CLOB: @@ -941,6 +1015,7 @@ final Object setObject(int targetType, Clob source) throws SqlException { // The Java compiler uses static binding, so we can't rely on the strongly // typed setObject() methods above for each of the Java Object instance types. final Object setObject(int targetType, Object source) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-1177 if (source == null) { return null; } else if (source instanceof Boolean) { @@ -953,6 +1028,7 @@ final Object setObject(int targetType, Object source) throws SqlException { return setObject(targetType, ((Float) source).floatValue()); } else if (source instanceof Double) { return setObject(targetType, ((Double) source).doubleValue()); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } else if (source instanceof BigDecimal) { return setObject(targetType, (BigDecimal) source); } else if (source instanceof Date) { @@ -1091,7 +1167,17 @@ final byte getByteFromFloat(float source) throws SqlException { final byte getByteFromDouble(double source) throws SqlException { if (Configuration.rangeCheckCrossConverters && +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 (source > Byte.MAX_VALUE || source < Byte.MIN_VALUE)) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 throw new OutsideRangeForDataTypeException( agent_.logWriter_, "TINYINT"); } @@ -1109,6 +1195,7 @@ final byte getByteFromString(String source) throws SqlException { } catch (NumberFormatException e) { throw new SqlException(agent_.logWriter_, new ClientMessageId +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 (SQLState.LANG_FORMAT_EXCEPTION), e, "byte"); } } @@ -1147,7 +1234,18 @@ final short getShortFromFloat(float source) throws SqlException { final short getShortFromDouble(double source) throws SqlException { if (Configuration.rangeCheckCrossConverters && +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 (source > Short.MAX_VALUE || source < Short.MIN_VALUE)) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 throw new OutsideRangeForDataTypeException( agent_.logWriter_, "SMALLINT"); } @@ -1162,10 +1260,13 @@ final short getShortFromBoolean(boolean source) throws SqlException { final short getShortFromString(String source) throws SqlException { try { return parseShort(source); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (NumberFormatException e) { throw new SqlException(agent_.logWriter_, new ClientMessageId (SQLState.LANG_FORMAT_EXCEPTION), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, "short"); } } @@ -1194,7 +1295,13 @@ final int getIntFromFloat(float source) throws SqlException { final int getIntFromDouble(double source) throws SqlException { if (Configuration.rangeCheckCrossConverters && +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 (source > Integer.MAX_VALUE || source < Integer.MIN_VALUE)) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 throw new OutsideRangeForDataTypeException( agent_.logWriter_, "INTEGER"); } @@ -1212,6 +1319,7 @@ final int getIntFromString(String source) throws SqlException { } catch (NumberFormatException e) { throw new SqlException(agent_.logWriter_, new ClientMessageId (SQLState.LANG_FORMAT_EXCEPTION), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, "int"); } } @@ -1230,7 +1338,11 @@ final long getLongFromFloat(float source) throws SqlException { final long getLongFromDouble(double source) throws SqlException { if (Configuration.rangeCheckCrossConverters && +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 (source > Long.MAX_VALUE || source < Long.MIN_VALUE)) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 throw new OutsideRangeForDataTypeException( agent_.logWriter_, "BIGINT"); } @@ -1248,6 +1360,7 @@ final long getLongFromString(String source) throws SqlException { } catch (NumberFormatException e) { throw new SqlException(agent_.logWriter_, new ClientMessageId (SQLState.LANG_FORMAT_EXCEPTION), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, "long"); } } @@ -1256,7 +1369,10 @@ final long getLongFromString(String source) throws SqlException { final float getFloatFromDouble(double source) throws SqlException { if (Configuration.rangeCheckCrossConverters && +//IC see: https://issues.apache.org/jira/browse/DERBY-1136 Float.isInfinite((float)source)) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 throw new OutsideRangeForDataTypeException( agent_.logWriter_, "DOUBLE"); } @@ -1274,6 +1390,7 @@ final float getFloatFromString(String source) throws SqlException { } catch (NumberFormatException e) { throw new SqlException(agent_.logWriter_, new ClientMessageId (SQLState.LANG_FORMAT_EXCEPTION), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, "float"); } } @@ -1290,6 +1407,7 @@ final double getDoubleFromString(String source) throws SqlException { } catch (NumberFormatException e) { throw new SqlException(agent_.logWriter_, new ClientMessageId (SQLState.LANG_FORMAT_EXCEPTION), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, "double"); } } @@ -1302,9 +1420,17 @@ final BigDecimal getBigDecimalFromString(String source) // Unfortunately, the big decimal constructor calls java.lang.Long.parseLong(), // which doesn't like spaces, so we have to call trim() to get rid of the spaces from CHAR columns. return new BigDecimal(source.trim()); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (NumberFormatException e) { throw new SqlException(agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 new ClientMessageId (SQLState.LANG_FORMAT_EXCEPTION), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, "java.math.BigDecimal"); } } @@ -1359,6 +1485,9 @@ final Timestamp getTimestampFromString(String source, Calendar cal) return timestamp_valueOf(source, cal); } catch (IllegalArgumentException e) { // subsumes NumberFormatException throw new SqlException(agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 new ClientMessageId (SQLState.LANG_DATE_SYNTAX_EXCEPTION), e); } } @@ -1513,6 +1642,8 @@ private static void initTimePortion(Calendar cal, String time) { */ private static Timestamp timestamp_valueOf(String s, Calendar cal) { if (s == null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throw new IllegalArgumentException(); } @@ -1705,6 +1836,7 @@ private static long parseLong(String s) throws NumberFormatException { if (negative) { if (i > 1) { return result; +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 } else { // Only got "-" throw new NumberFormatException(s); } @@ -1714,6 +1846,7 @@ private static long parseLong(String s) throws NumberFormatException { } private static void skipPadding(String s, int i, int length) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws NumberFormatException { while (i < length) { if (s.charAt(i++) != ' ') { diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/Cursor.java b/java/org.apache.derby.client/org/apache/derby/client/am/Cursor.java index 43208beaf5..b97ee511af 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/Cursor.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/Cursor.java @@ -101,6 +101,7 @@ public abstract class Cursor { // Total number of rows read so far. // This should never exceed this.statement.maxRows long rowsRead_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 // Maximum column size limit in bytes. int maxFieldSize_ = 0; @@ -110,6 +111,7 @@ public abstract class Cursor { protected ArrayList columnDataPositionCache_ = new ArrayList(); protected ArrayList columnDataLengthCache_ = new ArrayList(); protected ArrayList columnDataIsNullCache_ = new ArrayList(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 ArrayList isUpdateDeleteHoleCache_ = new ArrayList(); boolean isUpdateDeleteHole_; @@ -142,6 +144,7 @@ public abstract class Cursor { public Cursor(Agent agent) { agent_ = agent; isRowUpdated_ = false; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 dataBufferStream_ = new ByteArrayOutputStream(); } @@ -152,6 +155,7 @@ public void setNumberOfColumns(int numberOfColumns) { columns_ = numberOfColumns; nullable_ = new boolean[numberOfColumns]; charset_ = new Charset[numberOfColumns]; +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 ccsid_ = new int[numberOfColumns]; @@ -178,6 +182,7 @@ protected boolean stepNext(boolean allowServerFetch) throws SqlException { // Moving out of the hole, set isUpdateDeleteHole to false isUpdateDeleteHole_ = false; +//IC see: https://issues.apache.org/jira/browse/DERBY-718 isRowUpdated_ = false; @@ -195,6 +200,7 @@ protected boolean stepNext(boolean allowServerFetch) throws SqlException { // scrollable cursors, for the arrays to be reused. It is not used for forward-only // cursors, so just pass in 0. boolean rowPositionIsValid = +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 calculateColumnOffsetsForRow_(0, allowServerFetch); markNextRowPosition(); return rowPositionIsValid; @@ -208,6 +214,7 @@ protected boolean stepNext(boolean allowServerFetch) throws SqlException { * @exception SqlException if an error occurs */ public boolean next() throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-821 return stepNext(true); } @@ -234,6 +241,7 @@ public final boolean allRowsReceivedFromServer() { return allRowsReceivedFromServer_; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final boolean currentRowPositionIsEqualToNextRowPosition() { return (currentRowPosition_ == nextRowPosition_); } @@ -247,10 +255,13 @@ public final void resetDataBuffer() { lastValidBytePosition_ = 0; currentRowPosition_ = 0; nextRowPosition_ = 0; +//IC see: https://issues.apache.org/jira/browse/DERBY-821 +//IC see: https://issues.apache.org/jira/browse/DERBY-821 setAllRowsReceivedFromServer(false); dataBufferStream_.reset(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final boolean dataBufferHasUnprocessedData() { return (lastValidBytePosition_ - position_) > 0; } @@ -381,6 +392,7 @@ private final double get_DOUBLE(int column) { // Build a java.math.BigDecimal from a fixed point decimal byte representation. private final BigDecimal get_DECIMAL(int column) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 return Decimal.getBigDecimal(dataBuffer_, columnDataPosition_[column - 1], getColumnPrecision(column - 1), @@ -391,6 +403,7 @@ private final BigDecimal get_DECIMAL(int column) throws SqlException { // Build a Java double from a fixed point decimal byte representation. private double getDoubleFromDECIMAL(int column) throws SqlException { try { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return Decimal.getDouble(dataBuffer_, columnDataPosition_[column - 1], getColumnPrecision(column - 1), @@ -398,6 +411,7 @@ private double getDoubleFromDECIMAL(int column) throws SqlException { } catch (IllegalArgumentException e) { throw new SqlException(agent_.logWriter_, new ClientMessageId (SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, "double"); } } @@ -406,6 +420,7 @@ private double getDoubleFromDECIMAL(int column) throws SqlException { private long getLongFromDECIMAL(int column, String targetType) throws SqlException { try { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return Decimal.getLong(dataBuffer_, columnDataPosition_[column - 1], getColumnPrecision(column - 1), @@ -413,6 +428,7 @@ private long getLongFromDECIMAL(int column, String targetType) } catch (ArithmeticException e) { throw new SqlException(agent_.logWriter_, new ClientMessageId (SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, targetType); } catch (IllegalArgumentException e) { throw new SqlException(agent_.logWriter_, @@ -428,6 +444,7 @@ private long getLongFromDECIMAL(int column, String targetType) // for all other cases length is the number of bytes. // The length does not include the null terminator. private String getVARCHAR(int column) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 if (ccsid_[column - 1] == 1200) { return getStringWithoutConvert(columnDataPosition_[column - 1] + 2, columnDataComputedLength_[column - 1] - 2); @@ -443,6 +460,7 @@ private String getVARCHAR(int column) throws SqlException { new ClientMessageId(SQLState.CHARACTER_CONVERTER_NOT_AVAILABLE)); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 String tempString = new String(dataBuffer_, columnDataPosition_[column - 1] + 2, columnDataComputedLength_[column - 1] - 2, @@ -463,11 +481,13 @@ private String getCHAR(int column) throws SqlException { // a mixed or double byte ccsid (ccsid = 0). this check for null in the // cursor is only required for types which can have mixed or double // byte ccsids. +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 if (charset_[column - 1] == null) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.CHARACTER_CONVERTER_NOT_AVAILABLE)); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 String tempString = new String(dataBuffer_, columnDataPosition_[column - 1], columnDataComputedLength_[column - 1], @@ -479,6 +499,7 @@ private String getCHAR(int column) throws SqlException { // Build a JDBC Date object from the DERBY ISO DATE field. private Date getDATE(int column, Calendar cal) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return DateTime.dateBytesToDate(dataBuffer_, columnDataPosition_[column - 1], cal, @@ -487,6 +508,7 @@ private Date getDATE(int column, Calendar cal) throws SqlException { // Build a JDBC Time object from the DERBY ISO TIME field. private Time getTIME(int column, Calendar cal) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return DateTime.timeBytesToTime(dataBuffer_, columnDataPosition_[column - 1], cal, @@ -561,6 +583,7 @@ private byte[] get_CHAR_FOR_BIT_DATA(int column) throws SqlException { // Otherwise, use the smaller of maxFieldSize and the actual column length. int columnLength = (maxFieldSize_ == 0) ? columnDataComputedLength_[column - 1] : Math.min(maxFieldSize_, columnDataComputedLength_[column - 1]); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 byte[] bytes = new byte[columnLength]; System.arraycopy(dataBuffer_, columnDataPosition_[column - 1], bytes, 0, columnLength); @@ -586,6 +609,8 @@ private byte[] get_VARCHAR_FOR_BIT_DATA(int column) throws SqlException { private Object get_UDT(int column) throws SqlException { byte[] bytes; int columnLength = +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 (maxFieldSize_ == 0) ? columnDataComputedLength_[column - 1] - 2 : Math.min(maxFieldSize_, columnDataComputedLength_[column - 1] - 2); bytes = new byte[columnLength]; @@ -603,6 +628,7 @@ private Object get_UDT(int column) throws SqlException { ( agent_.logWriter_, new ClientMessageId (SQLState.NET_MARSHALLING_UDT_ERROR), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, e.getMessage() ); @@ -619,6 +645,7 @@ private Calendar getRecyclableCalendar() { if (recyclableCalendar_ == null) recyclableCalendar_ = new GregorianCalendar(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return recyclableCalendar_; } @@ -631,6 +658,7 @@ private Calendar getRecyclableCalendar() * * @return The locator procedures object. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-3571 CallableLocatorProcedures getLocatorProcedures() { return agent_.connection_.locatorProcedureCall(); } @@ -663,6 +691,7 @@ CallableLocatorProcedures getLocatorProcedures() { public abstract ClientBlob getBlobColumn_(int column, Agent agent, boolean toBePublished) throws SqlException; +//IC see: https://issues.apache.org/jira/browse/DERBY-2892 /** * Returns a {@code Clob} object. @@ -681,6 +710,7 @@ public abstract ClientClob getClobColumn_(int column, Agent agent, final boolean getBoolean(int column) throws SqlException { switch (jdbcTypes_[column - 1]) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.BOOLEAN: return get_BOOLEAN(column); case Types.SMALLINT: @@ -695,6 +725,7 @@ final boolean getBoolean(int column) throws SqlException { return agent_.crossConverters_.getBooleanFromDouble(get_DOUBLE(column)); case Types.DECIMAL: // For performance we don't materialize the BigDecimal, but convert directly from decimal bytes to a long. +//IC see: https://issues.apache.org/jira/browse/DERBY-5536 return agent_.crossConverters_.getBooleanFromLong( getLongFromDECIMAL(column, "boolean")); case Types.CHAR: @@ -703,6 +734,7 @@ final boolean getBoolean(int column) throws SqlException { case Types.LONGVARCHAR: return agent_.crossConverters_.getBooleanFromString(getVARCHAR(column)); default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "boolean", column ); } } @@ -710,6 +742,7 @@ final boolean getBoolean(int column) throws SqlException { final byte getByte(int column) throws SqlException { // This needs to be changed to use jdbcTypes[] switch (jdbcTypes_[column - 1]) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.BOOLEAN: return agent_.crossConverters_.getByteFromBoolean(get_BOOLEAN(column)); case Types.SMALLINT: @@ -724,6 +757,7 @@ final byte getByte(int column) throws SqlException { return agent_.crossConverters_.getByteFromDouble(get_DOUBLE(column)); case Types.DECIMAL: // For performance we don't materialize the BigDecimal, but convert directly from decimal bytes to a long. +//IC see: https://issues.apache.org/jira/browse/DERBY-5536 return agent_.crossConverters_.getByteFromLong( getLongFromDECIMAL(column, "byte")); case Types.CHAR: @@ -732,12 +766,14 @@ final byte getByte(int column) throws SqlException { case Types.LONGVARCHAR: return agent_.crossConverters_.getByteFromString(getVARCHAR(column)); default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "byte", column ); } } final short getShort(int column) throws SqlException { switch (jdbcTypes_[column - 1]) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.BOOLEAN: return agent_.crossConverters_.getShortFromBoolean(get_BOOLEAN(column)); case Types.SMALLINT: @@ -752,6 +788,7 @@ final short getShort(int column) throws SqlException { return agent_.crossConverters_.getShortFromDouble(get_DOUBLE(column)); case Types.DECIMAL: // For performance we don't materialize the BigDecimal, but convert directly from decimal bytes to a long. +//IC see: https://issues.apache.org/jira/browse/DERBY-5536 return agent_.crossConverters_.getShortFromLong( getLongFromDECIMAL(column, "short")); case Types.CHAR: @@ -760,12 +797,14 @@ final short getShort(int column) throws SqlException { case Types.LONGVARCHAR: return agent_.crossConverters_.getShortFromString(getVARCHAR(column)); default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "short", column ); } } final int getInt(int column) throws SqlException { switch (jdbcTypes_[column - 1]) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.BOOLEAN: return agent_.crossConverters_.getIntFromBoolean(get_BOOLEAN(column)); case Types.SMALLINT: @@ -780,6 +819,7 @@ final int getInt(int column) throws SqlException { return agent_.crossConverters_.getIntFromDouble(get_DOUBLE(column)); case Types.DECIMAL: // For performance we don't materialize the BigDecimal, but convert directly from decimal bytes to a long. +//IC see: https://issues.apache.org/jira/browse/DERBY-5536 return agent_.crossConverters_.getIntFromLong( getLongFromDECIMAL(column, "int")); case Types.CHAR: @@ -788,12 +828,14 @@ final int getInt(int column) throws SqlException { case Types.LONGVARCHAR: return agent_.crossConverters_.getIntFromString(getVARCHAR(column)); default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "int", column ); } } final long getLong(int column) throws SqlException { switch (jdbcTypes_[column - 1]) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.BOOLEAN: return agent_.crossConverters_.getLongFromBoolean(get_BOOLEAN(column)); case Types.SMALLINT: @@ -808,6 +850,7 @@ final long getLong(int column) throws SqlException { return agent_.crossConverters_.getLongFromDouble(get_DOUBLE(column)); case Types.DECIMAL: // For performance we don't materialize the BigDecimal, but convert directly from decimal bytes to a long. +//IC see: https://issues.apache.org/jira/browse/DERBY-5536 return getLongFromDECIMAL(column, "long"); case Types.CHAR: return agent_.crossConverters_.getLongFromString(getCHAR(column)); @@ -815,12 +858,14 @@ final long getLong(int column) throws SqlException { case Types.LONGVARCHAR: return agent_.crossConverters_.getLongFromString(getVARCHAR(column)); default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "long", column ); } } final float getFloat(int column) throws SqlException { switch (jdbcTypes_[column - 1]) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.BOOLEAN: return agent_.crossConverters_.getFloatFromBoolean(get_BOOLEAN(column)); case Types.REAL: @@ -842,12 +887,14 @@ final float getFloat(int column) throws SqlException { case Types.LONGVARCHAR: return agent_.crossConverters_.getFloatFromString(getVARCHAR(column)); default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "float", column ); } } final double getDouble(int column) throws SqlException { switch (jdbcTypes_[column - 1]) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.BOOLEAN: return agent_.crossConverters_.getDoubleFromBoolean(get_BOOLEAN(column)); case Types.REAL: @@ -871,6 +918,7 @@ final double getDouble(int column) throws SqlException { case Types.LONGVARCHAR: return agent_.crossConverters_.getDoubleFromString(getVARCHAR(column)); default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "double", column ); } } @@ -900,6 +948,7 @@ final BigDecimal getBigDecimal(int column) throws SqlException { case Types.LONGVARCHAR: return agent_.crossConverters_.getBigDecimalFromString(getVARCHAR(column)); default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "java.math.BigDecimal", column ); } } @@ -918,10 +967,12 @@ final Date getDate(int column, Calendar cal) throws SqlException { return agent_.crossConverters_. getDateFromString(getVARCHAR(column), cal); default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "java.sql.Date", column ); } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final Time getTime(int column, Calendar cal) throws SqlException { switch (jdbcTypes_[column - 1]) { case Types.TIME: @@ -936,10 +987,12 @@ final Time getTime(int column, Calendar cal) throws SqlException { return agent_.crossConverters_. getTimeFromString(getVARCHAR(column), cal); default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "java.sql.Time", column ); } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final Timestamp getTimestamp(int column, Calendar cal) throws SqlException { switch (jdbcTypes_[column - 1]) { @@ -957,14 +1010,17 @@ final Timestamp getTimestamp(int column, Calendar cal) return agent_.crossConverters_. getTimestampFromString(getVARCHAR(column), cal); default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "java.sql.Timestamp", column ); } } final String getString(int column) throws SqlException { try { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 String tempString; switch (jdbcTypes_[column - 1]) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.BOOLEAN: if ( get_BOOLEAN( column ) ) { return Boolean.TRUE.toString(); } else { return Boolean.FALSE.toString(); } @@ -1021,6 +1077,7 @@ final String getString(int column) throws SqlException { tempString = c.getSubString(1, (int) c.length()); return tempString; default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "String", column ); } } catch ( SQLException se ) { @@ -1031,6 +1088,7 @@ final String getString(int column) throws SqlException { final byte[] getBytes(int column) throws SqlException { try { switch (jdbcTypes_[column - 1]) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.BINARY: return get_CHAR_FOR_BIT_DATA(column); case Types.VARBINARY: @@ -1041,6 +1099,7 @@ final byte[] getBytes(int column) throws SqlException { byte[] bytes = b.getBytes(1, (int) b.length()); return bytes; default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "byte[]", column ); } } catch ( SQLException se ) { @@ -1048,9 +1107,11 @@ final byte[] getBytes(int column) throws SqlException { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final InputStream getBinaryStream(int column) throws SqlException { switch (jdbcTypes_[column - 1]) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.BINARY: return new ByteArrayInputStream(get_CHAR_FOR_BIT_DATA(column)); case Types.VARBINARY: @@ -1071,9 +1132,11 @@ final InputStream getBinaryStream(int column) throws SqlException } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final InputStream getAsciiStream(int column) throws SqlException { switch (jdbcTypes_[column - 1]) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.CLOB: ClientClob c = getClobColumn_(column, agent_, false); if (c.isLocator()) { @@ -1084,6 +1147,7 @@ final InputStream getAsciiStream(int column) throws SqlException return c.getAsciiStreamX(); } case Types.CHAR: +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 return new ByteArrayInputStream( getCHAR(column).getBytes(ISO_8859_1)); case Types.VARCHAR: @@ -1099,14 +1163,18 @@ final InputStream getAsciiStream(int column) throws SqlException case Types.BLOB: return getBinaryStream(column); default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "java.io.InputStream", column ); } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final Reader getCharacterStream(int column) throws SqlException { switch (jdbcTypes_[column - 1]) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.CLOB: ClientClob c = getClobColumn_(column, agent_, false); if (c.isLocator()) { @@ -1116,12 +1184,14 @@ final Reader getCharacterStream(int column) } else { return c.getCharacterStreamX(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.CHAR: return new StringReader(getCHAR(column)); case Types.VARCHAR: case Types.LONGVARCHAR: return new StringReader(getVARCHAR(column)); case Types.BINARY: +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 return new InputStreamReader( new ByteArrayInputStream( get_CHAR_FOR_BIT_DATA(column)), UTF_16BE); @@ -1133,15 +1203,18 @@ final Reader getCharacterStream(int column) case Types.BLOB: return new InputStreamReader(getBinaryStream(column), UTF_16BE); default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "java.io.Reader", column ); } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final Blob getBlob(int column) throws SqlException { switch (jdbcTypes_[column - 1]) { case ClientTypes.BLOB: return getBlobColumn_(column, agent_, true); default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "java.sql.Blob", column ); } } @@ -1151,10 +1224,12 @@ final Clob getClob(int column) throws SqlException { case ClientTypes.CLOB: return getClobColumn_(column, agent_, true); default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "java.sql.Clob", column ); } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final Array getArray(int column) throws SqlException { throw new SqlException(agent_.logWriter_, new ClientMessageId (SQLState.NOT_IMPLEMENTED), @@ -1168,7 +1243,9 @@ final Ref getRef(int column) throws SqlException { final Object getObject(int column) throws SqlException { switch (jdbcTypes_[column - 1]) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.BOOLEAN: +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 return get_BOOLEAN(column); case Types.SMALLINT: // See Table 4 in JDBC 1 spec (pg. 932 in jdbc book) @@ -1202,10 +1279,14 @@ final Object getObject(int column) throws SqlException { case Types.JAVA_OBJECT: return get_UDT( column ); case Types.BLOB: +//IC see: https://issues.apache.org/jira/browse/DERBY-2892 +//IC see: https://issues.apache.org/jira/browse/DERBY-2892 return getBlobColumn_(column, agent_, true); case Types.CLOB: +//IC see: https://issues.apache.org/jira/browse/DERBY-2892 return getClobColumn_(column, agent_, true); default: +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 throw coercionError( "Object", column ); } } @@ -1215,6 +1296,7 @@ public final void allocateCharBuffer() { int maxCharLength = 0; for (int i = 0; i < columns_; i++) { switch (jdbcTypes_[i]) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientTypes.CHAR: case ClientTypes.VARCHAR: case ClientTypes.LONGVARCHAR: @@ -1242,9 +1324,11 @@ private String getStringWithoutConvert(int position, int actualLength) { } private ColumnTypeConversionException coercionError +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 ( String targetType, int sourceColumn ) { return new ColumnTypeConversionException +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 (agent_.logWriter_, targetType, ClientTypes.getTypeString(jdbcTypes_[sourceColumn -1])); @@ -1260,6 +1344,7 @@ public void nullDataForGC() { columnDataIsNullCache_ = null; jdbcTypes_ = null; nullable_ = null; +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 charset_ = null; this.ccsid_ = null; isUpdateDeleteHoleCache_ = null; diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/DateTime.java b/java/org.apache.derby.client/org/apache/derby/client/am/DateTime.java index ae28c40564..ce7f5de9e0 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/DateTime.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/DateTime.java @@ -69,8 +69,10 @@ private DateTime() { */ static final Date dateBytesToDate(byte[] buffer, int offset, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Calendar recyclableCal, Charset encoding) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 int year, month, day; @@ -83,7 +85,9 @@ static final Date dateBytesToDate(byte[] buffer, monthIndx = 5; dayIndx = 8; } else { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throw new IllegalArgumentException( +//IC see: https://issues.apache.org/jira/browse/DERBY-847 SqlException.getMessageUtil().getTextMessage( SQLState.LANG_FORMAT_EXCEPTION)); } @@ -160,6 +164,7 @@ static final Time timeBytesToTime(byte[] buffer, * @return TimeStamp translated from buffer with specified encoding */ static final Timestamp timestampBytesToTimestamp( +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 byte[] buffer, int offset, Calendar recyclableCal, Charset encoding, boolean supportsTimestampNanoseconds) { @@ -173,6 +178,7 @@ static final Timestamp timestampBytesToTimestamp( * the parsed nanoseconds value and use that to set nanos. */ int nanos = parseTimestampString(timestamp, cal, supportsTimestampNanoseconds); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Timestamp ts = new Timestamp(cal.getTimeInMillis()); ts.setNanos( nanos ); return ts; @@ -263,11 +269,13 @@ private static int parseTimestampString(String timestamp, public static final int dateToDateBytes(byte[] buffer, int offset, DateTimeValue date) +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 throws SqlException { int year = date.getYear(); if (year > 9999) { throw new SqlException(null, new ClientMessageId(SQLState.YEAR_EXCEEDS_MAXIMUM), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 year, "9999"); } int month = date.getMonth() + 1; @@ -348,11 +356,13 @@ public static final int timestampToTimestampBytes(byte[] buffer, int offset, DateTimeValue timestamp, boolean supportsTimestampNanoseconds) +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 throws SqlException { int year = timestamp.getYear(); if (year > 9999) { throw new SqlException(null, new ClientMessageId(SQLState.YEAR_EXCEEDS_MAXIMUM), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 year, "9999"); } int month = timestamp.getMonth() + 1; @@ -430,6 +440,7 @@ public static final int timestampToTimestampBytes(byte[] buffer, static final Timestamp dateBytesToTimestamp(byte[] buffer, int offset, Calendar recyclableCal, +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 Charset encoding) { int year, month, day; @@ -461,6 +472,7 @@ static final Timestamp dateBytesToTimestamp(byte[] buffer, Calendar cal = getCleanCalendar(recyclableCal); cal.set(year, month, day, 0, 0, 0); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Timestamp ts = new Timestamp(cal.getTimeInMillis()); ts.setNanos(0); return ts; @@ -480,6 +492,8 @@ static final Timestamp dateBytesToTimestamp(byte[] buffer, */ static final Timestamp timeBytesToTimestamp(byte[] buffer, int offset, +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 Calendar recyclableCal, Charset encoding) { @@ -515,6 +529,7 @@ static final Timestamp timeBytesToTimestamp(byte[] buffer, // Derby's resolution for the TIME type is only seconds. cal.set(Calendar.MILLISECOND, 0); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return new Timestamp(cal.getTimeInMillis()); } @@ -530,6 +545,7 @@ static final Timestamp timeBytesToTimestamp(byte[] buffer, */ static final Date timestampBytesToDate(byte[] buffer, int offset, +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 Calendar recyclableCal, Charset encoding) { @@ -555,6 +571,8 @@ static final Date timestampBytesToDate(byte[] buffer, Calendar cal = getCleanCalendar(recyclableCal); cal.set(year, month, day); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return new Date(cal.getTimeInMillis()); } @@ -570,6 +588,7 @@ static final Date timestampBytesToDate(byte[] buffer, */ static final Time timestampBytesToTime(byte[] buffer, int offset, +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 Calendar recyclableCal, Charset encoding) { @@ -603,6 +622,8 @@ static final Time timestampBytesToTime(byte[] buffer, * must be set to January 1, 1970. So override those values now. */ cal.set(1970, Calendar.JANUARY, 1); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return new Time(cal.getTimeInMillis()); } @@ -626,6 +647,7 @@ private static Calendar getCleanCalendar(Calendar recyclableCal) * Make sure we clear that out before returning, per the * contract of this method. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Calendar result = new GregorianCalendar(); result.clear(); return result; @@ -651,6 +673,7 @@ private static Calendar getCleanCalendar(Calendar recyclableCal) public static int getTimestampLength( boolean supportsTimestampNanoseconds ) { return supportsTimestampNanoseconds ? +//IC see: https://issues.apache.org/jira/browse/DERBY-4614 DRDAConstants.JDBC_TIMESTAMP_LENGTH : DRDAConstants.DRDA_OLD_TIMESTAMP_LENGTH; } diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/DateTimeValue.java b/java/org.apache.derby.client/org/apache/derby/client/am/DateTimeValue.java index 8e19ec31e2..a733932a87 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/DateTimeValue.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/DateTimeValue.java @@ -72,6 +72,7 @@ private DateTimeValue(Calendar cal, int nanoFraction) { * Create an instance from a {@code java.sql.Timestamp} using the specified * {@code java.util.Calendar}. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 DateTimeValue(Date date, Calendar cal) { this(initCalendar(cal, date), 0); } @@ -80,6 +81,7 @@ private DateTimeValue(Calendar cal, int nanoFraction) { * Create an instance from a {@code java.sql.Time} using the specified * {@code java.util.Calendar}. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 DateTimeValue(Time time, Calendar cal) { this(initCalendar(cal, time), 0); } @@ -88,6 +90,7 @@ private DateTimeValue(Calendar cal, int nanoFraction) { * Create an instance from a {@code java.sql.Timestamp} using the specified * {@code java.util.Calendar}. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 DateTimeValue(Timestamp ts, Calendar cal) { this(initCalendar(cal, ts), ts.getNanos()); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/Decimal.java b/java/org.apache.derby.client/org/apache/derby/client/am/Decimal.java index 93b018edd6..a53c7db6ea 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/Decimal.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/Decimal.java @@ -163,6 +163,7 @@ static BigDecimal getBigDecimal( signum = 1; } +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 if (precision <= 18) { // can be handled by long without overflow. long value = packedNybblesToLong(buffer, offset, 0, length * 2 - 1); @@ -229,6 +230,8 @@ static BigDecimal getBigDecimal( magnitude[14] = (byte) (value[3] >>> 8); magnitude[15] = (byte) (value[3]); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return new BigDecimal(new BigInteger(signum, magnitude), scale); } else { // throw an exception here if nibbles is greater than 31 @@ -315,6 +318,7 @@ static long getLong( if (precision > 31) { // throw an exception here if nibbles is greater than 31 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throw new IllegalArgumentException( msgutil.getTextMessage(SQLState.DECIMAL_TOO_MANY_DIGITS)); } @@ -330,6 +334,7 @@ static long getLong( signum = 1; } +//IC see: https://issues.apache.org/jira/browse/DERBY-5536 if (precision - scale <= 18) { // Can be handled by long without overflow. // Compute the integer part only. @@ -362,6 +367,7 @@ static long getLong( */ public static final int bigDecimalToPackedDecimalBytes(byte[] buffer, int offset, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 BigDecimal b, int declaredPrecision, int declaredScale) @@ -381,6 +387,7 @@ public static final int bigDecimalToPackedDecimalBytes(byte[] buffer, if (bigPrecision > 31) { throw new SqlException(null, new ClientMessageId(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 new SqlCode(-405), "packed decimal"); } @@ -392,6 +399,7 @@ public static final int bigDecimalToPackedDecimalBytes(byte[] buffer, if (bigWholeIntegerLength > declaredWholeIntegerLength) { throw new SqlException(null, new ClientMessageId(SQLState.NUMERIC_OVERFLOW), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 new SqlCode(-413), b.toString(), "packed decimal"); } } diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/DisconnectException.java b/java/org.apache.derby.client/org/apache/derby/client/am/DisconnectException.java index be85b17c81..8f9b7fb12a 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/DisconnectException.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/DisconnectException.java @@ -36,6 +36,7 @@ private DisconnectException(Agent agent, ClientMessageId msgid, } public DisconnectException(Agent agent, ClientMessageId msgid, +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 Throwable t, Object... args) { this(agent, msgid, args, SqlCode.disconnectError, (Throwable)t); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/EncryptionManager.java b/java/org.apache.derby.client/org/apache/derby/client/am/EncryptionManager.java index 54cec9a1f1..fffadf5ae0 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/EncryptionManager.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/EncryptionManager.java @@ -652,6 +652,7 @@ public byte[] substitutePassword( }; /** +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Convert a byte array to a String with a hexadecimal format. The String may be converted back to a byte array using fromHexString.
@@ -670,6 +671,7 @@ the second character represents the low nibble ({@code b & 0x0f}). */ private String toHexString(byte[] data, int offset, int length) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 StringBuilder s = new StringBuilder(length*2); int end = offset+length; @@ -689,6 +691,7 @@ private String toHexString(byte[] data, int offset, int length) Convert a string into a byte array in hex format.
For each character (b) two bytes are generated, the first byte +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 represents the high nibble (4 bits) in hexadecimal ({@code b & 0xf0}), the second byte represents the low nibble ({@code b & 0x0f}).
diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ExceptionFormatter.java b/java/org.apache.derby.client/org/apache/derby/client/am/ExceptionFormatter.java index dcd3247edd..f99ef77ff0 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/ExceptionFormatter.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/ExceptionFormatter.java @@ -27,6 +27,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import java.sql.SQLWarning; import javax.transaction.xa.XAException; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class ExceptionFormatter { // returnTokensOnly is true only when exception tracing is enabled so // that we don't try to go to the server for a message while we're in @@ -35,6 +36,7 @@ class ExceptionFormatter { // when TRACE_DIAGNOSTICS is on because tracing occurs within the exception constructor. static void printTrace(SqlException e, PrintWriter printWriter, +//IC see: https://issues.apache.org/jira/browse/DERBY-852 String messageHeader, boolean returnTokensOnly) { String header; @@ -43,10 +45,12 @@ static void printTrace(SqlException e, header = messageHeader + "[" + "SQLException@" + Integer.toHexString(e.hashCode()) + "]"; printWriter.println(header + " java.sql.SQLException"); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Throwable throwable = e.getCause(); if (throwable != null) { printTrace(throwable, printWriter, header); } +//IC see: https://issues.apache.org/jira/browse/DERBY-5076 Sqlca sqlca = e.getSqlca(); if (sqlca != null) { printTrace(sqlca, printWriter, header); @@ -69,6 +73,7 @@ static void printTrace(SqlException e, if (!sqlca.messageTextRetrievedContainsTokensOnly_) { // got the message text. printWriter.println(header + " Message = " + message); } else { // got only message tokens. +//IC see: https://issues.apache.org/jira/browse/DERBY-1061 SqlException mysteryException = sqlca.exceptionThrownOnStoredProcInvocation_; if (mysteryException != null && (mysteryException.getErrorCode() == -440 || mysteryException.getErrorCode() == -444)) { @@ -88,6 +93,7 @@ static void printTrace(SqlException e, printWriter.println(header + " Stack trace follows"); e.printStackTrace(printWriter); +//IC see: https://issues.apache.org/jira/browse/DERBY-5076 sqlca = e.getSqlca(); if (sqlca != null) { // JDK stack trace calls e.getMessage(), now that it is finished, @@ -103,6 +109,8 @@ static void printTrace(SqlException e, } static void printTrace(SQLException e, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 PrintWriter printWriter, String messageHeader, boolean returnTokensOnly) { @@ -126,7 +134,9 @@ static void printTrace(SQLException e, printWriter.println(header + " SQL state = " + e.getSQLState()); printWriter.println(header + " Error code = " + String.valueOf(e.getErrorCode())); printWriter.println(header + " Message = " + e.getMessage()); +//IC see: https://issues.apache.org/jira/browse/DERBY-852 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (e instanceof DataTruncation) { printWriter.println(header + " Index = " + ((DataTruncation) e).getIndex()); @@ -158,12 +168,14 @@ static void printTrace(SQLException e, } private static void printTrace(Sqlca sqlca, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 PrintWriter printWriter, String messageHeader) { String header = messageHeader + "[" + "Sqlca@" + Integer.toHexString(sqlca.hashCode()) + "]"; synchronized (printWriter) { printWriter.println(header + " DERBY SQLCA from server"); printWriter.println(header + " SqlCode = " + sqlca.getSqlCode()); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 printWriter.println(header + " SqlErrd = " + sqlca.formatSqlErrd()); printWriter.println(header + " SqlErrmc = " + sqlca.getSqlErrmc()); printWriter.println(header + " SqlErrp = " + sqlca.getSqlErrp()); diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/FailedProperties40.java b/java/org.apache.derby.client/org/apache/derby/client/am/FailedProperties40.java index a1729599bc..2c947daa7e 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/FailedProperties40.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/FailedProperties40.java @@ -40,6 +40,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more public class FailedProperties40 { private final HashMap failedProps_ = new HashMap(); +//IC see: https://issues.apache.org/jira/browse/DERBY-1380 +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 private final String firstKey_; private final String firstValue_; @@ -52,6 +54,7 @@ public class FailedProperties40 { * @return the created Properties object */ public static Properties makeProperties(String name, String value) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 Properties p = new Properties(); if (name != null || value != null) p.setProperty(name, value); @@ -76,6 +79,7 @@ public FailedProperties40(Properties props) { Enumeration e = props.keys(); firstKey_ = (String)e.nextElement(); firstValue_ = props.getProperty(firstKey_); +//IC see: https://issues.apache.org/jira/browse/DERBY-1380 failedProps_.put(firstKey_, ClientInfoStatus.REASON_UNKNOWN_PROPERTY); while (e.hasMoreElements()) { failedProps_.put((String)e.nextElement(), diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/LOBStateTracker.java b/java/org.apache.derby.client/org/apache/derby/client/am/LOBStateTracker.java index d8d7730085..4c4220a58d 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/LOBStateTracker.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/LOBStateTracker.java @@ -84,6 +84,7 @@ class LOBStateTracker { * @param doRelease whether locators shall be released * @see #NO_OP_TRACKER */ +//IC see: https://issues.apache.org/jira/browse/DERBY-3601 LOBStateTracker(int[] lobIndexes, boolean[] isBlob, boolean doRelease) { this.columns = lobIndexes; this.isBlob = isBlob; @@ -106,6 +107,7 @@ void checkCurrentRow(Cursor cursor) throws SqlException { // If we are on a delete hole, there are no locators to release, and // trying to release them will cause an error. See DERBY-6228. +//IC see: https://issues.apache.org/jira/browse/DERBY-6228 if (this.doRelease && !cursor.getIsUpdateDeleteHole()) { CallableLocatorProcedures procs = cursor.getLocatorProcedures(); for (int i=0; i < this.columns.length; i++) { @@ -117,6 +119,7 @@ void checkCurrentRow(Cursor cursor) if (locator == this.lastLocatorSeen[i]) { // We are being called on the same row twice... return; +//IC see: https://issues.apache.org/jira/browse/DERBY-3658 } else if (locator == Lob.INVALID_LOCATOR) { // The locator is invalid, probably because the // database is running in soft upgrade mode and @@ -133,6 +136,8 @@ void checkCurrentRow(Cursor cursor) } } // Reset state for the next row. +//IC see: https://issues.apache.org/jira/browse/DERBY-3601 +//IC see: https://issues.apache.org/jira/browse/DERBY-3601 Arrays.fill(this.published, false); } } @@ -145,11 +150,13 @@ void checkCurrentRow(Cursor cursor) * to release them from the client side in this case. */ void discardState() { +//IC see: https://issues.apache.org/jira/browse/DERBY-3601 if (this.doRelease) { // Force the state to published for all LOB columns. // This will cause checkCurrentRow to ignore all LOBs on the next // invocation. The method markAsPublished cannot be called before // after checkCurrentRow has been called again. +//IC see: https://issues.apache.org/jira/browse/DERBY-3601 Arrays.fill(this.published, true); } } @@ -164,6 +171,7 @@ void discardState() { * @param index 1-based column index */ void markAsPublished(int index) { +//IC see: https://issues.apache.org/jira/browse/DERBY-3601 if (this.doRelease) { int internalIndex = Arrays.binarySearch(this.columns, index); this.published[internalIndex] = true; diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/Lob.java b/java/org.apache.derby.client/org/apache/derby/client/am/Lob.java index 5a8fbe7213..f79e6a84ab 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/Lob.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/Lob.java @@ -78,6 +78,7 @@ public abstract class Lob implements UnitOfWorkListener { private int transactionID_; //-----------------------------messageId------------------------------------------ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final static private ClientMessageId LOB_OBJECT_LENGTH_UNKNOWN_YET = new ClientMessageId( SQLState.LOB_OBJECT_LENGTH_UNKNOWN_YET ); @@ -108,9 +109,11 @@ long sqlLength() throws SqlException { if (lengthObtained_) return sqlLength_; +//IC see: https://issues.apache.org/jira/browse/DERBY-2496 if (isLocator()) { sqlLength_ = getLocatorLength(); lengthObtained_ = true; +//IC see: https://issues.apache.org/jira/browse/DERBY-2496 } else if (willBeLayerBStreamed()) { throw new SqlException(agent_.logWriter_, LOB_OBJECT_LENGTH_UNKNOWN_YET); @@ -142,6 +145,7 @@ void setSqlLength(long length) * * @return length of Lob */ +//IC see: https://issues.apache.org/jira/browse/DERBY-2496 long getLocatorLength() throws SqlException { return -1; @@ -151,6 +155,9 @@ long getLocatorLength() throws SqlException //-----------------------event callback methods------------------------------- public void listenToUnitOfWork() { +//IC see: https://issues.apache.org/jira/browse/DERBY-210 +//IC see: https://issues.apache.org/jira/browse/DERBY-557 +//IC see: https://issues.apache.org/jira/browse/DERBY-210 agent_.connection_.CommitAndRollbackListeners_.put(this,null); } @@ -201,8 +208,10 @@ void checkForClosedConnection() throws SqlException { * while reading from the stream */ protected InputStream materializeStream(InputStream is, String typeDesc) +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 throws SqlException { final int GROWBY = 32 * 1024; // 32 KB +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 ArrayList byteArrays = new ArrayList(); byte[] curBytes = new byte[GROWBY]; int totalLength = 0; @@ -221,6 +230,7 @@ protected InputStream materializeStream(InputStream is, String typeDesc) curBytes = new byte[GROWBY]; } } +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 if (partLength > 0) { totalLength += partLength; } @@ -235,6 +245,7 @@ protected InputStream materializeStream(InputStream is, String typeDesc) typeDesc ); } +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 if (partLength > 0) { byteArrays.add(curBytes); } @@ -250,6 +261,8 @@ protected InputStream materializeStream(InputStream is, String typeDesc) throw new SqlException(null, new ClientMessageId( SQLState.LANG_STREAMING_COLUMN_I_O_EXCEPTION), +//IC see: https://issues.apache.org/jira/browse/DERBY-3913 +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 ioe, typeDesc ); @@ -282,6 +295,7 @@ public boolean willBeLayerBStreamed() { * @return true if Lob is based on locator, false otherwise */ public boolean isLocator() { +//IC see: https://issues.apache.org/jira/browse/DERBY-2496 return ((dataType_ & LOCATOR) == LOCATOR); } @@ -311,6 +325,7 @@ protected void checkPosAndLength(long pos, long length) if (pos <= 0) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.BLOB_BAD_POSITION), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 pos).getSQLException(); } if (length < 0) { @@ -318,6 +333,7 @@ protected void checkPosAndLength(long pos, long length) new ClientMessageId(SQLState.BLOB_NONPOSITIVE_LENGTH), length).getSQLException(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-4060 if (length > (this.length() - (pos -1))) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.POS_AND_LENGTH_GREATER_THAN_LOB), @@ -344,6 +360,7 @@ protected void checkPosAndLength(long pos, long length) * depend on updateCount for invalidation */ protected synchronized void incrementUpdateCount() { +//IC see: https://issues.apache.org/jira/browse/DERBY-2763 updateCount++; } @@ -387,7 +404,10 @@ protected void checkValidity() throws SQLException{ throw se.getSQLException(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-4312 +//IC see: https://issues.apache.org/jira/browse/DERBY-4224 if(!isValid_ || (isLocator() && +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 (transactionID_ != agent_.connection_.getTransactionID()))) throw new SqlException(null,new ClientMessageId(SQLState.LOB_OBJECT_INVALID)) .getSQLException(); diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/LogWriter.java b/java/org.apache.derby.client/org/apache/derby/client/am/LogWriter.java index 0034e3b174..4e2f5fcd1d 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/LogWriter.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/LogWriter.java @@ -47,6 +47,7 @@ public LogWriter(PrintWriter printWriter, int traceLevel) { } final protected boolean loggingEnabled(int traceLevel) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (SanityManager.DEBUG) { if (printWriter_ == null) { SanityManager.THROWASSERT( @@ -144,7 +145,9 @@ private String getClassNameOfInstanceIfTraced(Object instance) { if (instance == null) // this prevents NPE from instance.getClass() used below { return null; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } else if (instance instanceof ClientConnection && loggingEnabled( +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 BasicClientDataSource.TRACE_CONNECTION_CALLS)) { return "ClientConnection"; } else if (instance instanceof ClientResultSet && loggingEnabled( @@ -221,6 +224,7 @@ public void traceExit(Object instance, String methodName, Object returnValue) { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void traceDeprecatedExit(Object instance, String methodName, Object returnValue) { @@ -235,6 +239,7 @@ void traceDeprecatedExit(Object instance, } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void traceExit( Object instance, String methodName, @@ -244,6 +249,7 @@ void traceExit( traceExit(instance, methodName, returnValue); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void traceExit( Object instance, String methodName, @@ -266,6 +272,7 @@ void traceExit( Object instance, String methodName, ClientDatabaseMetaData returnValue) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 traceExit(instance, methodName, "DatabaseMetaData@" + Integer.toHexString(returnValue.hashCode())); } @@ -297,6 +304,7 @@ void traceExit(Object instance, String methodName, byte returnValue) { // --------------------------- method entry tracing -------------------------- public void traceEntry(Object instance, String methodName, Object... args) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 traceEntryAllArgs(instance, methodName, false, args); } @@ -341,6 +349,7 @@ private static String toPrintableString(Object o) { // ---------------------------tracing exceptions and warnings----------------- +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void traceDiagnosable(SqlException e) { if (!loggingEnabled(BasicClientDataSource.TRACE_DIAGNOSTICS)) { return; @@ -362,7 +371,11 @@ public void traceDiagnosable(SQLException e) { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void traceDiagnosable(XAException e) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 if (!loggingEnabled(BasicClientDataSource.TRACE_DIAGNOSTICS)) { return; } @@ -379,6 +392,7 @@ void traceParameterMetaData( ColumnMetaData columnMetaData) { if (!loggingEnabled( +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 BasicClientDataSource.TRACE_PARAMETER_META_DATA) || columnMetaData == null) { return; @@ -391,6 +405,7 @@ void traceParameterMetaData( dncprintln(header, "Number of parameter columns: " + columnMetaData.getColumnCount()); traceColumnMetaData(header, columnMetaData); dncprintln(header, "END TRACE_PARAMETER_META_DATA"); +//IC see: https://issues.apache.org/jira/browse/DERBY-852 } catch (SQLException e) { dncprintln(header, "Encountered an SQL exception while trying to trace parameter meta data"); dncprintln(header, "END TRACE_PARAMETER_META_DATA"); @@ -399,10 +414,13 @@ void traceParameterMetaData( } void traceResultSetMetaData( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientStatement statement, ColumnMetaData columnMetaData) { if (!loggingEnabled( +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 BasicClientDataSource.TRACE_RESULT_SET_META_DATA) || columnMetaData == null) { return; @@ -415,6 +433,7 @@ void traceResultSetMetaData( dncprintln(header, "Number of result set columns: " + columnMetaData.getColumnCount()); traceColumnMetaData(header, columnMetaData); dncprintln(header, "END TRACE_RESULT_SET_META_DATA"); +//IC see: https://issues.apache.org/jira/browse/DERBY-852 } catch (SQLException e) { dncprintln(header, "Encountered an SQL exception while trying to trace result set meta data"); dncprintln(header, "END TRACE_RESULT_SET_META_DATA"); @@ -473,6 +492,7 @@ private void traceColumnMetaData(String header, ColumnMetaData columnMetaData) { printWriter_.println(" }"); printWriter_.flush(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-852 } catch (SQLException e) { dncprintln(header, "Encountered an SQL exception while trying to trace column meta data"); } @@ -482,6 +502,7 @@ private void traceColumnMetaData(String header, ColumnMetaData columnMetaData) { // Including protocol manager levels, and driver configuration // Jdbc 2 +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 void traceConnectEntry(BasicClientDataSource dataSource) { if (loggingEnabled( BasicClientDataSource.TRACE_DRIVER_CONFIGURATION)) { @@ -493,11 +514,14 @@ void traceConnectEntry(BasicClientDataSource dataSource) { } // Jdbc 1 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void traceConnectEntry(String server, int port, String database, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Properties properties) { if (loggingEnabled( +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 BasicClientDataSource.TRACE_DRIVER_CONFIGURATION)) { traceDriverConfigurationJdbc1(); } @@ -506,6 +530,7 @@ void traceConnectEntry(String server, } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void traceConnectResetEntry( Object instance, LogWriter logWriter, String user, BasicClientDataSource ds) { @@ -516,6 +541,7 @@ void traceConnectResetEntry( } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void traceConnectExit(ClientConnection connection) { if (loggingEnabled(BasicClientDataSource.TRACE_CONNECTS)) { traceConnectsExit(connection); @@ -536,6 +562,7 @@ private void traceConnectsResetEntry(BasicClientDataSource dataSource) { traceConnectsResetEntry(dataSource.getServerName(), dataSource.getPortNumber(), dataSource.getDatabaseName(), +//IC see: https://issues.apache.org/jira/browse/DERBY-446 getProperties(dataSource)); } catch ( SqlException se ) { dncprintln("Encountered an SQL exception while trying to trace connection reset entry"); @@ -547,6 +574,7 @@ private void traceConnectsEntry(BasicClientDataSource dataSource) { traceConnectsEntry(dataSource.getServerName(), dataSource.getPortNumber(), dataSource.getDatabaseName(), +//IC see: https://issues.apache.org/jira/browse/DERBY-446 getProperties(dataSource)); } catch ( SqlException se ) { dncprintln("Encountered an SQL exception while trying to trace connection entry"); @@ -557,6 +585,7 @@ private void traceConnectsEntry(BasicClientDataSource dataSource) { private void traceConnectsResetEntry(String server, int port, String database, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Properties properties) { dncprintln("BEGIN TRACE_CONNECT_RESET"); dncprintln("Connection reset requested for " + server + ":" + port + "/" + database); @@ -568,6 +597,7 @@ private void traceConnectsResetEntry(String server, private void traceConnectsEntry(String server, int port, String database, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Properties properties) { synchronized (printWriter_) { dncprintln("BEGIN TRACE_CONNECTS"); @@ -591,6 +621,7 @@ public void traceConnectsExit(ClientConnection c) { dncprintln(header, "Driver name: " + c.databaseMetaData_.getDriverName()); dncprintln(header, "Driver version: " + c.databaseMetaData_.getDriverVersion()); dncprintln(header, "END TRACE_CONNECTS"); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (SQLException e) { dncprintln(header, "Encountered an SQL exception while trying to trace connection exit"); dncprintln(header, "END TRACE_CONNECTS"); @@ -610,6 +641,7 @@ public void traceConnectsResetExit(ClientConnection c) { dncprintln(header, "Driver name: " + c.databaseMetaData_.getDriverName()); dncprintln(header, "Driver version: " + c.databaseMetaData_.getDriverVersion()); dncprintln(header, "END TRACE_CONNECT_RESET"); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (SQLException e) { dncprintln(header, "Encountered an SQL exception while trying to trace connection reset exit"); dncprintln(header, "END TRACE_CONNECT_RESET"); @@ -623,6 +655,7 @@ public void traceConnectsResetExit(ClientConnection c) { // printWriter_ synchronized by caller. private void writeProperties(Properties properties) { printWriter_.print("{ "); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 for (Iterator i = properties.entrySet().iterator(); i.hasNext();) { Map.Entry e = (Map.Entry) (i.next()); if ("password".equals(e.getKey())) { @@ -639,6 +672,7 @@ private void writeProperties(Properties properties) { } private String escapePassword(String pw) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 StringBuilder sb = new StringBuilder(pw); for (int j = 0; j < pw.length(); j++) { sb.setCharAt(j, '*'); @@ -666,6 +700,7 @@ private void traceDriverConfigurationJdbc1() { } private void writeDriverConfiguration() { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Version.writeDriverConfiguration(printWriter_); } @@ -676,6 +711,7 @@ private Properties getProperties(BasicClientDataSource cds) throws SqlException { Properties properties = BasicClientDataSource.getProperties(cds); +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 if (properties.getProperty(Attribute.PASSWORD_ATTR) != null) { properties.setProperty(Attribute.PASSWORD_ATTR, "********"); diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/LogicalCallableStatement.java b/java/org.apache.derby.client/org/apache/derby/client/am/LogicalCallableStatement.java index 7750418120..2c8f028530 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/LogicalCallableStatement.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/LogicalCallableStatement.java @@ -56,6 +56,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more public class LogicalCallableStatement extends LogicalPreparedStatement implements CallableStatement { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 /** * Creates a new logical callable statement. @@ -67,6 +68,8 @@ public class LogicalCallableStatement */ public LogicalCallableStatement(CallableStatement physicalCs, StatementKey stmtKey, +//IC see: https://issues.apache.org/jira/browse/DERBY-3328 +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 StatementCacheInteractor cacheInteractor) { super(physicalCs, stmtKey, cacheInteractor); } @@ -395,6 +398,7 @@ public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws //////////////////////////////////////////////////////////////////// public RowId getRowId(int arg0) +//IC see: https://issues.apache.org/jira/browse/DERBY-6213 throws SQLException { return getPhysCs().getRowId(arg0); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/LogicalCallableStatement42.java b/java/org.apache.derby.client/org/apache/derby/client/am/LogicalCallableStatement42.java index ad050515cb..b152a3ccaa 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/LogicalCallableStatement42.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/LogicalCallableStatement42.java @@ -56,6 +56,7 @@ public LogicalCallableStatement42(CallableStatement physicalCs, public void registerOutParameter( int parameterIndex, SQLType sqlType ) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ((ClientCallableStatement42)getPhysCs()). registerOutParameter( parameterIndex, sqlType ); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/LogicalConnection.java b/java/org.apache.derby.client/org/apache/derby/client/am/LogicalConnection.java index 693ab33298..af14b404d3 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/LogicalConnection.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/LogicalConnection.java @@ -61,6 +61,7 @@ public class LogicalConnection implements Connection { *

* Set to {@code null} when this logical connection is closed. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientConnection physicalConnection_; private ClientPooledConnection pooledConnection_ = null; /** @@ -72,11 +73,13 @@ public class LogicalConnection implements Connection { private LogicalDatabaseMetaData logicalDatabaseMetaData = null; public LogicalConnection( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientConnection physicalConnection, ClientPooledConnection pooledConnection) throws SqlException { physicalConnection_ = physicalConnection; pooledConnection_ = pooledConnection; +//IC see: https://issues.apache.org/jira/browse/DERBY-852 try { checkForNullPhysicalConnection(); } catch ( SQLException se ) { @@ -106,6 +109,7 @@ public void close() throws SQLException { // there is no deadlock when calling back into the pooledConnection_.recycleConnection // below, we first synchronize on the pooledConnection and then on this // LogicalConnection +//IC see: https://issues.apache.org/jira/browse/DERBY-5560 synchronized (pooledConnection_) { synchronized (this) { try { @@ -119,11 +123,14 @@ public void close() throws SQLException { if (physicalConnection_.isClosed()) // connection is closed or has become stale { +//IC see: https://issues.apache.org/jira/browse/DERBY-3328 +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 pooledConnection_.informListeners(new SqlException(null, new ClientMessageId( SQLState.PHYSICAL_CONNECTION_ALREADY_CLOSED))); } else { physicalConnection_.checkForTransactionInProgress(); +//IC see: https://issues.apache.org/jira/browse/DERBY-3441 physicalConnection_.closeForReuse( pooledConnection_.isStatementPoolingEnabled()); if (!physicalConnection_.isGlobalPending_()) { @@ -148,11 +155,14 @@ synchronized public void closeWithoutRecyclingToPool() throws SqlException { if (physicalConnection_.isClosed()) // connection is closed or has become stale { throw new SqlException(null, +//IC see: https://issues.apache.org/jira/browse/DERBY-3328 +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 new ClientMessageId(SQLState.NO_CURRENT_CONNECTION)); // no call to informListeners() } else { ; // no call to recycleConnection() } } finally { +//IC see: https://issues.apache.org/jira/browse/DERBY-3441 physicalConnection_.closeForReuse( pooledConnection_.isStatementPoolingEnabled()); //poolfix physicalConnection_ = null; @@ -178,6 +188,7 @@ public boolean isClosed() throws SQLException { * @throws SQLException if this logical connection has been closed */ protected final void checkForNullPhysicalConnection() +//IC see: https://issues.apache.org/jira/browse/DERBY-5561 throws SQLException { if (physicalConnection_ == null) { SqlException se = new SqlException(null, @@ -196,14 +207,18 @@ protected final void checkForNullPhysicalConnection() * * @param sqle the cause of the notification */ +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 final void notifyException(SQLException sqle) { if (physicalConnection_ != null) +//IC see: https://issues.apache.org/jira/browse/DERBY-3328 +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 pooledConnection_.informListeners(new SqlException(sqle)); } // ---------------------- wrapped public entry points ------------------------ // All methods are forwarded to the physical connection in a standard way +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized public Statement createStatement() throws SQLException { try { checkForNullPhysicalConnection(); @@ -214,6 +229,7 @@ synchronized public Statement createStatement() throws SQLException { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized public PreparedStatement prepareStatement(String sql) throws SQLException { try { @@ -225,8 +241,10 @@ synchronized public PreparedStatement prepareStatement(String sql) } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized public CallableStatement prepareCall(String sql) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 try { checkForNullPhysicalConnection(); return physicalConnection_.prepareCall(sql); @@ -236,6 +254,7 @@ synchronized public CallableStatement prepareCall(String sql) } } +//IC see: https://issues.apache.org/jira/browse/DERBY-5561 synchronized public String nativeSQL(String sql) throws SQLException { try { checkForNullPhysicalConnection(); @@ -256,6 +275,7 @@ synchronized public void setAutoCommit(boolean autoCommit) throws SQLException { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-5561 synchronized public boolean getAutoCommit() throws SQLException { try { checkForNullPhysicalConnection(); @@ -296,6 +316,7 @@ synchronized public void setTransactionIsolation(int level) throws SQLException } } +//IC see: https://issues.apache.org/jira/browse/DERBY-5561 synchronized public int getTransactionIsolation() throws SQLException { try { checkForNullPhysicalConnection(); @@ -306,6 +327,7 @@ synchronized public int getTransactionIsolation() throws SQLException { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized public SQLWarning getWarnings() throws SQLException { try { checkForNullPhysicalConnection(); @@ -342,7 +364,9 @@ synchronized public void clearWarnings() throws SQLException { * @throws SQLException if an error occurs */ public synchronized DatabaseMetaData getMetaData() +//IC see: https://issues.apache.org/jira/browse/DERBY-3431 throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 try { checkForNullPhysicalConnection(); // Create metadata object on demand, then cache it for later use. @@ -377,6 +401,7 @@ protected LogicalDatabaseMetaData newLogicalDatabaseMetaData() * @return The metadata object from the underlying physical connection. * @throws SQLException if the logical connection has been closed */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final synchronized DatabaseMetaData getRealMetaDataObject() throws SQLException { // Check if the logical connection has been closed. @@ -394,6 +419,7 @@ final synchronized DatabaseMetaData getRealMetaDataObject() } synchronized public void setReadOnly(boolean readOnly) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 try { checkForNullPhysicalConnection(); physicalConnection_.setReadOnly(readOnly); @@ -403,6 +429,7 @@ synchronized public void setReadOnly(boolean readOnly) throws SQLException { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-5561 synchronized public boolean isReadOnly() throws SQLException { try { checkForNullPhysicalConnection(); @@ -423,6 +450,7 @@ synchronized public void setCatalog(String catalog) throws SQLException { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-5561 synchronized public String getCatalog() throws SQLException { try { checkForNullPhysicalConnection(); @@ -433,6 +461,7 @@ synchronized public String getCatalog() throws SQLException { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { try { @@ -444,6 +473,7 @@ synchronized public Statement createStatement(int resultSetType, } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { @@ -456,6 +486,7 @@ synchronized public PreparedStatement prepareStatement(String sql, } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { @@ -468,6 +499,7 @@ synchronized public CallableStatement prepareCall(String sql, } } +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 synchronized public Map> getTypeMap() throws SQLException { try { checkForNullPhysicalConnection(); @@ -478,6 +510,7 @@ synchronized public Map> getTypeMap() throws SQLException { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 synchronized public void setTypeMap(Map map) throws SQLException { try { checkForNullPhysicalConnection(); @@ -488,6 +521,7 @@ synchronized public void setTypeMap(Map map) throws SQLException { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized public Statement createStatement( int resultSetType, int resultSetConcurrency, @@ -502,6 +536,7 @@ synchronized public Statement createStatement( } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized public CallableStatement prepareCall( String sql, int resultSetType, @@ -517,6 +552,7 @@ synchronized public CallableStatement prepareCall( } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized public PreparedStatement prepareStatement( String sql, int resultSetType, @@ -533,6 +569,7 @@ synchronized public PreparedStatement prepareStatement( } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized public PreparedStatement prepareStatement( String sql, int autoGeneratedKeys) throws SQLException { @@ -546,6 +583,7 @@ synchronized public PreparedStatement prepareStatement( } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized public PreparedStatement prepareStatement( String sql, int columnIndexes[]) throws SQLException { @@ -559,6 +597,7 @@ synchronized public PreparedStatement prepareStatement( } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized public PreparedStatement prepareStatement( String sql, String columnNames[]) throws SQLException { @@ -572,6 +611,7 @@ synchronized public PreparedStatement prepareStatement( } } +//IC see: https://issues.apache.org/jira/browse/DERBY-5561 synchronized public void setHoldability(int holdability) throws SQLException { try { checkForNullPhysicalConnection(); @@ -582,6 +622,7 @@ synchronized public void setHoldability(int holdability) throws SQLException { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-5561 synchronized public int getHoldability() throws SQLException { try { checkForNullPhysicalConnection(); @@ -592,6 +633,7 @@ synchronized public int getHoldability() throws SQLException { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized public Savepoint setSavepoint() throws SQLException { try { checkForNullPhysicalConnection(); @@ -602,6 +644,7 @@ synchronized public Savepoint setSavepoint() throws SQLException { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized public Savepoint setSavepoint(String name) throws SQLException { try { @@ -613,6 +656,7 @@ synchronized public Savepoint setSavepoint(String name) } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized public void rollback(Savepoint savepoint) throws SQLException { try { checkForNullPhysicalConnection(); @@ -623,6 +667,7 @@ synchronized public void rollback(Savepoint savepoint) throws SQLException { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized public void releaseSavepoint(Savepoint savepoint) throws SQLException { try { @@ -666,6 +711,7 @@ public int getServerVersion() { // //////////////////////////////////////////////////////////////////// public Array createArrayOf(String typeName, Object[] elements) +//IC see: https://issues.apache.org/jira/browse/DERBY-6213 throws SQLException { try { @@ -904,8 +950,11 @@ public T unwrap(Class interfaces) /** * Get the name of the current schema. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-5561 synchronized public String getSchema() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-4869 +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 try { checkForNullPhysicalConnection(); return physicalConnection_.getSchema(); @@ -918,6 +967,7 @@ synchronized public String getSchema() throws SQLException /** * Set the default schema for the Connection. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-5561 synchronized public void setSchema( String schemaName ) throws SQLException { try { @@ -931,6 +981,7 @@ synchronized public void setSchema( String schemaName ) throws SQLException public void abort( Executor executor ) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6213 try { if ( physicalConnection_ != null ) diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/LogicalDatabaseMetaData.java b/java/org.apache.derby.client/org/apache/derby/client/am/LogicalDatabaseMetaData.java index 17a2008068..74838d6e8d 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/LogicalDatabaseMetaData.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/LogicalDatabaseMetaData.java @@ -37,6 +37,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more * of the underlying physical connection. */ class LogicalDatabaseMetaData implements DatabaseMetaData { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 /** The associated logical connection. */ private final LogicalConnection logicalCon; @@ -54,6 +55,7 @@ class LogicalDatabaseMetaData implements DatabaseMetaData { * @param logWriter destination for log/error messages * @throws SQLException if obtaining the JDBC driver versions fail */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 LogicalDatabaseMetaData(LogicalConnection logicalCon, LogWriter logWriter) throws SQLException { @@ -76,6 +78,7 @@ class LogicalDatabaseMetaData implements DatabaseMetaData { * @throws SQLException if the logical connection has been closed, or * obtaining the metadata object fails */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final DatabaseMetaData getRealMetaDataObject() throws SQLException { return this.logicalCon.getRealMetaDataObject(); @@ -825,6 +828,7 @@ public boolean supportsStatementPooling() throws SQLException { // JDBC 4.0 methods public boolean autoCommitFailureClosesAllResultSets() +//IC see: https://issues.apache.org/jira/browse/DERBY-6213 throws SQLException { return getRealMetaDataObject().autoCommitFailureClosesAllResultSets(); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/LogicalPreparedStatement.java b/java/org.apache.derby.client/org/apache/derby/client/am/LogicalPreparedStatement.java index 68ac206949..c6e048a6a2 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/LogicalPreparedStatement.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/LogicalPreparedStatement.java @@ -61,6 +61,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more public class LogicalPreparedStatement extends LogicalStatementEntity implements PreparedStatement { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 /** * Creates a new logical prepared statement. @@ -72,6 +73,8 @@ public class LogicalPreparedStatement */ public LogicalPreparedStatement(PreparedStatement physicalPs, StatementKey stmtKey, +//IC see: https://issues.apache.org/jira/browse/DERBY-3328 +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 StatementCacheInteractor cacheInteractor) { super(physicalPs, stmtKey, cacheInteractor); } @@ -397,6 +400,7 @@ public ResultSet executeQuery(String sql) throws SQLException { //////////////////////////////////////////////////////////////// public void setRowId(int arg0, RowId arg1) +//IC see: https://issues.apache.org/jira/browse/DERBY-6213 throws SQLException { getPhysPs().setRowId(arg0, arg1); } @@ -515,6 +519,7 @@ public boolean isPoolable() public long executeLargeUpdate() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return ((ClientPreparedStatement) getPhysPs()).executeLargeUpdate(); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/LogicalPreparedStatement42.java b/java/org.apache.derby.client/org/apache/derby/client/am/LogicalPreparedStatement42.java index 3f790ccceb..d3c8040cb6 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/LogicalPreparedStatement42.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/LogicalPreparedStatement42.java @@ -40,6 +40,7 @@ public class LogicalPreparedStatement42 extends LogicalPreparedStatement * @throws IllegalArgumentException if {@code cache} is {@code null} */ public LogicalPreparedStatement42 ( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 PreparedStatement physicalPs, StatementKey stmtKey, StatementCacheInteractor cacheInteractor ) { diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/LogicalStatementEntity.java b/java/org.apache.derby.client/org/apache/derby/client/am/LogicalStatementEntity.java index f4496b18ff..72a3263aa3 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/LogicalStatementEntity.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/LogicalStatementEntity.java @@ -50,6 +50,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more //@ThreadSafe abstract class LogicalStatementEntity implements Statement { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 /** * Tells if we're holding a callable statement or not. @@ -91,6 +92,8 @@ abstract class LogicalStatementEntity */ protected LogicalStatementEntity(PreparedStatement physicalPs, StatementKey stmtKey, +//IC see: https://issues.apache.org/jira/browse/DERBY-3328 +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 StatementCacheInteractor cacheInteractor) { if (cacheInteractor.getCache() == null) { // Internal check, failure indicates programming error. @@ -100,8 +103,10 @@ protected LogicalStatementEntity(PreparedStatement physicalPs, } this.stmtKey = stmtKey; this.cache = cacheInteractor.getCache(); +//IC see: https://issues.apache.org/jira/browse/DERBY-3457 this.owner = cacheInteractor; this.physicalPs = physicalPs; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (physicalPs instanceof CallableStatement) { this.hasCallableStmt = true; this.physicalCs = (CallableStatement)physicalPs; @@ -118,6 +123,7 @@ protected LogicalStatementEntity(PreparedStatement physicalPs, * @return A prepared statement. * @throws SQLException if the logical statement has been closed */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized PreparedStatement getPhysPs() throws SQLException { if (physicalPs == null) { @@ -134,6 +140,7 @@ synchronized PreparedStatement getPhysPs() * @return A callable statement. * @throws SQLException if the logical statement has been closed */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized CallableStatement getPhysCs() throws SQLException { if (SanityManager.DEBUG) { @@ -155,6 +162,7 @@ synchronized CallableStatement getPhysCs() * @throws SQLException if the logical statement has been closed */ private synchronized Statement getPhysStmt() +//IC see: https://issues.apache.org/jira/browse/DERBY-4869 throws SQLException { if ( hasCallableStmt ) { return getPhysCs(); } @@ -168,12 +176,14 @@ private synchronized Statement getPhysStmt() */ public synchronized void close() throws SQLException { if (physicalPs != null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final ClientPreparedStatement temporaryPsRef = (ClientPreparedStatement)physicalPs; // Nullify both references. physicalPs = null; physicalCs = null; +//IC see: https://issues.apache.org/jira/browse/DERBY-3457 this.owner.markClosed(this); // Nullify the reference, since the entity object might stick around // for a while. @@ -182,6 +192,7 @@ public synchronized void close() throws SQLException { temporaryPsRef.setOwner(null); // NOTE: Accessing ps state directly below only to avoid tracing. // If the underlying statement has become closed, don't cache it. +//IC see: https://issues.apache.org/jira/browse/DERBY-4843 if (!temporaryPsRef.openOnClient_) { return; } @@ -193,6 +204,7 @@ public synchronized void close() throws SQLException { // Reset the statement for reuse. try { +//IC see: https://issues.apache.org/jira/browse/DERBY-3441 temporaryPsRef.resetForReuse(); } catch (SqlException sqle) { // Get a wrapper and throw it. @@ -234,6 +246,7 @@ synchronized boolean isLogicalEntityClosed() { * instance implements {@code iface} */ public boolean isWrapperFor(Class iface) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-5872 getPhysStmt(); // Just to check that the statement is not closed. return iface.isInstance(this); } @@ -248,6 +261,7 @@ public boolean isWrapperFor(Class iface) throws SQLException { * interface */ public T unwrap(Class iface) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (((ClientStatement) getPhysStmt()).isClosed()) { throw new SqlException(null, new ClientMessageId(SQLState.ALREADY_CLOSED), @@ -272,6 +286,7 @@ public T unwrap(Class iface) throws SQLException { public void closeOnCompletion() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ((ClientStatement) getPhysStmt()).closeOnCompletion(); } @@ -288,6 +303,7 @@ public boolean isCloseOnCompletion() throws SQLException public long[] executeLargeBatch() throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return ((ClientStatement) getPhysStmt()).executeLargeBatch(); } public long executeLargeUpdate( String sql ) throws SQLException diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/MaterialStatement.java b/java/org.apache.derby.client/org/apache/derby/client/am/MaterialStatement.java index 8c9a6675be..9c95b78226 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/MaterialStatement.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/MaterialStatement.java @@ -63,6 +63,7 @@ public abstract void writeExecuteCall_(boolean outputExpected, public abstract void writeSetSpecialRegister_( Section section, ArrayList sqlsttList) throws SqlException; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 public abstract void readSetSpecialRegister_() throws SqlException; diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ProductLevel.java b/java/org.apache.derby.client/org/apache/derby/client/am/ProductLevel.java index 401c714253..5a4004553d 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/ProductLevel.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/ProductLevel.java @@ -21,6 +21,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more package org.apache.derby.client.am; public class ProductLevel { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 String databaseProductName_; int versionLevel_; int releaseLevel_; diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/SQLExceptionFactory.java b/java/org.apache.derby.client/org/apache/derby/client/am/SQLExceptionFactory.java index 1bd0286e20..7e22568941 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/SQLExceptionFactory.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/SQLExceptionFactory.java @@ -82,6 +82,7 @@ else if ( sqlState.equals( SQLState.LANG_CHECK_CONSTRAINT_VIOLATED ) ) ex = new DerbySQLIntegrityConstraintViolationException(message, sqlState, errCode, args[1], args[0]); else +//IC see: https://issues.apache.org/jira/browse/DERBY-6803 ex = new DerbySQLIntegrityConstraintViolationException(message, sqlState, errCode, args[0], args[1]); } else if (sqlState.startsWith(SQLState.AUTHORIZATION_SPEC_PREFIX)) { diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/Section.java b/java/org.apache.derby.client/org/apache/derby/client/am/Section.java index 9bb7fe694e..3f6ede3e7a 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/Section.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/Section.java @@ -99,6 +99,7 @@ public void setPKGNAMCBytes(byte[] b) { * @return the package name and consistency token information */ public byte[] getPKGNAMCBytes() { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return PKGNAMCBytes != null ? PKGNAMCBytes.clone() : null; @@ -125,6 +126,7 @@ public String getServerCursorName() { // member for positioned update sections only String serverCursorNameForPositionedUpdate_ = null; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 public String getServerCursorNameForPositionedUpdate() { return serverCursorNameForPositionedUpdate_; @@ -144,6 +146,7 @@ public void setClientCursorName(String clientCursorName) { // this.clientCursorName_ = clientCursorName; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void free() { if (resultSetHoldability_ != -1) { this.agent_.sectionManager_.freeSection(this, resultSetHoldability_); diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/SectionManager.java b/java/org.apache.derby.client/org/apache/derby/client/am/SectionManager.java index f05d0e5ce2..810bc5f6ef 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/SectionManager.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/SectionManager.java @@ -180,6 +180,7 @@ void mapCursorNameToQuerySection(String cursorName, Section section) { positionedUpdateCursorNameToQuerySection_.put(cursorName, section); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void mapCursorNameToResultSet( String cursorName, ClientResultSet resultSet) { diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/SqlCode.java b/java/org.apache.derby.client/org/apache/derby/client/am/SqlCode.java index aa13633a50..1072cc6c1e 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/SqlCode.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/SqlCode.java @@ -31,6 +31,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more public class SqlCode { private int code_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 SqlCode(int code) { code_ = code; } @@ -47,6 +48,7 @@ public final int getCode() { public final static SqlCode queuedXAError = new SqlCode(-4203); final static SqlCode disconnectError = new SqlCode(40000); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 /** SQL code for SQL state 02000 (end of data). DRDA does not * specify the SQL code for this SQL state, but Derby uses 100. */ diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/SqlException.java b/java/org.apache.derby.client/org/apache/derby/client/am/SqlException.java index 362c40dae4..b8cc487830 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/SqlException.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/SqlException.java @@ -86,6 +86,7 @@ public class SqlException extends Exception implements Diagnosable { protected SqlException nextException_; public static final String CLIENT_MESSAGE_RESOURCE_NAME = +//IC see: https://issues.apache.org/jira/browse/DERBY-838 "org.apache.derby.loc.clientmessages"; /** @@ -117,7 +118,9 @@ public class SqlException extends Exception implements Diagnosable { * messages */ public static MessageUtil getMessageUtil() { +//IC see: https://issues.apache.org/jira/browse/DERBY-847 if ( msgutil_ == null ) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 msgutil_ = new MessageUtil(MessageUtil.CLIENT_MESSAGE_RESOURCE_NAME); } @@ -160,11 +163,13 @@ public static MessageUtil getMessageUtil() { * is chained into the nextException chain. Otherwise it is chained * using initCause(). */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 SqlException(LogWriter logwriter, ClientMessageId msgid, Object[] args, Throwable cause) { this( logwriter, +//IC see: https://issues.apache.org/jira/browse/DERBY-1069 cause, getMessageUtil().getCompleteMessage( msgid.msgid, @@ -175,6 +180,7 @@ public static MessageUtil getMessageUtil() { // Use the following SQLExceptions when you want to override the error // code that is derived from the severity of the message id. +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 SqlException(LogWriter logWriter, ClientMessageId msgid, Object[] args, SqlCode sqlcode, Throwable t) { this(logWriter, msgid, args, t); @@ -182,6 +188,7 @@ public static MessageUtil getMessageUtil() { } public SqlException(LogWriter logWriter, ClientMessageId msgid, +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 SqlCode sqlcode, Object... args) { this(logWriter, msgid, args, sqlcode, (Throwable)null); } @@ -197,6 +204,7 @@ public SqlException(LogWriter logWriter, ClientMessageId msgid, } public SqlException(LogWriter logwriter, +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 ClientMessageId msgid, Object... args) { @@ -210,12 +218,15 @@ public SqlException(LogWriter logwriter, * @param sqlca the SQLCA sent from the server */ public SqlException(LogWriter logWriter, Sqlca sqlca) { +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 this(sqlca, 0, true); // only set the error code for the first exception in the chain (we // don't know the error code for the rest) +//IC see: https://issues.apache.org/jira/browse/DERBY-2601 errorcode_ = sqlca.getErrorCode(); if ( logWriter != null ) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 logWriter.traceDiagnosable(SqlException.this); } } @@ -253,6 +264,7 @@ private SqlException(Sqlca sqlca, int number, boolean chain) { private SqlException(LogWriter logWriter, String reason, String sqlState, int errorCode) { +//IC see: https://issues.apache.org/jira/browse/DERBY-842 this(logWriter, (Throwable)null, reason, sqlState, errorCode); } @@ -265,6 +277,7 @@ private SqlException(LogWriter logWriter, Throwable throwable, setThrowable(throwable); if (logWriter != null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 logWriter.traceDiagnosable(SqlException.this); } @@ -289,6 +302,7 @@ else if ( throwable instanceof SQLException ) setNextException((SQLException) throwable ); } +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 if (throwable != null) { initCause(throwable); } @@ -322,9 +336,12 @@ public SQLException getSQLException() // When we have support for JDBC 4 SQLException subclasses, this is // where we decide which exception to create +//IC see: https://issues.apache.org/jira/browse/DERBY-1140 SQLException sqle = exceptionFactory.getSQLException(getMessage(), getSQLState(), +//IC see: https://issues.apache.org/jira/browse/DERBY-6803 getErrorCode(), getArgs()); sqle.initCause(this); +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 // Set up the nextException chain if ( nextException_ != null ) @@ -342,6 +359,7 @@ public SQLException getSQLException() // when getMessage() is called. // Called by the Agent. void setBatchPositionLabel(int index) { +//IC see: https://issues.apache.org/jira/browse/DERBY-3902 batchPositionLabel_ = getMessageUtil().getTextMessage(MessageId.BATCH_POSITION_ID) + index + ": "; } @@ -357,6 +375,7 @@ public String toString() { } private Object []getArgs() { +//IC see: https://issues.apache.org/jira/browse/DERBY-6803 if( sqlca_ != null ) return ((Sqlca)sqlca_).getArgs(messageNumber_); return null; @@ -364,6 +383,7 @@ public String toString() { @Override public String getMessage() { +//IC see: https://issues.apache.org/jira/browse/DERBY-852 if ( wrappedException_ != null ) { return wrappedException_.getMessage(); @@ -379,6 +399,7 @@ public String getMessage() { // the connection and JDBC not being retrievable (hence why it is // being cached here). if (sqlca_ != null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 cachedMessage_ = message_ = ((Sqlca) sqlca_).getJDBCMessage(messageNumber_); } @@ -407,6 +428,7 @@ public String getSQLState() { return wrappedException_.getSQLState(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 return sqlstate_; } @@ -416,6 +438,7 @@ public int getErrorCode() { return wrappedException_.getErrorCode(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 return errorcode_; } @@ -452,6 +475,7 @@ public void setNextException(SQLException nextException) else { // Add this exception to the end of the chain +//IC see: https://issues.apache.org/jira/browse/DERBY-860 SqlException theEnd = this; while (theEnd.nextException_ != null) { theEnd = theEnd.nextException_; @@ -465,6 +489,7 @@ public void setNextException(SQLException nextException) * we encountered an underlying Java exception */ static SqlException javaException(LogWriter logWriter, Throwable e) { +//IC see: https://issues.apache.org/jira/browse/DERBY-839 return new SqlException(logWriter, new ClientMessageId (SQLState.JAVA_EXCEPTION), new Object[] {e.getClass().getName(), e.getMessage()}, e); @@ -476,6 +501,7 @@ static SqlException javaException(LogWriter logWriter, Throwable e) { SqlException copyAsUnchainedSQLException(LogWriter logWriter) { if (sqlca_ != null) { // server error +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 return new SqlException(sqlca_, messageNumber_, false); } else { return new SqlException(logWriter, getMessage(), getSQLState(), getErrorCode()); // client error @@ -487,6 +513,7 @@ SqlException copyAsUnchainedSQLException(LogWriter logWriter) { // for common ResultSet data conversion exceptions. class ColumnTypeConversionException extends SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-4949 ColumnTypeConversionException(LogWriter logWriter, String targetType, String sourceType) { super(logWriter, @@ -498,6 +525,7 @@ class ColumnTypeConversionException extends SqlException { // An intermediate exception encapsulation to provide code-reuse // for common CrossConverters data conversion exceptions. +//IC see: https://issues.apache.org/jira/browse/DERBY-5533 class OutsideRangeForDataTypeException extends SqlException { OutsideRangeForDataTypeException(LogWriter logWriter, String instance) { super(logWriter, diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/SqlWarning.java b/java/org.apache.derby.client/org/apache/derby/client/am/SqlWarning.java index 64e1d7b5f8..b15958303d 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/SqlWarning.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/SqlWarning.java @@ -34,6 +34,7 @@ public class SqlWarning extends SqlException implements Diagnosable { private SqlWarning nextWarning_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 SqlWarning(LogWriter logwriter, ClientMessageId msgid, Object... args) { super(logwriter, msgid, args); @@ -69,6 +70,7 @@ public SQLWarning getSQLWarning() getErrorCode()); sqlw.initCause(this); +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 // Set up the nextException chain if ( nextWarning_ != null ) diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/Sqlca.java b/java/org.apache.derby.client/org/apache/derby/client/am/Sqlca.java index 807e5cd73f..8f33974b6f 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/Sqlca.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/Sqlca.java @@ -37,7 +37,9 @@ public abstract class Sqlca { private static final int LOW_ORDER_UPDATE_COUNT = 2; private static final int HIGH_ORDER_UPDATE_COUNT = 3; public static final int SQL_ERR_LENGTH = 6; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 transient private ClientConnection connection_; +//IC see: https://issues.apache.org/jira/browse/DERBY-1061 SqlException exceptionThrownOnStoredProcInvocation_; boolean messageTextRetrievedContainsTokensOnly_ = true; @@ -86,6 +88,7 @@ void returnTokensOnlyInMessageText(boolean returnTokensOnlyInMessageText) { * * @return number of messages */ +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 synchronized int numberOfMessages() { initSqlErrmcMessages(); if (sqlErrmcMessages_ != null) { @@ -148,6 +151,7 @@ synchronized public String getSqlErrmc() { // sqlErrmc string is dependent on sqlErrmcMessages_ array having // been built initSqlErrmcMessages(); +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 // sqlErrmc will be built only if sqlErrmcMessages_ has been built. // Otherwise, a null string will be returned. @@ -164,8 +168,10 @@ synchronized public String getSqlErrmc() { // concatenate tokens with sqlErrmcDelimiter delimiters into one String StringBuffer buffer = new StringBuffer(); int indx; +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 for (indx = 0; indx < sqlErrmcMessages_.length - 1; indx++) { buffer.append(sqlErrmcMessages_[indx]); +//IC see: https://issues.apache.org/jira/browse/DERBY-6803 buffer.append(MessageUtils.SQLERRMC_MESSAGE_DELIMITER); // all but the first message should be preceded by the SQL state // and a colon (see DRDAConnThread.buildTokenizedSqlerrmc() on the @@ -201,6 +207,7 @@ synchronized public String getSqlErrp() { return null; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 sqlErrp_ = bytes2String(sqlErrpBytes_, 0, sqlErrpBytes_.length); return sqlErrp_; } @@ -210,10 +217,12 @@ private int[] getSqlErrd() { return sqlErrd_; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 sqlErrd_ = new int[ SQL_ERR_LENGTH ]; // create an int array. return sqlErrd_; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 String formatSqlErrd() { return Utils.getStringFromInts(getSqlErrd()); } @@ -223,6 +232,7 @@ String formatSqlErrd() { synchronized public String getSqlWarn() { if (sqlWarn_ == null) { if (sqlWarnBytes_ != null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 sqlWarn_ = bytes2String(sqlWarnBytes_, 0, sqlWarnBytes_.length); } else { sqlWarn_ = elevenBlanks; @@ -241,6 +251,7 @@ synchronized public String getSqlState() { * @param messageNumber the error to retrieve SQL state for * @return SQL state for the error */ +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 synchronized String getSqlState(int messageNumber) { initSqlErrmcMessages(); if (sqlStates_ != null) { @@ -250,6 +261,7 @@ synchronized String getSqlState(int messageNumber) { } public Object [] getArgs(int messageNumber) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6803 if (sqlErrmcMessages_ != null) return MessageUtils.getArgs(getSqlState(messageNumber), sqlErrmcMessages_[messageNumber] ); @@ -267,6 +279,7 @@ private String getMessage(int messageNumber) throws SqlException { return getUnformattedMessage(messageNumber); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientCallableStatement cs = null; synchronized (connection_) { try { @@ -274,7 +287,9 @@ private String getMessage(int messageNumber) throws SqlException { // Cannot let this statement commit the transaction. Otherwise, // calling getWarnings while navigating a ResultSet will // release and invalidate locators used by the cursor. +//IC see: https://issues.apache.org/jira/browse/DERBY-6228 cs.isAutoCommittableStatement_ = false; +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 String errmc = null; String sqlState = null; @@ -299,12 +314,15 @@ private String getMessage(int messageNumber) throws SqlException { cs.setIntX(9, getSqlErrd()[4]); cs.setIntX(10, getSqlErrd()[5]); // SQLWarn: SQL warning flags. +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 cs.setStringX(11, getSqlWarn()); // SQLState: standard SQL state. +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 cs.setStringX(12, sqlState); // MessageFileName: Not used by our driver, so set to null. cs.setStringX(13, null); // Locale: language preference requested for the return error message. +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 cs.setStringX(14, Locale.getDefault().toString()); // server could return a locale different from what we requested cs.registerOutParameterX(14, Types.VARCHAR); @@ -318,6 +336,7 @@ private String getMessage(int messageNumber) throws SqlException { // Return the message text. messageTextRetrievedContainsTokensOnly_ = false; String message = cs.getStringX(15); +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 if (cachedMessages == null) { cachedMessages = new String[numberOfMessages()]; } @@ -332,6 +351,7 @@ private String getMessage(int messageNumber) throws SqlException { if (cs != null) { try { cs.closeX(); +//IC see: https://issues.apache.org/jira/browse/DERBY-852 } catch (SqlException doNothing) { } } @@ -340,6 +360,7 @@ private String getMessage(int messageNumber) throws SqlException { } // May or may not get the formatted message depending upon datasource directives. cannot throw exeption. +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 synchronized String getJDBCMessage(int messageNumber) { // The transient connection_ member will only be null if the Sqlca has been deserialized if (connection_ != null && connection_.retrieveMessageText_) { @@ -347,6 +368,7 @@ synchronized String getJDBCMessage(int messageNumber) { return getMessage(messageNumber); } catch (SqlException e) { // Invocation of stored procedure fails, so we return error message tokens directly. +//IC see: https://issues.apache.org/jira/browse/DERBY-1061 exceptionThrownOnStoredProcInvocation_ = e; chainDeferredExceptionsToAgentOrAsConnectionWarnings((SqlException) e); return getUnformattedMessage(messageNumber); @@ -369,6 +391,7 @@ private String getUnformattedMessage(int messageNumber) { if (messageNumber == 0) { // if the first exception in the chain is requested, return all the // information we have +//IC see: https://issues.apache.org/jira/browse/DERBY-2601 errorCode = getErrorCode(); sqlState = getSqlState(); sqlErrmc = getSqlErrmc(); @@ -390,11 +413,13 @@ private void chainDeferredExceptionsToAgentOrAsConnectionWarnings(SqlException e if (current.getErrorCode() == -440) { SqlWarning warningForStoredProcFailure = new SqlWarning(agent_.logWriter_, new ClientMessageId(SQLState.UNABLE_TO_OBTAIN_MESSAGE_TEXT_FROM_SERVER)); +//IC see: https://issues.apache.org/jira/browse/DERBY-852 warningForStoredProcFailure.setNextException(current.getSQLException()); connection_.accumulate440WarningForMessageProcFailure(warningForStoredProcFailure); } else if (current.getErrorCode() == -444) { SqlWarning warningForStoredProcFailure = new SqlWarning(agent_.logWriter_, new ClientMessageId(SQLState.UNABLE_TO_OBTAIN_MESSAGE_TEXT_FROM_SERVER)); +//IC see: https://issues.apache.org/jira/browse/DERBY-852 warningForStoredProcFailure.setNextException(current.getSQLException()); connection_.accumulate444WarningForMessageProcFailure(warningForStoredProcFailure); } else { @@ -413,6 +438,7 @@ private void chainDeferredExceptionsToAgentOrAsConnectionWarnings(SqlException e DataTruncation getDataTruncation() { // The network server has serialized all the parameters needed by // the constructor in the SQLERRMC field. +//IC see: https://issues.apache.org/jira/browse/DERBY-6803 String[] tokens = getSqlErrmc().split(MessageUtils.SQLERRMC_TOKEN_DELIMITER); return new DataTruncation( Integer.parseInt(tokens[0]), // index @@ -426,6 +452,7 @@ DataTruncation getDataTruncation() { private void processSqlErrmcTokens(byte[] tokenBytes) { if (tokenBytes == null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 return; } @@ -437,6 +464,7 @@ private void processSqlErrmcTokens(byte[] tokenBytes) { } // tokenize and convert tokenBytes +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 String fullString = bytes2String(tokenBytes, 0, length); String[] tokens = fullString.split("\\u0014{3}"); String[] states = new String[tokens.length]; @@ -463,6 +491,7 @@ public long getUpdateCount() { if (sqlErrd_ == null) { return 0L; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 long result = getSqlErrd()[ LOW_ORDER_UPDATE_COUNT ]; result &= 0xFFFFFFFFL; result |= ((long) getSqlErrd()[ HIGH_ORDER_UPDATE_COUNT ] << 32); @@ -484,6 +513,7 @@ public boolean containsSqlcax() { public void resetRowsetSqlca(ClientConnection connection, int sqlCode, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 String sqlState) { connection_ = connection; sqlCode_ = sqlCode; diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/StatementCacheInteractor.java b/java/org.apache.derby.client/org/apache/derby/client/am/StatementCacheInteractor.java index 9d0da6c5da..da4f93fcf4 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/StatementCacheInteractor.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/StatementCacheInteractor.java @@ -60,6 +60,7 @@ public final class StatementCacheInteractor { /** List of open logical statements created by this cache interactor. */ //@GuardedBy("this") private final ArrayList openLogicalStatements = +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 new ArrayList(); /** * Tells if this interactor is in the process of shutting down. @@ -75,6 +76,7 @@ public final class StatementCacheInteractor { * @param physicalConnection associated physical connection */ StatementCacheInteractor(JDBCStatementCache cache, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientConnection physicalConnection) { this.cache = cache; this.physicalConnection = physicalConnection; @@ -83,9 +85,11 @@ public final class StatementCacheInteractor { /** * @see java.sql.Connection#prepareStatement(String) */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized PreparedStatement prepareStatement(String sql) throws SQLException { StatementKey stmtKey = StatementKeyFactory.newPrepared( +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 sql, physicalConnection.getCurrentSchemaName(), physicalConnection.holdability()); PreparedStatement ps = cache.getCached(stmtKey); @@ -104,8 +108,10 @@ synchronized PreparedStatement prepareStatement( int resultSetConcurrency) throws SQLException { StatementKey stmtKey = StatementKeyFactory.newPrepared( +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 sql, physicalConnection.getCurrentSchemaName(), resultSetType, resultSetConcurrency, physicalConnection.holdability()); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 PreparedStatement ps = cache.getCached(stmtKey); if (ps == null) { ps = physicalConnection.prepareStatement( @@ -124,9 +130,11 @@ synchronized PreparedStatement prepareStatement( int resultSetHoldability) throws SQLException { StatementKey stmtKey = StatementKeyFactory.newPrepared( +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 sql, physicalConnection.getCurrentSchemaName(), resultSetType, resultSetConcurrency, resultSetHoldability); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 PreparedStatement ps = cache.getCached(stmtKey); if (ps == null) { ps = physicalConnection.prepareStatement( @@ -138,26 +146,36 @@ synchronized PreparedStatement prepareStatement( /** * @see java.sql.Connection#prepareStatement(String,int) */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized PreparedStatement prepareStatement( String sql, int autoGeneratedKeys) throws SQLException { StatementKey stmtKey = StatementKeyFactory.newPrepared( +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 sql, physicalConnection.getCurrentSchemaName(), physicalConnection.getHoldability(), autoGeneratedKeys); PreparedStatement ps = cache.getCached(stmtKey); if (ps == null) { ps = physicalConnection.prepareStatement(sql, autoGeneratedKeys); } +//IC see: https://issues.apache.org/jira/browse/DERBY-3457 +//IC see: https://issues.apache.org/jira/browse/DERBY-3457 +//IC see: https://issues.apache.org/jira/browse/DERBY-3457 +//IC see: https://issues.apache.org/jira/browse/DERBY-3457 return createLogicalPreparedStatement(ps, stmtKey); } /** * @see java.sql.Connection#prepareCall(String) */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized CallableStatement prepareCall(String sql) throws SQLException { StatementKey stmtKey = StatementKeyFactory.newCallable( +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 sql, physicalConnection.getCurrentSchemaName(), physicalConnection.holdability()); CallableStatement cs = @@ -172,11 +190,13 @@ synchronized CallableStatement prepareCall(String sql) /** * @see java.sql.Connection#prepareCall(String,int,int) */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { StatementKey stmtKey = StatementKeyFactory.newCallable( +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 sql, physicalConnection.getCurrentSchemaName(), resultSetType, resultSetConcurrency, physicalConnection.holdability()); CallableStatement cs = @@ -191,14 +211,17 @@ synchronized CallableStatement prepareCall(String sql, /** * @see java.sql.Connection#prepareCall(String,int,int,int) */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { StatementKey stmtKey = StatementKeyFactory.newCallable( +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 sql, physicalConnection.getCurrentSchemaName(), resultSetType, resultSetConcurrency, resultSetHoldability); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 CallableStatement cs = (CallableStatement)cache.getCached(stmtKey); @@ -206,6 +229,9 @@ synchronized CallableStatement prepareCall(String sql, cs = physicalConnection.prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability); } +//IC see: https://issues.apache.org/jira/browse/DERBY-3457 +//IC see: https://issues.apache.org/jira/browse/DERBY-3457 +//IC see: https://issues.apache.org/jira/browse/DERBY-3457 return createLogicalCallableStatement(cs, stmtKey); } @@ -215,12 +241,15 @@ synchronized CallableStatement prepareCall(String sql, * A cache interactor is bound to a single (caching) logical connection. * @throws SQLException if closing an open logical connection fails */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized void closeOpenLogicalStatements() +//IC see: https://issues.apache.org/jira/browse/DERBY-3457 throws SQLException { // Transist to closing state, to avoid changing the list of open // statements as we work our way through the list. this.connCloseInProgress = true; // Iterate through the list and close the logical statements. +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 for (LogicalStatementEntity logicalStatement : openLogicalStatements) { logicalStatement.close(); } @@ -233,6 +262,7 @@ synchronized void closeOpenLogicalStatements() * * @param logicalStmt the logical statement being closed */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized void markClosed(LogicalStatementEntity logicalStmt) { // If we are not in the process of shutting down the logical connection, // remove the notifying statement from the list of open statements. @@ -255,11 +285,21 @@ synchronized void markClosed(LogicalStatementEntity logicalStmt) { * @throws SQLException if creating a logical prepared statement fails */ private PreparedStatement createLogicalPreparedStatement( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 PreparedStatement ps, StatementKey stmtKey) throws SQLException { LogicalPreparedStatement logicalPs = +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 ClientAutoloadedDriver.getFactory().newLogicalPreparedStatement( +//IC see: https://issues.apache.org/jira/browse/DERBY-3328 +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 +//IC see: https://issues.apache.org/jira/browse/DERBY-3328 +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 +//IC see: https://issues.apache.org/jira/browse/DERBY-3328 +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 +//IC see: https://issues.apache.org/jira/browse/DERBY-3328 +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 ps, stmtKey, this); this.openLogicalStatements.add(logicalPs); return logicalPs; @@ -274,11 +314,19 @@ private PreparedStatement createLogicalPreparedStatement( * @throws SQLException if creating a logical callable statement fails */ private CallableStatement createLogicalCallableStatement( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 CallableStatement cs, StatementKey stmtKey) throws SQLException { LogicalCallableStatement logicalCs = +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 ClientAutoloadedDriver.getFactory().newLogicalCallableStatement( +//IC see: https://issues.apache.org/jira/browse/DERBY-3328 +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 +//IC see: https://issues.apache.org/jira/browse/DERBY-3328 +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 +//IC see: https://issues.apache.org/jira/browse/DERBY-3328 +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 cs, stmtKey, this); this.openLogicalStatements.add(logicalCs); return logicalCs; diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/StatementCallbackInterface.java b/java/org.apache.derby.client/org/apache/derby/client/am/StatementCallbackInterface.java index e6d616e710..d9609a0367 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/StatementCallbackInterface.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/StatementCallbackInterface.java @@ -33,6 +33,7 @@ public interface StatementCallbackInterface extends UnitOfWorkListener { // A query has been opened on the server. public void completeOpenQuery(Sqlca sqlca, ClientResultSet resultSet) throws DisconnectException; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 public void completeExecuteCallOpenQuery( Sqlca sqlca, @@ -55,6 +56,7 @@ public void completeExecuteCallOpenQuery( public void completeExecute(Sqlca sqlca); public void completeExecuteCall( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Sqlca sqlca, Cursor params, ClientResultSet[] resultSets); diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/UpdateSensitiveBlobLocatorInputStream.java b/java/org.apache.derby.client/org/apache/derby/client/am/UpdateSensitiveBlobLocatorInputStream.java index 84afd8c194..f868658df3 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/UpdateSensitiveBlobLocatorInputStream.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/UpdateSensitiveBlobLocatorInputStream.java @@ -30,6 +30,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more * which re-creates the underlying Blob locator stream whenever a * update happens on the Blob object associated with this stream. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class UpdateSensitiveBlobLocatorInputStream extends UpdateSensitiveLOBLocatorInputStream { //Stores the Blob instance associated with @@ -49,6 +50,7 @@ class UpdateSensitiveBlobLocatorInputStream * @throws SqlException If any exception occurs during stream * creation. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 UpdateSensitiveBlobLocatorInputStream( ClientConnection con, ClientBlob blob) throws SqlException { @@ -72,6 +74,7 @@ class UpdateSensitiveBlobLocatorInputStream * @throws SqlException If any exception occurs during stream * creation. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 UpdateSensitiveBlobLocatorInputStream( ClientConnection con, ClientBlob blob, @@ -93,6 +96,7 @@ class UpdateSensitiveBlobLocatorInputStream * re-creating the underlying streams. */ protected InputStream reCreateStream() throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 InputStream is_; //Verify if a subset of the underlying diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/UpdateSensitiveClobLocatorInputStream.java b/java/org.apache.derby.client/org/apache/derby/client/am/UpdateSensitiveClobLocatorInputStream.java index 5a199ed1b0..7f1502f48d 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/UpdateSensitiveClobLocatorInputStream.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/UpdateSensitiveClobLocatorInputStream.java @@ -31,6 +31,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more * which re-creates the underlying Clob locator stream whenever a * update happens on the Clob object associated with this stream. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class UpdateSensitiveClobLocatorInputStream extends UpdateSensitiveLOBLocatorInputStream { //Stores the Clob instance associated with @@ -50,6 +51,7 @@ class UpdateSensitiveClobLocatorInputStream * @throws SqlException If any exception occurs during stream * creation. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 UpdateSensitiveClobLocatorInputStream( ClientConnection con, ClientClob clob) throws SqlException { diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/UpdateSensitiveClobLocatorReader.java b/java/org.apache.derby.client/org/apache/derby/client/am/UpdateSensitiveClobLocatorReader.java index 1ff98b60ff..a281a3cc56 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/UpdateSensitiveClobLocatorReader.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/UpdateSensitiveClobLocatorReader.java @@ -32,6 +32,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more * this stream verifies that the underlying Clob has not * changed and if it has it recreates the specific streams. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class UpdateSensitiveClobLocatorReader extends Reader { //The ClobLocatorReader instance //wrapped inside a BufferedReader @@ -68,6 +69,7 @@ class UpdateSensitiveClobLocatorReader extends Reader { * this stream. */ protected UpdateSensitiveClobLocatorReader( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientConnection con, ClientClob clob) throws SqlException { @@ -106,6 +108,7 @@ protected UpdateSensitiveClobLocatorReader( * */ protected UpdateSensitiveClobLocatorReader( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientConnection con, ClientClob clob, long pos, diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/UpdateSensitiveLOBLocatorInputStream.java b/java/org.apache.derby.client/org/apache/derby/client/am/UpdateSensitiveLOBLocatorInputStream.java index 5508d521c5..7383cd4a14 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/UpdateSensitiveLOBLocatorInputStream.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/UpdateSensitiveLOBLocatorInputStream.java @@ -36,6 +36,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more * streams. * */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 abstract class UpdateSensitiveLOBLocatorInputStream extends InputStream { //The ClobLocatorInputStream or //BlobLocatorInputStream instance @@ -85,6 +86,7 @@ abstract class UpdateSensitiveLOBLocatorInputStream extends InputStream { * appropriate locator stream instance. */ protected UpdateSensitiveLOBLocatorInputStream( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientConnection con, Lob lob, InputStream is) throws SqlException { @@ -124,6 +126,7 @@ protected UpdateSensitiveLOBLocatorInputStream( * */ protected UpdateSensitiveLOBLocatorInputStream( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientConnection con, Lob lob, InputStream is, diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/Utils.java b/java/org.apache.derby.client/org/apache/derby/client/am/Utils.java index 4d588d7750..487ac0b81e 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/Utils.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/Utils.java @@ -98,7 +98,9 @@ static public int computeBigDecimalPrecision(BigDecimal decimal) { byte[] bBytes = decimal.unscaledValue().abs().toByteArray(); if (byteArrayCmp(bBytes, tenRadixArr[tenRadixArr.length - 1]) >= 0) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throw new IllegalArgumentException( +//IC see: https://issues.apache.org/jira/browse/DERBY-847 SqlException.getMessageUtil(). getTextMessage(MessageId.CONN_PRECISION_TOO_LARGE)); } @@ -213,12 +215,14 @@ public static int[] squashLongs( long[] longs ) int count = (longs == null) ? 0 : longs.length; int[] ints = new int[ count ]; for ( int i = 0; i < count; i++ ) { ints[ i ] = (int) longs[ i ]; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 return ints; } // latestException is assumed to be non-null, accumulatedExceptions can be null public static SQLException accumulateSQLException(SQLException latestException, +//IC see: https://issues.apache.org/jira/browse/DERBY-852 SQLException accumulatedExceptions) { if (accumulatedExceptions == null) { return latestException; diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/Version.java b/java/org.apache.derby.client/org/apache/derby/client/am/Version.java index c6565a0486..f8551b0b8e 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/Version.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/Version.java @@ -34,6 +34,7 @@ public abstract class Version { // for DatabaseMetaData.getDriverVersion() public static String getDriverVersion() { +//IC see: https://issues.apache.org/jira/browse/DERBY-4293 return Configuration.getProductVersionHolder().getVersionBuildString(true); } @@ -54,6 +55,7 @@ public static int getProtocolMaintVersion() { // Not an external, just a helper method private static String getDriverNameAndVersion() { return Configuration.dncDriverName + " " + +//IC see: https://issues.apache.org/jira/browse/DERBY-4293 Configuration.getProductVersionHolder().getVersionBuildString(true); } @@ -66,6 +68,7 @@ static void writeDriverConfiguration(PrintWriter printWriter) { printWriter.println(header + "Driver: " + getDriverNameAndVersion()); printWriter.print(header + "Compatible JRE versions: { "); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 String [] cv = Configuration.getDncCompatibleJREVersions(); for (int i = 0; i < cv.length; i++) { printWriter.print(cv[i]); @@ -80,6 +83,7 @@ static void writeDriverConfiguration(PrintWriter printWriter) { printWriter.println(header + "Default fetch size: " + Configuration.defaultFetchSize); printWriter.println(header + "Default isolation: " + Configuration.defaultIsolation); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 SecurityManager security = System.getSecurityManager(); if (security == null) { printWriter.println(header + "No security manager detected."); @@ -124,6 +128,7 @@ static void writeDriverConfiguration(PrintWriter printWriter) { private static void printSystemProperty(SecurityManager security, String prefix, String property, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 PrintWriter printWriter) { String header = "[derby] "; synchronized (printWriter) { @@ -136,6 +141,7 @@ private static void printSystemProperty(SecurityManager security, printWriter.flush(); } catch (SecurityException e) { printWriter.println(header + +//IC see: https://issues.apache.org/jira/browse/DERBY-3902 msgutil.getTextMessage(MessageId.SECURITY_MANAGER_NO_ACCESS_ID, property)); printWriter.flush(); } @@ -144,6 +150,7 @@ private static void printSystemProperty(SecurityManager security, // printWriter synchronized by caller private static void detectLocalHost( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 SecurityManager security, PrintWriter printWriter) { @@ -156,6 +163,7 @@ private static void detectLocalHost( printWriter.flush(); } catch (UnknownHostException e) { printWriter.println(header + +//IC see: https://issues.apache.org/jira/browse/DERBY-3902 msgutil.getTextMessage(MessageId.UNKNOWN_HOST_ID, e.getMessage())); printWriter.flush(); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/XaException.java b/java/org.apache.derby.client/org/apache/derby/client/am/XaException.java index c1ac6647ac..c3672d4495 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/XaException.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/XaException.java @@ -30,6 +30,9 @@ public class XaException extends XAException implements Diagnosable { public XaException(LogWriter logWriter, Throwable throwable, String s) { super(s); +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 +//IC see: https://issues.apache.org/jira/browse/DERBY-2692 initCause(throwable); if (logWriter != null) { logWriter.traceDiagnosable(this); diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/stmtcache/JDBCStatementCache.java b/java/org.apache.derby.client/org/apache/derby/client/am/stmtcache/JDBCStatementCache.java index 9ded592418..12fca80fb2 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/stmtcache/JDBCStatementCache.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/stmtcache/JDBCStatementCache.java @@ -55,6 +55,7 @@ public final class JDBCStatementCache { //@GuardedBy("this"); private final LinkedHashMap statements; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 /** * Creates a new, empty JDBC statement cache. @@ -85,6 +86,7 @@ public synchronized PreparedStatement getCached( SanityManager.ASSERT(statementKey != null, "statementKey is not supposed to be null"); } +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 return statements.remove(statementKey); } @@ -98,6 +100,7 @@ public synchronized PreparedStatement getCached( */ public synchronized boolean cacheStatement( StatementKey statementKey, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 PreparedStatement ps) { if (SanityManager.DEBUG) { SanityManager.ASSERT(statementKey != null, @@ -121,6 +124,8 @@ public synchronized boolean cacheStatement( //@NotThreadSafe private static class BoundedLinkedHashMap extends LinkedHashMap { +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 /** Maximum number of entries. */ private final int maxSize; @@ -150,8 +155,11 @@ public BoundedLinkedHashMap(int maxCapacity) { * false if not. */ protected boolean removeEldestEntry( +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Map.Entry eldest) { final boolean remove = size() > maxSize; +//IC see: https://issues.apache.org/jira/browse/DERBY-3324 if (remove && eldest != null) { try { eldest.getValue().close(); diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/stmtcache/StatementKey.java b/java/org.apache.derby.client/org/apache/derby/client/am/stmtcache/StatementKey.java index 7810558681..23bdfd0241 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/stmtcache/StatementKey.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/stmtcache/StatementKey.java @@ -72,6 +72,7 @@ public class StatementKey { StatementKey(boolean isCallableStatement, String sql, String schema, int rsType, int rsConcurrency, int rsHoldability, int autogeneratedKeys) { +//IC see: https://issues.apache.org/jira/browse/DERBY-3438 if (schema == null) { // Not localized (yet), because this should never reach the user. throw new IllegalArgumentException("schema is "); @@ -84,8 +85,10 @@ public class StatementKey { this.holdability = rsHoldability; this.autogeneratedKeys = autogeneratedKeys; // In sane builds, make sure valid JDBC values are passed. +//IC see: https://issues.apache.org/jira/browse/DERBY-3324 if (SanityManager.DEBUG) { SanityManager.ASSERT( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 rsType == ResultSet.TYPE_FORWARD_ONLY || rsType == ResultSet.TYPE_SCROLL_INSENSITIVE || rsType == ResultSet.TYPE_SCROLL_SENSITIVE, @@ -122,6 +125,7 @@ public boolean equals(Object obj) { if (!this.schema.equals(other.schema)) { return false; } +//IC see: https://issues.apache.org/jira/browse/DERBY-3438 if (this.sql == null && other.sql != null) { return false; } @@ -140,6 +144,7 @@ public boolean equals(Object obj) { public int hashCode() { int hash = 7; hash = 47 * hash + (this.isCallableStatement ? 1 : 0); +//IC see: https://issues.apache.org/jira/browse/DERBY-3438 hash = 47 * hash + (this.sql == null ? 3 : this.sql.hashCode()); hash = 47 * hash + this.schema.hashCode(); hash = 47 * hash + this.type; diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/stmtcache/StatementKeyFactory.java b/java/org.apache.derby.client/org/apache/derby/client/am/stmtcache/StatementKeyFactory.java index c1d8cb9c02..7e03d86048 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/am/stmtcache/StatementKeyFactory.java +++ b/java/org.apache.derby.client/org/apache/derby/client/am/stmtcache/StatementKeyFactory.java @@ -56,6 +56,7 @@ public final class StatementKeyFactory { public static StatementKey newPrepared( String sql, String schema, int holdability) { return new StatementKey(PREPARED, sql, schema, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, holdability, Statement.NO_GENERATED_KEYS); @@ -79,6 +80,7 @@ public static StatementKey newPrepared( public static StatementKey newPrepared( String sql, String schema, int holdability, int autogeneratedKeys) { return new StatementKey(PREPARED, sql, schema, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, holdability, autogeneratedKeys); @@ -97,8 +99,10 @@ public static StatementKey newPrepared( * @return A statement key. */ public static StatementKey newPrepared( +//IC see: https://issues.apache.org/jira/browse/DERBY-3324 String sql, String schema, int rst, int rsc, int rsh) { return new StatementKey(PREPARED, sql, schema, rst, rsc, rsh, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Statement.NO_GENERATED_KEYS); } @@ -116,6 +120,8 @@ public static StatementKey newPrepared( */ public static StatementKey newCallable( String sql, String schema, int holdability) { +//IC see: https://issues.apache.org/jira/browse/DERBY-3324 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return newCallable(sql, schema, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, holdability); } @@ -134,8 +140,10 @@ public static StatementKey newCallable( * @return A statement key. */ public static StatementKey newCallable( +//IC see: https://issues.apache.org/jira/browse/DERBY-3324 String sql, String schema, int rst, int rsc, int rsh) { return new StatementKey(CALLABLE, sql, schema, rst, rsc, rsh, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Statement.NO_GENERATED_KEYS); } } diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/CcsidManager.java b/java/org.apache.derby.client/org/apache/derby/client/net/CcsidManager.java index 8a3ba617ac..be8c91dd7b 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/CcsidManager.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/CcsidManager.java @@ -29,6 +29,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more // Performs character conversions as required to send and receive PROTOCOL control data. // User data uses the JVM's built in converters, i18n.jar, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 abstract class CcsidManager { byte space_; // ' ' character byte dot_; // '.' character @@ -61,6 +62,7 @@ abstract class CcsidManager { // @param sourceString A Java String to convert. // @return A new byte array representing the String in a particular ccsid. public abstract byte[] convertFromJavaString( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 String sourceString, Agent agent) throws SqlException; diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl.java b/java/org.apache.derby.client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl.java index 5ec63989e6..c8a8c3de8a 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl.java @@ -71,12 +71,14 @@ public class ClientJDBCObjectFactoryImpl implements ClientJDBCObjectFactory{ */ private static final MessageUtil msgutil_ = SqlException.getMessageUtil(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 /** * @return an instance of {@link * org.apache.derby.client.ClientPooledConnection} */ public ClientPooledConnection newClientPooledConnection( +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 BasicClientDataSource ds, LogWriter logWriter, String user, @@ -90,6 +92,7 @@ public ClientPooledConnection newClientPooledConnection( public ClientXAConnection newClientXAConnection(BasicClientDataSource ds, LogWriter logWriter,String user, String password) throws SQLException { +//IC see: https://issues.apache.org/jira/browse/DERBY-1028 return new ClientXAConnection(ds, logWriter, user, password); } /** @@ -113,6 +116,7 @@ public ClientXAConnection newClientXAConnection(BasicClientDataSource ds, * @throws SqlException on error */ public ClientCallableStatement newCallableStatement(Agent agent, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientConnection connection, String sql,int type,int concurrency, int holdability,ClientPooledConnection cpc) throws SqlException { @@ -125,7 +129,9 @@ public ClientCallableStatement newCallableStatement(Agent agent, * org.apache.derby.client.am.LogicalConnection} */ public LogicalConnection newLogicalConnection( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientConnection physicalConnection, +//IC see: https://issues.apache.org/jira/browse/DERBY-1180 ClientPooledConnection pooledConnection) throws SqlException { return new LogicalConnection(physicalConnection, pooledConnection); @@ -144,7 +150,10 @@ public LogicalConnection newLogicalConnection( * @throws SqlException if creation of the logical connection fails */ public LogicalConnection newCachingLogicalConnection( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientConnection physicalConnection, +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 +//IC see: https://issues.apache.org/jira/browse/DERBY-3328 ClientPooledConnection pooledConnection, JDBCStatementCache stmtCache) throws SqlException { return new CachingLogicalConnection(physicalConnection, @@ -176,6 +185,7 @@ public LogicalConnection newCachingLogicalConnection( * @throws SqlException on error */ public ClientPreparedStatement newPreparedStatement(Agent agent, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientConnection connection, String sql,Section section,ClientPooledConnection cpc) throws SqlException { @@ -214,6 +224,7 @@ public ClientPreparedStatement newPreparedStatement(Agent agent, * */ public ClientPreparedStatement newPreparedStatement(Agent agent, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientConnection connection, String sql,int type,int concurrency,int holdability, int autoGeneratedKeys,String [] columnNames, @@ -243,8 +254,11 @@ public ClientPreparedStatement newPreparedStatement(Agent agent, * @return A logical prepared statement. */ public LogicalPreparedStatement newLogicalPreparedStatement( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 PreparedStatement ps, StatementKey stmtKey, +//IC see: https://issues.apache.org/jira/browse/DERBY-3328 +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 StatementCacheInteractor cacheInteractor) { return new LogicalPreparedStatement(ps, stmtKey, cacheInteractor); } @@ -258,8 +272,11 @@ public LogicalPreparedStatement newLogicalPreparedStatement( * @return A logical callable statement. */ public LogicalCallableStatement newLogicalCallableStatement( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 CallableStatement cs, StatementKey stmtKey, +//IC see: https://issues.apache.org/jira/browse/DERBY-3328 +//IC see: https://issues.apache.org/jira/browse/DERBY-3326 StatementCacheInteractor cacheInteractor) { return new LogicalCallableStatement(cs, stmtKey, cacheInteractor); } @@ -268,14 +285,17 @@ public LogicalCallableStatement newLogicalCallableStatement( * @return an instance of {@link org.apache.derby.client.net.NetConnection} */ public ClientConnection newNetConnection( +//IC see: https://issues.apache.org/jira/browse/DERBY-1028 LogWriter logWriter, int driverManagerLoginTimeout, String serverName, int portNumber, String databaseName, Properties properties) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return new NetConnection( +//IC see: https://issues.apache.org/jira/browse/DERBY-1028 logWriter, driverManagerLoginTimeout, serverName, @@ -287,7 +307,9 @@ public ClientConnection newNetConnection( * @return an instance of {@link org.apache.derby.client.net.NetConnection} */ public ClientConnection newNetConnection( +//IC see: https://issues.apache.org/jira/browse/DERBY-1028 LogWriter logWriter, String user, String password, +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 BasicClientDataSource dataSource, int rmId, boolean isXAConn) throws SqlException { @@ -318,8 +340,10 @@ public ClientConnection newNetConnection( * @throws SqlException on error */ public ClientConnection newNetConnection( +//IC see: https://issues.apache.org/jira/browse/DERBY-1028 LogWriter logWriter,String user, String password, +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 BasicClientDataSource dataSource, int rmId,boolean isXAConn, ClientPooledConnection cpc) throws SqlException { @@ -352,6 +376,7 @@ public ClientResultSet newNetResultSet(Agent netAgent, * @return an instance of {@link NetDatabaseMetaData} */ public ClientDatabaseMetaData newNetDatabaseMetaData(Agent netAgent, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientConnection netConnection) { return new NetDatabaseMetaData((NetAgent)netAgent, (NetConnection)netConnection); @@ -372,6 +397,7 @@ public ClientDatabaseMetaData newNetDatabaseMetaData(Agent netAgent, * */ public ClientStatement newStatement(Agent agent, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientConnection connection, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, @@ -421,6 +447,7 @@ public ColumnMetaData newColumnMetaData(LogWriter logWriter, int upperBound) { * */ public ClientParameterMetaData newParameterMetaData( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ColumnMetaData columnMetaData) { return new ClientParameterMetaData(columnMetaData); } @@ -431,11 +458,13 @@ public ClientParameterMetaData newParameterMetaData( public BatchUpdateException newBatchUpdateException ( LogWriter logWriter, ClientMessageId msgid, Object[] args, long[] updateCounts, SqlException cause ) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 BatchUpdateException bue = newBatchUpdateException ( msgutil_.getCompleteMessage( msgid.msgid, args), ExceptionUtil.getSQLStateFromIdentifier(msgid.msgid), ExceptionUtil.getSeverityFromIdentifier(msgid.msgid), +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 updateCounts, cause ); diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl42.java b/java/org.apache.derby.client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl42.java index 5eaa32f0e7..394ad27965 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl42.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl42.java @@ -57,6 +57,7 @@ public class ClientJDBCObjectFactoryImpl42 extends ClientJDBCObjectFactoryImpl protected BatchUpdateException newBatchUpdateException ( String message, String sqlState, int errorCode, long[] updateCounts, SqlException cause ) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return new BatchUpdateException( message, sqlState, @@ -84,6 +85,7 @@ public ClientPreparedStatement newPreparedStatement(Agent agent, * statement is closed. */ public ClientPreparedStatement newPreparedStatement(Agent agent, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientConnection connection, String sql,int type,int concurrency, int holdability,int autoGeneratedKeys, @@ -119,6 +121,7 @@ public LogicalPreparedStatement newLogicalPreparedStatement( */ public ClientResultSet newNetResultSet(Agent netAgent, MaterialStatement netStatement, +//IC see: https://issues.apache.org/jira/browse/DERBY-6000 Cursor cursor,int qryprctyp,int sqlcsrhld, int qryattscr,int qryattsns,int qryattset,long qryinsid, int actualResultSetType,int actualResultSetConcurrency, @@ -132,6 +135,7 @@ public ClientResultSet newNetResultSet(Agent netAgent, /** return a ClientCallableStatement42 object */ public ClientCallableStatement newCallableStatement(Agent agent, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientConnection connection, String sql,int type,int concurrency, int holdability,ClientPooledConnection cpc) throws SqlException { diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/CodePoint.java b/java/org.apache.derby.client/org/apache/derby/client/net/CodePoint.java index 307c8790b7..cbada4ed0d 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/CodePoint.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/CodePoint.java @@ -22,6 +22,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more package org.apache.derby.client.net; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class CodePoint { // ---------------callable statement codepoints------------------------------- @@ -115,6 +116,7 @@ class CodePoint { // Sync Point Control Request. final static int SYNCCTL = 0x1055; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 // Sync Point Resync Command. final static int SYNCRSY = 0x1069; @@ -172,6 +174,7 @@ class CodePoint { // SQL Data Reply Data. final static int SQLDTARD = 0x2413; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 // SQL Statement. final static int SQLSTT = 0x2414; @@ -497,6 +500,7 @@ class CodePoint { // Open Query Complete. final static int OPNQRYRM = 0x2205; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 // End of Query. final static int ENDQRYRM = 0x220B; @@ -509,6 +513,7 @@ class CodePoint { // RDB Result Set Reply Message. final static int RSLSETRM = 0x2219; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 //----------------------------fdoca code points------------------------------- diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/CodePointNameTable.java b/java/org.apache.derby.client/org/apache/derby/client/net/CodePointNameTable.java index 60d84b4591..e89a2383a0 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/CodePointNameTable.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/CodePointNameTable.java @@ -30,8 +30,10 @@ Licensed to the Apache Software Foundation (ASF) under one or more // This data type may be modified for performance to adapt to any sort of lookup implementation, // such as binary search on an underlying sorted array. +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class CodePointNameTable extends Hashtable { CodePointNameTable() { +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 put(CodePoint.ACCSECRD, "ACCSECRD"); put(CodePoint.TYPDEFNAM, "TYPDEFNAM"); put(CodePoint.TYPDEFOVR, "TYPDEFOVR"); @@ -94,6 +96,7 @@ class CodePointNameTable extends Hashtable { } String lookup(int codePoint) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 return get(codePoint); } } diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/ConnectionReply.java b/java/org.apache.derby.client/org/apache/derby/client/net/ConnectionReply.java index 46e393b12e..e4b7b70ab1 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/ConnectionReply.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/ConnectionReply.java @@ -26,9 +26,11 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.client.am.SqlException; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class ConnectionReply { private ConnectionReplyInterface materialConnectionReply_; Agent agent_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ConnectionReply( Agent agent, @@ -38,6 +40,7 @@ class ConnectionReply { materialConnectionReply_ = materialConnectionReply; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void readCommitSubstitute(ConnectionCallbackInterface connection) throws SqlException { materialConnectionReply_.readCommitSubstitute(connection); diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/ConnectionRequestInterface.java b/java/org.apache.derby.client/org/apache/derby/client/net/ConnectionRequestInterface.java index 98b3c2e4b2..0dc5d29b3d 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/ConnectionRequestInterface.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/ConnectionRequestInterface.java @@ -32,6 +32,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more interface ConnectionRequestInterface { public void writeCommitSubstitute(NetConnection connection) throws SqlException; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 public void writeLocalCommit(NetConnection connection) throws SqlException; diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/EbcdicCcsidManager.java b/java/org.apache.derby.client/org/apache/derby/client/net/EbcdicCcsidManager.java index 8c99457725..2a3f36b45e 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/EbcdicCcsidManager.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/EbcdicCcsidManager.java @@ -34,6 +34,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more * should be fine since this class is intended for converting DDM Parameter data only. */ class EbcdicCcsidManager extends CcsidManager { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 private static final int[] conversionArrayToEbcdic = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0037, 0x002d, 0x002e, 0x002f @@ -130,7 +131,9 @@ public EbcdicCcsidManager() { } public byte[] convertFromJavaString(String sourceString, Agent agent) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-5068 CharBuffer src = CharBuffer.wrap(sourceString); ByteBuffer dest = ByteBuffer.allocate(sourceString.length()); startEncoding(); @@ -168,6 +171,7 @@ public boolean encode(CharBuffer src, ByteBuffer dest, Agent agent) } } +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 String convertToJavaString(byte[] sourceBytes, int offset, int numToConvert) { int i = 0, j = 0; char[] theChars = new char[numToConvert]; diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/EncodedInputStream.java b/java/org.apache.derby.client/org/apache/derby/client/net/EncodedInputStream.java index d2f2fe7159..95ab9f324d 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/EncodedInputStream.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/EncodedInputStream.java @@ -54,6 +54,7 @@ public final class EncodedInputStream extends InputStream { */ public static EncodedInputStream createUTF8Stream(Reader reader) { return new EncodedInputStream(reader, +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 UTF_8, BUFFERED_CHAR_LEN, BUFFERED_CHAR_LEN*3); @@ -67,6 +68,7 @@ public static EncodedInputStream createUTF8Stream(Reader reader) { */ static EncodedInputStream createUTF16BEStream(Reader reader) { return new EncodedInputStream(reader, +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 UTF_16BE, BUFFERED_CHAR_LEN, BUFFERED_CHAR_LEN*2); @@ -94,16 +96,19 @@ static EncodedInputStream createUTF16BEStream(Reader reader) { * holding the encoded bytes */ private EncodedInputStream(Reader reader, +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 Charset encoding, int charBufferSize, int initialByteBufferSize) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 reader_ = reader; decodedBuffer_ = new char[charBufferSize]; encodedOutputStream_ = new PublicBufferOutputStream( initialByteBufferSize); +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 encodedStreamWriter_ = new OutputStreamWriter(encodedOutputStream_, encoding); diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetAgent.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetAgent.java index 108a4fa07d..7e5fa49ec0 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetAgent.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetAgent.java @@ -44,6 +44,7 @@ public class NetAgent extends Agent { //---------------------navigational members----------------------------------- // All these request objects point to the same physical request object. +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ConnectionRequestInterface connectionRequest_; StatementRequestInterface statementRequest_; ResultSetRequestInterface resultSetRequest_; @@ -66,6 +67,7 @@ public class NetAgent extends Agent { // Alias for (Request) super.*Request, all in one // In the case of the NET implementation, these all point to the same physical request object. private Request request_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 NetConnectionRequest netConnectionRequest_; private NetPackageRequest netPackageRequest_; private NetStatementRequest netStatementRequest_; @@ -95,6 +97,7 @@ public class NetAgent extends Agent { // TODO: Remove target? Keep just one CcsidManager? //public CcsidManager targetCcsidManager_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Typdef typdef_; Typdef targetTypdef_; Typdef originalTargetTypdef_; // added to support typdef overrides @@ -118,6 +121,7 @@ public class NetAgent extends Agent { // Only used for testing public NetAgent(NetConnection netConnection, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 LogWriter logWriter) throws SqlException { super(netConnection, logWriter); this.netConnection_ = netConnection; @@ -135,6 +139,7 @@ public NetAgent(NetConnection netConnection, port_ = port; netConnection_ = netConnection; clientSSLMode_ = clientSSLMode; +//IC see: https://issues.apache.org/jira/browse/DERBY-2356 if (server_ == null) { throw new DisconnectException(this, @@ -143,11 +148,13 @@ public NetAgent(NetConnection netConnection, } try { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 socket_ = (Socket)AccessController.doPrivileged( new OpenSocketAction(server, port, clientSSLMode_)); } catch (PrivilegedActionException e) { throw new DisconnectException(this, new ClientMessageId(SQLState.CONNECT_UNABLE_TO_CONNECT_TO_SERVER), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e.getException(), e.getException().getClass().getName(), server, port, e.getException().getMessage()); @@ -160,6 +167,7 @@ public NetAgent(NetConnection netConnection, socket_.setKeepAlive(true); // PROTOCOL Manual: TCP/IP connection allocation rule #2 socket_.setSoTimeout(loginTimeout * 1000); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (SocketException e) { try { socket_.close(); @@ -175,6 +183,7 @@ public NetAgent(NetConnection netConnection, rawSocketOutputStream_ = socket_.getOutputStream(); rawSocketInputStream_ = socket_.getInputStream(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (IOException e) { try { socket_.close(); @@ -182,6 +191,7 @@ public NetAgent(NetConnection netConnection, } exceptionOpeningSocket_ = new DisconnectException(this, new ClientMessageId(SQLState.CONNECT_UNABLE_TO_OPEN_SOCKET_STREAM), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, e.getMessage()); } @@ -189,6 +199,7 @@ public NetAgent(NetConnection netConnection, utf8CcsidManager_ = new Utf8CcsidManager(); currentCcsidManager_ = ebcdicCcsidManager_; +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 if (netConnection_.isXAConnection()) { NetXAConnectionReply netXAConnectionReply_ = new NetXAConnectionReply(this, netConnection_.commBufferSize_); @@ -205,6 +216,8 @@ public NetAgent(NetConnection netConnection, statementReply_ = (StatementReply) resultSetReply_; packageReply_ = (ConnectionReply) statementReply_; connectionReply_ = (ConnectionReply) packageReply_; +//IC see: https://issues.apache.org/jira/browse/DERBY-728 +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 NetXAConnectionRequest netXAConnectionRequest_ = new NetXAConnectionRequest(this, netConnection_.commBufferSize_); netResultSetRequest_ = (NetResultSetRequest) netXAConnectionRequest_; netStatementRequest_ = (NetStatementRequest) netResultSetRequest_; @@ -229,6 +242,8 @@ public NetAgent(NetConnection netConnection, statementReply_ = (StatementReply) resultSetReply_; packageReply_ = (ConnectionReply) statementReply_; connectionReply_ = (ConnectionReply) packageReply_; +//IC see: https://issues.apache.org/jira/browse/DERBY-728 +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 netResultSetRequest_ = new NetResultSetRequest(this, netConnection_.commBufferSize_); netStatementRequest_ = (NetStatementRequest) netResultSetRequest_; netPackageRequest_ = (NetPackageRequest) netStatementRequest_; @@ -256,6 +271,7 @@ protected void resetAgent_(LogWriter netLogWriter, // Set TCP/IP Socket Properties try { socket_.setSoTimeout(loginTimeout * 1000); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (SocketException e) { try { socket_.close(); @@ -301,6 +317,7 @@ public void close_() throws SqlException { // changing {4} to e.getMessage() may require pub changes accumulatedExceptions = new SqlException(logWriter_, new ClientMessageId(SQLState.COMMUNICATION_ERROR), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, e.getMessage()); } finally { rawSocketInputStream_ = null; @@ -310,6 +327,8 @@ public void close_() throws SqlException { if (rawSocketOutputStream_ != null) { try { rawSocketOutputStream_.close(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (IOException e) { // note when {6} = 0 it indicates the socket was closed. // this should be ok since we are going to go an close the socket @@ -317,6 +336,7 @@ public void close_() throws SqlException { // changing {4} to e.getMessage() may require pub changes SqlException latestException = new SqlException(logWriter_, new ClientMessageId(SQLState.COMMUNICATION_ERROR), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, e.getMessage()); accumulatedExceptions = Utils.accumulateSQLException(latestException, accumulatedExceptions); } finally { @@ -327,6 +347,7 @@ public void close_() throws SqlException { if (socket_ != null) { try { socket_.close(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (IOException e) { // again {6} = 0, indicates the socket was closed. // maybe set {4} to e.getMessage(). @@ -334,6 +355,9 @@ public void close_() throws SqlException { // add this to the message pubs. SqlException latestException = new SqlException(logWriter_, new ClientMessageId(SQLState.COMMUNICATION_ERROR), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, e.getMessage()); accumulatedExceptions = Utils.accumulateSQLException(latestException, accumulatedExceptions); } finally { @@ -359,6 +383,7 @@ public void close_() throws SqlException { * infinite timeout. */ protected void setTimeout(int timeout) { +//IC see: https://issues.apache.org/jira/browse/DERBY-1090 try { // Sets a timeout on the socket socket_.setSoTimeout(timeout * 1000); // convert to milliseconds @@ -404,7 +429,9 @@ protected int getTimeout() { private void sendRequest() throws DisconnectException { try { request_.flush(rawSocketOutputStream_); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (IOException e) { +//IC see: https://issues.apache.org/jira/browse/DERBY-846 throwCommunicationsFailure(e); } } @@ -414,6 +441,7 @@ public InputStream getInputStream() { } public CcsidManager getCurrentCcsidManager() { +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 return currentCcsidManager_; } @@ -421,6 +449,7 @@ public OutputStream getOutputStream() { return rawSocketOutputStream_; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void setInputStream(InputStream inputStream) { rawSocketInputStream_ = inputStream; } @@ -429,6 +458,7 @@ void setOutputStream(OutputStream outputStream) { rawSocketOutputStream_ = outputStream; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void throwCommunicationsFailure(Throwable cause) throws DisconnectException { //DisconnectException @@ -438,6 +468,7 @@ void throwCommunicationsFailure(Throwable cause) accumulateChainBreakingReadExceptionAndThrow( new DisconnectException(this, new ClientMessageId(SQLState.COMMUNICATION_ERROR), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 cause, cause.getMessage())); } @@ -512,6 +543,8 @@ private void readDeferredResetConnection() throws SqlException { netConnection_.readDeferredReset(); checkForExceptions(); } catch (SqlException sqle) { +//IC see: https://issues.apache.org/jira/browse/DERBY-846 +//IC see: https://issues.apache.org/jira/browse/DERBY-846 DisconnectException de = new DisconnectException(this, new ClientMessageId(SQLState.CONNECTION_FAILED_ON_DEFERRED_RESET)); de.setNextException(sqle); @@ -520,6 +553,7 @@ private void readDeferredResetConnection() throws SqlException { } protected void beginReadChain(ClientStatement statement) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SqlException { // Clear here as endWriteChain may not always be called writeChainIsDirty_ = false; @@ -537,13 +571,16 @@ protected void beginReadChainOutsideUOW() throws SqlException { /** * Switches the current CCSID manager to UTF-8 */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void switchToUtf8CcsidMgr() { +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 currentCcsidManager_ = utf8CcsidManager_; } /** * Switches the current CCSID manager to EBCDIC */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void switchToEbcdicMgr() { currentCcsidManager_ = ebcdicCcsidManager_; } diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetCallableStatement.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetCallableStatement.java index 7a04f6997d..c4bca015cd 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetCallableStatement.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetCallableStatement.java @@ -26,10 +26,12 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.client.ClientAutoloadedDriver; import org.apache.derby.client.ClientPooledConnection; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class NetCallableStatement extends NetPreparedStatement implements MaterialPreparedStatement { ClientCallableStatement callableStatement_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 //-----------------------------state------------------------------------------ @@ -71,7 +73,9 @@ private void initNetCallableStatement(ClientCallableStatement statement) { int type, int concurrency, int holdability, +//IC see: https://issues.apache.org/jira/browse/DERBY-941 ClientPooledConnection cpc) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 this(ClientAutoloadedDriver.getFactory().newCallableStatement(netAgent, netConnection, sql, type, concurrency, holdability,cpc), netAgent, diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetConfiguration.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetConfiguration.java index 2a88f36801..c65af4c443 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetConfiguration.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetConfiguration.java @@ -172,6 +172,7 @@ public class NetConfiguration { // mm = minor version // x = protocol MaintenanceVersion +//IC see: https://issues.apache.org/jira/browse/DERBY-499 String prdId = DRDAConstants.DERBY_DRDA_CLIENT_ID; if (majorVersion < 10) { prdId += "0"; diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetConnection.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetConnection.java index 71c80086e1..559acf96de 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetConnection.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetConnection.java @@ -113,6 +113,7 @@ public class NetConnection extends ClientConnection { // for example, the product id (prdid) would give this driver an idea of // what type of sevrer it is connected to. String targetSrvclsnm_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 // Server Product Release Level of the target server returned in excsatrd. // specifies the procuct release level of a ddm server. @@ -142,6 +143,7 @@ public class NetConnection extends ClientConnection { // Correlation Token of the source sent to the server in the accrdb. // It is saved like the prddta in case it is needed for a connect reflow. byte[] crrtkn_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 // The Secmec used by the target. // It contains the negotiated security mechanism for the connection. @@ -189,14 +191,19 @@ private String getDeferredResetPassword() { //---------------------constructors/finalizer--------------------------------- // For jdbc 1 connections +//IC see: https://issues.apache.org/jira/browse/DERBY-1028 NetConnection(LogWriter logWriter, int driverManagerLoginTimeout, String serverName, int portNumber, String databaseName, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Properties properties) throws SqlException { super(logWriter, driverManagerLoginTimeout, serverName, portNumber, databaseName, properties); +//IC see: https://issues.apache.org/jira/browse/DERBY-3441 +//IC see: https://issues.apache.org/jira/browse/DERBY-3441 this.pooledConnection_ = null; this.closeStatementsOnClose = true; netAgent_ = (NetAgent) super.agent_; @@ -204,24 +211,32 @@ private String getDeferredResetPassword() { throw netAgent_.exceptionOpeningSocket_; } checkDatabaseName(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 String password = BasicClientDataSource.getPassword(properties); securityMechanism_ = BasicClientDataSource.getSecurityMechanism(properties); flowConnect(password, securityMechanism_); +//IC see: https://issues.apache.org/jira/browse/DERBY-374 if(!isConnectionNull()) +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 completeConnect(); //DERBY-2026. reset timeout after connection is made netAgent_.setTimeout(0); } // For JDBC 2 Connections +//IC see: https://issues.apache.org/jira/browse/DERBY-1028 NetConnection(LogWriter logWriter, String user, String password, +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 BasicClientDataSource dataSource, int rmId, boolean isXAConn) throws SqlException { super(logWriter, user, password, isXAConn, dataSource); +//IC see: https://issues.apache.org/jira/browse/DERBY-3441 +//IC see: https://issues.apache.org/jira/browse/DERBY-3441 +//IC see: https://issues.apache.org/jira/browse/DERBY-3441 this.pooledConnection_ = null; this.closeStatementsOnClose = true; netAgent_ = (NetAgent) super.agent_; @@ -248,21 +263,28 @@ private String getDeferredResetPassword() { * @throws SqlException */ +//IC see: https://issues.apache.org/jira/browse/DERBY-1028 NetConnection(LogWriter logWriter, +//IC see: https://issues.apache.org/jira/browse/DERBY-941 String user, String password, +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 BasicClientDataSource dataSource, int rmId, boolean isXAConn, ClientPooledConnection cpc) throws SqlException { super(logWriter, user, password, isXAConn, dataSource); netAgent_ = (NetAgent) super.agent_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 initialize(password, dataSource, isXAConn); this.pooledConnection_=cpc; +//IC see: https://issues.apache.org/jira/browse/DERBY-3441 this.closeStatementsOnClose = !cpc.isStatementPoolingEnabled(); } private void initialize(String password, +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 BasicClientDataSource dataSource, boolean isXAConn) throws SqlException { securityMechanism_ = dataSource.getSecurityMechanism(password); @@ -278,6 +300,7 @@ private void initialize(String password, // and it's not a subsubprotocol recognized by our drivers. // If so, bail out here. if(!isConnectionNull()) { +//IC see: https://issues.apache.org/jira/browse/DERBY-2498 completeConnect(); } else @@ -442,6 +465,8 @@ private void flowSimpleConnect() throws SqlException { // is returned in one of the connect flows. open_ = false; +//IC see: https://issues.apache.org/jira/browse/DERBY-6094 +//IC see: https://issues.apache.org/jira/browse/DERBY-6094 handleLoginTimeout( e ); // logWriter may be closed in agent_.close(), @@ -455,6 +480,8 @@ private void flowSimpleConnect() throws SqlException { { exceptionToBeThrown = new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.JAVA_EXCEPTION), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, e.getClass().getName(), e.getMessage()); } @@ -471,10 +498,12 @@ private void flowSimpleConnect() throws SqlException { /** Handle socket timeouts during connection attempts */ private void handleLoginTimeout( Throwable original ) +//IC see: https://issues.apache.org/jira/browse/DERBY-6094 throws SqlException { for ( Throwable cause = original; cause != null; cause = cause.getCause() ) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if ( cause instanceof SocketTimeoutException ) { throw new SqlException @@ -484,6 +513,7 @@ private void handleLoginTimeout( Throwable original ) } private boolean flowReconnect(String password, int securityMechanism) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SqlException { constructExtnam(); // these calls need to be after newing up the agent @@ -530,6 +560,7 @@ private boolean flowReconnect(String password, int securityMechanism) default: throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.SECMECH_NOT_SUPPORTED), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 securityMechanism); } } catch (SqlException sqle) { // this may not be needed because on method up the stack @@ -673,6 +704,7 @@ private void flowServerAttributes() throws SqlException { targetCmnappc_, targetXamgr_, targetSyncptmgr_, +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 targetRsyncmgr_, targetUnicodemgr_); agent_.flowOutsideUOW(); @@ -753,6 +785,7 @@ private void writeServerAttributesAndKeyExchange(int securityMechanism, targetCmnappc_, targetXamgr_, targetSyncptmgr_, +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 targetRsyncmgr_, targetUnicodemgr_); netAgent_.netConnectionRequest_.writeAccessSecurity(securityMechanism, @@ -779,6 +812,7 @@ private void writeSecurityCheckAndAccessRdb(int securityMechanism, netAgent_.netConnectionRequest_.writeAccessDatabase(databaseName_, false, crrtkn_, +//IC see: https://issues.apache.org/jira/browse/DERBY-5068 prddta_.array(), netAgent_.typdef_); } @@ -790,6 +824,7 @@ private void readSecurityCheckAndAccessRdb() throws SqlException { void writeDeferredReset() throws SqlException { // NetConfiguration.SECMEC_USRIDPWD +//IC see: https://issues.apache.org/jira/browse/DERBY-3421 if (securityMechanism_ == NetConfiguration.SECMEC_USRIDPWD) { writeAllConnectCommandsChained(NetConfiguration.SECMEC_USRIDPWD, user_, @@ -873,6 +908,7 @@ void readDeferredReset() throws SqlException { //-------------------parse callback methods-------------------------------- +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void setServerAttributeData(String srvclsnm, String srvrlslv) { targetSrvclsnm_ = srvclsnm; // since then can be optionally returned from the @@ -912,6 +948,7 @@ void setAccessSecurityData(int secchkcd, // a security token is required for USRENCPWD, or EUSRIDPWD. if (!sectknReceived) { +//IC see: https://issues.apache.org/jira/browse/DERBY-1350 agent_.accumulateChainBreakingReadExceptionAndThrow( new DisconnectException(agent_, new ClientMessageId(SQLState.NET_SECTKN_NOT_RETURNED))); @@ -933,6 +970,7 @@ void setAccessSecurityData(int secchkcd, // will be surfaced by endReadChain // agent_.accumulateChainBreakingReadExceptionAndThrow ( // new DisconnectException (agent_,"secmec not supported ","0000", -999)); +//IC see: https://issues.apache.org/jira/browse/DERBY-846 agent_.accumulateReadException(new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.NET_SECKTKN_NOT_RETURNED))); } @@ -963,13 +1001,16 @@ void rdbAccessed(int svrcod, //-------------------Abstract object factories-------------------------------- protected Agent newAgent_( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 LogWriter logWriter, int loginTimeout, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 String serverName, int portNumber, int clientSSLMode) throws SqlException { return new NetAgent(this, +//IC see: https://issues.apache.org/jira/browse/DERBY-1028 logWriter, loginTimeout, serverName, @@ -987,11 +1028,13 @@ protected ClientStatement newStatement_( } protected void resetStatement_( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientStatement statement, int type, int concurrency, int holdability) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ((NetStatement) statement.getMaterialStatement()).resetNetStatement(netAgent_, this, type, concurrency, holdability); } @@ -1001,6 +1044,7 @@ protected ClientPreparedStatement newPositionedUpdatePreparedStatement_( //passing the pooledConnection_ object which will be used to raise //StatementEvents to the PooledConnection +//IC see: https://issues.apache.org/jira/browse/DERBY-941 return new NetPreparedStatement(netAgent_, this, sql, section,pooledConnection_).preparedStatement_; } @@ -1025,6 +1069,7 @@ protected void resetPreparedStatement_(ClientPreparedStatement ps, int resultSetConcurrency, int resultSetHoldability, int autoGeneratedKeys, +//IC see: https://issues.apache.org/jira/browse/DERBY-2653 String[] columnNames, int[] columnIndexes) throws SqlException { ((NetPreparedStatement) ps.materialPreparedStatement_).resetNetPreparedStatement(netAgent_, this, sql, resultSetType, resultSetConcurrency, @@ -1033,6 +1078,7 @@ protected void resetPreparedStatement_(ClientPreparedStatement ps, protected ClientCallableStatement newCallableStatement_( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 String sql, int type, int concurrency, @@ -1040,6 +1086,7 @@ protected ClientCallableStatement newCallableStatement_( //passing the pooledConnection_ object which will be used to raise //StatementEvents to the PooledConnection +//IC see: https://issues.apache.org/jira/browse/DERBY-941 return new NetCallableStatement(netAgent_, this, sql, type, concurrency, holdability,pooledConnection_).callableStatement_; } @@ -1053,6 +1100,7 @@ protected void resetCallableStatement_(ClientCallableStatement cs, protected ClientDatabaseMetaData newDatabaseMetaData_() { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 return ClientAutoloadedDriver.getFactory().newNetDatabaseMetaData(netAgent_, this); } @@ -1072,6 +1120,7 @@ private void checkUserLength(String user) throws SqlException { if ((usridLength == 0) || (usridLength > NetConfiguration.USRID_MAXSIZE)) { throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.CONNECT_USERID_LENGTH_OUT_OF_RANGE), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 usridLength, NetConfiguration.USRID_MAXSIZE); } } @@ -1081,6 +1130,7 @@ private void checkPasswordLength(String password) throws SqlException { if ((passwordLength == 0) || (passwordLength > NetConfiguration.PASSWORD_MAXSIZE)) { throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.CONNECT_PASSWORD_LENGTH_OUT_OF_RANGE), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 passwordLength, NetConfiguration.PASSWORD_MAXSIZE); } } @@ -1096,6 +1146,7 @@ private void checkUser(String user) throws SqlException { private void checkUserPassword(String user, String password) throws SqlException { checkUser(user); if (password == null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-846 throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.CONNECT_PASSWORD_ISNULL)); } @@ -1124,6 +1175,8 @@ private void checkSecmgrForSecmecSupport(int securityMechanism) throws SqlExcept if (!secmecSupported) { throw new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.SECMECH_NOT_SUPPORTED), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 securityMechanism); } } @@ -1142,6 +1195,7 @@ private SqlException mapSecchkcd(int secchkcd) { switch (secchkcd) { case CodePoint.SECCHKCD_01: // ERROR SVRCOD return new SqlException(agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-846 new ClientMessageId(SQLState.NET_CONNECT_AUTH_FAILED), msgutil.getTextMessage(MessageId.CONN_SECMECH_NOT_SUPPORTED)); case CodePoint.SECCHKCD_10: // ERROR SVRCOD @@ -1206,10 +1260,12 @@ protected void constructCrrtkn() throws SqlException { if (crrtkn_ == null) { crrtkn_ = new byte[19]; } else { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Arrays.fill(crrtkn_, (byte) 0); } byte [] localAddressBytes = netAgent_.socket_.getLocalAddress().getAddress(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 // IP addresses are returned in a 4 byte array. // Obtain the character representation of each half byte. @@ -1225,6 +1281,7 @@ protected void constructCrrtkn() throws SqlException { // the characters 'G' thro 'P'(in order to use the crrtkn as the LUWID when using // SNA in a hop site). For example, 0 is mapped to G, 1 is mapped H,etc. if (i == 0) { +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 crrtkn_[j] = netAgent_.getCurrentCcsidManager().numToSnaRequiredCrrtknChar_[halfByte]; } else { crrtkn_[j] = netAgent_.getCurrentCcsidManager().numToCharRepresentation_[halfByte]; @@ -1244,6 +1301,7 @@ protected void constructCrrtkn() throws SqlException { int num = netAgent_.socket_.getLocalPort(); int halfByte = (num >> 12) & 0x0f; +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 crrtkn_[9] = netAgent_.getCurrentCcsidManager().numToSnaRequiredCrrtknChar_[halfByte]; halfByte = (num >> 8) & 0x0f; crrtkn_[10] = netAgent_.getCurrentCcsidManager().numToCharRepresentation_[halfByte]; @@ -1257,6 +1315,7 @@ protected void constructCrrtkn() throws SqlException { // If the new time stamp is the // same as one of the already created ones, then recreate the time stamp. long time = System.currentTimeMillis(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 for (int i = 0; i < 6; i++) { // store 6 bytes of 8 byte time into crrtkn @@ -1268,6 +1327,7 @@ protected void constructCrrtkn() throws SqlException { private void constructExtnam() throws SqlException { /* Construct the EXTNAM based on the thread name */ char[] chars = Thread.currentThread().getName().toCharArray(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 /* DERBY-4584: Replace non-EBCDIC characters (> 0xff) with '?' */ for (int i = 0; i < chars.length; i++) { @@ -1278,9 +1338,11 @@ private void constructExtnam() throws SqlException { private void constructPrddta() throws SqlException { if (prddta_ == null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5068 prddta_ = ByteBuffer.allocate(NetConfiguration.PRDDTA_MAXSIZE); } else { prddta_.clear(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Arrays.fill(prddta_.array(), (byte) 0); } @@ -1354,6 +1416,7 @@ private void initializeClientSeed() throws SqlException { } private byte[] encryptedPasswordForUSRENCPWD(String password) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 return encryptionManager_.encryptData(netAgent_.getCurrentCcsidManager().convertFromJavaString(password, netAgent_), NetConfiguration.SECMEC_USRENCPWD, netAgent_.getCurrentCcsidManager().convertFromJavaString(user_, netAgent_), @@ -1392,6 +1455,7 @@ private byte[] passwordSubstituteForUSRSSBPWD(String password) throws SqlExcepti String dataSourceUserName = dataSource_.getUser(); if (!dataSourceUserName.equals("") && userName.equalsIgnoreCase( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientDataSourceInterface.propertyDefault_user) && !dataSourceUserName.equalsIgnoreCase( ClientDataSourceInterface.propertyDefault_user)) @@ -1501,6 +1565,7 @@ protected boolean isGlobalPending_() { } protected boolean doCloseStatementsOnClose_() { +//IC see: https://issues.apache.org/jira/browse/DERBY-3441 return closeStatementsOnClose; } @@ -1532,6 +1597,9 @@ protected boolean allowCloseInUOW_() { // Allow local COMMIT/ROLLBACK only if we are not in an XA transaction protected boolean allowLocalCommitRollback_() { +//IC see: https://issues.apache.org/jira/browse/DERBY-966 +//IC see: https://issues.apache.org/jira/browse/DERBY-1005 +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 if (getXAState() == XA_T0_NOT_ASSOCIATED) { return true; } @@ -1556,6 +1624,7 @@ public OutputStream getOutputStream() { public void writeTransactionStart(ClientStatement statement) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SqlException { } @@ -1565,7 +1634,9 @@ public void readTransactionStart() throws SqlException { public void setIndoubtTransactions( List indoubtTransactions) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-1192 if (isXAConnection_) { if (indoubtTransactions_ != null) { indoubtTransactions_.clear(); @@ -1574,12 +1645,14 @@ public void setIndoubtTransactions( } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Xid[] getIndoubtTransactionIds() { Xid[] result = new Xid[0]; return indoubtTransactions_.toArray(result); } public SectionManager newSectionManager +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 (Agent agent) { return new SectionManager(agent); } @@ -1596,6 +1669,8 @@ public boolean willAutoCommitGenerateFlow() { int xaState = getXAState(); +//IC see: https://issues.apache.org/jira/browse/DERBY-339 +//IC see: https://issues.apache.org/jira/browse/DERBY-246 if (xaState == XA_T0_NOT_ASSOCIATED) { doCommit = true; } @@ -1612,6 +1687,7 @@ public EncryptionManager getEncryptionManager() { } public byte[] getTargetPublicKey() { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return targetPublicKey_ != null ? targetPublicKey_.clone() : null; @@ -1625,6 +1701,8 @@ public String getProductID() { * @return Returns the connectionNull. */ public final boolean isConnectionNull() { +//IC see: https://issues.apache.org/jira/browse/DERBY-374 +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 return connectionNull; } /** @@ -1640,7 +1718,9 @@ public void setConnectionNull(boolean connectionNull) { * * @return true if QRYCLSIMP is fully supported */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final boolean serverSupportsQryclsimp() { +//IC see: https://issues.apache.org/jira/browse/DERBY-821 NetDatabaseMetaData metadata = (NetDatabaseMetaData) databaseMetaData_; return metadata.serverSupportsQryclsimp(); @@ -1672,6 +1752,7 @@ public final boolean serverSupportLongRDBNAM() { */ protected final boolean supportsSessionDataCaching() { +//IC see: https://issues.apache.org/jira/browse/DERBY-3192 NetDatabaseMetaData metadata = (NetDatabaseMetaData) databaseMetaData_; @@ -1683,6 +1764,7 @@ protected final boolean supportsSessionDataCaching() { * @return true if the server supports the UTF-8 Ccsid Manager */ protected final boolean serverSupportsUtf8Ccsid() { +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 return targetUnicodemgr_ == CcsidManager.UTF8_CCSID; } @@ -1699,6 +1781,7 @@ protected final boolean serverSupportsUDTs() { } protected final boolean serverSupportsEXTDTAAbort() { +//IC see: https://issues.apache.org/jira/browse/DERBY-2017 NetDatabaseMetaData metadata = (NetDatabaseMetaData) databaseMetaData_; @@ -1713,6 +1796,7 @@ protected final boolean serverSupportsEXTDTAAbort() { protected final boolean serverSupportsLocators() { // Support for locators was added in the same version as layer B // streaming. +//IC see: https://issues.apache.org/jira/browse/DERBY-3571 return serverSupportsLayerBStreaming(); } @@ -1763,6 +1847,7 @@ protected void readXARollback_() throws SqlException { protected void writeXATransactionStart(ClientStatement statement) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SqlException { xares_.netXAConn_.writeTransactionStart(statement); } @@ -1770,6 +1855,7 @@ protected void writeXATransactionStart(ClientStatement statement) // JDBC 4.0 methods public Array createArrayOf(String typeName, Object[] elements) +//IC see: https://issues.apache.org/jira/browse/DERBY-6213 throws SQLException { throw SQLExceptionFactory.notImplemented ("createArrayOf(String,Object[])"); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetConnectionReply.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetConnectionReply.java index 4cf78236a6..e206e44955 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetConnectionReply.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetConnectionReply.java @@ -42,6 +42,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.shared.common.sanity.SanityManager; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class NetConnectionReply extends Reply implements ConnectionReplyInterface { private static MessageUtil msgutil_ = SqlException.getMessageUtil(); @@ -51,6 +52,7 @@ class NetConnectionReply extends Reply } // NET only entry point +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void readExchangeServerAttributes(ClientConnection connection) throws SqlException { startSameIdChainParse(); @@ -60,6 +62,7 @@ void readExchangeServerAttributes(ClientConnection connection) } // NET only entry point +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void readAccessSecurity(ClientConnection connection, int securityMechanism) throws SqlException { startSameIdChainParse(); @@ -69,6 +72,7 @@ void readAccessSecurity(ClientConnection connection, } // NET only entry point +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void readSecurityCheck(ClientConnection connection) throws SqlException { startSameIdChainParse(); parseSECCHKreply((NetConnection) connection); @@ -77,6 +81,7 @@ void readSecurityCheck(ClientConnection connection) throws SqlException { } // NET only entry point +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void readAccessDatabase(ClientConnection connection) throws SqlException { startSameIdChainParse(); parseACCRDBreply((NetConnection) connection); @@ -114,6 +119,7 @@ public void readLocalXARollback(ConnectionCallbackInterface connection) throws D } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void readXaStartUnitOfWork(NetConnection conn) throws DisconnectException { } @@ -166,6 +172,8 @@ private void parseRDBCMMreply(ConnectionCallbackInterface connection) throws Dis // for the rdbrllbck command. private void parseRDBRLLBCKreply(ConnectionCallbackInterface connection) throws DisconnectException { parseTypdefsOrMgrlvlovrs(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 parseENDUOWRM(connection); int peekCP = parseTypdefsOrMgrlvlovrs(); @@ -216,6 +224,7 @@ private void parseACCSECreply(NetConnection netConnection, int securityMechanism peekCP = peekCodePoint(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (SanityManager.DEBUG) { if (peekCP != Reply.END_OF_SAME_ID_CHAIN) { SanityManager.THROWASSERT("expected END_OF_SAME_ID_CHAIN"); @@ -243,6 +252,7 @@ private void parseSECCHKreply(NetConnection netConnection) throws DisconnectExce // incorrect but consider it a conversation protocol error // 0x03 - OBJDSS sent when not allowed. //parseSECTKN (true); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 parseSECTKN(false); } } @@ -296,6 +306,7 @@ int parseTypdefsOrMgrlvlovrs() throws DisconnectException { //-----------------------------parse DDM Reply Messages----------------------- private void parseCommitError(ConnectionCallbackInterface connection) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws DisconnectException { int peekCP = peekCodePoint(); switch (peekCP) { @@ -439,6 +450,7 @@ void parseCommonError(int peekCP) throws DisconnectException { * */ private NetSqlca parseAbnormalEndUow( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ConnectionCallbackInterface connection, UnitOfWorkListener uwl) throws DisconnectException { @@ -485,6 +497,11 @@ NetSqlca parseAbnormalEndUow(ResultSetCallbackInterface r) throws DisconnectExce } private void parseRdbAccessFailed(NetConnection netConnection) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws DisconnectException { parseRDBAFLRM(); @@ -503,7 +520,9 @@ private void parseRdbAccessFailed(NetConnection netConnection) NetSqlca netSqlca = parseSQLCARD(null); //Check if the SQLCARD has null SQLException +//IC see: https://issues.apache.org/jira/browse/DERBY-374 if(netSqlca.getSqlErrmc() == null) +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 netConnection.setConnectionNull(true); else netConnection.completeSqlca(netSqlca); @@ -801,6 +820,7 @@ void parseENDUOWRM(ConnectionCallbackInterface connection) throws DisconnectExce // RECCNT - optional (MINVAL 0, MINLVL 3) // // Called by all the Reply classesCMDCHKRM +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void parseCMDCHKRM() throws DisconnectException { boolean svrcodReceived = false; int svrcod = CodePoint.SVRCOD_INFO; @@ -852,6 +872,7 @@ void parseCMDCHKRM() throws DisconnectException { new DisconnectException( agent_, new ClientMessageId(SQLState.DRDA_CONNECTION_TERMINATED), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 new SqlException(agent_.logWriter_, netSqlca), msgutil_.getTextMessage(MessageId.CONN_DRDA_CMDCHKRM))); } @@ -925,6 +946,7 @@ void parseRDBNACRM() throws DisconnectException { checkRequiredObjects(svrcodReceived, rdbnamReceived); netAgent_.setSvrcod(svrcod); +//IC see: https://issues.apache.org/jira/browse/DERBY-846 agent_.accumulateChainBreakingReadExceptionAndThrow( new DisconnectException(agent_, new ClientMessageId(SQLState.DRDA_CONNECTION_TERMINATED), @@ -986,6 +1008,7 @@ private void parseRDBNFNRM(NetConnection netConnection) throws DisconnectExcepti netAgent_.setSvrcod(svrcod); agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, +//IC see: https://issues.apache.org/jira/browse/DERBY-846 new ClientMessageId(SQLState.NET_DATABASE_NOT_FOUND), netConnection.databaseName_)); } @@ -1046,6 +1069,7 @@ private void parseRDBATHRM(NetConnection netConnection) throws DisconnectExcepti netAgent_.setSvrcod(svrcod); netAgent_.accumulateReadException(new SqlException(agent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-846 new ClientMessageId(SQLState.NET_CONNECT_AUTH_FAILED), msgutil_.getTextMessage(MessageId.CONN_USER_NOT_AUTHORIZED_TO_DB))); } @@ -1211,6 +1235,7 @@ private void parseRDBACCRM() throws DisconnectException { netAgent_.setSvrcod(svrcod); agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, +//IC see: https://issues.apache.org/jira/browse/DERBY-846 new ClientMessageId(SQLState.DRDA_CONNECTION_TERMINATED), msgutil_.getTextMessage(MessageId.CONN_DRDA_RDBACCRM))); } @@ -1657,6 +1682,7 @@ private void parseMGRLVLRM() throws DisconnectException { // CODPNT - required // RDBNAM - optional (MINLVL 3) // +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void parseCMDNSPRM() throws DisconnectException { boolean svrcodReceived = false; int svrcod = CodePoint.SVRCOD_INFO; @@ -1705,6 +1731,7 @@ void parseCMDNSPRM() throws DisconnectException { netAgent_.setSvrcod(svrcod); agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, +//IC see: https://issues.apache.org/jira/browse/DERBY-846 new ClientMessageId(SQLState.DRDA_DDM_COMMAND_NOT_SUPPORTED), Integer.toHexString(codpnt))); } @@ -1750,6 +1777,7 @@ private void parseABNUOWRM() throws DisconnectException { // not having to convert this to a string is a time saver also. foundInPass = true; rdbnamReceived = checkAndGetReceivedFlag(rdbnamReceived); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 String rdbnam = parseRDBNAM(true); peekCP = peekCodePoint(); } @@ -1842,6 +1870,7 @@ private void parseEXCSATRD(NetConnection netConnection) throws DisconnectExcepti // for logging errors. foundInPass = true; srvnamReceived = checkAndGetReceivedFlag(srvnamReceived); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 parseSRVNAM(); // not used yet peekCP = peekCodePoint(); } @@ -1865,6 +1894,7 @@ private void parseEXCSATRD(NetConnection netConnection) throws DisconnectExcepti } popCollectionStack(); // according the the DDM book, all these instance variables are optional +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 netConnection.setServerAttributeData(srvclsnm, srvrlslv); } @@ -1898,6 +1928,8 @@ private void parseDummyEXCSATRD(NetConnection netConnection) throws DisconnectEx // driver may use it for logging purposes later). foundInPass = true; extnamReceived = checkAndGetReceivedFlag(extnamReceived); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 String extnam = parseEXTNAM(); peekCP = peekCodePoint(); } @@ -2037,6 +2069,7 @@ private void parseACCSECRD(NetConnection netConnection, int securityMechanism) t sectkn); /* Switch to UTF-8 or EBCDIC managers depending on what's supported */ +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 if (netConnection.serverSupportsUtf8Ccsid()) { netConnection.netAgent_.switchToUtf8CcsidMgr(); } else { @@ -2099,6 +2132,7 @@ int parseXARETVAL() throws DisconnectException { } // Process XA return value +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 byte parseSYNCTYPE() throws DisconnectException { return 0; } @@ -2106,6 +2140,7 @@ byte parseSYNCTYPE() throws DisconnectException { // This method handles the parsing of all command replies and reply data // for the SYNCCTL command. int parseSYNCCTLreply(ConnectionCallbackInterface connection) +//IC see: https://issues.apache.org/jira/browse/DERBY-3192 throws DisconnectException { if (peekCodePoint() == CodePoint.PBSD) { parsePBSD(); @@ -2255,6 +2290,7 @@ private void parseMGRLVLLS(NetConnection netConnection) throws DisconnectExcepti } netConnection.targetSyncptmgr_ = managerLevel; break; +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 case CodePoint.UNICODEMGR: if ((managerLevel < NetConfiguration.MIN_UNICODE_MGRLVL) || (managerLevel > netConnection.targetUnicodemgr_)) { @@ -2408,6 +2444,7 @@ private int parseUOWDSP() throws DisconnectException { // Relational Database Name specifies the name of a relational // database of the server. A server can have more than one RDB. +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 String parseRDBNAM(boolean skip) throws DisconnectException { parseLengthAndMatchCodePoint(CodePoint.RDBNAM); if (skip) { @@ -2424,6 +2461,7 @@ int parseXIDCNT() throws DisconnectException { return readUnsignedShort(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Xid parseXID() throws DisconnectException { return null; } @@ -2510,6 +2548,7 @@ int parseSVRCOD(int minSvrcod, int maxSvrcod) throws DisconnectException { } int parseFastSVRCOD(int minSvrcod, int maxSvrcod) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws DisconnectException { matchCodePoint(CodePoint.SVRCOD); @@ -2531,6 +2570,7 @@ int parseFastSVRCOD(int minSvrcod, int maxSvrcod) return svrcod; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 NetSqlca parseSQLCARD(Sqlca[] rowsetSqlca) throws DisconnectException { parseLengthAndMatchCodePoint(CodePoint.SQLCARD); int ddmLength = getDdmLength(); @@ -2609,6 +2649,7 @@ private NetSqlca parseSQLCAGRP(Sqlca[] rowsetSqlca) throws DisconnectException { sqlstate, sqlerrproc); parseSQLCAXGRP(netSqlca); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (netAgent_.targetSqlam_ >= NetConfiguration.MGRLVL_7) { netSqlca.setRowsetRowCount(parseSQLDIAGGRP(rowsetSqlca)); @@ -2705,6 +2746,7 @@ private void parseSQLCAXGRP(NetSqlca netSqlca) throws DisconnectException { netSqlca.setSqlerrd(sqlerrd); netSqlca.setSqlwarnBytes(sqlwarn); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 netSqlca.setSqlerrmcBytes(sqlerrmc); // sqlerrmc may be null } @@ -2729,6 +2771,7 @@ private long parseSQLDIAGGRP(Sqlca[] rowsetSqlca) throws DisconnectException { // this is duplicated in parseColumnMetaData, but different // DAGroup under NETColumnMetaData requires a lot more stuffs including // precsion, scale and other stuffs +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 String parseFastVCS() throws DisconnectException { // doublecheck what readString() does if the length is 0 return readFastString(readFastUnsignedShort(), @@ -2746,6 +2789,7 @@ boolean checkAndGetReceivedFlag(boolean receivedFlag) return true; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void checkRequiredObjects(boolean receivedFlag) throws DisconnectException { if (!receivedFlag) { doSyntaxrmSemantics(CodePoint.SYNERRCD_REQ_OBJ_NOT_FOUND); @@ -2782,11 +2826,13 @@ private void checkRequiredObjects(boolean receivedFlag, private void doObjnsprmSemantics(int codePoint) throws DisconnectException { agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, +//IC see: https://issues.apache.org/jira/browse/DERBY-846 new ClientMessageId(SQLState.DRDA_DDM_OBJECT_NOT_SUPPORTED), Integer.toHexString(codePoint))); } // Also called by NetStatementReply and others +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void doPrmnsprmSemantics(int codePoint) throws DisconnectException { agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, new ClientMessageId(SQLState.DRDA_DDM_PARAM_NOT_SUPPORTED), @@ -2800,6 +2846,7 @@ void doValnsprmSemantics(int codePoint, int value) throws DisconnectException { private void doValnsprmSemantics(int codePoint, String value) throws DisconnectException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 // special case the FDODTA codepoint not to disconnect. if (codePoint == CodePoint.FDODTA) { @@ -2835,6 +2882,7 @@ private void doValnsprmSemantics(int codePoint, String value) } agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, new ClientMessageId(SQLState.DRDA_NO_AVAIL_CODEPAGE_CONVERSION), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 cpValue, value)); return; } @@ -2843,6 +2891,8 @@ private void doValnsprmSemantics(int codePoint, String value) // Returning more information would // require rearranging this code a little. agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, +//IC see: https://issues.apache.org/jira/browse/DERBY-846 +//IC see: https://issues.apache.org/jira/browse/DERBY-846 new ClientMessageId(SQLState.DRDA_DDM_PARAMVAL_NOT_SUPPORTED), Integer.toHexString(codePoint))); } @@ -2869,6 +2919,7 @@ void doDtamchrmSemantics() throws DisconnectException { // is producted for SQL CONNECT statement. private void doMgrlvlrmSemantics(String manager, String level) throws DisconnectException { agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, +//IC see: https://issues.apache.org/jira/browse/DERBY-846 new ClientMessageId(SQLState.DRDA_MGRLVLRM), manager, level)); } @@ -2879,6 +2930,7 @@ private void doMgrlvlrmSemantics(int manager, int level) throws DisconnectExcept } private void doMgrlvlrmSemantics(int[] nameList, int[] levelList) throws DisconnectException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 StringBuilder managerNames = new StringBuilder(100); StringBuilder managerLevels = new StringBuilder(100); @@ -2944,10 +2996,12 @@ private void doMgrlvlrmSemantics(int[] nameList, int[] levelList) throws Disconn // transaction is rolled back and the application is disconnected // from the remote database. private void doPrccnvrmSemantics(int conversationProtocolErrorCode) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws DisconnectException { // we may need to map the conversation protocol error code, prccnvcd, to some kind // of reason code. For now just return the prccnvcd as the reason code agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, +//IC see: https://issues.apache.org/jira/browse/DERBY-846 new ClientMessageId(SQLState.DRDA_CONNECTION_TERMINATED), msgutil_.getTextMessage(MessageId.CONN_DRDA_PRCCNVRM, Integer.toHexString(conversationProtocolErrorCode)))); @@ -3124,6 +3178,7 @@ private int parseSQLDCGRP(Sqlca[] rowsetSqlca, int lastRow) throws DisconnectExc if (rowsetSqlca[sqldcRown] != null) { rowsetSqlca[sqldcRown].resetRowsetSqlca(netAgent_.netConnection_, sqldcCode, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 sqldcState); } else { rowsetSqlca[sqldcRown] = new NetSqlca(netAgent_.netConnection_, @@ -3237,6 +3292,8 @@ private void skipFastNVCMorNVCS() throws DisconnectException { skipFastBytes(vcm_length); } if (readFastUnsignedByte() != CodePoint.NULLDATA) { +//IC see: https://issues.apache.org/jira/browse/DERBY-1350 +//IC see: https://issues.apache.org/jira/browse/DERBY-1350 agent_.accumulateChainBreakingReadExceptionAndThrow( new DisconnectException(agent_, new ClientMessageId( @@ -3304,7 +3361,9 @@ private void parseInitialPBSD(ClientConnection connection) * current schema as an UTF-8 String. * @throws org.apache.derby.client.am.DisconnectException */ +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void parsePBSD() throws DisconnectException { +//IC see: https://issues.apache.org/jira/browse/DERBY-3192 parseLengthAndMatchCodePoint(CodePoint.PBSD); int peekCP = peekCodePoint(); while (peekCP != END_OF_SAME_ID_CHAIN) { @@ -3317,6 +3376,8 @@ void parsePBSD() throws DisconnectException { case CodePoint.PBSD_SCHEMA: netAgent_.netConnection_. completePiggyBackSchema +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 (readString(getDdmLength(), Typdef.UTF8ENCODING)); break; default: diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetConnectionRequest.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetConnectionRequest.java index e53be7a39c..74f9eebb17 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetConnectionRequest.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetConnectionRequest.java @@ -28,9 +28,12 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.client.am.ClientMessageId; import org.apache.derby.shared.common.reference.SQLState; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class NetConnectionRequest extends Request implements ConnectionRequestInterface { +//IC see: https://issues.apache.org/jira/browse/DERBY-728 +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 NetConnectionRequest(NetAgent netAgent, int bufferSize) { super(netAgent, bufferSize); } @@ -161,6 +164,7 @@ void writeXID(int codepoint, Xid xid) throws SqlException { void writeXAFlags(int codepoint, int xaFlags) { } +//IC see: https://issues.apache.org/jira/browse/DERBY-2432 void writeXATimeout(int codepoint, long xaTimeout) { } @@ -246,6 +250,8 @@ private void buildEXCSAT(String externalName, targetSecmgr, targetXamgr, targetSyncptmgr, +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 targetRsyncmgr, targetUnicodemgr); @@ -356,6 +362,7 @@ private void buildACCRDB(String rdbnam, // write the data and pad with the correct number of bytes as needed. // this instance variable is always required. buildRDBNAM(rdbnam,true); +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 // the rdb access manager class specifies an instance of the SQLAM // that accesses the RDB. the sqlam manager class codepoint @@ -434,6 +441,7 @@ private void buildEXTNAM(String extnam) throws SqlException { NetConfiguration.EXTNAM_MAXSIZE); // Writing the truncated string as to preserve previous behavior +//IC see: https://issues.apache.org/jira/browse/DERBY-4009 writeScalarString(CodePoint.EXTNAM, extnam.substring(0, extnamTruncateLength), 0, NetConfiguration.EXTNAM_MAXSIZE, SQLState.NET_EXTNAM_TOO_LONG); } @@ -485,6 +493,8 @@ private void buildRDBNAM(String rdbnam, boolean dontSendOnConversionError) throw // see if we can optimize if (dontSendOnConversionError) { try { +//IC see: https://issues.apache.org/jira/browse/DERBY-728 +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 netAgent_.getCurrentCcsidManager().convertFromJavaString(rdbnam, netAgent_); } catch (SqlException se) { netAgent_.exceptionConvertingRdbnam = se; @@ -506,6 +516,8 @@ private void buildRDBNAM(String rdbnam, boolean dontSendOnConversionError) throw // connect request along with the RDBNAM. int maxRDBlength = NetConfiguration.RDBNAM_MAX_LEN; +//IC see: https://issues.apache.org/jira/browse/DERBY-4009 +//IC see: https://issues.apache.org/jira/browse/DERBY-728 writeScalarString(CodePoint.RDBNAM, rdbnam, NetConfiguration.PKG_IDENTIFIER_FIXED_LEN, //minimum RDBNAM length in bytes maxRDBlength, @@ -515,6 +527,7 @@ private void buildRDBNAM(String rdbnam, boolean dontSendOnConversionError) throw private void buildSECTKN(byte[] sectkn) throws SqlException { if (sectkn.length > NetConfiguration.SECTKN_MAXSIZE) { +//IC see: https://issues.apache.org/jira/browse/DERBY-846 throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.NET_SECTKN_TOO_LONG)); } @@ -523,6 +536,8 @@ private void buildSECTKN(byte[] sectkn) throws SqlException { private void buildUSRID(String usrid) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-4009 +//IC see: https://issues.apache.org/jira/browse/DERBY-728 writeScalarString(CodePoint.USRID, usrid,0,NetConfiguration.USRID_MAXSIZE, SQLState.NET_USERID_TOO_LONG); } @@ -530,6 +545,7 @@ private void buildUSRID(String usrid) throws SqlException { private void buildPASSWORD(String password) throws SqlException { int passwordLength = password.length(); if ((passwordLength == 0) ) { +//IC see: https://issues.apache.org/jira/browse/DERBY-846 throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.NET_PASSWORD_TOO_LONG)); } @@ -537,8 +553,11 @@ private void buildPASSWORD(String password) throws SqlException { // remember the position of password in order to // mask it out in trace (see Request.sendBytes()). passwordIncluded_ = true; +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 passwordStart_ = buffer.position() + 4; } +//IC see: https://issues.apache.org/jira/browse/DERBY-4009 +//IC see: https://issues.apache.org/jira/browse/DERBY-728 writeScalarString(CodePoint.PASSWORD, password, 0, NetConfiguration.PASSWORD_MAXSIZE, SQLState.NET_PASSWORD_TOO_LONG); if (netAgent_.logWriter_ != null) { @@ -605,6 +624,7 @@ private void buildMGRLVLLS(int agent, writeCodePoint4Bytes(CodePoint.SQLAM, sqlam); writeCodePoint4Bytes(CodePoint.RDB, rdb); writeCodePoint4Bytes(CodePoint.SECMGR, secmgr); +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 writeCodePoint4Bytes(CodePoint.UNICODEMGR, unicodemgr); if (netAgent_.netConnection_.isXAConnection()) { diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetCursor.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetCursor.java index b7a4de60c2..704376b99d 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetCursor.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetCursor.java @@ -42,6 +42,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.shared.common.sanity.SanityManager; class NetCursor extends Cursor { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 NetResultSet netResultSet_; private NetAgent netAgent_; @@ -57,6 +58,7 @@ class NetCursor extends Cursor { // key = column position, value = index into extdtaData_ HashMap extdtaPositions_; +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 /** * Queue to hold EXTDTA data that hasn't been correlated to its @@ -79,6 +81,7 @@ class NetCursor extends Cursor { super(netAgent); netAgent_ = netAgent; maximumRowSize_ = 0; +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 extdtaPositions_ = new HashMap(); extdtaData_ = new ArrayList(); } @@ -146,10 +149,12 @@ boolean calculateColumnOffsetsForRow_(int rowIndex, return false; } +//IC see: https://issues.apache.org/jira/browse/DERBY-1382 if (hasLobs_) { extdtaPositions_.clear(); // reset positions for this row } +//IC see: https://issues.apache.org/jira/browse/DERBY-1313 NetSqlca[] netSqlca = this.parseSQLCARD(qrydscTypdef_); // If we don't have at least one byte in the buffer for the DA null indicator, // then we need to send a CNTQRY request to fetch the next block of data. @@ -164,11 +169,13 @@ boolean calculateColumnOffsetsForRow_(int rowIndex, throw new SqlException(netAgent_.logWriter_, netSqlca[i]); } else { +//IC see: https://issues.apache.org/jira/browse/DERBY-821 if (sqlcode == SqlCode.END_OF_DATA.getCode()) { setAllRowsReceivedFromServer(true); if (netResultSet_ != null && netSqlca[i].containsSqlcax()) { netResultSet_.setRowCountEvent( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 netSqlca[i].getRowCount()); } } else if (netResultSet_ != null && sqlcode > 0) { @@ -206,6 +213,7 @@ boolean calculateColumnOffsetsForRow_(int rowIndex, // since it's only resetting nextRowPosition_ to position_ and position_ will // not change again from this point. +//IC see: https://issues.apache.org/jira/browse/DERBY-821 if (allRowsReceivedFromServer() && (position_ == lastValidBytePosition_)) { markNextRowPosition(); @@ -216,6 +224,7 @@ boolean calculateColumnOffsetsForRow_(int rowIndex, // If data flows.... if (daNullIndicator == 0x0) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 if (SanityManager.DEBUG && receivedDeleteHoleWarning) { SanityManager.THROWASSERT("Delete hole warning received: nulldata expected"); } @@ -330,6 +339,7 @@ boolean calculateColumnOffsetsForRow_(int rowIndex, columnDataComputedLength_ = columnDataComputedLength; isNull_ = columnDataIsNull; +//IC see: https://issues.apache.org/jira/browse/DERBY-821 if (!allRowsReceivedFromServer()) { calculateLobColumnPositionsForRow(); // Flow another CNTQRY if we are blocking, are using rtnextrow, and expect @@ -348,6 +358,7 @@ boolean calculateColumnOffsetsForRow_(int rowIndex, } } else { if (netResultSet_ != null && netResultSet_.scrollable_) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 if (receivedDeleteHoleWarning) { setIsUpdataDeleteHole(rowIndex, true); } else { @@ -367,6 +378,7 @@ boolean calculateColumnOffsetsForRow_(int rowIndex, // the flag for allRowsReceivedFromServer_ is set, we still want to continue to parse through // the data in the dataBuffer. // But in the case where fixed row protocol is used, +//IC see: https://issues.apache.org/jira/browse/DERBY-821 if (!blocking_ && allRowsReceivedFromServer() && daNullIndicator == 0xFF) { return false; @@ -408,6 +420,7 @@ private int readFdocaOneByte() throws DisconnectException, SqlException { // If position is already at the end of the buffer, send CNTQRY to get more data. private int readFdocaOneByte(int index) throws DisconnectException, SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 checkForSplitRowAndComplete(1, index); return dataBuffer_[position_++] & 0xff; @@ -419,6 +432,7 @@ private int readFdocaOneByte(int index) // CNTQRY to get more data. private byte[] readFdocaBytes(int length) throws DisconnectException, SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 checkForSplitRowAndComplete(length); @@ -434,6 +448,7 @@ private byte[] readFdocaBytes(int length) // 2 bytes goes past the lastValidBytePosition, send CNTQRY to get more data. private int readFdocaTwoByteLength() throws DisconnectException, SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 checkForSplitRowAndComplete(2); return @@ -456,6 +471,7 @@ private int readFdocaTwoByteLength(int index) // returns the number of bytes skipped private int skipFdocaBytes(int length) throws DisconnectException, SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 checkForSplitRowAndComplete(length); position_ += length; @@ -516,11 +532,13 @@ void calculateLobColumnPositionsForRow() { int currentPosition = 0; for (int i = 0; i < columns_; i++) { +//IC see: https://issues.apache.org/jira/browse/DERBY-2496 if ((isNonTrivialDataLob(i)) && (locator(i + 1) == Lob.INVALID_LOCATOR)) // key = column position, data = index to corresponding data in extdtaData_ // ASSERT: the server always returns the EXTDTA objects in ascending order { +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 extdtaPositions_.put(i + 1, currentPosition++); } } @@ -531,6 +549,7 @@ private boolean isNonTrivialDataLob(int index) { long length = 0L; if (isNull_[index] || +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 (jdbcTypes_[index] != ClientTypes.BLOB && jdbcTypes_[index] != ClientTypes.CLOB)) { return false; @@ -608,6 +627,7 @@ private NetSqlca[] parseSQLCAGRP(Typdef typdef) parseSQLCAXGRP(typdef, netSqlca); NetSqlca[] sqlCa = parseSQLDIAGGRP(); +//IC see: https://issues.apache.org/jira/browse/DERBY-1313 NetSqlca[] ret_val; if (sqlCa != null) { @@ -704,11 +724,13 @@ private void parseSQLCAXGRP(Typdef typdef, NetSqlca netSqlca) throws DisconnectE netSqlca.setSqlerrd(sqlerrd); netSqlca.setSqlwarnBytes(sqlwarn); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 netSqlca.setSqlerrmcBytes(sqlerrmc); } // SQLDIAGGRP : FDOCA EARLY GROUP private NetSqlca[] parseSQLDIAGGRP() throws DisconnectException, SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-1313 if (readFdocaOneByte() == CodePoint.NULLDATA) { return null; } @@ -793,6 +815,7 @@ private void parseSQLDIAGCN() throws DisconnectException, SqlException { // SQLDCPNAM_s; PROTOCOL TYPE NVCS; ENVLID 0x33; Length Override 255 // SQLDCXGRP; PROTOCOL TYPE N-GDA; ENVLID 0xD3; Length Override 1 private NetSqlca parseSQLDCGRP() +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws DisconnectException, SqlException { int sqldcCode = readFdocaInt(); // SQLCODE @@ -814,6 +837,7 @@ private NetSqlca parseSQLDCGRP() String sqldcMsg = parseVCS(qrydscTypdef_); // MESSAGE_TEXT if (sqldcMsg != null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 sqlca.setSqlerrmcBytes(sqldcMsg.getBytes()); } @@ -864,6 +888,7 @@ private String parseVCS(Typdef typdefInEffect) throws DisconnectException, SqlEx // This is not used for column data. private String readFdocaString(int length, Charset encoding) +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 throws SqlException { if (length == 0) { return null; @@ -887,9 +912,11 @@ private byte[] findExtdtaData(int column) { // locate the EXTDTA bytes, if any Integer extdtaQueuePosition = extdtaPositions_.get(column); +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 if (extdtaQueuePosition != null) { // found, get the data +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 data = extdtaData_.get(extdtaQueuePosition); } @@ -914,6 +941,7 @@ protected int locator(int column) // Zero is not a valid locator, it indicates a zero length value if ((locator == 0x8000) || (locator == 0x8002) || (locator == 0x8004) || (locator == 0x8006) || (locator == 0x8008) ||(locator == 0)) { +//IC see: https://issues.apache.org/jira/browse/DERBY-2496 return Lob.INVALID_LOCATOR; } else { return locator; @@ -925,6 +953,7 @@ protected int locator(int column) */ public ClientBlob getBlobColumn_( int column, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Agent agent, boolean toBePublished) throws SqlException { @@ -935,6 +964,7 @@ public ClientBlob getBlobColumn_( // Check for locator int locator = locator(column); if (locator > 0) { // Create locator-based LOB object +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return new ClientBlob(agent, locator); } @@ -956,6 +986,7 @@ public ClientBlob getBlobColumn_( dataOffset = 1; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 blob = new ClientBlob(data, agent, dataOffset); } else { blob = new ClientBlob(new byte[0], agent, 0); @@ -970,16 +1001,21 @@ public ClientBlob getBlobColumn_( */ public ClientClob getClobColumn_( int column, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Agent agent, boolean toBePublished) throws SqlException { // Only inform the tracker if the Clob is published to the user. if (toBePublished) { +//IC see: https://issues.apache.org/jira/browse/DERBY-4066 +//IC see: https://issues.apache.org/jira/browse/DERBY-4066 if ( netResultSet_ != null ) { netResultSet_.markLOBAsPublished(column); } } // Check for locator int locator = locator(column); +//IC see: https://issues.apache.org/jira/browse/DERBY-2604 if (locator > 0) { // Create locator-based LOB object +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return new ClientClob(agent, locator); } @@ -1000,6 +1036,7 @@ public ClientClob getClobColumn_( } else { dataOffset = 1; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 clob = new ClientClob(agent, data, charset_[index], dataOffset); } else { // the locator is not valid, it is a zero-length LOB @@ -1010,6 +1047,7 @@ public ClientClob getClobColumn_( } // this is really an event-callback from NetStatementReply.parseSQLDTARDarray() +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void initializeColumnInfoArrays( Typdef typdef, int columnCount) throws DisconnectException { @@ -1027,6 +1065,7 @@ protected void getMoreData_() throws SqlException { // reset the dataBuffer_ before getting more data if cursor is foward-only. // getMoreData() is only called in Cursor.next() when current position is // equal to lastValidBytePosition_. +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (netResultSet_.resultSetType_ == ResultSet.TYPE_FORWARD_ONLY) { resetDataBuffer(); } @@ -1101,10 +1140,12 @@ private void checkAndThrowReceivedEndqryrm() throws SqlException { SqlException sqlException = null; int sqlcode = Utils.getSqlcodeFromSqlca( netResultSet_.queryTerminatingSqlca_); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (sqlcode < 0) { sqlException = new SqlException(agent_.logWriter_, netResultSet_.queryTerminatingSqlca_); } else { +//IC see: https://issues.apache.org/jira/browse/DERBY-846 sqlException = new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.NET_QUERY_PROCESSING_TERMINATED)); } @@ -1155,6 +1196,7 @@ private int[] allocateColumnDataPositionArray(int row) { columnDataPosition = new int[columns_]; columnDataPositionCache_.add(columnDataPosition); } else { +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 columnDataPosition = columnDataPositionCache_.get(row); } return columnDataPosition; @@ -1166,6 +1208,7 @@ private int[] allocateColumnDataComputedLengthArray(int row) { columnDataComputedLength = new int[columns_]; columnDataLengthCache_.add(columnDataComputedLength); } else { +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 columnDataComputedLength = columnDataLengthCache_.get(row); } return columnDataComputedLength; @@ -1177,6 +1220,7 @@ private boolean[] allocateColumnDataIsNullArray(int row) { columnDataIsNull = new boolean[columns_]; columnDataIsNullCache_.add(columnDataIsNull); } else { +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 columnDataIsNull = columnDataIsNullCache_.get(row); } return columnDataIsNull; @@ -1193,6 +1237,7 @@ protected int getDecimalLength(int index) { * rows are received from the server */ public final void setAllRowsReceivedFromServer(boolean b) { +//IC see: https://issues.apache.org/jira/browse/DERBY-821 if (b && qryclsimpEnabled_) { netResultSet_.markClosedOnServer(); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetDatabaseMetaData.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetDatabaseMetaData.java index 64b7d885f2..efd4fd6be1 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetDatabaseMetaData.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetDatabaseMetaData.java @@ -26,6 +26,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.client.am.SqlException; class NetDatabaseMetaData extends ClientDatabaseMetaData { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 NetDatabaseMetaData(NetAgent netAgent, NetConnection netConnection) { // Consider setting product level during parse diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetLogWriter.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetLogWriter.java index 93ba234c24..a3728e822f 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetLogWriter.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetLogWriter.java @@ -132,6 +132,7 @@ public NetLogWriter(PrintWriter printWriter, int traceLevel) { // Initialize the codepoint name table if not previously initialized. // This is done lazily so that it is not created if the trace isn't used (save some init time). +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (codePointNameTable__ == null) { initCodePointTable(); } @@ -190,6 +191,7 @@ public void traceConnectsResetExit(ClientConnection connection) { // The type is needed to indicate if the data is part of the send or receive buffer. // The class name, method name, and trcPt number are also written to the trace. // Not much checking is performed on the parameters. This is done to help performance. +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 synchronized void traceProtocolFlow(byte[] buff, int offset, int len, @@ -197,11 +199,13 @@ synchronized void traceProtocolFlow(byte[] buff, String className, String methodName, int tracepoint) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 if (!loggingEnabled(BasicClientDataSource.TRACE_PROTOCOL_FLOWS)) { return; } synchronized (printWriter_) { tracepoint("[net]", tracepoint, className, methodName); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 int fullLen = len; boolean printColPos = true; @@ -348,6 +352,7 @@ synchronized void traceProtocolFlow(byte[] buff, // Gets the int value of the two byte unsigned codepoint. private static int getCodePoint(byte[] buff, int offset) { return ((buff[offset++] & 0xff) << 8) + +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 (buff[offset] & 0xff); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetPackageReply.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetPackageReply.java index 3c7f236016..28b3683f4e 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetPackageReply.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetPackageReply.java @@ -23,6 +23,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.client.am.DisconnectException; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class NetPackageReply extends NetConnectionReply { NetPackageReply(NetAgent netAgent, int bufferSize) { super(netAgent, bufferSize); @@ -112,6 +113,7 @@ protected void parseRDBUPDRM() throws DisconnectException { if (peekCP == CodePoint.RDBNAM) { foundInPass = true; rdbnamReceived = checkAndGetReceivedFlag(rdbnamReceived); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 parseRDBNAM(true); peekCP = peekCodePoint(); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetPackageRequest.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetPackageRequest.java index 94a2c59a1e..689dcebce8 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetPackageRequest.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetPackageRequest.java @@ -124,6 +124,7 @@ void buildPKGNAMCSN(Section section) throws SqlException { // Mark the beginning of PKGNAMCSN bytes. markForCachingPKGNAMCSN(); buildCommonPKGNAMinfo(section); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 writeScalarPaddedBytes( Configuration.getDncPackageConsistencyToken(), NetConfiguration.PKGCNSTKN_FIXED_LEN, @@ -141,6 +142,7 @@ void buildPKGNAMCSN(Section section) throws SqlException { private void storePKGNAMCBytes(Section section) { // Get the locaton where we started writing PKGNAMCSN int startPos = popMarkForCachingPKGNAMCSN(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 byte[] b = new byte[buffer.position() - startPos]; buffer.position(startPos); buffer.get(b); @@ -165,6 +167,7 @@ private boolean checkPKGNAMlengths(String identifier, if (length > maxIdentifierLength) { throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.LANG_IDENTIFIER_TOO_LONG), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 identifier, maxIdentifierLength); } @@ -176,6 +179,7 @@ private void buildNOCMorNOCS(String string) throws SqlException { write2Bytes(0xffff); } else { if (netAgent_.typdef_.isCcsidMbcSet()) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 byte[] sqlBytes = string.getBytes(netAgent_.typdef_.getCcsidMbcEncoding()); write1Byte(0x00); @@ -248,7 +252,9 @@ protected void buildSQLATTRcommandData(String sql) throws SqlException { } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void encryptDataStream(int lengthLocation) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 byte[] clearedBytes = new byte[buffer.position() - lengthLocation]; buffer.position(lengthLocation); buffer.get(clearedBytes); @@ -261,6 +267,7 @@ void encryptDataStream(int lengthLocation) throws SqlException { netAgent_.netConnection_.getTargetPublicKey(), netAgent_.netConnection_.getTargetPublicKey()); +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 buffer.position(lengthLocation); writeBytes(encryptedBytes); diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetPreparedStatement.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetPreparedStatement.java index 67c780e6d3..1674779cc2 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetPreparedStatement.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetPreparedStatement.java @@ -29,6 +29,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.client.am.MaterialPreparedStatement; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class NetPreparedStatement extends NetStatement implements MaterialPreparedStatement { @@ -36,6 +37,7 @@ class NetPreparedStatement extends NetStatement /*final*/ ClientPreparedStatement preparedStatement_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 // Relay constructor for NetCallableStatement. NetPreparedStatement(ClientPreparedStatement statement, @@ -91,8 +93,10 @@ private void initNetPreparedStatement(ClientPreparedStatement statement) { * @throws SqlException * */ +//IC see: https://issues.apache.org/jira/browse/DERBY-2653 NetPreparedStatement(NetAgent netAgent, NetConnection netConnection, String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes, ClientPooledConnection cpc) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 this(ClientAutoloadedDriver.getFactory().newPreparedStatement(netAgent, netConnection, sql, type, concurrency, holdability, autoGeneratedKeys, columnNames, columnIndexes, cpc), @@ -133,8 +137,10 @@ void resetNetPreparedStatement(NetAgent netAgent, NetConnection netConnection, S NetPreparedStatement(NetAgent netAgent, NetConnection netConnection, String sql, +//IC see: https://issues.apache.org/jira/browse/DERBY-941 Section section,ClientPooledConnection cpc) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 this(ClientAutoloadedDriver.getFactory().newPreparedStatement(netAgent, netConnection, sql, section,cpc), netAgent, diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetResultSet.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetResultSet.java index 28062ea6b6..ccf384ca30 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetResultSet.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetResultSet.java @@ -29,6 +29,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class NetResultSet extends ClientResultSet { // Alias for (NetConnection) super.statement.connection private final NetConnection netConnection_; @@ -146,10 +147,12 @@ protected void parseRowset_() throws SqlException { // the end of data is returned or when an error occurs. all successfully fetched rows // are returned to the user. the specific error is not returned until the next fetch. while (rowsReceivedInCurrentRowset_ != fetchSize_ && +//IC see: https://issues.apache.org/jira/browse/DERBY-821 !netCursor_.allRowsReceivedFromServer() && !isRowsetCursor_ && sensitivity_ != sensitivity_sensitive_dynamic__ && sensitivity_ != sensitivity_sensitive_static__) { flowFetchToCompleteRowset(); +//IC see: https://issues.apache.org/jira/browse/DERBY-821 while (netCursor_.calculateColumnOffsetsForRow_(row, true)) { rowsReceivedInCurrentRowset_++; row++; @@ -172,6 +175,7 @@ void flowFetchToCompleteRowset() throws DisconnectException { try { agent_.beginWriteChain(statement_); +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 writeScrollableFetch_((generatedSection_ == null) ? statement_.getSection() : generatedSection_, fetchSize_ - rowsReceivedInCurrentRowset_, scrollOrientation_relative__, @@ -189,6 +193,7 @@ void flowFetchToCompleteRowset() throws DisconnectException { // ------------------------------- abstract box car methods -------------------------------------- public void writeFetch_(Section section) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (resultSetType_ == ResultSet.TYPE_FORWARD_ONLY && fetchSize_ != 0 && rowsYetToBeReceivedForRowset_ > 0) { netAgent_.resultSetRequest_.writeFetch(this, @@ -255,6 +260,7 @@ public void readCursorClose_() throws SqlException { * @exception SqlException */ protected void preClose_() throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-821 if (netCursor_.getQryclsimpEnabled()) { netCursor_.scanDataBufferForEndOfData(); } @@ -264,9 +270,11 @@ protected void preClose_() throws SqlException { // common can we make this the common layer fetch method. Called by the // read/skip Fdoca bytes methods in the net whenever data reads exhaust the // internal buffer used by this reply. +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void flowFetch() throws DisconnectException, SqlException { agent_.beginWriteChain(statement_); writeFetch_((generatedSection_ == null) ? +//IC see: https://issues.apache.org/jira/browse/DERBY-6082 statement_.getSection() : generatedSection_); agent_.flow(statement_); diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetResultSet42.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetResultSet42.java index 8d1fadeaad..c4917e2ce1 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetResultSet42.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetResultSet42.java @@ -28,6 +28,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.client.am.Utils42; +//IC see: https://issues.apache.org/jira/browse/DERBY-6213 class NetResultSet42 extends NetResultSet { diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetResultSetReply.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetResultSetReply.java index 410357baec..f3715cd606 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetResultSetReply.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetResultSetReply.java @@ -30,6 +30,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.shared.common.reference.SQLState; import org.apache.derby.shared.common.reference.MessageId; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class NetResultSetReply extends NetStatementReply implements ResultSetReplyInterface { @@ -113,6 +114,7 @@ private void parseCNTQRYreply(ResultSetCallbackInterface resultSetI, int ddmLength = getDdmLength(); ensureBLayerDataInBuffer(ddmLength); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ((ClientResultSet) resultSetI).expandRowsetSqlca(); NetSqlca sqlca = parseSQLCARDrow( ((ClientResultSet) resultSetI).rowsetSqlca_); @@ -126,6 +128,7 @@ private void parseCNTQRYreply(ResultSetCallbackInterface resultSetI, } peekCP = peekCodePoint(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6228 if (peekCP == CodePoint.SQLCARD) { NetSqlca netSqlca = parseSQLCARD(((ClientResultSet) resultSetI).rowsetSqlca_); resultSetI.completeSqlca(netSqlca); @@ -134,6 +137,7 @@ private void parseCNTQRYreply(ResultSetCallbackInterface resultSetI, parseRDBUPDRM(); peekCP = peekCodePoint(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-3192 if (peekCP == CodePoint.PBSD) { parsePBSD(); } @@ -148,6 +152,7 @@ private void parseCNTQRYreply(ResultSetCallbackInterface resultSetI, if (peekCP == CodePoint.EXTDTA) { found = true; do { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 copyEXTDTA((NetCursor) ((ClientResultSet) resultSetI).cursor_); if (longBufferForDecryption_ != null) {//encrypted EXTDTA buffer_ = longBufferForDecryption_; @@ -163,6 +168,7 @@ private void parseCNTQRYreply(ResultSetCallbackInterface resultSetI, if (peekCP == CodePoint.SQLCARD) { found = true; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ((ClientResultSet) resultSetI).expandRowsetSqlca(); NetSqlca netSqlca = parseSQLCARD(((ClientResultSet)resultSetI).rowsetSqlca_); @@ -190,6 +196,7 @@ private void parseCNTQRYreply(ResultSetCallbackInterface resultSetI, if (peekCP == CodePoint.RDBUPDRM) { found = true; parseRDBUPDRM(); +//IC see: https://issues.apache.org/jira/browse/DERBY-3192 peekCP = peekCodePoint(); } @@ -238,6 +245,8 @@ private void parseCloseError(ResultSetCallbackInterface resultSetI) private void parseFetchError(ResultSetCallbackInterface resultSetI) throws DisconnectException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 int peekCP = peekCodePoint(); switch (peekCP) { @@ -359,6 +368,7 @@ private void parseQRYNOPRM(ResultSetCallbackInterface resultSet) throws Disconne netAgent_.setSvrcod(svrcod); if (svrcod == CodePoint.SVRCOD_WARNING) { netAgent_.accumulateReadException(new SqlException(netAgent_.logWriter_, +//IC see: https://issues.apache.org/jira/browse/DERBY-847 new ClientMessageId(SQLState.DRDA_CURSOR_NOT_OPEN))); } else { agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetResultSetRequest.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetResultSetRequest.java index 0e211f9da0..aa15544f69 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetResultSetRequest.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetResultSetRequest.java @@ -30,6 +30,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.shared.common.reference.SQLState; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class NetResultSetRequest extends NetStatementRequest implements ResultSetRequestInterface { @@ -45,9 +46,11 @@ public void writeFetch(NetResultSet resultSet, // but qryrowset is sent on EXCSQLSTT for a stored procedure call. boolean sendQryrowset = ((NetStatement) resultSet.statement_.getMaterialStatement()).qryrowsetSentOnOpnqry_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 boolean sendRtnextdta = false; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (sendQryrowset && resultSet.resultSetType_ == ResultSet.TYPE_FORWARD_ONLY && ((NetCursor) resultSet.cursor_).hasLobs_) { @@ -96,6 +99,7 @@ public void writeScrollableFetch(NetResultSet resultSet, // * qryrowset is optional. it is ignored on opnqry. if not sent on cntqry, // then the fetch is going fetch next row as opposed to fetch next rowset. boolean sendQryrowset = +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 resultSet.isRowsetCursor_ || (((NetStatement)resultSet.statement_.getMaterialStatement()). qryrowsetSentOnOpnqry_ && @@ -126,6 +130,8 @@ public void writePositioningFetch(NetResultSet resultSet, // do not send qryrowste if the cursor is a non-rowset, sensitive dynamic cursor boolean sendQryrowset = resultSet.isRowsetCursor_ || +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 (((NetStatement) resultSet.statement_.getMaterialStatement()).qryrowsetSentOnOpnqry_ && resultSet.sensitivity_ != resultSet.sensitivity_sensitive_dynamic__); @@ -279,7 +285,9 @@ private void buildOUTOVR(NetResultSet resultSet, ColumnMetaData resultSetMetaData, boolean firstOutovrBuilt, boolean hasLobs) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-2496 if (hasLobs) { +//IC see: https://issues.apache.org/jira/browse/DERBY-2347 if (!firstOutovrBuilt) { buildOUTOVR(resultSet, resultSetMetaData); resultSet.firstOutovrBuilt_ = true; @@ -315,6 +323,7 @@ private void buildQRYRTNDTA(int qryrtndta) throws SqlException { // Called by NetResultSetRequest.writeScrollableFetch() private int computePROTOCOLOrientation(int orientation) throws SqlException { switch (orientation) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case ClientResultSet.scrollOrientation_absolute__: return CodePoint.QRYSCRABS; @@ -328,6 +337,7 @@ private int computePROTOCOLOrientation(int orientation) throws SqlException { return CodePoint.QRYSCRREL; default: +//IC see: https://issues.apache.org/jira/browse/DERBY-847 throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.NET_INVALID_SCROLL_ORIENTATION)); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetSqlca.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetSqlca.java index 5c9dfb3499..fca8d997c8 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetSqlca.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetSqlca.java @@ -24,10 +24,12 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.client.am.Sqlca; import org.apache.derby.client.am.ClientConnection; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class NetSqlca extends Sqlca { // these are the same variables that are in the Sqlca except ccsids // are a little different +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 NetSqlca(ClientConnection connection, int sqlCode, String sqlState, @@ -38,9 +40,11 @@ class NetSqlca extends Sqlca { sqlErrpBytes_ = sqlErrpBytes; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 NetSqlca(ClientConnection connection, int sqlCode, byte[] sqlState, +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 byte[] sqlErrpBytes) { super(connection); sqlCode_ = sqlCode; @@ -48,6 +52,7 @@ class NetSqlca extends Sqlca { sqlErrpBytes_ = sqlErrpBytes; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void setSqlerrd(int[] sqlErrd) { sqlErrd_ = sqlErrd; } diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetSqldta.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetSqldta.java index e32da0917d..1f95fc59f1 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetSqldta.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetSqldta.java @@ -25,12 +25,14 @@ Licensed to the Apache Software Foundation (ASF) under one or more class NetSqldta extends NetCursor { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 NetSqldta(NetAgent netAgent) { super(netAgent); } public boolean next() throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-821 if (allRowsReceivedFromServer()) { return false; } else { @@ -128,6 +130,7 @@ protected boolean calculateColumnOffsetsForRow() { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-821 if (!allRowsReceivedFromServer()) { calculateLobColumnPositionsForRow(); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetStatement.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetStatement.java index 9a32895fb0..cf8eeac529 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetStatement.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetStatement.java @@ -30,9 +30,11 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.client.ClientAutoloadedDriver; class NetStatement implements MaterialStatement { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientStatement statement_; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 // Alias for (NetConnection) statement_.connection NetConnection netConnection_; @@ -59,6 +61,7 @@ private void initNetStatement() { } // Relay constructor for NetPreparedStatement. +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 NetStatement( ClientStatement statement, NetAgent netAgent, @@ -85,6 +88,7 @@ private void initNetStatement( netAgent_ = netAgent; netConnection_ = netConnection; statement_ = statement; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 statement_.setMaterialStatement(this); } @@ -94,7 +98,9 @@ public void reset_() { // Called by abstract Connection.createStatement().newStatement() for jdbc 2 statements with scroll attributes NetStatement(NetAgent netAgent, NetConnection netConnection, int type, int concurrency, int holdability) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 this(ClientAutoloadedDriver.getFactory().newStatement( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 netAgent, netConnection, type, diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetStatementReply.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetStatementReply.java index 98da4dda20..ca996ed473 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetStatementReply.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetStatementReply.java @@ -375,6 +375,7 @@ private void parseResultSetProcedure(StatementCallbackInterface statementI) // the result set summary component consists of a result set reply message. List

sectionAL = parseRSLSETRM(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 // following the RSLSETRM is an SQLCARD or an SQLDTARD. check for a // TYPDEFNAM or TYPDEFOVR before looking for these objects. @@ -408,6 +409,7 @@ private void parseResultSetProcedure(StatementCallbackInterface statementI) NetResultSet[] resultSets = new NetResultSet[numberOfResultSets]; for (int i = 0; i < numberOfResultSets; i++) { // parse the result set component of the stored procedure reply. +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 NetResultSet netResultSet = parseResultSetCursor(statementI, sectionAL.get(i)); resultSets[i] = netResultSet; @@ -430,10 +432,12 @@ private void parseResultSetProcedure(StatementCallbackInterface statementI) // SQL Column Information Reply data object, followed by a Query Descriptor. // There may also be Query Data or an End of Query Reply Message. private NetResultSet parseResultSetCursor( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 StatementCallbackInterface statementI, Section section) throws DisconnectException { // The first item returne is an OPNQRYRM. NetResultSet netResultSet = parseOPNQRYRM(statementI, false); +//IC see: https://issues.apache.org/jira/browse/DERBY-821 // The next to be returned is an OBJDSS so check for any TYPDEF overrides. int peekCP = parseTypdefsOrMgrlvlovrs(); @@ -477,6 +481,7 @@ private NetResultSet parseResultSetCursor( private void parseOpenQuery(StatementCallbackInterface statementI) throws DisconnectException { NetResultSet netResultSet = parseOPNQRYRM(statementI, true); +//IC see: https://issues.apache.org/jira/browse/DERBY-821 NetSqlca sqlca = null; int peekCP = peekCodePoint(); @@ -485,6 +490,7 @@ private void parseOpenQuery(StatementCallbackInterface statementI) peekCP = parseTypdefsOrMgrlvlovrs(); if (peekCP == CodePoint.SQLDARD) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 ColumnMetaData columnMetaData = ClientAutoloadedDriver.getFactory().newColumnMetaData(netAgent_.logWriter_); NetSqlca netSqlca = parseSQLDARD(columnMetaData, false); // false means do not skip SQLDARD bytes @@ -532,6 +538,7 @@ private void parseOpenQuery(StatementCallbackInterface statementI) statementI.completeOpenQuery(sqlca, netResultSet); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void parseEndQuery(ResultSetCallbackInterface resultSetI) throws DisconnectException { parseENDQRYRM(resultSetI); @@ -541,6 +548,7 @@ void parseEndQuery(ResultSetCallbackInterface resultSetI) } private void parseOpenQueryFailure(StatementCallbackInterface statementI) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws DisconnectException { parseOPNQFLRM(statementI); parseTypdefsOrMgrlvlovrs(); @@ -687,6 +695,10 @@ private void parseOpenQueryError(StatementCallbackInterface statementI) } private void parseExecuteError(StatementCallbackInterface statementI) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws DisconnectException { int peekCP = peekCodePoint(); switch (peekCP) { @@ -724,6 +736,7 @@ private void parseExecuteError(StatementCallbackInterface statementI) } private void parseExecuteSetStatementError( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 StatementCallbackInterface statement) throws DisconnectException { int peekCP = peekCodePoint(); switch (peekCP) { @@ -781,6 +794,7 @@ private void parseExecuteSetStatementError( */ private NetResultSet parseOPNQRYRM(StatementCallbackInterface statementI, boolean isOPNQRYreply) +//IC see: https://issues.apache.org/jira/browse/DERBY-821 throws DisconnectException { // these need to be initialized to the correct default values. @@ -901,15 +915,19 @@ private NetResultSet parseOPNQRYRM(StatementCallbackInterface statementI, // hack for now until event methods are used below ClientStatement statement = (ClientStatement) statementI; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 // if there is a cached Cursor object, then use the cached cursor object. NetResultSet rs = null; if (statement.cachedCursor_ != null) { statement.cachedCursor_.resetDataBuffer(); ((NetCursor) statement.cachedCursor_).extdtaData_.clear(); +//IC see: https://issues.apache.org/jira/browse/DERBY-796 try { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 rs = (NetResultSet)ClientAutoloadedDriver.getFactory().newNetResultSet (netAgent_, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 (NetStatement) statement.getMaterialStatement(), statement.cachedCursor_, qryprctyp, //protocolType, CodePoint.FIXROWPRC | @@ -929,8 +947,10 @@ private NetResultSet parseOPNQRYRM(StatementCallbackInterface statementI, } } else { try { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 rs = (NetResultSet)ClientAutoloadedDriver.getFactory().newNetResultSet (netAgent_, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 (NetStatement) statement.getMaterialStatement(), new NetCursor(netAgent_, qryprctyp), qryprctyp, //protocolType, CodePoint.FIXROWPRC | @@ -950,8 +970,10 @@ private NetResultSet parseOPNQRYRM(StatementCallbackInterface statementI, } // QRYCLSIMP only applies to OPNQRY, not EXCSQLSTT +//IC see: https://issues.apache.org/jira/browse/DERBY-821 final boolean qryclsimp = isOPNQRYreply && +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 (rs.resultSetType_ == ResultSet.TYPE_FORWARD_ONLY) && netAgent_.netConnection_.serverSupportsQryclsimp(); rs.netCursor_.setQryclsimpEnabled(qryclsimp); @@ -1087,8 +1109,10 @@ private void parseQRYPOPRM() throws DisconnectException { netAgent_.setSvrcod(svrcod); agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, +//IC see: https://issues.apache.org/jira/browse/DERBY-848 new ClientMessageId(SQLState.DRDA_CONNECTION_TERMINATED), MessageUtil.getCompleteMessage(MessageId.CONN_DRDA_QRYOPEN, +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 MessageUtil.CLIENT_MESSAGE_RESOURCE_NAME, (Object [])null))); } @@ -1162,6 +1186,7 @@ private List
parseRSLSETRM() throws DisconnectException { int svrcod = CodePoint.SVRCOD_INFO; boolean pkgsnlstReceived = false; List
pkgsnlst = null; +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 parseLengthAndMatchCodePoint(CodePoint.RSLSETRM); pushLengthOnCollectionStack(); @@ -1209,6 +1234,7 @@ private List
parseRSLSETRM() throws DisconnectException { // FDODSC - required // FDODTA - required private NetSqlca parseSQLDTARD(NetSqldta netSqldta) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws DisconnectException { boolean fdodscReceived = false; boolean fdodtaReceived = false; @@ -1314,6 +1340,7 @@ private void parseSQLDTARDarray(NetCursor cursor, boolean skipBytes) throws Disc // i.e. from integer to char. int columns = peekTotalColumnCount(tripletLength); // peek ahead to get the total number of columns. +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 cursor.initializeColumnInfoArrays( netAgent_.targetTypdef_, columns); columnCount += parseSQLDTAGRPdataLabelsAndUpdateColumn(cursor, columnCount, tripletLength); @@ -1462,12 +1489,14 @@ private void checkFastRLO(int[][] rlo) throws DisconnectException { // DSCERRCD_42 - RLO fails to reference a required GDA or RLO. private void descriptorErrorDetected() throws DisconnectException { agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, +//IC see: https://issues.apache.org/jira/browse/DERBY-848 new ClientMessageId(SQLState.DRDA_CONNECTION_TERMINATED), MessageUtil.getCompleteMessage(MessageId.CONN_DRDA_INVALIDFDOCA, SqlException.CLIENT_MESSAGE_RESOURCE_NAME, (Object [])null))); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void parseQRYDTA(NetResultSet netResultSet) throws DisconnectException { parseLengthAndMatchCodePoint(CodePoint.QRYDTA); if (longValueForDecryption_ == null) { @@ -1497,6 +1526,7 @@ void parseQRYDTA(NetResultSet netResultSet) throws DisconnectException { } private NetSqlca parseFDODTA(NetCursor netCursor) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws DisconnectException { parseLengthAndMatchCodePoint(CodePoint.FDODTA); int ddmLength = getDdmLength(); @@ -1510,6 +1540,7 @@ private NetSqlca parseFDODTA(NetCursor netCursor) } private void parseFastSQLDTARDdata(NetCursor netCursor) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws DisconnectException { netCursor.dataBufferStream_ = getFastData(netCursor.dataBufferStream_); netCursor.dataBuffer_ = netCursor.dataBufferStream_.toByteArray(); @@ -1538,6 +1569,7 @@ private void parseSQLDTARDdata(NetCursor netCursor) netCursor.lastValidBytePosition_ = netCursor.dataBuffer_.length; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void copyEXTDTA(NetCursor netCursor) throws DisconnectException { try { parseLengthAndMatchCodePoint(CodePoint.EXTDTA); @@ -1550,8 +1582,10 @@ void copyEXTDTA(NetCursor netCursor) throws DisconnectException { longValueForDecryption_ = null; } netCursor.extdtaData_.add(data); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (OutOfMemoryError e) { agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 new ClientMessageId(SQLState.NET_LOB_DATA_TOO_LARGE_FOR_JVM), e)); } } @@ -1565,6 +1599,7 @@ void copyEXTDTA(NetCursor netCursor) throws DisconnectException { // // Only called for generated secctions from a callable statement. // +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Section parsePKGNAMCSN(boolean skip) throws DisconnectException { parseLengthAndMatchCodePoint(CodePoint.PKGNAMCSN); if (skip) { @@ -1627,6 +1662,7 @@ Section parsePKGNAMCSN(boolean skip) throws DisconnectException { : NetConfiguration.PKG_IDENTIFIER_MAX_LEN); if (scldtaLen < NetConfiguration.PKG_IDENTIFIER_FIXED_LEN || scldtaLen > maxRDBlength) { +//IC see: https://issues.apache.org/jira/browse/DERBY-1350 agent_.accumulateChainBreakingReadExceptionAndThrow( new DisconnectException(agent_, new ClientMessageId( @@ -1645,6 +1681,8 @@ Section parsePKGNAMCSN(boolean skip) throws DisconnectException { if (scldtaLen < 18 || scldtaLen > 255) { agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, new ClientMessageId(SQLState.NET_SQLCDTA_INVALID_FOR_RDBCOLID), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 scldtaLen)); return null; } @@ -1658,6 +1696,7 @@ Section parsePKGNAMCSN(boolean skip) throws DisconnectException { if (scldtaLen < 18 || scldtaLen > 255) { agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, new ClientMessageId(SQLState.NET_SQLCDTA_INVALID_FOR_PKGID), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 scldtaLen)); return null; // To make compiler happy. } @@ -1673,6 +1712,7 @@ Section parsePKGNAMCSN(boolean skip) throws DisconnectException { } else { agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, new ClientMessageId(SQLState.NET_PGNAMCSN_INVALID_AT_SQLAM), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 ddmLength, netAgent_.targetSqlam_)); return null; // To make compiler happy. } @@ -1765,6 +1805,7 @@ private long parseFastQRYINSID() throws DisconnectException { // within one or more packages. private List
parsePKGSNLST() throws DisconnectException { ArrayList
pkgsnlst = new ArrayList
(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 parseLengthAndMatchCodePoint(CodePoint.PKGSNLST); pushLengthOnCollectionStack(); @@ -1782,6 +1823,7 @@ private NetSqlca parseSQLDARD(ColumnMetaData columnMetaData, } private int parseSQLRSLRD(List
sections) +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 throws DisconnectException { parseLengthAndMatchCodePoint(CodePoint.SQLRSLRD); return parseSQLRSLRDarray(sections); @@ -1883,6 +1925,7 @@ private NetSqlca parseSQLDARDarray(ColumnMetaData columnMetaData, // information about result sets returned as reply data in the response to // an EXCSQLSTT command that invokes a stored procedure private int parseSQLRSLRDarray(List
sections) +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 throws DisconnectException { int numOfResultSets = parseSQLNUMROW(); for (int i = 0; i < numOfResultSets; i++) { @@ -1909,6 +1952,7 @@ private int parseSQLRSLRDarray(List
sections) // procedure private ColumnMetaData parseSQLCINRDarray() throws DisconnectException { ColumnMetaData columnMetaData = ClientAutoloadedDriver.getFactory().newColumnMetaData(netAgent_.logWriter_); +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 parseSQLDHROW(columnMetaData); @@ -2030,6 +2074,7 @@ private void parseSQLDAGRP(ColumnMetaData columnMetaData, columnMetaData.nullable_[columnNumber] = Utils.isSqlTypeNullable(sqlType); columnMetaData.sqlCcsid_[columnNumber] = ccsid; columnMetaData.types_[columnNumber] = +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientTypes.mapDERBYTypeToDriverType( true, sqlType, columnLength, ccsid); // true means isDescribed @@ -2048,6 +2093,7 @@ private void parseSQLUDTGRP(ColumnMetaData columnMetaData, { int jdbcType = columnMetaData.types_[columnNumber]; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (!(jdbcType == ClientTypes.JAVA_OBJECT) || !netAgent_.netConnection_.serverSupportsUDTs()) { @@ -2299,6 +2345,7 @@ private String parseFastVCMorVCS() throws DisconnectException { int vcs_length = readFastUnsignedShort(); if (vcm_length > 0 && vcs_length > 0) { agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, +//IC see: https://issues.apache.org/jira/browse/DERBY-848 new ClientMessageId(SQLState.NET_VCM_VCS_LENGTHS_INVALID))); } else if (vcs_length > 0) { stringToBeSet = readFastString(vcs_length, netAgent_.targetTypdef_.getCcsidSbcEncoding()); @@ -2317,6 +2364,7 @@ private String parseVCMorVCS() throws DisconnectException { int vcs_length = readUnsignedShort(); if (vcm_length > 0 && vcs_length > 0) { agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, +//IC see: https://issues.apache.org/jira/browse/DERBY-848 new ClientMessageId(SQLState.NET_VCM_VCS_LENGTHS_INVALID))); } else if (vcs_length > 0) { stringToBeSet = readString(vcs_length, netAgent_.targetTypdef_.getCcsidSbcEncoding()); @@ -2332,6 +2380,7 @@ private int calculateResultSetType(int qryattscr, int qryattsns, int defaultType // but we will set it to the default. if (qryattscr == 0xF0) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return ResultSet.TYPE_FORWARD_ONLY; } @@ -2349,6 +2398,7 @@ private int calculateResultSetConcurrency(int qryattupd, int defaultConcurrency) // we want to set it to the actual concurrency. switch (qryattupd) { case CodePoint.QRYRDO: +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return ResultSet.CONCUR_READ_ONLY; case CodePoint.QRYUPD: return ResultSet.CONCUR_UPDATABLE; @@ -2359,6 +2409,8 @@ private int calculateResultSetConcurrency(int qryattupd, int defaultConcurrency) private int calculateResultSetHoldability(int sqlcsrhld) { if (sqlcsrhld == 0xF0) { +//IC see: https://issues.apache.org/jira/browse/DERBY-3484 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return ResultSet.CLOSE_CURSORS_AT_COMMIT; } else { return ResultSet.HOLD_CURSORS_OVER_COMMIT; diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetStatementRequest.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetStatementRequest.java index 557e707f8c..34ca625ccd 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetStatementRequest.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetStatementRequest.java @@ -51,6 +51,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more // For performance, should we worry about the ordering of our DDM command parameters +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class NetStatementRequest extends NetPackageRequest implements StatementRequestInterface { @@ -65,7 +66,10 @@ class NetStatementRequest extends NetPackageRequest // is still needed for non-promototed LOBs private final HashMap promototedParameters_ = new HashMap(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 +//IC see: https://issues.apache.org/jira/browse/DERBY-728 +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 NetStatementRequest(NetAgent netAgent, int bufferSize) { super(netAgent, bufferSize); } @@ -177,6 +181,7 @@ public void writeOpenQuery(NetPreparedStatement materialPreparedStatement, int fetchSize, int resultSetType, int numInputColumns, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ColumnMetaData parameterMetaData, Object[] inputs) throws SqlException { boolean sendQryrowset = checkSendQryrowset(fetchSize, resultSetType); @@ -282,6 +287,7 @@ public void writeExecuteCall(NetStatement materialStatement, boolean sendQryrowset = true; fetchSize = (fetchSize == 0) ? Configuration.defaultFetchSize : fetchSize; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 boolean sendPrcnam = (procedureName != null) ? true : false; int numParameters = (parameterMetaData != null) ? parameterMetaData.columns_ : 0; @@ -324,6 +330,7 @@ public void writeExecuteCall(NetStatement materialStatement, // Write the message to execute an SQL Set Statement. /* public void writeSetGenericSQLSetInfo ( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 SetGenericSQLSetPiggybackCommand setGenericSQLSetPiggybackCommand, JDBCSection section) throws SqlException { @@ -368,6 +375,7 @@ private void buildOPNQRY(Section section, // Tell the server to close forward-only result sets // implicitly when they are exhausted. The server will ignore // this parameter if the result set is scrollable. +//IC see: https://issues.apache.org/jira/browse/DERBY-821 if (netAgent_.netConnection_.serverSupportsQryclsimp()) { buildQRYCLSIMP(); } @@ -539,6 +547,7 @@ private boolean buildSQLDTAcommandData(int numInputColumns, int[][] protocolTypesAndLengths = allocateLidAndLengthsArray(parameterMetaData); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Hashtable protocolTypeToOverrideLidMapping = null; ArrayList mddOverrideArray = null; protocolTypeToOverrideLidMapping = @@ -575,6 +584,7 @@ private boolean buildSQLDTAcommandData(int numInputColumns, private void buildFDODSC(int numColumns, int[][] protocolTypesAndLengths, boolean overrideExists, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Hashtable overrideMap, ArrayList overrideArray) throws SqlException { markLengthBytes(CodePoint.FDODSC); @@ -588,6 +598,7 @@ private void buildFDODSC(int numColumns, private void buildSQLDTA(int numColumns, int[][] lidAndLengthOverrides, boolean overrideExists, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Hashtable overrideMap, ArrayList overrideArray) throws SqlException { // mdd overrides need to be built first if any before the descriptors are built. @@ -609,6 +620,7 @@ private void buildSQLDTA(int numColumns, private void buildSQLDTAGRP(int numVars, int[][] lidAndLengthOverrides, boolean mddRequired, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Hashtable overrideMap) throws SqlException { int n = 0; int offset = 0; @@ -647,6 +659,7 @@ protected void buildOUTOVR(ClientResultSet resultSet, } private int[][] calculateOUTOVRLidAndLengthOverrides( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ClientResultSet resultSet, ColumnMetaData resultSetMetaData) { @@ -664,6 +677,7 @@ private int[][] calculateOUTOVRLidAndLengthOverrides( case Types.CLOB: lidAndLengths[i][0] = (resultSetMetaData.nullable_[i]) +//IC see: https://issues.apache.org/jira/browse/DERBY-2702 ? DRDAConstants.DRDA_TYPE_NCLOBLOC : DRDAConstants.DRDA_TYPE_CLOBLOC; lidAndLengths[i][1] = 4; @@ -675,6 +689,7 @@ private int[][] calculateOUTOVRLidAndLengthOverrides( } private void buildSQLDTARD(int numColumns, int[][] lidAndLengthOverrides) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SqlException { buildSQLCADTA(numColumns, lidAndLengthOverrides); writeBytes(FdocaConstants.SQLDTARD_RLO_TOSEND); @@ -711,6 +726,7 @@ private void buildFDODTA(int numVars, } switch (protocolTypesAndLengths[i][0] | 0x01) { // mask out null indicator +//IC see: https://issues.apache.org/jira/browse/DERBY-499 case DRDAConstants.DRDA_TYPE_NVARMIX: case DRDAConstants.DRDA_TYPE_NLONGMIX: // What to do for server that don't understand 1208 (UTF-8) @@ -726,6 +742,7 @@ private void buildFDODTA(int numVars, } break; +//IC see: https://issues.apache.org/jira/browse/DERBY-499 case DRDAConstants.DRDA_TYPE_NVARCHAR: case DRDAConstants.DRDA_TYPE_NLONG: o = retrievePromotedParameterIfExists(i); @@ -744,6 +761,7 @@ private void buildFDODTA(int numVars, case DRDAConstants.DRDA_TYPE_NBOOLEAN: writeBoolean(((Boolean) inputs[i]).booleanValue()); break; +//IC see: https://issues.apache.org/jira/browse/DERBY-499 case DRDAConstants.DRDA_TYPE_NINTEGER: writeIntFdocaData(((Integer) inputs[i]).intValue()); break; @@ -757,6 +775,7 @@ private void buildFDODTA(int numVars, writeDouble(((Double) inputs[i]).doubleValue()); break; case DRDAConstants.DRDA_TYPE_NDECIMAL: +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 writeBigDecimal((BigDecimal) inputs[i], (protocolTypesAndLengths[i][1] >> 8) & 0xff, // described precision not actual protocolTypesAndLengths[i][1] & 0xff); // described scale, not actual @@ -813,6 +832,7 @@ private void buildFDODTA(int numVars, case DRDAConstants.DRDA_TYPE_NUDT: writeUDT( inputs[i] ); break; +//IC see: https://issues.apache.org/jira/browse/DERBY-499 case DRDAConstants.DRDA_TYPE_NLOBCSBCS: case DRDAConstants.DRDA_TYPE_NLOBCDBCS: // check for a promoted Clob @@ -820,6 +840,7 @@ private void buildFDODTA(int numVars, if (o == null) { try { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Clob c = (Clob) inputs[i]; if(c instanceof ClientClob && @@ -845,12 +866,14 @@ private void buildFDODTA(int numVars, } break; +//IC see: https://issues.apache.org/jira/browse/DERBY-499 case DRDAConstants.DRDA_TYPE_NLOBBYTES: // check for a promoted Clob o = retrievePromotedParameterIfExists(i); if (o == null) { try { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Blob b = (Blob) inputs[i]; if(b instanceof ClientBlob && @@ -864,6 +887,7 @@ private void buildFDODTA(int numVars, } } catch (SQLException e) { +//IC see: https://issues.apache.org/jira/browse/DERBY-848 throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.NET_ERROR_GETTING_BLOB_LENGTH), e); @@ -875,12 +899,14 @@ private void buildFDODTA(int numVars, i); } break; +//IC see: https://issues.apache.org/jira/browse/DERBY-499 case DRDAConstants.DRDA_TYPE_NLOBCMIXED: // check for a promoted Clob o = retrievePromotedParameterIfExists(i); if (o == null) { final ClientClob c = (ClientClob) inputs[i]; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (c.isString()) { setFDODTALobLength(protocolTypesAndLengths, @@ -900,16 +926,22 @@ private void buildFDODTA(int numVars, } else { // use promoted Clob setFDODTALob(netAgent_.netConnection_.getSecurityMechanism(), +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 (ClientClob) o, protocolTypesAndLengths, i); } break; +//IC see: https://issues.apache.org/jira/browse/DERBY-2506 case DRDAConstants.DRDA_TYPE_NLOBLOC: //The FD:OCA data or the FDODTA contains the locator //value corresponding to the LOB. write the integer //value representing the locator here. +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 writeIntFdocaData(((ClientBlob)inputs[i]). getLocator()); break; @@ -923,6 +955,7 @@ private void buildFDODTA(int numVars, default: throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.NET_UNRECOGNIZED_JDBC_TYPE), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 protocolTypesAndLengths[i][0], numVars, i); } } @@ -970,6 +1003,7 @@ private void buildEXTDTA(ColumnMetaData parameterMetaData, } // the follow types are possible due to promotion to BLOB +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (parameterType == ClientTypes.BLOB || parameterType == ClientTypes.BINARY || parameterType == ClientTypes.VARBINARY @@ -989,7 +1023,10 @@ private void buildEXTDTA(ColumnMetaData parameterMetaData, b.getBinaryStream(), writeNullByte, index + 1); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (SQLException e) { +//IC see: https://issues.apache.org/jira/browse/DERBY-848 +//IC see: https://issues.apache.org/jira/browse/DERBY-848 throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.NET_ERROR_GETTING_BLOB_LENGTH), e); @@ -1023,6 +1060,7 @@ private void buildEXTDTA(ColumnMetaData parameterMetaData, writeScalarStream(chainFlag, chainedWithSameCorrelator, CodePoint.EXTDTA, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 (int) ((ClientBlob) b).length(), ((ClientBlob) b).getBinaryStream(), writeNullByte, @@ -1051,6 +1089,7 @@ else if ( c.getCharacterStream(), writeNullByte, index + 1); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (SQLException e) { throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.NET_ERROR_GETTING_BLOB_LENGTH), @@ -1152,6 +1191,7 @@ private Object retrievePromotedParameterIfExists(int index) { if (promototedParameters_.isEmpty()) { return null; } +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 return promototedParameters_.get(index); } @@ -1171,6 +1211,7 @@ private int calculateColumnsInSQLDTAGRPtriplet(int numVars) { // precision and scale (Kathey Marsden 10/11) // backburner: after refactoring this, later on, think about replacing case statements with table lookups private Hashtable computeProtocolTypesAndLengths( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Object[] inputRow, ColumnMetaData parameterMetaData, int[][] lidAndLengths, @@ -1203,10 +1244,12 @@ private Hashtable computeProtocolTypesAndLengths( if (jdbcType == 0) { throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.NET_INVALID_JDBC_TYPE_FOR_PARAM), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 i); } switch (jdbcType) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.CHAR: case Types.VARCHAR: // lid: PROTOCOL_TYPE_NVARMIX, length override: 32767 (max) @@ -1216,10 +1259,12 @@ private Hashtable computeProtocolTypesAndLengths( // assumes UTF-8 characters at most 3 bytes long // Flow the String as a VARCHAR if (s == null || s.length() <= 32767 / 3) { +//IC see: https://issues.apache.org/jira/browse/DERBY-499 lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NVARMIX; lidAndLengths[i][1] = 32767; } else { // Flow the data as CLOB data if the data too large to for LONGVARCHAR +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 byte[] ba = s.getBytes(Typdef.UTF8ENCODING); ByteArrayInputStream bais = new ByteArrayInputStream(ba); ClientClob c = new ClientClob( @@ -1245,6 +1290,7 @@ private Hashtable computeProtocolTypesAndLengths( case Types.INTEGER: // lid: PROTOCOL_TYPE_NINTEGER, length override: 4 // dataFormat: Integer +//IC see: https://issues.apache.org/jira/browse/DERBY-499 lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NINTEGER; lidAndLengths[i][1] = 4; break; @@ -1264,11 +1310,13 @@ private Hashtable computeProtocolTypesAndLengths( lidAndLengths[i][1] = 2; if (inputRow[i] instanceof Boolean) { Boolean bool = (Boolean) inputRow[i]; +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 inputRow[i] = Short.valueOf( bool.booleanValue() ? (short) 1 : 0); } } break; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.SMALLINT: case Types.TINYINT: // lid: PROTOCOL_TYPE_NSMALL, length override: 2 @@ -1300,6 +1348,7 @@ private Hashtable computeProtocolTypesAndLengths( int scale; int precision; +//IC see: https://issues.apache.org/jira/browse/DERBY-3126 if (bigDecimal == null) { scale = 0; @@ -1318,11 +1367,13 @@ private Hashtable computeProtocolTypesAndLengths( scale = bigDecimal.scale(); precision = Utils.computeBigDecimalPrecision(bigDecimal); } +//IC see: https://issues.apache.org/jira/browse/DERBY-499 lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NDECIMAL; lidAndLengths[i][1] = (precision << 8) + // use precision above (scale << 0); break; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.DATE: // for input, output, and inout parameters // lid: PROTOCOL_TYPE_NDATE, length override: 8 @@ -1359,6 +1410,7 @@ private Hashtable computeProtocolTypesAndLengths( lidAndLengths[i][1] = 32767; } else { // Flow the data as CLOB data if the data too large to for LONGVARCHAR +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 byte[] ba = s.getBytes(Typdef.UTF8ENCODING); ByteArrayInputStream bais = new ByteArrayInputStream(ba); ClientClob c = new ClientClob( @@ -1368,7 +1420,11 @@ private Hashtable computeProtocolTypesAndLengths( // Place the new Lob in the promototedParameter_ collection for // NetStatementRequest use promototedParameters_.put(i, c); +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 +//IC see: https://issues.apache.org/jira/browse/DERBY-499 +//IC see: https://issues.apache.org/jira/browse/DERBY-499 lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED; lidAndLengths[i][1] = buildPlaceholderLength(c.length()); } @@ -1377,6 +1433,7 @@ private Hashtable computeProtocolTypesAndLengths( case Types.VARBINARY: byte[] ba = (byte[]) inputRow[i]; if (ba == null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-499 lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NVARBYTE; lidAndLengths[i][1] = 32767; } else if (ba.length <= 32767) { @@ -1391,10 +1448,12 @@ private Hashtable computeProtocolTypesAndLengths( // NetStatementRequest use promototedParameters_.put(i, b); +//IC see: https://issues.apache.org/jira/browse/DERBY-499 lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES; lidAndLengths[i][1] = buildPlaceholderLength(ba.length); } break; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.LONGVARBINARY: ba = (byte[]) inputRow[i]; if (ba == null) { @@ -1406,16 +1465,22 @@ private Hashtable computeProtocolTypesAndLengths( } else { // Promote to a BLOB. Only reach this path in the absensce of describe information. ClientBlob b = new ClientBlob(ba, netAgent_, 0); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 // inputRow[i] = b; // Place the new Lob in the promototedParameter_ collection for // NetStatementRequest use promototedParameters_.put(i, b); +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 +//IC see: https://issues.apache.org/jira/browse/DERBY-499 lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES; lidAndLengths[i][1] = buildPlaceholderLength(ba.length); } break; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case Types.JAVA_OBJECT: lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NUDT; lidAndLengths[i][1] = 32767; @@ -1432,6 +1497,7 @@ private Hashtable computeProtocolTypesAndLengths( //Here the LID local identifier in the FDODSC //FD:OCA descriptor should be initialized as //to contain a BLOB locator. +//IC see: https://issues.apache.org/jira/browse/DERBY-2506 lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBLOC; lidAndLengths[i][1] = 4; @@ -1439,6 +1505,7 @@ private Hashtable computeProtocolTypesAndLengths( lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES; try { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if( b instanceof ClientBlob && ( (ClientBlob) b).willBeLayerBStreamed() ){ @@ -1449,7 +1516,9 @@ private Hashtable computeProtocolTypesAndLengths( lidAndLengths[i][1] = buildPlaceholderLength(b.length()); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (SQLException e) { +//IC see: https://issues.apache.org/jira/browse/DERBY-848 throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.NET_ERROR_GETTING_BLOB_LENGTH), e); } @@ -1473,13 +1542,17 @@ private Hashtable computeProtocolTypesAndLengths( //Here the LID local identifier in the FDODSC //FD:OCA descriptor should be initialized as //to contain a CLOB locator. +//IC see: https://issues.apache.org/jira/browse/DERBY-2506 lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NCLOBLOC; lidAndLengths[i][1] = 4; } else if (isExternalClob) { try { lobLength = c.length(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (SQLException e) { +//IC see: https://issues.apache.org/jira/browse/DERBY-848 +//IC see: https://issues.apache.org/jira/browse/DERBY-848 throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.NET_ERROR_GETTING_BLOB_LENGTH), e); @@ -1496,11 +1569,13 @@ private Hashtable computeProtocolTypesAndLengths( } if (c == null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-499 lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED; lidAndLengths[i][1] = buildPlaceholderLength(lobLength); } else if (isExternalClob) { lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCDBCS; lidAndLengths[i][1] = buildPlaceholderLength(lobLength); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } else if (((ClientClob) c).isCharacterStream()) { lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCDBCS; @@ -1513,6 +1588,7 @@ private Hashtable computeProtocolTypesAndLengths( lidAndLengths[i][1] = buildPlaceholderLength(lobLength); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } else if (((ClientClob) c).isUnicodeStream()) { lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED; @@ -1525,6 +1601,7 @@ private Hashtable computeProtocolTypesAndLengths( lidAndLengths[i][1] = buildPlaceholderLength(lobLength); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } else if (((ClientClob) c).isAsciiStream()) { lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCSBCS; @@ -1537,6 +1614,7 @@ private Hashtable computeProtocolTypesAndLengths( lidAndLengths[i][1] = buildPlaceholderLength(lobLength); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } else if (((ClientClob) c).isString()) { lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED; @@ -1555,6 +1633,7 @@ private Hashtable computeProtocolTypesAndLengths( default : throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.UNRECOGNIZED_JAVA_SQL_TYPE), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 jdbcType); } @@ -1564,6 +1643,8 @@ private Hashtable computeProtocolTypesAndLengths( } return overrideMap; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 catch ( SQLException se ) { throw new SqlException(se); @@ -1639,6 +1720,7 @@ void buildQRYROWSET(int fetchSize) throws SqlException { // prcnam can not be 0 length or > 255 length, SQLException will be thrown. private void buildPRCNAM(String prcnam) throws SqlException { if (prcnam == null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-848 throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.NET_NULL_PROCEDURE_NAME)); } @@ -1647,6 +1729,7 @@ private void buildPRCNAM(String prcnam) throws SqlException { if ((prcnamLength == 0) || (prcnamLength > 255)) { throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.NET_PROCEDURE_NAME_LENGTH_OUT_OF_RANGE), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 prcnamLength, 255); } @@ -1782,6 +1865,7 @@ private void buildTYPSQLDA(int typeSqlda) throws SqlException { * non-scrollable query upon end of data (SQLSTATE 02000). */ private void buildQRYCLSIMP() { +//IC see: https://issues.apache.org/jira/browse/DERBY-821 writeScalar1Byte(CodePoint.QRYCLSIMP, CodePoint.QRYCLSIMP_YES); } @@ -1791,6 +1875,7 @@ private void setFDODTALobLength(int[][] protocolTypesAndLengths, int i, long dat writeShort((short) dataLength); } else if (protocolTypesAndLengths[i][1] == 0x8004) { writeInt((int) dataLength); // 4 bytes to encode the length +//IC see: https://issues.apache.org/jira/browse/DERBY-1595 } else if (protocolTypesAndLengths[i][1] == 0x8006) { writeLong6Bytes(dataLength); // 6 bytes to encode the length } else if (protocolTypesAndLengths[i][1] == 0x8008) { @@ -1809,6 +1894,8 @@ private void setFDODTALobLengthUnknown(int i) throws SqlException { short v = 1; writeShort( v <<= 15 ); if (extdtaPositions_ == null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 extdtaPositions_ = new ArrayList(); } @@ -1821,6 +1908,7 @@ private boolean checkSendQryrowset(int fetchSize, // as many rows as fit in the query block. // if the cursor is scrollable, send qryrowset if it is supported by the server boolean sendQryrowset = false; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (resultSetType != ResultSet.TYPE_FORWARD_ONLY) { sendQryrowset = true; } @@ -1829,7 +1917,9 @@ private boolean checkSendQryrowset(int fetchSize, private int checkFetchsize(int fetchSize, int resultSetType) { // if fetchSize is not set for scrollable cursors, set it to the default fetchSize +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 if (resultSetType != ResultSet.TYPE_FORWARD_ONLY && fetchSize == 0) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 fetchSize = Configuration.defaultFetchSize; } return fetchSize; @@ -1840,6 +1930,7 @@ private int calculateResultSetFlags() { } public void writeSetSpecialRegister(Section section, ArrayList sqlsttList) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SqlException { buildEXCSQLSET(section); @@ -1871,6 +1962,7 @@ private void setFDODTALob(int securityMechanism, Lob lob, int[][] protocolTypesAndLengths, int i) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SqlException, SQLException{ if( lob.willBeLayerBStreamed() ) { diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetXACallInfo.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetXACallInfo.java index 9f25b2dfb0..58c3a7ce54 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetXACallInfo.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetXACallInfo.java @@ -43,11 +43,13 @@ Licensed to the Apache Software Foundation (ASF) under one or more import javax.transaction.xa.Xid; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class NetXACallInfo { Xid xid_; // current xid int xaFlags_; // current xaFlags /** XA transaction timeout in milliseconds. The value less than 0 means * that the time out is not specified. The value 0 means infinite timeout. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-2432 long xaTimeoutMillis_; // may not be needed!!!~~~ int xaFunction_; // queued XA function being performed @@ -73,15 +75,19 @@ public NetXACallInfo() { xaRetVal_ = 0; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 NetXACallInfo(Xid xid, int flags, NetXAConnection actualConn) { xid_ = xid; xaFlags_ = flags; +//IC see: https://issues.apache.org/jira/browse/DERBY-2432 +//IC see: https://issues.apache.org/jira/browse/DERBY-2432 xaTimeoutMillis_ = -1; actualConn_ = actualConn; xaRetVal_ = 0; } void saveConnectionVariables() { +//IC see: https://issues.apache.org/jira/browse/DERBY-1192 in_ = actualConn_.getNetConnection().getInputStream(); out_ = actualConn_.getNetConnection().getOutputStream(); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetXAConnection.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetXAConnection.java index 5671657dec..25edc196f3 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetXAConnection.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetXAConnection.java @@ -70,6 +70,7 @@ public NetXAConnection( boolean isXAConn, ClientPooledConnection cpc) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-1028 netCon = createNetConnection(logWriter, user, password, dataSource, rmId, isXAConn,cpc); checkPlatformVersion(); @@ -99,6 +100,7 @@ private void readLocalXARollback_() throws SqlException { netCon.netAgent_.netConnectionReply_.readLocalXARollback(netCon); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void writeTransactionStart(ClientStatement statement) throws SqlException { //KATHEY remove below after checking that we don't need it. @@ -125,9 +127,11 @@ void writeTransactionStart(ClientStatement statement) return; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void writeCommit() throws SqlException { // this logic must be in sync with willAutoCommitGenerateFlow() logic int xaState = netCon.getXAState(); +//IC see: https://issues.apache.org/jira/browse/DERBY-1192 if (xaState == netCon.XA_T0_NOT_ASSOCIATED){ netCon.xares_.callInfoArray_[ netCon.xares_.conn_.currXACallInfoOffset_ @@ -136,10 +140,12 @@ void writeCommit() throws SqlException { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void readCommit() throws SqlException { int xaState = netCon.getXAState(); NetXACallInfo callInfo = netCon.xares_.callInfoArray_ [netCon.currXACallInfoOffset_]; +//IC see: https://issues.apache.org/jira/browse/DERBY-1024 callInfo.xaRetVal_ = XAResource.XA_OK; // initialize XARETVAL if (xaState == netCon.XA_T0_NOT_ASSOCIATED) { readLocalXACommit_(); @@ -154,6 +160,7 @@ void readCommit() throws SqlException { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void writeRollback() throws SqlException { netCon.xares_.callInfoArray_[ netCon.xares_.conn_.currXACallInfoOffset_ @@ -164,6 +171,7 @@ void writeRollback() throws SqlException { void readRollback() throws SqlException { NetXACallInfo callInfo = netCon.xares_.callInfoArray_ [netCon.currXACallInfoOffset_]; +//IC see: https://issues.apache.org/jira/browse/DERBY-1024 callInfo.xaRetVal_ = XAResource.XA_OK; // initialize XARETVAL readLocalXARollback_(); @@ -193,6 +201,7 @@ private void checkPlatformVersion() throws SqlException { supportedVersion = 8; +//IC see: https://issues.apache.org/jira/browse/DERBY-1192 if (netCon.xaHostVersion_ >= supportedVersion) { // supported version, return return; @@ -203,6 +212,7 @@ private void checkPlatformVersion() throws SqlException { platform = "Linux, Unix, Windows"; throw new SqlException(netCon.agent_.logWriter_, new ClientMessageId(SQLState.NET_WRONG_XA_VERSION), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 platform, supportedVersion, netCon.xaHostVersion_); } @@ -226,15 +236,22 @@ private void checkPlatformVersion() throws SqlException { * */ private NetConnection createNetConnection ( +//IC see: https://issues.apache.org/jira/browse/DERBY-1028 +//IC see: https://issues.apache.org/jira/browse/DERBY-1028 LogWriter logWriter, String user, String password, +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 BasicClientDataSource dataSource, int rmId, boolean isXAConn, ClientPooledConnection cpc) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-941 +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 return (NetConnection)ClientAutoloadedDriver.getFactory().newNetConnection +//IC see: https://issues.apache.org/jira/browse/DERBY-1028 (logWriter, user, password,dataSource, rmId, isXAConn,cpc); } } diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetXAConnectionReply.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetXAConnectionReply.java index 4267911559..5011ca149d 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetXAConnectionReply.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetXAConnectionReply.java @@ -32,6 +32,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.client.am.ConnectionCallbackInterface; import org.apache.derby.client.am.DisconnectException; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class NetXAConnectionReply extends NetResultSetReply { NetXAConnectionReply(NetAgent netAgent, int bufferSize) { super(netAgent, bufferSize); @@ -60,6 +61,7 @@ public void readLocalXARollback(ConnectionCallbackInterface connection) throws D connection.completeLocalRollback(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void readXaStartUnitOfWork(NetConnection conn) throws DisconnectException { startSameIdChainParse(); parseSYNCCTLreply(conn); @@ -85,6 +87,7 @@ int readXaEndUnitOfWork(NetConnection conn) throws DisconnectException { parseSYNCCTLreply(conn); endOfSameIdChainData(); if (xaFlags == XAResource.TMFAIL) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return XAException.XA_RBROLLBACK; } return XAResource.XA_OK; @@ -98,6 +101,7 @@ int readXaPrepare(NetConnection conn) throws DisconnectException { return synctype; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void readXaCommit(NetConnection conn) throws DisconnectException { startSameIdChainParse(); parseSYNCCTLreply(conn); @@ -115,6 +119,7 @@ int readXaRollback(NetConnection conn) throws DisconnectException { NetXACallInfo callInfo = conn.xares_.callInfoArray_[conn.currXACallInfoOffset_]; conn.completeLocalRollback(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return XAResource.XA_OK; } @@ -176,6 +181,7 @@ int parseSYNCCRD(ConnectionCallbackInterface connection) throws DisconnectExcept if (peekCP == CodePoint.PRPHRCLST) { foundInPass = true; +//IC see: https://issues.apache.org/jira/browse/DERBY-5840 conn.setIndoubtTransactions(parseIndoubtList()); peekCP = peekCodePoint(); } @@ -198,6 +204,7 @@ int parseXARETVAL() throws DisconnectException { } // Process XA return value +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 byte parseSYNCTYPE() throws DisconnectException { parseLengthAndMatchCodePoint(CodePoint.SYNCTYPE); return readByte(); @@ -221,6 +228,7 @@ int parseSYNCCTLreply(ConnectionCallbackInterface connection) //JCFTMP, need to null out the client list? peekCP = peekCodePoint(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-3192 if (peekCP == CodePoint.PBSD) { parsePBSD(); } @@ -272,6 +280,7 @@ int parseXIDCNT() throws DisconnectException { return readUnsignedShort(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Xid parseXID() throws DisconnectException { parseLengthAndMatchCodePoint(CodePoint.XID); int formatId = readInt(); @@ -280,9 +289,11 @@ Xid parseXID() throws DisconnectException { byte[] gtrid = readBytes(gtridLen); byte[] bqual = readBytes(bqualLen); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 return new ClientXid(formatId, gtrid, bqual); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 List parseIndoubtList() throws DisconnectException { peekCodePoint(); diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetXAConnectionRequest.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetXAConnectionRequest.java index ce7e369c89..0779f1628c 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetXAConnectionRequest.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetXAConnectionRequest.java @@ -26,7 +26,10 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.client.am.SqlException; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class NetXAConnectionRequest extends NetResultSetRequest { +//IC see: https://issues.apache.org/jira/browse/DERBY-728 +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 NetXAConnectionRequest(NetAgent netAgent, int bufferSize) { super(netAgent, bufferSize); } @@ -54,6 +57,7 @@ public void writeXaStartUnitOfWork(NetConnection conn) throws SqlException { Xid xid = callInfo.xid_; int xaFlags = callInfo.xaFlags_; long xaTimeout = callInfo.xaTimeoutMillis_; +//IC see: https://issues.apache.org/jira/browse/DERBY-2432 // create DSS command with reply. createCommand(); @@ -79,6 +83,7 @@ public void writeXaStartUnitOfWork(NetConnection conn) throws SqlException { // DERBY-4232: The DRDA spec says that SYNCCTL should only have a // timeout property if TMNOFLAGS is specified. if (xaTimeout >= 0 && xaFlags == XAResource.TMNOFLAGS) { +//IC see: https://issues.apache.org/jira/browse/DERBY-2432 writeXATimeout(CodePoint.TIMEOUT, xaTimeout); } @@ -248,6 +253,7 @@ void writeXID(int codepoint, Xid xid) throws SqlException { write4Bytes(gtrid.length); write4Bytes(bqual.length); +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 writeBytes(gtrid); writeBytes(bqual); @@ -261,6 +267,7 @@ void writeXAFlags(int codepoint, int xaFlags) { } +//IC see: https://issues.apache.org/jira/browse/DERBY-2432 void writeXATimeout(int codepoint, long xaTimeout) { writeScalar8Bytes(codepoint, xaTimeout); } diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/NetXAResource.java b/java/org.apache.derby.client/org/apache/derby/client/net/NetXAResource.java index 7d10043ec2..a73ed59cc9 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/NetXAResource.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/NetXAResource.java @@ -78,6 +78,7 @@ public class NetXAResource implements XAResource { private static final String XAFUNCSTR_START = "XAResource.start()"; SqlException exceptionsOnXA = null; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 NetXAConnection netXAConn_; NetConnection conn_; @@ -91,6 +92,7 @@ public class NetXAResource implements XAResource { private int timeoutSeconds = 0; public NetXAResource(XAConnection xaconn, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 NetXAConnection conn) { conn_ = conn.getNetConnection(); netXAConn_ = conn; @@ -101,12 +103,14 @@ public NetXAResource(XAConnection xaconn, // construct the NetXACallInfo object for the array. for (int i = 0; i < INITIAL_CALLINFO_ELEMENTS; ++i) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 callInfoArray_[i] = new NetXACallInfo(null, XAResource.TMNOFLAGS, null); } // initialize the first XACallInfo element with the information from the // primary connection +//IC see: https://issues.apache.org/jira/browse/DERBY-1192 callInfoArray_[0].actualConn_ = conn; // ~~~ save conn_ connection variables in callInfoArray_[0] callInfoArray_[0].saveConnectionVariables(); @@ -129,6 +133,7 @@ public void commit(Xid xid, boolean onePhase) throws XAException { callInfo.xaFlags_ = (onePhase ? XAResource.TMONEPHASE : XAResource.TMNOFLAGS); callInfo.xid_ = xid; +//IC see: https://issues.apache.org/jira/browse/DERBY-1024 callInfo.xaRetVal_ = XAResource.XA_OK; // initialize XARETVAL try { netAgent.beginWriteChainOutsideUOW(); @@ -208,6 +213,7 @@ public void end(Xid xid, int flags) throws XAException { NetXACallInfo callInfo = callInfoArray_[conn_.currXACallInfoOffset_]; callInfo.xaFlags_ = flags; callInfo.xid_ = xid; +//IC see: https://issues.apache.org/jira/browse/DERBY-1024 callInfo.xaRetVal_ = XAResource.XA_OK; // initialize XARETVAL try { netAgent.beginWriteChainOutsideUOW(); @@ -231,6 +237,7 @@ public void end(Xid xid, int flags) throws XAException { // is changed by setXaStateForXAException inside the call // to throwXAException according the error code of the XAException // to be thrown. +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throwXAException(rc); }else { conn_.setXAState(ClientConnection.XA_T0_NOT_ASSOCIATED); @@ -259,6 +266,7 @@ public void forget(Xid xid) throws XAException { } NetXACallInfo callInfo = callInfoArray_[conn_.currXACallInfoOffset_]; callInfo.xid_ = xid; +//IC see: https://issues.apache.org/jira/browse/DERBY-1024 callInfo.xaRetVal_ = XAResource.XA_OK; // initialize XARETVAL try { // flow the required PROTOCOL to the server @@ -273,12 +281,14 @@ public void forget(Xid xid) throws XAException { netAgent.netConnectionReply_.readXaForget(netAgent.netConnection_); netAgent.endReadChain(); +//IC see: https://issues.apache.org/jira/browse/DERBY-1024 if (callInfo.xaRetVal_ != XAResource.XA_OK) { // xaRetVal has possible error, format it callInfo.xaFunction_ = XAFUNC_FORGET; rc = xaRetValErrorAccumSQL(callInfo, rc); callInfo.xaRetVal_ = XAResource.XA_OK; // re-initialize XARETVAL } } catch (SqlException sqle) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 exceptionsOnXA = Utils.accumulateSQLException(sqle, exceptionsOnXA); throwXAException(getSqlExceptionXAErrorCode(sqle)); } @@ -308,6 +318,7 @@ public int getTransactionTimeout() throws XAException { } if (conn_.agent_.loggingEnabled()) { +//IC see: https://issues.apache.org/jira/browse/DERBY-2432 conn_.agent_.logWriter_.traceExit(this, "getTransactionTimeout", timeoutSeconds); } return timeoutSeconds; @@ -341,6 +352,7 @@ public int prepare(Xid xid) throws XAException { // public interface for prepare int rc = XAResource.XA_OK; NetXACallInfo callInfo = callInfoArray_[conn_.currXACallInfoOffset_]; callInfo.xid_ = xid; +//IC see: https://issues.apache.org/jira/browse/DERBY-1024 callInfo.xaRetVal_ = XAResource.XA_OK; // initialize XARETVAL try { netAgent.beginWriteChainOutsideUOW(); @@ -350,6 +362,7 @@ public int prepare(Xid xid) throws XAException { // public interface for prepare // read the reply to the prepare rc = netAgent.netConnectionReply_.readXaPrepare(conn_); +//IC see: https://issues.apache.org/jira/browse/DERBY-1024 if ((callInfo.xaRetVal_ != XAResource.XA_OK) && (callInfo.xaRetVal_ != XAException.XA_RDONLY)) { // xaRetVal has possible error, format it callInfo.xaFunction_ = XAFUNC_PREPARE; @@ -363,7 +376,9 @@ public int prepare(Xid xid) throws XAException { // public interface for prepare exceptionsOnXA = Utils.accumulateSQLException(sqle, exceptionsOnXA); } +//IC see: https://issues.apache.org/jira/browse/DERBY-960 if ((rc != XAResource.XA_OK ) && (rc != XAResource.XA_RDONLY)) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throwXAException(rc); } if (conn_.agent_.loggingEnabled()) { @@ -403,6 +418,7 @@ public Xid[] recover(int flag) throws XAException { NetXACallInfo callInfo = callInfoArray_[conn_.currXACallInfoOffset_]; callInfo.xaFlags_ = flag; +//IC see: https://issues.apache.org/jira/browse/DERBY-1024 callInfo.xaRetVal_ = XAResource.XA_OK; // initialize XARETVAL try { netAgent.beginWriteChainOutsideUOW(); @@ -417,6 +433,7 @@ public Xid[] recover(int flag) throws XAException { } netAgent.endReadChain(); xidList = conn_.getIndoubtTransactionIds(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (SqlException sqle) { rc = getSqlExceptionXAErrorCode(sqle); @@ -455,6 +472,7 @@ public void rollback(Xid xid) throws XAException { // update the XACallInfo NetXACallInfo callInfo = callInfoArray_[conn_.currXACallInfoOffset_]; callInfo.xid_ = xid; +//IC see: https://issues.apache.org/jira/browse/DERBY-1024 callInfo.xaRetVal_ = XAResource.XA_OK; // initialize XARETVAL try { netAgent.beginWriteChainOutsideUOW(); @@ -463,6 +481,7 @@ public void rollback(Xid xid) throws XAException { // read the reply to the rollback rc = netAgent.netConnectionReply_.readXaRollback(conn_); netAgent.endReadChain(); +//IC see: https://issues.apache.org/jira/browse/DERBY-1024 if (callInfo.xaRetVal_ != XAResource.XA_OK) { // xaRetVal has possible error, format it callInfo.xaFunction_ = XAFUNC_END; rc = xaRetValErrorAccumSQL(callInfo, rc); @@ -500,6 +519,7 @@ public void rollback(Xid xid) throws XAException { */ public boolean setTransactionTimeout(int seconds) throws XAException { if (conn_.agent_.loggingEnabled()) { +//IC see: https://issues.apache.org/jira/browse/DERBY-2432 conn_.agent_.logWriter_.traceEntry(this, "setTransactionTimeout"); } if (seconds < 0) { @@ -539,6 +559,8 @@ public synchronized void start(Xid xid, int flags) throws XAException { if (conn_.agent_.loggingEnabled()) { conn_.agent_.logWriter_.traceEntry(this, "start", xid, flags); } +//IC see: https://issues.apache.org/jira/browse/DERBY-339 +//IC see: https://issues.apache.org/jira/browse/DERBY-246 if (conn_.isPhysicalConnClosed()) { connectionClosedFailure(); } @@ -546,10 +568,12 @@ public synchronized void start(Xid xid, int flags) throws XAException { // DERBY-1025 - Flow an auto-commit if in auto-commit mode before // entering a global transaction try { +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 if(conn_.autoCommit_) conn_.flowAutoCommit(); } catch (SqlException sqle) { rc = getSqlExceptionXAErrorCode(sqle); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 exceptionsOnXA = Utils.accumulateSQLException(sqle, exceptionsOnXA); } @@ -558,8 +582,10 @@ public synchronized void start(Xid xid, int flags) throws XAException { callInfo.xaFlags_ = flags; callInfo.xid_ = xid; callInfo.xaRetVal_ = XAResource.XA_OK; // initialize XARETVAL +//IC see: https://issues.apache.org/jira/browse/DERBY-1024 // check and setup the transaction timeout settings +//IC see: https://issues.apache.org/jira/browse/DERBY-2432 if (flags == TMNOFLAGS) { if (timeoutSeconds == Integer.MAX_VALUE) { // Disable the transaction timeout. @@ -591,15 +617,27 @@ public synchronized void start(Xid xid, int flags) throws XAException { // Setting this is currently required to avoid client from sending // commit for autocommit. if (rc == XAResource.XA_OK) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 conn_.setXAState(ClientConnection.XA_T1_ASSOCIATED); } } catch (SqlException sqle) { rc = getSqlExceptionXAErrorCode(sqle); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 exceptionsOnXA = Utils.accumulateSQLException(sqle, exceptionsOnXA); } if (rc != XAResource.XA_OK) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throwXAException(rc); } } @@ -607,6 +645,7 @@ public synchronized void start(Xid xid, int flags) throws XAException { private String getXAExceptionText(int rc) { String xaExceptionText; switch (rc) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case XAException.XA_RBROLLBACK: xaExceptionText = "XA_RBROLLBACK"; break; @@ -688,12 +727,15 @@ private String getXAExceptionText(int rc) { private void throwXAException(int rc) throws XAException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 StringBuilder xaExceptionText = new StringBuilder(64); +//IC see: https://issues.apache.org/jira/browse/DERBY-5071 xaExceptionText.append(getXAExceptionText(rc)); // save the SqlException chain to add it to the XAException SqlException sqlExceptions = exceptionsOnXA; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 while (exceptionsOnXA != null) { // one or more SqlExceptions received, format them xaExceptionText.append(" : ").append(exceptionsOnXA.getMessage()); @@ -721,11 +763,13 @@ private void throwXAException(int rc) * @throws XAException */ private void setXaStateForXAException(int rc) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 switch (rc) { // Reset to T0, not associated for XA_RB*, RM* // XAER_RMFAIL and XAER_RMERR will be fatal to the connection // but that is not dealt with here +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 case XAException.XAER_RMFAIL: case XAException.XAER_RMERR: case XAException.XA_RBROLLBACK: @@ -736,6 +780,7 @@ private void setXaStateForXAException(int rc) { case XAException.XA_RBPROTO: case XAException.XA_RBTIMEOUT: case XAException.XA_RBTRANSIENT: +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 conn_.setXAState(ClientConnection.XA_T0_NOT_ASSOCIATED); break; // No change for other XAExceptions @@ -764,6 +809,22 @@ public boolean isSameRM(XAResource xares) throws XAException { if (conn_.agent_.loggingEnabled()) { conn_.agent_.logWriter_.traceEntry(this, "isSameRM", xares); } +//IC see: https://issues.apache.org/jira/browse/DERBY-339 +//IC see: https://issues.apache.org/jira/browse/DERBY-246 +//IC see: https://issues.apache.org/jira/browse/DERBY-339 +//IC see: https://issues.apache.org/jira/browse/DERBY-246 +//IC see: https://issues.apache.org/jira/browse/DERBY-339 +//IC see: https://issues.apache.org/jira/browse/DERBY-246 +//IC see: https://issues.apache.org/jira/browse/DERBY-339 +//IC see: https://issues.apache.org/jira/browse/DERBY-246 +//IC see: https://issues.apache.org/jira/browse/DERBY-339 +//IC see: https://issues.apache.org/jira/browse/DERBY-246 +//IC see: https://issues.apache.org/jira/browse/DERBY-339 +//IC see: https://issues.apache.org/jira/browse/DERBY-246 +//IC see: https://issues.apache.org/jira/browse/DERBY-339 +//IC see: https://issues.apache.org/jira/browse/DERBY-246 +//IC see: https://issues.apache.org/jira/browse/DERBY-339 +//IC see: https://issues.apache.org/jira/browse/DERBY-246 if (conn_.isPhysicalConnClosed()) { connectionClosedFailure(); } @@ -846,10 +907,13 @@ public static boolean xidsEqual(Xid xid1, Xid xid2) { // determine if the 2 xids private void connectionClosedFailure() throws XAException { // throw an XAException XAER_RMFAIL, with a chained SqlException - closed +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 exceptionsOnXA = Utils.accumulateSQLException +//IC see: https://issues.apache.org/jira/browse/DERBY-1350 (new SqlException(null, new ClientMessageId(SQLState.NO_CURRENT_CONNECTION)), exceptionsOnXA); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throwXAException(XAException.XAER_RMFAIL); } @@ -883,6 +947,7 @@ protected int xaRetValErrorAccumSQL(NetXACallInfo callInfo, int currentRC) { // create an SqlException to report this error within SqlException accumSql = new SqlException(conn_.netAgent_.logWriter_, new ClientMessageId(SQLState.NET_XARETVAL_ERROR), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 SqlCode.queuedXAError, getXAFuncStr(callInfo.xaFunction_), getXAExceptionText(rc)); diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/OpenSocketAction.java b/java/org.apache.derby.client/org/apache/derby/client/net/OpenSocketAction.java index bad6eac719..25e8a82b0a 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/OpenSocketAction.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/OpenSocketAction.java @@ -39,6 +39,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.client.BasicClientDataSource; import org.apache.derby.shared.common.drda.NaiveTrustManager; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class OpenSocketAction implements PrivilegedExceptionAction { private String server_; private int port_; @@ -52,6 +53,7 @@ class OpenSocketAction implements PrivilegedExceptionAction { @Override public Socket run() +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws UnknownHostException, IOException, NoSuchAlgorithmException, @@ -64,7 +66,9 @@ public Socket run() SocketFactory sf; switch (clientSSLMode_) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 case BasicClientDataSource.SSL_BASIC: +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 Properties sslProperties = getSSLProperties(); sf = NaiveTrustManager.getSocketFactory(sslProperties); break; @@ -80,6 +84,7 @@ public Socket run() sf = SocketFactory.getDefault(); break; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 if (clientSSLMode_ == BasicClientDataSource.SSL_BASIC || clientSSLMode_ == BasicClientDataSource.SSL_PEER_AUTHENTICATION){ //DERBY-6764(analyze impact of poodle security alert on Derby @@ -126,6 +131,7 @@ public Socket run() */ private Properties getSSLProperties() { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 Properties retval = new Properties(); String keyStoreProp = System.getProperty(NaiveTrustManager.SSL_KEYSTORE); diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/PublicBufferOutputStream.java b/java/org.apache.derby.client/org/apache/derby/client/net/PublicBufferOutputStream.java index dcaa5bd438..e2f31fc930 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/PublicBufferOutputStream.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/PublicBufferOutputStream.java @@ -26,6 +26,7 @@ Licensed to the Apache Software Foundation (ASF) under one * A ByteArrayOutputStream which gives a direct reference of the buffer array */ class PublicBufferOutputStream extends ByteArrayOutputStream { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 PublicBufferOutputStream() { super(); diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/Reply.java b/java/org.apache.derby.client/org/apache/derby/client/net/Reply.java index e7093e9ce6..b83e9574c1 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/Reply.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/Reply.java @@ -36,6 +36,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.shared.common.reference.SQLState; import org.apache.derby.shared.common.reference.MessageId; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class Reply { protected Agent agent_; protected NetAgent netAgent_; //cheat-link to (NetAgent) agent_ @@ -67,6 +68,7 @@ class Reply { private int peekedNumOfExtendedLenBytes_ = 0; private int currentPos_ = 0; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final static int END_OF_COLLECTION = -1; final static int END_OF_SAME_ID_CHAIN = -2; @@ -81,6 +83,7 @@ final void initialize() { pos_ = 0; count_ = 0; topDdmCollectionStack_ = Reply.EMPTY_STACK; +//IC see: https://issues.apache.org/jira/browse/DERBY-823 Arrays.fill(ddmCollectionLenStack_, 0); ddmScalarLen_ = 0; dssLength_ = 0; @@ -170,7 +173,9 @@ private int fill(int minimumBytesNeeded) throws DisconnectException { try { // oops, we shouldn't expose the agent's input stream here, collapse this into a read method on the agent actualBytesRead = netAgent_.getInputStream().read(buffer_, count_, buffer_.length - count_); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (IOException ioe) { +//IC see: https://issues.apache.org/jira/browse/DERBY-846 netAgent_.throwCommunicationsFailure(ioe); } finally { if (agent_.loggingEnabled()) { @@ -196,6 +201,7 @@ private int fill(int minimumBytesNeeded) throws DisconnectException { netAgent_.accumulateChainBreakingReadExceptionAndThrow( new DisconnectException(netAgent_, new ClientMessageId(SQLState.NET_INSUFFICIENT_DATA), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 minimumBytesNeeded, totalBytesRead)); } } @@ -206,6 +212,7 @@ private int fill(int minimumBytesNeeded) throws DisconnectException { // The data will be in the buffer after this method is called. // Now returns the total bytes read for decryption, use to return void. private int ensureALayerDataInBuffer(int desiredDataSize) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws DisconnectException { int totalBytesRead = 0; // calulate the the number of bytes in the buffer. @@ -237,6 +244,7 @@ protected final void ensureBLayerDataInBuffer(int desiredDataSize) throws Discon // copying out the data into some other storage. any extended dss header // info will be removed in the copying process. private void compressBLayerData(int continueDssHeaderCount) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws DisconnectException { int tempPos = 0; @@ -305,6 +313,7 @@ private void compressBLayerData(int continueDssHeaderCount) bytesToShift = dssLength_; } +//IC see: https://issues.apache.org/jira/browse/DERBY-823 tempPos -= (bytesToShift - 2); System.arraycopy(buffer_, tempPos - shiftSize, buffer_, tempPos , bytesToShift); } @@ -399,6 +408,7 @@ private void readDssHeader() throws DisconnectException { private void decryptData(int gdsFormatter, int oldDssLength) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws DisconnectException { boolean readHeader; @@ -511,6 +521,7 @@ private void decryptData(int gdsFormatter, int oldDssLength) } if (flag) { int firstLobLength = ((clearedByte[0] & 0xFF) << 8) + +//IC see: https://issues.apache.org/jira/browse/DERBY-5017 ((clearedByte[1] & 0xFF) << 0); if (oldCount - oldDssLength < 6) { int totalBytesRead = fill(6); //sometimes the 2nd EXTDTA doesn't come back, need to fetch again to get it @@ -574,6 +585,7 @@ private void decryptData(int gdsFormatter, int oldDssLength) } +//IC see: https://issues.apache.org/jira/browse/DERBY-849 final int readUnsignedShort() throws DisconnectException { // should we be checking dss lengths and ddmScalarLengths here // if yes, i am not sure this is the correct place if we should be checking @@ -583,6 +595,7 @@ final int readUnsignedShort() throws DisconnectException { ((buffer_[pos_++] & 0xff) << 0); } +//IC see: https://issues.apache.org/jira/browse/DERBY-849 final short readShort() throws DisconnectException { // should we be checking dss lengths and ddmScalarLengths here ensureBLayerDataInBuffer(2); @@ -594,6 +607,7 @@ final short readShort() throws DisconnectException { return s; } +//IC see: https://issues.apache.org/jira/browse/DERBY-849 final int readInt() throws DisconnectException { // should we be checking dss lengths and ddmScalarLengths here ensureBLayerDataInBuffer(4); @@ -604,6 +618,7 @@ final int readInt() throws DisconnectException { return i; } +//IC see: https://issues.apache.org/jira/browse/DERBY-849 final int[] readUnsignedShortList() throws DisconnectException { int len = ddmScalarLen_; ensureBLayerDataInBuffer(len); @@ -632,6 +647,7 @@ final byte readByte() throws DisconnectException { return (byte) (buffer_[pos_++] & 0xff); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 final String readString(int length, Charset encoding) throws DisconnectException { ensureBLayerDataInBuffer(length); @@ -645,12 +661,15 @@ final String readString() throws DisconnectException { int len = ddmScalarLen_; ensureBLayerDataInBuffer(len); adjustLengths(len); +//IC see: https://issues.apache.org/jira/browse/DERBY-728 +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 String result = netAgent_.getCurrentCcsidManager() .convertToJavaString(buffer_, pos_, len); pos_ += len; return result; } +//IC see: https://issues.apache.org/jira/browse/DERBY-849 final byte[] readBytes(int length) throws DisconnectException { ensureBLayerDataInBuffer(length); adjustLengths(length); @@ -661,6 +680,7 @@ final byte[] readBytes(int length) throws DisconnectException { return b; } +//IC see: https://issues.apache.org/jira/browse/DERBY-849 final byte[] readBytes() throws DisconnectException { int len = ddmScalarLen_; ensureBLayerDataInBuffer(len); @@ -672,6 +692,7 @@ final byte[] readBytes() throws DisconnectException { return b; } +//IC see: https://issues.apache.org/jira/browse/DERBY-849 final void skipBytes(int length) throws DisconnectException { ensureBLayerDataInBuffer(length); adjustLengths(length); @@ -687,6 +708,7 @@ final void skipBytes() throws DisconnectException { // This will be the new and improved getData that handles all QRYDTA/EXTDTA // Returns the stream so that the caller can cache it +//IC see: https://issues.apache.org/jira/browse/DERBY-849 final ByteArrayOutputStream getData(ByteArrayOutputStream existingBuffer) throws DisconnectException { boolean readHeader; int copySize; @@ -886,6 +908,7 @@ final void doSyntaxrmSemantics(int syntaxErrorCode) throws DisconnectException { new ClientMessageId(SQLState.DRDA_CONNECTION_TERMINATED), SqlException.getMessageUtil().getTextMessage( MessageId.CONN_DRDA_DATASTREAM_SYNTAX_ERROR, +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 syntaxErrorCode)); // if we are communicating to an older server, we may get a SYNTAXRM on @@ -1091,6 +1114,7 @@ protected final void endOfSameIdChainData() throws DisconnectException { netAgent_.targetSqlam_ = netAgent_.orignalTargetSqlam_; if (this.topDdmCollectionStack_ != Reply.EMPTY_STACK) { +//IC see: https://issues.apache.org/jira/browse/DERBY-849 agent_.accumulateChainBreakingReadExceptionAndThrow( new DisconnectException(agent_, new ClientMessageId(SQLState.NET_COLLECTION_STACK_NOT_EMPTY))); @@ -1178,6 +1202,10 @@ final int readFastInt() throws DisconnectException { } final String readFastString(int length) throws DisconnectException { +//IC see: https://issues.apache.org/jira/browse/DERBY-728 +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 +//IC see: https://issues.apache.org/jira/browse/DERBY-728 +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 String result = netAgent_.getCurrentCcsidManager() .convertToJavaString(buffer_, pos_, length); pos_ += length; @@ -1207,6 +1235,7 @@ final void readFastIntArray(int[] array) throws DisconnectException { } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 final String readFastString(int length, Charset encoding) { String s = new String(buffer_, pos_, length, encoding); pos_ += length; @@ -1225,6 +1254,7 @@ final byte[] readFastLDBytes() throws DisconnectException { return b; } +//IC see: https://issues.apache.org/jira/browse/DERBY-849 final long readFastLong() throws DisconnectException { long l = SignedBinary.getLong(buffer_, pos_); pos_ += 8; @@ -1250,6 +1280,7 @@ final int getFastSkipSQLCARDrowLength() { // The only difference between this method and the original getData() method is this method // is not doing an ensureALayerDataInBuffer +//IC see: https://issues.apache.org/jira/browse/DERBY-849 final ByteArrayOutputStream getFastData(ByteArrayOutputStream existingBuffer) throws DisconnectException { boolean readHeader; int copySize; @@ -1307,6 +1338,8 @@ final protected void matchCodePoint(int expectedCodePoint) throws DisconnectExce agent_.accumulateChainBreakingReadExceptionAndThrow( new DisconnectException(agent_, new ClientMessageId(SQLState.NET_NOT_EXPECTED_CODEPOINT), +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 actualCodePoint, expectedCodePoint)); } } diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/Request.java b/java/org.apache.derby.client/org/apache/derby/client/net/Request.java index 33d0efb0c3..6e6447d231 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/Request.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/Request.java @@ -44,6 +44,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.shared.common.error.ExceptionUtil; class Request { +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 // byte array buffer used for constructing requests. // currently requests are built starting at the beginning of the buffer. @@ -81,8 +82,11 @@ class Request { // construct a request object specifying the minimum buffer size // to be used to buffer up the built requests. also specify the ccsid manager // instance to be used when building ddm character data. +//IC see: https://issues.apache.org/jira/browse/DERBY-728 +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 Request(NetAgent netAgent, int minSize) { netAgent_ = netAgent; +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 buffer = ByteBuffer.allocate(minSize); clearBuffer(); } @@ -110,6 +114,7 @@ final void initialize() { // will be expanded by the larger of (2 * current size) or (current size + length). // the data from the previous buffer is copied into the larger buffer. private final void ensureLength(int length) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 if (length > buffer.remaining()) { int newLength = Math.max(buffer.capacity() * 2, buffer.position() + length); @@ -173,6 +178,7 @@ private final void buildDss(boolean dssHasSameCorrelator, // RQSDSS header is 6 bytes long: (ll)(Cf)(rc) ensureLength(6); +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 // Save the position of the length bytes, so they can be updated with a // different value at a later time. @@ -193,6 +199,7 @@ private final void buildDss(boolean dssHasSameCorrelator, } } buffer.put((byte) dssType); +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 // Write the request correlation id (two bytes, token rc). // use method that writes a short @@ -219,14 +226,17 @@ final void writeScalarStream(boolean chained, } +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 final void writeScalarStream(boolean chained, boolean chainedWithSameCorrelator, int codePoint, +//IC see: https://issues.apache.org/jira/browse/DERBY-1595 long length, InputStream in, boolean writeNullByte, int parameterIndex) throws DisconnectException, SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 if (netAgent_.netConnection_.getSecurityMechanism() == NetConfiguration.SECMEC_EUSRIDDTA || netAgent_.netConnection_.getSecurityMechanism() == NetConfiguration.SECMEC_EUSRPWDDTA) { // DERBY-4706 @@ -235,10 +245,12 @@ final void writeScalarStream(boolean chained, // state. // Throw an exception for now until we're positive the code can be // ditched, later this comment/code itself can also be removed. +//IC see: https://issues.apache.org/jira/browse/DERBY-4706 throw new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.NOT_IMPLEMENTED), "encrypted scalar streams"); +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 }else{ writePlainScalarStream(chained, @@ -271,24 +283,32 @@ final void writeScalarStream(boolean chained, * @throws DisconnectException if a severe error condition is encountered, * causing the connection to be broken */ +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 final private void writePlainScalarStream(boolean chained, boolean chainedWithSameCorrelator, int codePoint, +//IC see: https://issues.apache.org/jira/browse/DERBY-1595 long length, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 InputStream in, boolean writeNullByte, int parameterIndex) throws DisconnectException, SqlException { // We don't have the metadata available when we create this request // object, so we have to check here if we are going to write the status // byte or not. +//IC see: https://issues.apache.org/jira/browse/DERBY-2017 final boolean writeEXTDTAStatusByte = netAgent_.netConnection_.serverSupportsEXTDTAAbort(); // If the Derby specific status byte is sent, the number of bytes to // send differs from the number of bytes to read (off by one byte). +//IC see: https://issues.apache.org/jira/browse/DERBY-1595 long leftToRead = length; long bytesToSend = writeEXTDTAStatusByte ? leftToRead + 1 : leftToRead; int extendedLengthByteCount = prepScalarStream(chained, +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 chainedWithSameCorrelator, writeNullByte, bytesToSend); @@ -304,6 +324,7 @@ final private void writePlainScalarStream(boolean chained, bytesToRead--; } +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 buildLengthAndCodePointForLob(codePoint, bytesToSend, writeNullByte, @@ -313,6 +334,7 @@ final private void writePlainScalarStream(boolean chained, do { do { try { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 bytesRead = in.read(buffer.array(), buffer.position(), bytesToRead); } catch (IOException ioe) { @@ -340,6 +362,7 @@ final private void writePlainScalarStream(boolean chained, padScalarStreamForError(leftToRead, bytesToRead, writeEXTDTAStatusByte, status); // set with SQLSTATE 01004: The value of a string was truncated when assigned to a host variable. +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 netAgent_.accumulateReadException( new SqlException( netAgent_.logWriter_, @@ -349,10 +372,12 @@ final private void writePlainScalarStream(boolean chained, return; } if (bytesRead == -1) { +//IC see: https://issues.apache.org/jira/browse/DERBY-2017 status = DRDAConstants.STREAM_TOO_SHORT; padScalarStreamForError(leftToRead, bytesToRead, writeEXTDTAStatusByte, status); // set with SQLSTATE 01004: The value of a string was truncated when assigned to a host variable. +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 netAgent_.accumulateReadException( new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.NET_PREMATURE_EOS), @@ -360,6 +385,7 @@ final private void writePlainScalarStream(boolean chained, return; } else { bytesToRead -= bytesRead; +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 buffer.position(buffer.position() + bytesRead); leftToRead -= bytesRead; } @@ -371,8 +397,10 @@ final private void writePlainScalarStream(boolean chained, // check to make sure that the specified length wasn't too small try { if (in.read() != -1) { +//IC see: https://issues.apache.org/jira/browse/DERBY-2017 status = DRDAConstants.STREAM_TOO_LONG; // set with SQLSTATE 01004: The value of a string was truncated when assigned to a host variable. +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 netAgent_.accumulateReadException(new SqlException( netAgent_.logWriter_, new ClientMessageId( @@ -385,9 +413,12 @@ final private void writePlainScalarStream(boolean chained, netAgent_.logWriter_, new ClientMessageId( SQLState.NET_EXCEPTION_ON_STREAMLEN_VERIFICATION), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, parameterIndex, e.getMessage())); } // Write the status byte to the send buffer. +//IC see: https://issues.apache.org/jira/browse/DERBY-2017 if (writeEXTDTAStatusByte) { writeEXTDTAStatus(status); } @@ -417,9 +448,11 @@ final private void writePlainScalarStream(boolean chained, * @throws DisconnectException if a severe error condition is encountered, * causing the connection to be broken */ +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 final private void writePlainScalarStream(boolean chained, boolean chainedWithSameCorrelator, int codePoint, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 InputStream in, boolean writeNullByte, int parameterIndex) @@ -435,6 +468,7 @@ final private void writePlainScalarStream(boolean chained, flushExistingDSS(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 ensureLength(DssConstants.MAX_DSS_LEN - buffer.position()); buildDss(true, @@ -446,6 +480,7 @@ final private void writePlainScalarStream(boolean chained, int spareInDss; +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 if (writeNullByte) { spareInDss = DssConstants.MAX_DSS_LEN - 6 - 4 - 1; } else { @@ -460,6 +495,7 @@ final private void writePlainScalarStream(boolean chained, int bytesRead = 0; while( ( bytesRead = +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 in.read(buffer.array(), buffer.position(), spareInDss) ) > -1 ) { @@ -473,6 +509,7 @@ final private void writePlainScalarStream(boolean chained, flushScalarStreamSegment(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 buffer.putShort((short) 0xFFFF); spareInDss = DssConstants.MAX_DSS_LEN - 2; @@ -481,6 +518,7 @@ final private void writePlainScalarStream(boolean chained, } } catch (Exception e) { +//IC see: https://issues.apache.org/jira/browse/DERBY-2017 if (writeEXTDTAStatusByte) { writeEXTDTAStatus(DRDAConstants.STREAM_READ_ERROR); } @@ -488,12 +526,15 @@ final private void writePlainScalarStream(boolean chained, new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.NET_EXCEPTION_ON_READ), e, parameterIndex, e.getMessage()); +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 netAgent_.accumulateReadException(sqlex); +//IC see: https://issues.apache.org/jira/browse/DERBY-5896 return; } +//IC see: https://issues.apache.org/jira/browse/DERBY-2017 if (writeEXTDTAStatusByte) { writeEXTDTAStatus(DRDAConstants.STREAM_OK); } @@ -511,10 +552,13 @@ final void writeScalarStream(boolean chained, boolean writeNullByte, int parameterIndex) throws DisconnectException, SqlException{ +//IC see: https://issues.apache.org/jira/browse/DERBY-1388 +//IC see: https://issues.apache.org/jira/browse/DERBY-1417 writeScalarStream(chained, chainedWithSameCorrelator, codePoint, +//IC see: https://issues.apache.org/jira/browse/DERBY-1595 length * 2L, EncodedInputStream.createUTF16BEStream(r), writeNullByte, @@ -525,6 +569,8 @@ final void writeScalarStream(boolean chained, final void writeScalarStream(boolean chained, boolean chainedWithSameCorrelator, int codePoint, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Reader r, boolean writeNullByte, int parameterIndex) throws DisconnectException, @@ -545,6 +591,7 @@ final void writeScalarStream(boolean chained, private final int prepScalarStream(boolean chained, boolean chainedWithSameCorrelator, boolean writeNullByte, +//IC see: https://issues.apache.org/jira/browse/DERBY-1595 long leftToRead) throws DisconnectException { int nullIndicatorSize = writeNullByte ? 1 : 0; @@ -553,6 +600,7 @@ private final int prepScalarStream(boolean chained, // flush the existing DSS segment if this stream will not fit in the send buffer if ((10 + extendedLengthByteCount + nullIndicatorSize + +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 leftToRead + buffer.position()) > DssConstants.MAX_DSS_LEN) { try { if (simpleDssFinalize) { @@ -598,7 +646,10 @@ private final void flushExistingDSS() throws DisconnectException { finalizePreviousChainedDss(true); } sendBytes(netAgent_.getOutputStream()); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (IOException e) { +//IC see: https://issues.apache.org/jira/browse/DERBY-846 netAgent_.throwCommunicationsFailure(e); } @@ -614,6 +665,7 @@ private final int flushScalarStreamSegment(long leftToRead, // either at end of data, end of dss segment, or both. if (leftToRead != 0) { // 32k segment filled and not at end of data. +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 if ((Math.min(2 + leftToRead, 32767)) > buffer.remaining()) { try { sendBytes(netAgent_.getOutputStream()); @@ -623,6 +675,7 @@ private final int flushScalarStreamSegment(long leftToRead, } dssLengthLocation_ = buffer.position(); buffer.putShort((short) 0xFFFF); +//IC see: https://issues.apache.org/jira/browse/DERBY-1595 newBytesToRead = (int)Math.min(leftToRead, 32765L); } @@ -633,10 +686,18 @@ private final int flushScalarStreamSegment() throws DisconnectException { try { sendBytes(netAgent_.getOutputStream()); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (IOException ioe) { +//IC see: https://issues.apache.org/jira/browse/DERBY-846 +//IC see: https://issues.apache.org/jira/browse/DERBY-846 +//IC see: https://issues.apache.org/jira/browse/DERBY-846 +//IC see: https://issues.apache.org/jira/browse/DERBY-846 +//IC see: https://issues.apache.org/jira/browse/DERBY-846 netAgent_.throwCommunicationsFailure(ioe); } +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 dssLengthLocation_ = buffer.position(); return DssConstants.MAX_DSS_LEN; } @@ -663,10 +724,12 @@ private final int flushScalarStreamSegment() throws DisconnectException { private final void padScalarStreamForError(long leftToRead, int bytesToRead, boolean writeStatus, +//IC see: https://issues.apache.org/jira/browse/DERBY-2017 byte status) throws DisconnectException { do { do { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 buffer.put((byte) 0x0); // use 0x0 as the padding byte bytesToRead--; leftToRead--; @@ -676,6 +739,7 @@ private final void padScalarStreamForError(long leftToRead, } while (leftToRead > 0); // Append the EXTDTA status flag if appropriate. +//IC see: https://issues.apache.org/jira/browse/DERBY-2017 if (writeStatus) { writeEXTDTAStatus(status); } @@ -684,6 +748,7 @@ private final void padScalarStreamForError(long leftToRead, private final void writeExtendedLengthBytes(int extendedLengthByteCount, long length) { int shiftSize = (extendedLengthByteCount - 1) * 8; for (int i = 0; i < extendedLengthByteCount; i++) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 buffer.put((byte) (length >>> shiftSize)); shiftSize -= 8; } @@ -699,6 +764,7 @@ private final void finalizePreviousChainedDss( finalizeDssLength(); int pos = dssLengthLocation_ + 3; +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 byte value = buffer.get(pos); value |= 0x40; if (dssHasSameCorrelator) // for blobs @@ -760,6 +826,7 @@ private final void finalizeDssLength() { // new end of the data. int dataByte = buffer.position() - 1; int shiftOffset = contDssHeaderCount * 2; +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 ensureLength(shiftOffset); buffer.position(buffer.position() + shiftOffset); @@ -775,6 +842,7 @@ private final void finalizeDssLength() { // perform the shift dataByte -= dataToShift; +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 byte[] array = buffer.array(); System.arraycopy(array, dataByte + 1, array, dataByte + shiftOffset + 1, dataToShift); @@ -792,6 +860,7 @@ private final void finalizeDssLength() { } // insert the header's length bytes +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 buffer.putShort(dataByte + shiftOffset - 1, (short) twoByteContDssHeader); @@ -809,6 +878,7 @@ private final void finalizeDssLength() { } // insert the length bytes in the 6 byte dss header. +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 buffer.putShort(dssLengthLocation_, (short) totalSize); } @@ -820,6 +890,7 @@ private final void finalizeDssLength() { // Note: this mechanism handles extended length ddms. protected final void markLengthBytes(int codePoint) { ensureLength(4); +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 // save the location of length bytes in the mark stack. mark(); @@ -868,6 +939,7 @@ protected final void updateLengthBytes() throws SqlException { // ensure there is enough room in the buffer for the extended length bytes. ensureLength(extendedLengthByteCount); +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 // calculate the length to be placed in the extended length bytes. // this length does not include the 4 byte llcp. @@ -875,6 +947,7 @@ protected final void updateLengthBytes() throws SqlException { // shift the data to the right by the number of extended length bytes needed. int extendedLengthLocation = lengthLocation + 4; +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 byte[] array = buffer.array(); System.arraycopy(array, extendedLengthLocation, @@ -901,6 +974,7 @@ protected final void updateLengthBytes() throws SqlException { } // write the 2 byte length field (2 bytes before codepoint). +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 buffer.putShort(lengthLocation, (short) length); } @@ -925,6 +999,7 @@ private final int calculateExtendedLengthByteCount(long ddmSize) //throws SqlExc // insert the padByte into the buffer by length number of times. private final void padBytes(byte padByte, int length) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 ensureLength(length); for (int i = 0; i < length; i++) { buffer.put(padByte); @@ -941,6 +1016,7 @@ final void write1Byte(int value) { final void buildTripletHeader(int tripletLength, int tripletType, int tripletId) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 ensureLength(3); buffer.put((byte) tripletLength); buffer.put((byte) tripletType); @@ -965,6 +1041,7 @@ final void writeLidAndLengths(int[][] lidAndLengthOverrides, int count, int offset, boolean mddRequired, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 Hashtable map) { if (!mddRequired) { writeLidAndLengths(lidAndLengthOverrides, count, offset); @@ -972,6 +1049,7 @@ final void writeLidAndLengths(int[][] lidAndLengthOverrides, // if mdd overrides are required, lookup the protocolType in the map, and substitute // the protocolType with the override lid. else { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 ensureLength(count * 3); int protocolType, overrideLid; Object entry; @@ -979,8 +1057,10 @@ final void writeLidAndLengths(int[][] lidAndLengthOverrides, protocolType = lidAndLengthOverrides[offset][0]; // lookup the protocolType in the protocolType->overrideLid map // if an entry exists, replace the protocolType with the overrideLid +//IC see: https://issues.apache.org/jira/browse/DERBY-5873 entry = map.get(protocolType); overrideLid = (entry == null) ? protocolType : ((Integer) entry).intValue(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 buffer.put((byte) overrideLid); buffer.putShort((short) lidAndLengthOverrides[offset][1]); } @@ -991,6 +1071,7 @@ final void writeLidAndLengths(int[][] lidAndLengthOverrides, // insert a big endian unsigned 2 byte value into the buffer. final void write2Bytes(int value) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 writeShort((short) value); } @@ -1064,6 +1145,7 @@ final void writeScalar8Bytes(int codePoint, long value) { // passed in as an argument (this value is NOT incremented by 4 before being // inserted). final void writeLengthCodePoint(int length, int codePoint) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 ensureLength(4); buffer.putShort((short) length); buffer.putShort((short) codePoint); @@ -1105,11 +1187,14 @@ final void writeScalarString(int codePoint, String string, int byteMinLength, /* Grab the current CCSID MGR from the NetAgent */ CcsidManager currentCcsidMgr = netAgent_.getCurrentCcsidManager(); +//IC see: https://issues.apache.org/jira/browse/DERBY-728 +//IC see: https://issues.apache.org/jira/browse/DERBY-4757 // We don't know the length of the string yet, so set it to 0 for now. // Will be updated later. int lengthPos = buffer.position(); writeLengthCodePoint(0, codePoint); +//IC see: https://issues.apache.org/jira/browse/DERBY-5068 int stringByteLength = encodeString(string); if (stringByteLength > byteLengthLimit) { @@ -1159,6 +1244,7 @@ private int encodeString(String string) throws SqlException { // the length of the llcp. This method does not handle scenarios which // require extended length bytes. final void writeScalarBytes(int codePoint, byte[] buff) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 writeScalarBytes(codePoint, buff, 0, buff.length); } @@ -1170,6 +1256,7 @@ final void writeScalarBytes(int codePoint, byte[] buff) { // the length will contain the length of the data plus the length of the llcp. // This method does not handle scenarios which require extended length bytes. final void writeScalarBytes(int codePoint, byte[] buff, int start, int length) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 writeLengthCodePoint(length + 4, codePoint); ensureLength(length); buffer.put(buff, start, length); @@ -1180,6 +1267,7 @@ final void writeScalarBytes(int codePoint, byte[] buff, int start, int length) { // Not: this method is not to be used for truncation and buff.length // must be <= paddedLength. final void writeScalarPaddedBytes(byte[] buff, int paddedLength, byte padByte) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 writeBytes(buff); padBytes(padByte, paddedLength - buff.length); } @@ -1197,6 +1285,7 @@ private void sendBytes(OutputStream socketOutputStream) throws IOException { try { netAgent_.markWriteChainAsDirty(); +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 socketOutputStream.write(buffer.array(), 0, buffer.position()); socketOutputStream.flush(); } finally { @@ -1206,6 +1295,7 @@ private void sendBytes(OutputStream socketOutputStream) passwordIncluded_ = false; } if (netAgent_.loggingEnabled()) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 ((NetLogWriter) netAgent_.logWriter_).traceProtocolFlow( buffer.array(), 0, @@ -1229,6 +1319,7 @@ private final void maskOutPassword() { mask.append(maskChar); } // try to write mask over password. +//IC see: https://issues.apache.org/jira/browse/DERBY-5068 buffer.position(passwordStart_); encodeString(mask.toString()); } catch (SqlException sqle) { @@ -1268,6 +1359,7 @@ void writeInt(int v) { * represented by six bytes. */ final void writeLong6Bytes(long v) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 ensureLength(6); buffer.putShort((short) (v >> 32)); buffer.putInt((int) v); @@ -1307,6 +1399,7 @@ protected void writeDouble(double v) { } // insert a java.math.BigDecimal into the buffer. +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 final void writeBigDecimal(BigDecimal v, int declaredPrecision, int declaredScale) throws SqlException { @@ -1318,12 +1411,14 @@ final void writeBigDecimal(BigDecimal v, } final void writeDate(DateTimeValue date) throws SqlException { +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 ensureLength(10); DateTime.dateToDateBytes(buffer.array(), buffer.position(), date); buffer.position(buffer.position() + 10); } final void writeTime(DateTimeValue time) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 ensureLength(8); DateTime.timeToTimeBytes(buffer.array(), buffer.position(), time); buffer.position(buffer.position() + 8); @@ -1332,6 +1427,7 @@ final void writeTime(DateTimeValue time) { final void writeTimestamp(DateTimeValue timestamp) throws SqlException { boolean supportsTimestampNanoseconds = netAgent_.netConnection_.serverSupportsTimestampNanoseconds(); int length = DateTime.getTimestampLength( supportsTimestampNanoseconds ); +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 ensureLength(length); DateTime.timestampToTimestampBytes( buffer.array(), buffer.position(), @@ -1342,6 +1438,7 @@ final void writeTimestamp(DateTimeValue timestamp) throws SqlException { // insert a java boolean into the buffer. the boolean is written // as a signed byte having the value 0 or 1. final void writeBoolean(boolean v) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 write1Byte(v ? 1 : 0); } @@ -1350,6 +1447,7 @@ final void writeBoolean(boolean v) { // should this throw SqlException // Will write a varchar mixed or single // this was writeLDString +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 final void writeSingleorMixedCcsidLDString(String s, Charset encoding) throws SqlException { byte[] b = s.getBytes(encoding); if (b.length > 0x7FFF) { @@ -1357,6 +1455,7 @@ final void writeSingleorMixedCcsidLDString(String s, Charset encoding) throws Sq new ClientMessageId(SQLState.LANG_STRING_TOO_LONG), "32767"); } +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 writeLDBytes(b); } @@ -1377,6 +1476,7 @@ private final void writeLDBytesX(int ldSize, byte[] bytes) { // private helper method for writing just a subset of a byte array private final void writeLDBytesXSubset( int ldSize, int bytesToCopy, byte[] bytes ) { +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 writeShort((short) ldSize); writeBytes(bytes, bytesToCopy); } @@ -1389,6 +1489,8 @@ final void writeUDT( Object val ) throws SqlException try { +//IC see: https://issues.apache.org/jira/browse/DERBY-5786 +//IC see: https://issues.apache.org/jira/browse/DERBY-4491 PublicBufferOutputStream pbos = new PublicBufferOutputStream(); ObjectOutputStream oos = new ObjectOutputStream( pbos ); @@ -1403,6 +1505,7 @@ final void writeUDT( Object val ) throws SqlException ( netAgent_.logWriter_, new ClientMessageId (SQLState.NET_MARSHALLING_UDT_ERROR), +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 e, e.getMessage() ); @@ -1423,6 +1526,7 @@ final void writeUDT( Object val ) throws SqlException } private void buildLengthAndCodePointForLob(int codePoint, +//IC see: https://issues.apache.org/jira/browse/DERBY-1595 long leftToRead, boolean writeNullByte, int extendedLengthByteCount) throws DisconnectException { @@ -1472,10 +1576,12 @@ private void buildLengthAndCodePointForLob(int codePoint, * @throws DisconnectException if flushing the buffer fails */ private void writeEXTDTAStatus(byte flag) +//IC see: https://issues.apache.org/jira/browse/DERBY-2017 throws DisconnectException { // Write the status byte to the send buffer. // Make sure we have enough space for the status byte. +//IC see: https://issues.apache.org/jira/browse/DERBY-5210 if (buffer.remaining() == 0) { flushScalarStreamSegment(1, 0); // Trigger a flush. } diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/ResultSetReply.java b/java/org.apache.derby.client/org/apache/derby/client/net/ResultSetReply.java index 245f7cfcce..a3512fd404 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/ResultSetReply.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/ResultSetReply.java @@ -26,6 +26,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.client.am.SqlException; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class ResultSetReply extends StatementReply { private ResultSetReplyInterface materialResultSetReply_; @@ -37,6 +38,7 @@ class ResultSetReply extends StatementReply { materialResultSetReply_ = materialResultSetReply; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void readFetch(ResultSetCallbackInterface resultSet) throws SqlException { materialResultSetReply_.readFetch(resultSet); agent_.checkForChainBreakingException_(); @@ -55,6 +57,7 @@ public void readPositioningFetch(ResultSetCallbackInterface resultSet) throws Sq agent_.checkForChainBreakingException_(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void readCursorClose(ResultSetCallbackInterface resultSet) throws SqlException { materialResultSetReply_.readCursorClose(resultSet); diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/ResultSetReplyInterface.java b/java/org.apache.derby.client/org/apache/derby/client/net/ResultSetReplyInterface.java index 145ccd07c8..11f680a5a4 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/ResultSetReplyInterface.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/ResultSetReplyInterface.java @@ -27,6 +27,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more interface ResultSetReplyInterface { public void readFetch(ResultSetCallbackInterface resultSet) throws DisconnectException; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 public void readScrollableFetch(ResultSetCallbackInterface resultSet) throws DisconnectException; diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/ResultSetRequestInterface.java b/java/org.apache.derby.client/org/apache/derby/client/net/ResultSetRequestInterface.java index 77bfd3508d..43fbe37f24 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/ResultSetRequestInterface.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/ResultSetRequestInterface.java @@ -35,6 +35,8 @@ public void writeFetch(NetResultSet resultSet, int fetchSize) throws SqlException; public void writeScrollableFetch( +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 NetResultSet resultSet, Section section, int fetchSize, diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/StatementReply.java b/java/org.apache.derby.client/org/apache/derby/client/net/StatementReply.java index 700e94fb45..66013fe842 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/StatementReply.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/StatementReply.java @@ -26,6 +26,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import org.apache.derby.client.am.SqlException; import org.apache.derby.client.am.StatementCallbackInterface; +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 class StatementReply extends ConnectionReply { private StatementReplyInterface materialStatementReply_; @@ -36,6 +37,7 @@ class StatementReply extends ConnectionReply { materialStatementReply_ = materialStatementReply; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 void readPrepareDescribeOutput(StatementCallbackInterface statement) throws SqlException { materialStatementReply_.readPrepareDescribeOutput(statement); diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/StatementRequestInterface.java b/java/org.apache.derby.client/org/apache/derby/client/net/StatementRequestInterface.java index 154a239e4d..d58ca9757f 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/StatementRequestInterface.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/StatementRequestInterface.java @@ -51,6 +51,7 @@ public void writeOpenQuery(NetStatement materialStatement, public void writeExecute(NetPreparedStatement materialPreparedStatement, Section section, +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 ColumnMetaData parameterMetaData, Object[] inputs, int numInputColumns, @@ -90,5 +91,6 @@ public void writeExecuteCall(NetStatement materialStatement, public void writeSetSpecialRegister(Section section, ArrayList sqlsttList) +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 throws SqlException; } diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/Typdef.java b/java/org.apache.derby.client/org/apache/derby/client/net/Typdef.java index ff27b92c84..1b3ba84e81 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/Typdef.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/Typdef.java @@ -984,6 +984,7 @@ boolean isCcsidSbcSet() { } // analyze exception handling some more here +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 Charset getCcsidSbcEncoding() throws DisconnectException { if (ccsidSbcEncoding_ == null) { ccsidSbcEncoding_ = UTF8ENCODING; @@ -1028,6 +1029,7 @@ boolean isCcsidMbcSet() { } // analyze exception handling some more here +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 Charset getCcsidMbcEncoding() throws DisconnectException { if (ccsidMbcEncoding_ == null) { ccsidMbcEncoding_ = UTF8ENCODING; @@ -1038,6 +1040,7 @@ Charset getCcsidMbcEncoding() throws DisconnectException { public Object clone() { try { return super.clone(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 } catch (CloneNotSupportedException e) { return null; // this shouldn't happen since we implement the cloneable interface } @@ -1055,6 +1058,7 @@ void updateColumn(NetCursor netCursor, } if (sda == null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-849 netAgent_.accumulateChainBreakingReadExceptionAndThrow( new DisconnectException(netAgent_, new ClientMessageId(SQLState.NET_INVALID_FDOCA_ID))); @@ -1069,6 +1073,7 @@ void updateColumn(NetCursor netCursor, // The typdef object should store the java encoding, switch (sda.ccsid_) { case CCSIDSBC: +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 netCursor.charset_[columnIndex] = getCcsidSbcEncoding(); netCursor.ccsid_[columnIndex] = this.ccsidSbc_; break; @@ -1102,6 +1107,7 @@ void updateColumn(NetCursor netCursor, // otherwise the sda.ccsid_ is a placeholder: // CCSIDMBC, CCSIDDDBC, CCSIDSBC to indicate that // the actual ccsid is the connection's ccsid (in protocol lingo the connection's typdef ccsid). +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 netCursor.charset_[columnIndex] = UTF8ENCODING; netCursor.ccsid_[columnIndex] = sda.ccsid_; break; diff --git a/java/org.apache.derby.client/org/apache/derby/client/net/Utf8CcsidManager.java b/java/org.apache.derby.client/org/apache/derby/client/net/Utf8CcsidManager.java index ca484ea94c..32bd78ea00 100644 --- a/java/org.apache.derby.client/org/apache/derby/client/net/Utf8CcsidManager.java +++ b/java/org.apache.derby.client/org/apache/derby/client/net/Utf8CcsidManager.java @@ -64,6 +64,7 @@ public Utf8CcsidManager() { } public byte[] convertFromJavaString(String sourceString, Agent agent) +//IC see: https://issues.apache.org/jira/browse/DERBY-5068 throws SqlException { try { ByteBuffer buf = encoder.encode(CharBuffer.wrap(sourceString)); @@ -91,10 +92,12 @@ public byte[] convertFromJavaString(String sourceString, Agent agent) * Offset and numToConvert are given in terms of bytes! Not characters! */ public String convertToJavaString(byte[] sourceBytes, int offset, int numToConvert) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6231 return new String(sourceBytes, offset, numToConvert, UTF8_CHARSET); } public void startEncoding() { +//IC see: https://issues.apache.org/jira/browse/DERBY-5068 encoder.reset(); } diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/drda/NaiveTrustManager.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/drda/NaiveTrustManager.java index 26ede59248..36e52ca2b2 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/drda/NaiveTrustManager.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/drda/NaiveTrustManager.java @@ -71,6 +71,7 @@ private NaiveTrustManager() **/ public static SocketFactory getSocketFactory(Properties sslProperties) throws java.security.NoSuchAlgorithmException, +//IC see: https://issues.apache.org/jira/browse/DERBY-3096 java.security.KeyManagementException, java.security.NoSuchProviderException, java.security.KeyStoreException, @@ -85,6 +86,7 @@ public static SocketFactory getSocketFactory(Properties sslProperties) SSLContext ctx = SSLContext.getInstance("TLS"); if (ctx.getProvider().getName().equals("SunJSSE") && +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 (sslProperties.getProperty(SSL_KEYSTORE) != null) && (sslProperties.getProperty(SSL_KEYSTORE_PASSWORD) != null)) { @@ -94,6 +96,7 @@ public static SocketFactory getSocketFactory(Properties sslProperties) // peerAuthentication, we have to provide one working the // same way as the default one. +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 String keyStore = sslProperties.getProperty(SSL_KEYSTORE); String keyStorePassword = sslProperties.getProperty(SSL_KEYSTORE_PASSWORD); diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/DerbySQLIntegrityConstraintViolationException.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/DerbySQLIntegrityConstraintViolationException.java index 8f5f4cff9a..1706200897 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/DerbySQLIntegrityConstraintViolationException.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/DerbySQLIntegrityConstraintViolationException.java @@ -36,6 +36,7 @@ public DerbySQLIntegrityConstraintViolationException( } public DerbySQLIntegrityConstraintViolationException( +//IC see: https://issues.apache.org/jira/browse/DERBY-6803 String reason, String SQLState, int vendorCode, diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/ErrorStringBuilder.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/ErrorStringBuilder.java index 7f321f2429..66372abb57 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/ErrorStringBuilder.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/ErrorStringBuilder.java @@ -92,6 +92,7 @@ public void stackTrace(Throwable t) t.printStackTrace(printWriter); +//IC see: https://issues.apache.org/jira/browse/DERBY-2472 if (t instanceof java.sql.SQLException) { Throwable next = ((java.sql.SQLException)t).getNextException(); t = (next == null) ? t.getCause() : next; diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/ExceptionFactory.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/ExceptionFactory.java index 78bbc7fa3b..a69f7a50c8 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/ExceptionFactory.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/ExceptionFactory.java @@ -38,9 +38,11 @@ public abstract class ExceptionFactory { // the need for more than one implementation ever arises again, the // code below should be changed to load the correct factory for the // run-time platform. +//IC see: https://issues.apache.org/jira/browse/DERBY-6253 String impl = "org.apache.derby.impl.jdbc.SQLExceptionFactory"; ExceptionFactory factory = null; try { +//IC see: https://issues.apache.org/jira/browse/DERBY-6856 Class clazz = Class.forName(impl); factory = (ExceptionFactory) clazz.getConstructor().newInstance(); } catch (Exception e) { @@ -71,6 +73,7 @@ public static ExceptionFactory getInstance() { */ public abstract SQLException getSQLException(String message, String messageId, SQLException next, int severity, Throwable cause, Object... args); +//IC see: https://issues.apache.org/jira/browse/DERBY-6253 /** * Construct an SQLException whose message and severity are derived from @@ -83,5 +86,6 @@ public abstract SQLException getSQLException(String message, String messageId, * @return an SQLException */ public abstract SQLException getSQLException(String messageId, +//IC see: https://issues.apache.org/jira/browse/DERBY-6253 SQLException next, Throwable cause, Object... args); } diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/ExceptionUtil.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/ExceptionUtil.java index ada005c837..9ccf80e258 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/ExceptionUtil.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/ExceptionUtil.java @@ -55,6 +55,7 @@ public class ExceptionUtil */ public static String getSQLStateFromIdentifier(String messageID) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 if (messageID.length() == 5) return messageID; return messageID.substring(0, 5); diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/MessageUtils.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/MessageUtils.java index faccd9fa9b..6bac72e2a2 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/MessageUtils.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/MessageUtils.java @@ -346,6 +346,7 @@ public static void getLocalizedMessage(int sqlcode, short errmcLen, String sqler } try { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 msg[0] = formatMessage (MessageService.getBundleForLocale(locale, messageId), messageId, arguments, true); rc[0] = 0; @@ -355,6 +356,7 @@ public static void getLocalizedMessage(int sqlcode, short errmcLen, String sqler // most likely it does exist in our fake base class _en, so try that. } catch (ShutdownException se) { } +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 msg[0] = formatMessage (MessageService.getBundleForLocale(EN, messageId), messageId, arguments, false); rc[0] = 0; @@ -373,6 +375,7 @@ public static String getLocalizedMessage(Locale locale, String messageId, Object String locMsg = null; try { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 locMsg = formatMessage (MessageService.getBundleForLocale(locale, messageId), messageId, args, true); return locMsg; diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/PassThroughException.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/PassThroughException.java index 6a59e2976b..24c253684e 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/PassThroughException.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/PassThroughException.java @@ -35,6 +35,7 @@ public final class PassThroughException extends RuntimeException { * @param cause the {@code Throwable} to pass through */ public PassThroughException(Throwable cause) { +//IC see: https://issues.apache.org/jira/browse/DERBY-4010 super(cause); } diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/PublicAPI.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/PublicAPI.java index b06099b6ba..6f9f2739dd 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/PublicAPI.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/PublicAPI.java @@ -39,6 +39,7 @@ public class PublicAPI @return a SQLException wrapped around the original exception */ public static SQLException wrapStandardException(StandardException se) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6488 se.markAsPublicAPI(); return ExceptionFactory.getInstance().getSQLException( se.getMessage(), se.getMessageId(), (SQLException) null, diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/SQLWarningFactory.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/SQLWarningFactory.java index aa829e1849..550afa2514 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/SQLWarningFactory.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/SQLWarningFactory.java @@ -51,6 +51,7 @@ public static SQLWarning newSQLWarning(String messageId, Object... args) { return new SQLWarning ( +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 MessageService.getTextMessage( messageId, args ), StandardException.getSQLStateFromIdentifier(messageId), ExceptionSeverity.WARNING_SEVERITY diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/StandardException.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/StandardException.java index 289e261798..562a49857b 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/error/StandardException.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/error/StandardException.java @@ -83,12 +83,14 @@ protected StandardException(String messageID, Throwable t, Object[] args) this.severity = getSeverityFromIdentifier(messageID); this.sqlState = getSQLStateFromIdentifier(messageID); this.arguments = args; +//IC see: https://issues.apache.org/jira/browse/DERBY-2472 if (t != null) { initCause(t); } if (SanityManager.DEBUG) { +//IC see: https://issues.apache.org/jira/browse/DERBY-336 SanityManager.ASSERT(messageID != null, "StandardException with no messageID"); } @@ -153,6 +155,7 @@ public final int getErrorCode() { If you need teh identifier that was used to create the message, then use getMessageId(). getMessageId() will return the string that corresponds to the field in org.apache.derby.shared.common.reference.SQLState. +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 @return the 5 character SQL state */ @@ -167,6 +170,7 @@ public final String getSQLState() * @return the next exception */ public final SQLException getNextException() { +//IC see: https://issues.apache.org/jira/browse/DERBY-6488 return next; } @@ -183,6 +187,7 @@ final void markAsPublicAPI() { } /** +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 Convert a message identifer from org.apache.derby.shared.common.reference.SQLState to a SQLState five character string. * @param messageID - the sql state id of the message from Derby @@ -197,6 +202,7 @@ public static String getSQLStateFromIdentifier(String messageID) { /** Get the severity given a message identifier from org.apache.derby.shared.common.reference.SQLState. +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 @param messageID The handle on the message @return the severity associated with the message @@ -291,6 +297,7 @@ public static StandardException normalClose() } public static StandardException +//IC see: https://issues.apache.org/jira/browse/DERBY-6254 newException(String messageId, Object... args) { return newException(messageId, (Throwable) null, args); } @@ -343,6 +350,7 @@ public static StandardException newException(String messageID, * @throws BadMessageArgumentException - always (dummy) */ public static StandardException newException(String messageID, +//IC see: https://issues.apache.org/jira/browse/DERBY-336 Object a1, Object a2, Throwable t) @@ -369,6 +377,7 @@ public static StandardException newPreLocalizedException( String MessageID, { StandardException se = new StandardException( MessageID, localizedMessage); if( t != null) +//IC see: https://issues.apache.org/jira/browse/DERBY-2472 se.initCause(t); return se; } @@ -387,6 +396,7 @@ public static StandardException newPreLocalizedException( String MessageID, */ public static StandardException getArgumentFerry(SQLException se) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6488 Throwable cause = se.getCause(); return (cause instanceof StandardException) ? (StandardException) cause : null; @@ -406,6 +416,7 @@ private static boolean isVacuousWrapper(Throwable t) { // The only interesting information in an InvocationTargetException // or a PrivilegedActionException is the cause, so consider them // vacuous if they have a cause. +//IC see: https://issues.apache.org/jira/browse/DERBY-6493 if (t instanceof InvocationTargetException || t instanceof PrivilegedActionException) { return (t.getCause() != null); @@ -450,6 +461,8 @@ public static StandardException unexpectedUserException(Throwable t) ** (38001-38XXX). If so, then we convert it into a ** StandardException without further ado. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-1440 +//IC see: https://issues.apache.org/jira/browse/DERBY-2472 if ((t instanceof SQLException) && (ferry == null)) { SQLException sqlex = (SQLException)t; @@ -462,6 +475,7 @@ public static StandardException unexpectedUserException(Throwable t) StandardException se = new StandardException(state, sqlex.getMessage()); if (sqlex.getNextException() != null) { +//IC see: https://issues.apache.org/jira/browse/DERBY-2472 se.initCause(sqlex.getNextException()); } return se; @@ -506,6 +520,7 @@ public static StandardException unexpectedUserException(Throwable t) ** should be seen as a bug. */ String detailMessage = t.getMessage(); +//IC see: https://issues.apache.org/jira/browse/DERBY-6488 if (detailMessage == null) { @@ -518,6 +533,7 @@ public static StandardException unexpectedUserException(Throwable t) if (detailMessage.length() == 0) { detailMessage = t.getClass().getName(); } +//IC see: https://issues.apache.org/jira/browse/DERBY-6488 else { detailMessage = t.getClass().getName() + ": " + detailMessage; @@ -542,6 +558,7 @@ public static StandardException plainWrapException(Throwable t) { // If there is no useful information in the top-level throwable, // peel it off and only report the cause. +//IC see: https://issues.apache.org/jira/browse/DERBY-6493 if (isVacuousWrapper(t)) { return plainWrapException(t.getCause()); } @@ -559,6 +576,7 @@ public static StandardException plainWrapException(Throwable t) { StandardException se = new StandardException(sqlState, "(" + sqle.getErrorCode() + ") " + sqle.getMessage()); sqle = sqle.getNextException(); if (sqle != null) +//IC see: https://issues.apache.org/jira/browse/DERBY-2472 se.initCause(plainWrapException(sqle)); return se; } @@ -593,6 +611,7 @@ public static StandardException closeException() { */ /** +//IC see: https://issues.apache.org/jira/browse/DERBY-6945

The message stored in the super class Throwable must be set up object creation. At this time we cannot get any information @@ -612,6 +631,7 @@ is stored in this class at the first request. */ public String getMessage() { +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 if (textMessage == null) { textMessage = MessageService.getTextMessage( getMessageId(), getArguments()); @@ -671,6 +691,7 @@ public static StandardException interrupt(InterruptedException ie) { public static SQLWarning newWarning(String messageId, Object... oa) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 String message = MessageService.getTextMessage(messageId, oa); String state = StandardException.getSQLStateFromIdentifier(messageId); SQLWarning sqlw = new SQLWarning(message, state, ExceptionSeverity.WARNING_SEVERITY); @@ -700,6 +721,7 @@ public final boolean isLockTimeout() { **/ public final boolean isSelfDeadlock() { +//IC see: https://issues.apache.org/jira/browse/DERBY-6554 return(SQLState.SELF_DEADLOCK.equals(getSQLState())); } diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/i18n/MessageService.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/i18n/MessageService.java index 946cadfc75..20834b653a 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/i18n/MessageService.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/i18n/MessageService.java @@ -73,6 +73,7 @@ public static void setFinder(BundleFinder theFinder) { } /** +//IC see: https://issues.apache.org/jira/browse/DERBY-6945

Transform the message from messageID to the actual error, warning, or info message using the correct locale. @@ -209,6 +210,7 @@ default locale or base class the one for en_US is returned. public static ResourceBundle getBundleWithEnDefault(String resource, Locale locale) { ResourceBundle retval = null; +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 retval = getBundle(resource, locale); @@ -268,6 +270,7 @@ private static ResourceBundle getBundle(String resource, Locale locale) */ private static ResourceBundle lookupBundle(String resource, Locale locale) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 if (JVMInfo.isModuleAware()) { return lookupBundleInModule(resource, locale); } else { return ResourceBundle.getBundle(resource, locale); } } @@ -292,6 +295,7 @@ public static ResourceBundle lookupBundleInModule(String resource, Locale locale // if (resource.contains(CLIENT_MESSAGES)) { moduleName = ModuleUtil.CLIENT_MODULE_NAME; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 else if (resource.contains(SERVER_MESSAGES)) { moduleName = ModuleUtil.SERVER_MODULE_NAME; } else if (resource.contains(TOOLS_MESSAGES) || resource.contains(SYSINFO_MESSAGES)) { @@ -375,6 +379,7 @@ else if (resource.contains(TOOLS_MESSAGES) || resource.contains(SYSINFO_MESSAGES * @return the corresponding resource bundle */ private static PropertyResourceBundle getModuleResourceBundle +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 (final String resourceName, final Module module) { try @@ -397,6 +402,7 @@ public InputStream run() throws IOException } else { return null; } } +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 catch (Exception ioe) { System.out.println(ioe.getMessage()); @@ -412,6 +418,7 @@ public InputStream run() throws IOException */ private static String localizeResourceName(String original, String localeName) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 if ( (original == null) || (original.contains(CLIENT_MESSAGES)) || diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/i18n/MessageUtil.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/i18n/MessageUtil.java index 9ba2f378ce..0a12405553 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/i18n/MessageUtil.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/i18n/MessageUtil.java @@ -65,6 +65,7 @@ public MessageUtil(String resourceBundleName) * @return the message text with arguments plugged in */ public String getTextMessage(String messageID, Object... args) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6262 return getCompleteMessage(messageID, args); } @@ -137,6 +138,7 @@ public static String getCompleteMessage(Locale locale, // we should compose a default message or throw an exception if // the message still is not found. return formatMessage( +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 MessageService.getBundleWithEnDefault(resourceBundleName, US), messageId, arguments, composeDefault); } @@ -207,6 +209,7 @@ public static String formatMessage(ResourceBundle bundle, String messageId, Object[] arguments, boolean composeDefault) { String message = null; +//IC see: https://issues.apache.org/jira/browse/DERBY-1115 String badArgsMessage = null; if (arguments == null) @@ -219,11 +222,13 @@ public static String formatMessage(ResourceBundle bundle, String messageId, // Ensure that the right number of arguments are passed in. +//IC see: https://issues.apache.org/jira/browse/DERBY-1115 if ( SanityManager.DEBUG ) { int numExpected = countParams(message); SanityManager.ASSERT(numExpected == arguments.length, "Number of parameters expected for message id " + +//IC see: https://issues.apache.org/jira/browse/DERBY-842 messageId + " (" + numExpected + ") does not match number of arguments received (" + arguments.length + ")"); @@ -233,6 +238,7 @@ public static String formatMessage(ResourceBundle bundle, String messageId, return MessageFormat.format(message, arguments); } catch (IllegalArgumentException iae) { +//IC see: https://issues.apache.org/jira/browse/DERBY-839 if ( !composeDefault || SanityManager.DEBUG ) throw iae; } @@ -251,6 +257,7 @@ public static String formatMessage(ResourceBundle bundle, String messageId, } } +//IC see: https://issues.apache.org/jira/browse/DERBY-1115 return composeDefaultMessage("UNKNOWN MESSAGE, id " + messageId, arguments); } @@ -294,6 +301,7 @@ private static int countParams(String message) */ public static String composeDefaultMessage(String message, Object[] arguments) { +//IC see: https://issues.apache.org/jira/browse/DERBY-1115 if (message == null) { message = "UNKNOWN"; diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/info/JVMInfo.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/info/JVMInfo.java index 0120afcce3..bfb5771164 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/info/JVMInfo.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/info/JVMInfo.java @@ -44,11 +44,14 @@ public abstract class JVMInfo

  • 1 - not used was JDK 1.1
  • 2 - not used, was for JDK 1.2 and 1.3 +//IC see: https://issues.apache.org/jira/browse/DERBY-6213
  • 4 - not used, was for JDK 1.4.0 or 1.4.1
  • 5 - not used, was for JDK 1.4.2
  • 6 - not used, was for JDK 1.5 +//IC see: https://issues.apache.org/jira/browse/DERBY-6857
  • 7 - not used, was for JDK 1.6
  • 8 - not used, was for JDK 1.7 +//IC see: https://issues.apache.org/jira/browse/DERBY-5948
  • 9 - J2SE_18 - JDK 1.8
*/ @@ -61,6 +64,7 @@ public abstract class JVMInfo public static int jdbcMajorVersion() { +//IC see: https://issues.apache.org/jira/browse/DERBY-6324 return 4; } @@ -88,6 +92,7 @@ public static int jdbcMinorVersion() // If we don't recognize that, or if the property is not set, assume // version 1.8, which is the lowest level we support. // +//IC see: https://issues.apache.org/jira/browse/DERBY-6857 String javaVersion = "1.8"; try { javaVersion = @@ -109,6 +114,7 @@ public static int jdbcMinorVersion() try { // Extract major and minor version out of the spec version. +//IC see: https://issues.apache.org/jira/browse/DERBY-6518 String[] ver = javaVersion.split("[.]"); int major = ver.length >= 1 ? Integer.parseInt(ver[0]) : 0; int minor = ver.length >= 2 ? Integer.parseInt(ver[1]) : 0; @@ -128,6 +134,7 @@ public static int jdbcMinorVersion() JDK_ID = id; +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 _isModuleAware = (getSystemModulePath() != null); } @@ -153,6 +160,7 @@ public static String derbyVMLevel() */ private static String getSystemProperty(final String name) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6213 return AccessController .doPrivileged(new java.security.PrivilegedAction() { @@ -191,6 +199,7 @@ public static final boolean isIBMJVM() { */ public static final boolean isModuleAware() { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 return _isModuleAware; } @@ -212,6 +221,7 @@ public static final String getSystemModulePath() */ public static void javaDump() { if (isIBMJVM()) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6213 Class ibmc = null; try { ibmc = Class.forName("com.ibm.jvm.Dump"); @@ -240,6 +250,7 @@ public Object run() throws IllegalAccessException, * @return true if JNDI is available */ public static boolean hasJNDI() { +//IC see: https://issues.apache.org/jira/browse/DERBY-5955 try { Class.forName("javax.naming.Referenceable"); } catch (ClassNotFoundException e) { diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/info/ProductVersionHolder.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/info/ProductVersionHolder.java index 18dae0bff2..dc0db9b6f6 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/info/ProductVersionHolder.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/info/ProductVersionHolder.java @@ -31,6 +31,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more /** Class to hold a Derby Product version. +//IC see: https://issues.apache.org/jira/browse/DERBY-2400 This class includes the following product version features. @@ -61,6 +62,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more is represented by a int (2G values) we have plenty of room for encoding. If we assign a given majorVersion.minorVersion.fixPack a 10 year life, then we about the maximum number of individual releases it can have is 10 years * 365 days/year = 3650. Thus with the pre 5.2 scheme we would not expect a +//IC see: https://issues.apache.org/jira/browse/DERBY-6856 5.1.x to have an x > 3650 (approximately). Usually the rate of point releases has been much less than one per day, 5.1.31 is released about 225 days after GA which makes around a point release every 7 days. But in the encoding we need to be conservative. With fix packs the maximum is about 2 per year and fix @@ -84,6 +86,7 @@ is represented by a int (2G values) we have plenty of room for encoding. If we a The encoding number must continue to increase so that the encodedMaintB > encodedMaintA +//IC see: https://issues.apache.org/jira/browse/DERBY-6856 if (fixPackB > fixPackA) || ((fixPackB == fixPackA) && (bugB > bugA)) @@ -365,6 +368,7 @@ public String getProductTechnologyName() /** Return the fix pack version from the maintenance encoding. +//IC see: https://issues.apache.org/jira/browse/DERBY-6125 @return the fix pack version number */ @@ -553,6 +557,7 @@ else if (isBeta) { Returns a short-hand value for the product version string. Used by Sysinfo. Includes the optional beta designation +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 @param withBuild If true, include the build number @@ -575,9 +580,11 @@ public final Properties run() { } // SECURITY PERMISSION - IP4 private Properties loadProperties(String productGenus) { +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 String resourceName = "/org/apache/derby/info/" + productGenus+"/info.properties"; InputStream is = null; +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 if (JVMInfo.isModuleAware()) { diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/Attribute.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/Attribute.java index 4321fe62f3..2d71b3cb2f 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/Attribute.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/Attribute.java @@ -46,6 +46,7 @@ public interface Attribute { /** +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 Not an attribute but the root for the JDBC URL that Derby supports. */ String PROTOCOL = "jdbc:derby:"; @@ -112,6 +113,8 @@ public interface Attribute * If used, REPLICATION_SLAVE_HOST is a required attribute. */ String REPLICATION_START_MASTER = "startMaster"; +//IC see: https://issues.apache.org/jira/browse/DERBY-3189 +//IC see: https://issues.apache.org/jira/browse/DERBY-2954 /** * Attribute name to stop replication master mode for a database. @@ -154,7 +157,9 @@ public interface Attribute String REPLICATION_SLAVE_PORT = "slavePort"; /** +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 The attribute that is used for the database name, from +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 the JDBC notion of jdbc:$subprotocol:$subname */ String DBNAME_ATTR = "databaseName"; @@ -355,6 +360,7 @@ Optional JDBC url attribute (at the database create time only) It can * traceLevel. * Client driver attribute. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-446 String CLIENT_TRACE_LEVEL = "traceLevel"; /** diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/ClassName.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/ClassName.java index 6ca1975460..5b60d1b4ce 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/ClassName.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/ClassName.java @@ -71,6 +71,7 @@ public interface ClassName String Storable = "org.apache.derby.iapi.services.io.Storable"; String StandardException = "org.apache.derby.shared.common.error.StandardException"; +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 String LanguageConnectionContext = "org.apache.derby.iapi.sql.conn.LanguageConnectionContext"; String ConstantAction = "org.apache.derby.iapi.sql.execute.ConstantAction"; diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/EngineType.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/EngineType.java index 1f3e490164..b4e6901f00 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/EngineType.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/EngineType.java @@ -53,4 +53,4 @@ public interface EngineType { * If not set defaults to STANDALONE_DB. */ String PROPERTY = "derby.engineType"; -} \ No newline at end of file +} diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/JDBC40Translation.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/JDBC40Translation.java index fa50c689c4..2f4675d351 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/JDBC40Translation.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/JDBC40Translation.java @@ -28,6 +28,7 @@ an intermediary class with hard-coded copies of constants that will be available in jdbc 4.0, it becomes possible to refer to these constants when compiling against older jdk versions. +//IC see: https://issues.apache.org/jira/browse/DERBY-2438

This class also contains some constants shared by the network server and client.

diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/MessageId.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/MessageId.java index 47f32a83cd..163543b107 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/MessageId.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/MessageId.java @@ -63,6 +63,7 @@ public interface MessageId { String LOG_DURABILITY_TESTMODE_NO_SYNC_ERR = "L021"; // hint that error could be because // derby.system.durability was set to test +//IC see: https://issues.apache.org/jira/browse/DERBY-4072 String LOG_CHANGED_DB_TO_READ_ONLY = "L022"; // a permissions error on log caused us // to change db to read only. @@ -93,8 +94,11 @@ public interface MessageId { * When the specified overflow page isn't found while streaming from a * page overflow chain (large data values, typically BLOB or CLOB). */ +//IC see: https://issues.apache.org/jira/browse/DERBY-2992 String STORE_STREAM_OVERFLOW_PAGE_NOT_FOUND = "D015"; String STORE_PAGE_DUMP = "D016"; +//IC see: https://issues.apache.org/jira/browse/DERBY-6320 +//IC see: https://issues.apache.org/jira/browse/DERBY-4923 /* ** ClassManager @@ -113,8 +117,10 @@ public interface MessageId { /* ** Connectivity */ +//IC see: https://issues.apache.org/jira/browse/DERBY-4601 String CONN_SHUT_DOWN_ENGINE = "J003"; // shutting down Derby Engine String CONN_DATABASE_IDENTITY = "J004"; // database identity +//IC see: https://issues.apache.org/jira/browse/DERBY-2400 String CONN_SHUT_DOWN_CLOUDSCAPE = "J005"; // shut down Derby String CONN_DEREGISTER_AUTOLOADEDDRIVER = "J006"; // remove registered AutoloadedDriver String CONN_CREATE_DATABASE = "J007"; // create database @@ -127,6 +133,7 @@ public interface MessageId { String CONN_CRYPTO_EXTERNAL_KEY = "J019"; // external cryptographic key String CONN_BOOT_PASSWORD = "J020"; // secret cryptographic key String CONN_LOCALE = "J021"; // locale for the database +//IC see: https://issues.apache.org/jira/browse/DERBY-2334 String CONN_COLLATION = "J031"; // collation info for the character datatypes String CONN_USERNAME_ATTR = "J022"; // user name String CONN_PASSWORD_ATTR = "J023"; // user password @@ -138,7 +145,10 @@ public interface MessageId { String CONN_NETWORK_SERVER_CLASS_LOAD = "J101"; // Cannot load the network server constructor String CONN_NETWORK_SERVER_START_EXCEPTION = "J102"; String CONN_NETWORK_SERVER_SHUTDOWN_EXCEPTION = "J103"; +//IC see: https://issues.apache.org/jira/browse/DERBY-5090 String OBJECT_CLOSED = "J104"; +//IC see: https://issues.apache.org/jira/browse/DERBY-847 +//IC see: https://issues.apache.org/jira/browse/DERBY-3902 String CONN_PRECISION_TOO_LARGE = "J105"; // following only used in text we print out - see client.am.SqlException: String BATCH_POSITION_ID = "J107"; @@ -165,13 +175,17 @@ public interface MessageId { String CONN_DRDA_QRYOPEN = "J129"; String CONN_DRDA_INVALIDFDOCA = "J130"; String CONN_DRDA_DATASTREAM_SYNTAX_ERROR = "J131"; +//IC see: https://issues.apache.org/jira/browse/DERBY-851 String CONN_USERNAME_DESCRIPTION = "J132"; String CONN_PASSWORD_DESCRIPTION = "J133"; /** * Error message for negative values for the maxStatements property * of data sources supporting statement pooling. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-3325 +//IC see: https://issues.apache.org/jira/browse/DERBY-3329 String CONN_NEGATIVE_MAXSTATEMENTS = "J134"; +//IC see: https://issues.apache.org/jira/browse/DERBY-2871 String CONN_XA_TRANSACTION_TIMED_OUT = "J135"; String CONN_CLOSE_XA_TRANSACTION_ROLLED_BACK = "J136"; @@ -192,25 +206,30 @@ public interface MessageId { */ String CORE_DATABASE_NOT_AVAILABLE = "I024"; // Database not available String CORE_DRIVER_NOT_AVAILABLE = "I025"; // JDBC Driver not available +//IC see: https://issues.apache.org/jira/browse/DERBY-1459 String JDBC_DRIVER_REGISTER_ERROR = "I026"; // Error while registering driver /** * At the time InputStream.reset was invoked, either no mark was set or the * read ahead limit of the mark was exceeded. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-4122 String STREAM_MARK_UNSET_OR_EXCEEDED = "I027"; /** * Error message when the client encounters a read error when reading a * user stream, which it is in the process of sending to the server. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-2017 String STREAM_DRDA_CLIENTSIDE_EXTDTA_READ_ERROR = "I028"; /** The stream ended before it was supposed to. */ String STREAM_PREMATURE_EOF = "I029"; +//IC see: https://issues.apache.org/jira/browse/DERBY-4241 /* * Monitor */ /** Tell user not to edit service.properties. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-5283 String SERVICE_PROPERTIES_DONT_EDIT = "M001"; /** Informational message, service properties restored. */ String SERVICE_PROPERTIES_RESTORED = "M002"; @@ -232,30 +251,42 @@ public interface MessageId { */ String CANNOT_READ_SECURITY_PROPERTY = "M008"; String CANNOT_CREATE_FILE_OR_DIRECTORY = "M009"; +//IC see: https://issues.apache.org/jira/browse/DERBY-6619 String CANNOT_GET_CLASSLOADER = "M00A"; String CANNOT_SET_CLASSLOADER = "M00B"; +//IC see: https://issues.apache.org/jira/browse/DERBY-6117 +//IC see: https://issues.apache.org/jira/browse/DERBY-6617 String CANNOT_SET_DAEMON = "M010"; /* * Misc */ String CAUSED_BY = "N001"; +//IC see: https://issues.apache.org/jira/browse/DERBY-5363 /* * Replication */ +//IC see: https://issues.apache.org/jira/browse/DERBY-3021 +//IC see: https://issues.apache.org/jira/browse/DERBY-3071 String REPLICATION_ERROR_BEGIN = "R001"; String REPLICATION_ERROR_END = "R002"; String REPLICATION_SLAVE_STARTED = "R003"; String REPLICATION_SLAVE_STOPPED = "R004"; String REPLICATION_FATAL_ERROR = "R005"; String REPLICATION_SLAVE_LOST_CONN = "R006"; +//IC see: https://issues.apache.org/jira/browse/DERBY-3064 String REPLICATION_MASTER_STARTED = "R007"; String REPLICATION_MASTER_STOPPED = "R008"; String REPLICATION_LOGSHIPPER_EXCEPTION = "R009"; String REPLICATION_MASTER_RECONN = "R010"; +//IC see: https://issues.apache.org/jira/browse/DERBY-3361 +//IC see: https://issues.apache.org/jira/browse/DERBY-3356 String REPLICATION_SLAVE_NETWORK_LISTEN = "R011"; +//IC see: https://issues.apache.org/jira/browse/DERBY-3454 String REPLICATION_INVALID_CONNECTION_HANDLE = "R012"; +//IC see: https://issues.apache.org/jira/browse/DERBY-3388 String REPLICATION_ONELINE_MSG_HEADER = "R013"; String REPLICATION_FAILOVER_SUCCESSFUL = "R020"; +//IC see: https://issues.apache.org/jira/browse/DERBY-3254 } diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/Module.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/Module.java index 191144b01b..77f2a321d4 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/Module.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/Module.java @@ -24,6 +24,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more public interface Module { String CacheFactory = "org.apache.derby.iapi.services.cache.CacheFactory"; +//IC see: https://issues.apache.org/jira/browse/DERBY-1156 String CipherFactoryBuilder = "org.apache.derby.iapi.services.crypto.CipherFactoryBuilder"; String ClassFactory = "org.apache.derby.iapi.services.loader.ClassFactory"; String DaemonFactory = "org.apache.derby.iapi.services.daemon.DaemonFactory"; @@ -33,5 +34,7 @@ public interface Module { String ResourceAdapter = "org.apache.derby.iapi.jdbc.ResourceAdapter"; String JMX = "org.apache.derby.iapi.services.jmx.ManagementService"; +//IC see: https://issues.apache.org/jira/browse/DERBY-3424 +//IC see: https://issues.apache.org/jira/browse/DERBY-1387 } diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/ModuleUtil.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/ModuleUtil.java index 2ac38adc30..2a907d033a 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/ModuleUtil.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/ModuleUtil.java @@ -85,6 +85,7 @@ public static java.lang.Module derbyModule(String moduleName) if (!JVMInfo.isModuleAware()) { return null; } initModuleInfo(); // find all of the derby modules +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 return _derbyModules.get(moduleName); } @@ -112,6 +113,7 @@ public static String localizationModuleName(String localeString) * @return a stream opened on the resource or null if it was not found */ public static InputStream getResourceAsStream(String resourceName) +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 throws StandardException { initModuleInfo(); // find all of the derby modules @@ -138,6 +140,7 @@ public static InputStream getResourceAsStream(String resourceName) private static void initModuleInfo() { if (_derbyModules != null) { return; } +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 HashMap result = new HashMap(); ServiceLoader loader = ServiceLoader.load(DerbyModuleAPI.class); @@ -163,6 +166,7 @@ private static void initModuleInfo() */ private static InputStream getResourceAsStream ( +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 final java.lang.Module module, final String resourceName ) diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/Property.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/Property.java index 0d9a3894d1..54342cd07f 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/Property.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/Property.java @@ -52,6 +52,7 @@ public interface Property { /** By convention properties that must not be stored any persistent form of +//IC see: https://issues.apache.org/jira/browse/DERBY-6220 service properties start with this prefix. These properties are not documented. */ public static final String PROPERTY_RUNTIME_PREFIX = "derby.__rt."; @@ -97,7 +98,9 @@ public interface Property { String LOG_BOOT_TRACE = "derby.stream.error.logBootTrace"; /** +//IC see: https://issues.apache.org/jira/browse/DERBY-6350 derby.stream.error.style=The error stream error style. +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 rollingFile is the only file currently supported. Takes precendence over derby.stream.error.file. Takes precendence over derby.stream.error.method. @@ -106,7 +109,9 @@ public interface Property { String ERRORLOG_STYLE_PROPERTY = "derby.stream.error.style"; /** +//IC see: https://issues.apache.org/jira/browse/DERBY-862 derby.stream.error.file=absolute or relative error log filename +//IC see: https://issues.apache.org/jira/browse/DERBY-205 Takes precendence over derby.stream.error.method. Takes precendence over derby.stream.error.field */ @@ -115,6 +120,7 @@ public interface Property { /** derby.stream.error.method= +//IC see: https://issues.apache.org/jira/browse/DERBY-6945 $className.$methodName returning an OutputStream or Writer object Takes precendence over derby.stream.error.field */ @@ -123,12 +129,14 @@ public interface Property { /** derby.stream.error.field= +//IC see: https://issues.apache.org/jira/browse/DERBY-6856 className.fieldName returning an OutputStream or Writer object */ String ERRORLOG_FIELD_PROPERTY = "derby.stream.error.field"; /** +//IC see: https://issues.apache.org/jira/browse/DERBY-6350 derby.stream.error.rollingfile.pattern=the pattern A pattern consists of a string that includes the following special components that will be replaced at runtime: @@ -200,6 +208,9 @@ public interface Property { * info stream is started. */ String LOG_FILE_APPEND = "derby.infolog.append"; +//IC see: https://issues.apache.org/jira/browse/DERBY-1302 +//IC see: https://issues.apache.org/jira/browse/DERBY-326 +//IC see: https://issues.apache.org/jira/browse/DERBY-1302 /* ** derby.service.* and related properties @@ -244,6 +255,7 @@ Before creating this service delete any remenants (e.g. the directory) /** derby.database.forceDatabaseLock
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400 Derby attempts to prevent two instances of Derby from booting the same database with the use of a file called db.lck inside the database directory. @@ -272,6 +284,7 @@ Before creating this service delete any remenants (e.g. the directory) The warning message looks like this: +//IC see: https://issues.apache.org/jira/browse/DERBY-2400 WARNING: Derby (instance 80000000-00d2-3265-de92-000a0a0a0200) is attempting to boot the database /export/home/sky/wombat even though Derby (instance 80000000-00d2-3265-8abf-000a0a0a0200) may still be @@ -284,6 +297,7 @@ Before creating this service delete any remenants (e.g. the directory) This warning is primarily a Technical Support aid to determine the cause of corruption. However, if you see this warning, your best choice is to close the connection and exit the JVM. This minimizes the +//IC see: https://issues.apache.org/jira/browse/DERBY-2400 risk of a corruption. Close all instances of Derby, then restart one instance of Derby and shut down the database properly so that the db.lck file can be removed. The warning message continues to appear @@ -397,6 +411,7 @@ Default value for wait timeouts (60 seconds) /** internal use only, passes the database classpathinto the class manager +//IC see: https://issues.apache.org/jira/browse/DERBY-6220 Undocumented. */ String BOOT_DB_CLASSPATH = PROPERTY_RUNTIME_PREFIX + "database.classpath"; @@ -498,6 +513,9 @@ Default value for wait timeouts (60 seconds) public static final String ROW_LOCKING = "derby.storage.rowLocking"; /** +//IC see: https://issues.apache.org/jira/browse/DERBY-1302 +//IC see: https://issues.apache.org/jira/browse/DERBY-326 +//IC see: https://issues.apache.org/jira/browse/DERBY-1302 derby.storage.propertiesId
Stores the id of the conglomerate that holds the per-database @@ -509,6 +527,7 @@ Default value for wait timeouts (60 seconds) String PROPERTIES_CONGLOM_ID = "derby.storage.propertiesId"; /** +//IC see: https://issues.apache.org/jira/browse/DERBY-6945

derby.storage.tempDirectory

@@ -606,6 +625,9 @@ Default value for wait timeouts (60 seconds) */ String LOG_ARCHIVE_MODE = "derby.storage.logArchiveMode"; +//IC see: https://issues.apache.org/jira/browse/DERBY-1302 +//IC see: https://issues.apache.org/jira/browse/DERBY-326 +//IC see: https://issues.apache.org/jira/browse/DERBY-1302 /** * derby.storage.logDeviceWhenBackedUp @@ -634,6 +656,7 @@ Default value for wait timeouts (60 seconds) * */ String MODULE_PREFIX = "derby.module."; +//IC see: https://issues.apache.org/jira/browse/DERBY-927 /** * derby.subSubProtocol.xxx @@ -674,6 +697,7 @@ Default value for wait timeouts (60 seconds) * See org.apache.derby.shared.common.info.JVMInfo.JDK_ID */ String MODULE_ENV_JDK_PREFIX = "derby.env.jdk."; +//IC see: https://issues.apache.org/jira/browse/DERBY-927 /** * Declare a set of classes that the class for a module or sub sub protocol requires. @@ -692,6 +716,9 @@ Default value for wait timeouts (60 seconds) *

* Undocumented. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-1302 +//IC see: https://issues.apache.org/jira/browse/DERBY-326 +//IC see: https://issues.apache.org/jira/browse/DERBY-1302 String LANG_TD_CACHE_SIZE = "derby.language.tableDescriptorCacheSize"; int LANG_TD_CACHE_SIZE_DEFAULT = 64; @@ -701,6 +728,7 @@ Default value for wait timeouts (60 seconds) *

* Undocumented. */ +//IC see: https://issues.apache.org/jira/browse/DERBY-464 String LANG_PERMISSIONS_CACHE_SIZE = "derby.language.permissionsCacheSize"; int LANG_PERMISSIONS_CACHE_SIZE_DEFAULT = 64; /** @@ -742,6 +770,7 @@ Default value for wait timeouts (60 seconds) be executed before checking whether its plan is stale. Database. Dynamic.

+//IC see: https://issues.apache.org/jira/browse/DERBY-6220 Externally visible but undocumented. */ String LANGUAGE_STALE_PLAN_CHECK_INTERVAL = @@ -866,6 +895,7 @@ Default value for wait timeouts (60 seconds) * Undocumented. *

*/ +//IC see: https://issues.apache.org/jira/browse/DERBY-5680 String STORAGE_AUTO_INDEX_STATS_DEBUG_KEEP_DISPOSABLE_STATS = "derby.storage.indexStats.debug.keepDisposableStats"; @@ -877,6 +907,7 @@ Default value for wait timeouts (60 seconds) * timeout in seconds. Zero means no timout. */ String PROP_XA_TRANSACTION_TIMEOUT = "derby.jdbc.xaTransactionTimeout"; +//IC see: https://issues.apache.org/jira/browse/DERBY-2432 /** The default value for XA transaction timeout if the corresponding * property is not found in system properties. Zero means no timeout. @@ -889,6 +920,7 @@ Default value for wait timeouts (60 seconds) public static final String DATABASE_MODULE = "org.apache.derby.database.Database"; /* +//IC see: https://issues.apache.org/jira/browse/DERBY-464 Property to enable Grant & Revoke SQL authorization. Introduced in Derby 10.2 release. New databases and existing databases (in Derby 10.2) still use legacy authorization by default and by setting this property to true could request for @@ -1035,6 +1067,7 @@ release. New databases and existing databases (in Derby 10.2) still use legacy /** Property name for specifying log switch interval +//IC see: https://issues.apache.org/jira/browse/DERBY-6220 Undocumented. */ public static final String LOG_SWITCH_INTERVAL = "derby.storage.logSwitchInterval"; @@ -1257,10 +1290,12 @@ release. New databases and existing databases (in Derby 10.2) still use legacy // type should be ignored. The TERRITORY_BASED collation uses the default // collator strength while the four with a colon uses a specific strength. public static final String UCS_BASIC_COLLATION = +//IC see: https://issues.apache.org/jira/browse/DERBY-2334 "UCS_BASIC"; public static final String TERRITORY_BASED_COLLATION = "TERRITORY_BASED"; public static final String TERRITORY_BASED_PRIMARY_COLLATION = +//IC see: https://issues.apache.org/jira/browse/DERBY-1748 "TERRITORY_BASED:PRIMARY"; public static final String TERRITORY_BASED_SECONDARY_COLLATION = "TERRITORY_BASED:SECONDARY"; @@ -1337,6 +1372,7 @@ release. New databases and existing databases (in Derby 10.2) still use legacy * the server, too (i.e. started via API). *

*/ +//IC see: https://issues.apache.org/jira/browse/DERBY-5363 String STORAGE_USE_DEFAULT_FILE_PERMISSIONS = "derby.storage.useDefaultFilePermissions"; diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/SQLState.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/SQLState.java index 5aaa5dfa8c..70d9d8163b 100644 --- a/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/SQLState.java +++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/reference/SQLState.java @@ -41,6 +41,7 @@ The message identifier (ie. the value that matches a field in this class)
 		if (se.getMessageId().equals(SQLState.DEADLOCK))
 	
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945

A utility static method StandardException.getSQLState(String messageId) exists to convert an field from this class into a five character SQLState. @@ -53,6 +54,7 @@ exists to convert an field from this class into a five character SQLState. is expected to be 7 characters long and the last character determines the state. If the state is seven characters long then only the first five will be seen by the error reporting code and exception. +//IC see: https://issues.apache.org/jira/browse/DERBY-6945

If the state is 9 characters long, the last two characters encode @@ -110,6 +112,7 @@

  • ENVIRONMENTAL exception category (the default)
  • XBCM ClassManager
  • XBCX Cryptography
  • XBM0 Monitor +//IC see: https://issues.apache.org/jira/browse/DERBY-6094
  • XBDA Communications
  • XCY0 Properties @@ -130,6 +133,8 @@
  • ENVIRONMENTAL exception category (the default)
  • 46000 for SQLJ errors (for now, leave this range empty)
  • 38000 SQL3 ranges
  • XD00x Dependency mgr
  • +//IC see: https://issues.apache.org/jira/browse/DERBY-1772 +//IC see: https://issues.apache.org/jira/browse/DERBY-1758
  • XMLxx Misc XML errors not covered by SQL standard
  • @@ -140,11 +145,13 @@
  • ENVIRONMENTAL exception category (the default)
  • XSCH0 Heap +//IC see: https://issues.apache.org/jira/browse/DERBY-2466
  • Security
    • XK...
    +//IC see: https://issues.apache.org/jira/browse/DERBY-3016
  • Replication