i = keySet.iterator(); i.hasNext();) {
UnitOfWorkListener listener = i.next();
@@ -2251,7 +2409,9 @@ private void completeSpecificRollback(UnitOfWorkListener uwl) {
protected abstract void readXARollback_() throws SqlException;
public void writeTransactionStart(ClientStatement statement)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
throws SqlException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1192
if (isXAConnection_) {
writeXATransactionStart (statement);
}
@@ -2301,6 +2461,7 @@ public void completeSqlca(Sqlca sqlca) {
}
public void completePiggyBackIsolation(int pbIsolation) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3192
if (SanityManager.DEBUG) {
SanityManager.ASSERT(supportsSessionDataCaching());
}
@@ -2322,6 +2483,7 @@ public void completeInitialPiggyBackIsolation(int pbIsolation) {
if (SanityManager.DEBUG) {
SanityManager.ASSERT(
pbIsolation ==
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
Connection.TRANSACTION_READ_UNCOMMITTED ||
pbIsolation ==
Connection.TRANSACTION_READ_COMMITTED ||
@@ -2355,6 +2517,7 @@ public void completeInitialPiggyBackSchema(String pbSchema) {
// can this be called in a unit of work
// can this be called from within a stored procedure
//
+//IC see: https://issues.apache.org/jira/browse/DERBY-3581
synchronized public void reset(LogWriter logWriter)
throws SqlException {
if (logWriter != null) {
@@ -2373,6 +2536,7 @@ synchronized public void reset(LogWriter logWriter)
synchronized public void lightReset() throws SqlException {
if (!open_ && !availableForReuse_) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5896
return;
}
open_ = true;
@@ -2380,6 +2544,7 @@ synchronized public void lightReset() throws SqlException {
}
abstract protected void reset_(LogWriter logWriter) throws SqlException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3581
/**
*
@@ -2416,6 +2581,7 @@ protected void completeReset(boolean isDeferredReset,
// Iterate through the physical statements and re-enable them for reuse.
if (closeStatementsOnClose) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
for (ClientStatement stmt : openStatements_.keySet()) {
stmt.reset(closeStatementsOnClose);
}
@@ -2458,6 +2624,7 @@ protected void completeReset(boolean isDeferredReset,
*
* @return object with prepared statements for calling locator procedures
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2495
CallableLocatorProcedures locatorProcedureCall()
{
if (lobProcs == null) {
@@ -2473,6 +2640,7 @@ protected void checkForClosedConnection() throws SqlException {
if (!open_) {
agent_.checkForDeferredExceptions();
throw new SqlException(agent_.logWriter_,
+//IC see: https://issues.apache.org/jira/browse/DERBY-5896
new ClientMessageId (SQLState.NO_CURRENT_CONNECTION));
} else {
agent_.checkForDeferredExceptions();
@@ -2499,6 +2667,7 @@ private void accumulateWarning(SqlWarning e) {
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
void accumulate440WarningForMessageProcFailure(SqlWarning e) {
if (!accumulated440ForMessageProcFailure_) {
accumulateWarning(e);
@@ -2524,9 +2693,12 @@ public int getServerVersion() {
* global (XA) transaction the holdability is CLOSE_CURSORS_AT_COMMIT.
* Otherwise return the holdability set by the user.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-966
+//IC see: https://issues.apache.org/jira/browse/DERBY-1005
final int holdability()
{
if (this.isXAConnection_ && this.xaState_ == XA_T1_ASSOCIATED)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
return ResultSet.CLOSE_CURSORS_AT_COMMIT;
return holdability;
}
@@ -2542,6 +2714,7 @@ final int holdability()
*/
public Clob createClob() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2587
if (agent_.loggingEnabled()) {
agent_.logWriter_.traceEntry(this, "createClob");
}
@@ -2558,9 +2731,11 @@ public Clob createClob() throws SQLException {
//Stores the Clob instance that is returned.
ClientClob clob = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
//Call the CLOBCREATELOCATOR stored procedure
//that will return a locator value.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2587
try {
locator = locatorProcedureCall().clobCreateLocator();
}
@@ -2576,6 +2751,7 @@ public Clob createClob() throws SQLException {
//the Lob implementations are completed then this code can be enabled.
if (locator != INVALID_LOCATOR) {
//A valid locator value has been obtained.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
clob = new ClientClob(this.agent_, locator);
}
else {
@@ -2618,6 +2794,7 @@ public Blob createBlob() throws SQLException {
//Stores the Blob instance that is returned.
ClientBlob blob = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
//Call the BLOBCREATELOCATOR stored procedure
//that will return a locator value.
@@ -2631,8 +2808,11 @@ public Blob createBlob() throws SQLException {
//If the locator value is -1 it means that we do not
//have locator support on the server.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2496
+//IC see: https://issues.apache.org/jira/browse/DERBY-2702
if (locator != INVALID_LOCATOR) {
//A valid locator value has been obtained.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
blob = new ClientBlob(this.agent_, locator);
}
else {
@@ -2673,6 +2853,7 @@ protected void beginAborting()
*/
public String getSchema() throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4869
return getCurrentSchemaName();
}
@@ -2689,10 +2870,12 @@ public void setSchema( String schemaName ) throws SQLException
// nothing to do if the current schema name is cached and is the same
// as the new schema name
+//IC see: https://issues.apache.org/jira/browse/DERBY-4869
if ( ( currentSchemaName_ != null) && (currentSchemaName_.equals( schemaName )) )
{ return; }
PreparedStatement ps = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
try {
ps = prepareStatement( "set schema ?" );
@@ -2708,6 +2891,7 @@ public void setSchema( String schemaName ) throws SQLException
public void abort( Executor executor ) throws SQLException
{
// NOP if called on a closed connection.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
if ( !open_ ) { return; }
// Null executor not allowed.
if ( executor == null )
diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ClientDatabaseMetaData.java b/java/org.apache.derby.client/org/apache/derby/client/am/ClientDatabaseMetaData.java
index aade721cec..6db57a7c6d 100644
--- a/java/org.apache.derby.client/org/apache/derby/client/am/ClientDatabaseMetaData.java
+++ b/java/org.apache.derby.client/org/apache/derby/client/am/ClientDatabaseMetaData.java
@@ -68,6 +68,7 @@ public abstract class ClientDatabaseMetaData implements DatabaseMetaData {
private boolean metaDataInfoIsCached_ = false;
ProductLevel productLevel_;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
/** The JDBC major version supported by the server. */
private final int serverJdbcMajorVersion;
@@ -119,6 +120,7 @@ public abstract class ClientDatabaseMetaData implements DatabaseMetaData {
//---------------------constructors/finalizer---------------------------------
protected ClientDatabaseMetaData(Agent agent,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientConnection connection,
ProductLevel productLevel) {
agent_ = agent;
@@ -128,6 +130,9 @@ protected ClientDatabaseMetaData(Agent agent,
if (connection.isXAConnection()) {
connection.xaHostVersion_ = productLevel_.versionLevel_;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-924
+//IC see: https://issues.apache.org/jira/browse/DERBY-925
+//IC see: https://issues.apache.org/jira/browse/DERBY-970
if (productLevel_.lessThan(10, 2, 0)) {
serverJdbcMajorVersion = 3;
serverJdbcMinorVersion = 0;
@@ -939,6 +944,7 @@ public boolean supportsSavepoints() throws SQLException {
abstract public String getURL_() throws SqlException;
public String getURL() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
try
{
checkForClosedConnection();
@@ -1073,6 +1079,7 @@ public boolean supportsCorrelatedSubqueries() throws SQLException {
//
public ResultSet getProcedures(String catalog,
String schemaPattern,
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
String procedureNamePattern) throws SQLException {
try
{
@@ -1095,6 +1102,7 @@ private ClientResultSet getProceduresX(String catalog,
String procedureNamePattern) throws SqlException {
checkForClosedConnectionX();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs =
prepareMetaDataQuery("SYSIBM.SQLPROCEDURES(?,?,?,?)");
@@ -1117,6 +1125,7 @@ private ClientResultSet getProceduresX(String catalog,
public ResultSet getProcedureColumns(String catalog,
String schemaPattern,
String procedureNamePattern,
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
String columnNamePattern) throws SQLException {
try
{
@@ -1140,6 +1149,7 @@ private ClientResultSet getProcedureColumnsX(String catalog,
String columnNamePattern) throws SqlException {
checkForClosedConnectionX();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs =
prepareMetaDataQuery("SYSIBM.SQLPROCEDURECOLS(?,?,?,?,?)");
@@ -1218,6 +1228,7 @@ private ClientResultSet getFunctionsX(String catalog,
checkForClosedConnectionX();
checkServerJdbcVersionX("getFunctions(String,String,String)", 4, 0);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs =
prepareMetaDataQuery("SYSIBM.SQLFUNCTIONS(?,?,?,?)");
@@ -1258,6 +1269,7 @@ private ClientResultSet getFunctionsX(String catalog,
* @see #getFunctionColumnsX(String, String, String,String)
*/
public ResultSet
+//IC see: https://issues.apache.org/jira/browse/DERBY-1530
getFunctionColumns(String catalog,
String schemaPattern,
String functionNamePattern,
@@ -1269,6 +1281,7 @@ private ClientResultSet getFunctionsX(String catalog,
if (agent_.loggingEnabled()) {
agent_.logWriter_.
traceEntry(this,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1530
"getFunctionColumns",
catalog, schemaPattern,
functionNamePattern, parameterNamePattern);
@@ -1306,6 +1319,7 @@ private ClientResultSet getFunctionColumnsX(String catalog,
checkServerJdbcVersionX("getFunctionColumns"+
"(String,String,String,String)", 4, 0);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs =
prepareMetaDataQuery("SYSIBM.SQLFUNCTIONPARAMS(?,?,?,?,?)");
@@ -1328,6 +1342,7 @@ private ClientResultSet getFunctionColumnsX(String catalog,
public ResultSet getTables(String catalog,
String schemaPattern,
String tableNamePattern,
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
String types[]) throws SQLException {
try
{
@@ -1354,6 +1369,7 @@ private ClientResultSet getTablesX(String catalog,
throw new SqlException(se);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs =
prepareMetaDataQuery("SYSIBM.SQLTABLES(?,?,?,?,?)");
@@ -1375,9 +1391,11 @@ private ClientResultSet getTablesX(String catalog,
cs.setStringX(3, tableNamePattern);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-5491
String tableTypes = "";
int i = 0;
if (types == null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
cs.setNullX(4, Types.VARCHAR);
} else if (types.length == 1 && (types[0].trim()).equals("%")) {
cs.setStringX(4, types[0]);
@@ -1392,6 +1410,7 @@ private ClientResultSet getTablesX(String catalog,
cs.setStringX(4, tableTypes);
}
cs.setStringX(5, getOptions());
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
return executeCatalogQuery(cs);
}
@@ -1404,6 +1423,7 @@ private ClientResultSet getTablesX(String catalog,
// Options varchar(4000))
//
public ResultSet getSchemas() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
try
{
synchronized (connection_) {
@@ -1426,6 +1446,7 @@ private ClientResultSet getSchemasX() throws SqlException {
throw new SqlException(se);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs = prepareMetaDataQuery(
"SYSIBM.SQLTABLES('', '', '', '', 'GETSCHEMAS=1')");
return (ClientResultSet) cs.executeQueryX();
@@ -1434,6 +1455,7 @@ private ClientResultSet getSchemasX() throws SqlException {
// DERBY does not have the notion of a catalog, so we return a result set with no rows.
public ResultSet getCatalogs() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
try
{
synchronized (connection_) {
@@ -1452,6 +1474,7 @@ public ResultSet getCatalogs() throws SQLException {
private ClientResultSet getCatalogsX() throws SqlException {
checkForClosedConnectionX();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs = prepareMetaDataQuery(
"SYSIBM.SQLTABLES('', '', '', '', 'GETCATALOGS=1')");
return (ClientResultSet) cs.executeQueryX();
@@ -1465,6 +1488,7 @@ private ClientResultSet getCatalogsX() throws SqlException {
// TableType varchar(4000),
// Options varchar(4000))
public ResultSet getTableTypes() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
try
{
synchronized (connection_) {
@@ -1483,6 +1507,7 @@ public ResultSet getTableTypes() throws SQLException {
private ClientResultSet getTableTypesX() throws SqlException {
checkForClosedConnectionX();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs = null;
cs = prepareMetaDataQuery("SYSIBM.SQLTABLES(?,?,?,?,?)");
@@ -1512,6 +1537,7 @@ private ClientResultSet getTableTypesX() throws SqlException {
public ResultSet getColumns(String catalog,
String schemaPattern,
String tableNamePattern,
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
String columnNamePattern) throws SQLException {
try
{
@@ -1535,6 +1561,7 @@ private ClientResultSet getColumnsX(String catalog,
String columnNamePattern) throws SqlException {
checkForClosedConnectionX();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs = prepareMetaDataQuery(
"SYSIBM.SQLCOLUMNS(?,?,?,?,?)");
@@ -1558,6 +1585,7 @@ private ClientResultSet getColumnsX(String catalog,
public ResultSet getColumnPrivileges(String catalog,
String schema,
String table,
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
String columnNamePattern) throws SQLException {
try
{
@@ -1578,6 +1606,7 @@ private ClientResultSet getColumnPrivilegesX(String catalog,
String schema,
String table,
String columnNamePattern) throws SqlException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
checkForClosedConnectionX();
// check input params, table and columnNamePattern cannot be null
if (table == null) {
@@ -1586,6 +1615,7 @@ private ClientResultSet getColumnPrivilegesX(String catalog,
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs = prepareMetaDataQuery(
"SYSIBM.SQLCOLPRIVILEGES(?,?,?,?,?)");
@@ -1607,6 +1637,7 @@ private ClientResultSet getColumnPrivilegesX(String catalog,
//
public ResultSet getTablePrivileges(String catalog,
String schemaPattern,
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
String tableNamePattern) throws SQLException {
try
{
@@ -1628,6 +1659,7 @@ private ClientResultSet getTablePrivilegesX(String catalog,
String tableNamePattern) throws SqlException {
checkForClosedConnectionX();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs = prepareMetaDataQuery(
"SYSIBM.SQLTABLEPRIVILEGES(?,?,?,?)");
@@ -1653,6 +1685,7 @@ public ResultSet getBestRowIdentifier(String catalog,
String table,
int scope,
boolean nullable) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
try
{
synchronized (connection_) {
@@ -1683,6 +1716,7 @@ private ClientResultSet getBestRowIdentifierX(String catalog,
new ClientMessageId(SQLState.TABLE_NAME_CANNOT_BE_NULL));
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs = prepareMetaDataQuery(
"SYSIBM.SQLSPECIALCOLUMNS(?,?,?,?,?,?,?)");
@@ -1703,6 +1737,7 @@ private ClientResultSet getBestRowIdentifierX(String catalog,
public ResultSet getVersionColumns(String catalog,
String schema,
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
String table) throws SQLException {
try
{
@@ -1730,6 +1765,7 @@ private ClientResultSet getVersionColumnsX(String catalog,
new ClientMessageId(SQLState.TABLE_NAME_CANNOT_BE_NULL));
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs = prepareMetaDataQuery(
"SYSIBM.SQLSPECIALCOLUMNS(?,?,?,?,?,?,?)");
@@ -1741,6 +1777,7 @@ private ClientResultSet getVersionColumnsX(String catalog,
cs.setShortX(6, (short) 0);
cs.setStringX(7, getOptions());
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
return executeCatalogQuery(cs);
}
@@ -1753,6 +1790,7 @@ private ClientResultSet getVersionColumnsX(String catalog,
//
public ResultSet getPrimaryKeys(String catalog,
String schema,
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
String table) throws SQLException {
try
{
@@ -1780,6 +1818,7 @@ private ClientResultSet getPrimaryKeysX(String catalog,
new ClientMessageId(SQLState.TABLE_NAME_CANNOT_BE_NULL));
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs = prepareMetaDataQuery(
"SYSIBM.SQLPRIMARYKEYS(?,?,?,?)");
@@ -1803,6 +1842,7 @@ private ClientResultSet getPrimaryKeysX(String catalog,
//
public ResultSet getImportedKeys(String catalog,
String schema,
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
String table) throws SQLException {
try
{
@@ -1825,10 +1865,12 @@ private ClientResultSet getImportedKeysX(String catalog,
checkForClosedConnectionX();
// validate the table name
+//IC see: https://issues.apache.org/jira/browse/DERBY-2607
if (table == null) {
throw new SqlException(agent_.logWriter_,
new ClientMessageId(SQLState.TABLE_NAME_CANNOT_BE_NULL));
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs = prepareMetaDataQuery(
"SYSIBM.SQLFOREIGNKEYS(?,?,?,?,?,?,?)");
@@ -1840,6 +1882,7 @@ private ClientResultSet getImportedKeysX(String catalog,
cs.setStringX(6, table);
// We're passing the keyword EXPORTEDKEY, but this support may not be in the GA version of SPs.
// As a workaround in getCrossReference(), we'll just "select * where 0=1" when primaryTable==""
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
if (connection_.holdability() == ResultSet.HOLD_CURSORS_OVER_COMMIT) {
cs.setStringX(7, "DATATYPE='JDBC';IMPORTEDKEY=1; CURSORHOLD=1");
} else {
@@ -1860,6 +1903,7 @@ private ClientResultSet getImportedKeysX(String catalog,
//
public ResultSet getExportedKeys(String catalog,
String schema,
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
String table) throws SQLException {
try
{
@@ -1897,11 +1941,14 @@ private ClientResultSet getExportedKeysX(String catalog,
cs.setStringX(6, "");
// We're passing the keyword EXPORTEDKEY, but this support may not be in the GA version of SPs.
// As a workaround in getCrossReference(), we'll just "select * where 0=1" when foreignTable==""
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
if (connection_.holdability() == ResultSet.HOLD_CURSORS_OVER_COMMIT) {
cs.setStringX(7, "DATATYPE='JDBC';EXPORTEDKEY=1; CURSORHOLD=1");
} else {
cs.setStringX(7, "DATATYPE='JDBC';EXPORTEDKEY=1; CURSORHOLD=0");
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
return executeCatalogQuery(cs);
}
@@ -1920,6 +1967,7 @@ public ResultSet getCrossReference(String primaryCatalog,
String primaryTable,
String foreignCatalog,
String foreignSchema,
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
String foreignTable) throws SQLException {
try
{
@@ -1959,6 +2007,8 @@ private ClientResultSet getCrossReferenceX(String primaryCatalog,
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs = prepareMetaDataQuery(
"SYSIBM.SQLFOREIGNKEYS(?,?,?,?,?,?,?)");
@@ -1969,6 +2019,7 @@ private ClientResultSet getCrossReferenceX(String primaryCatalog,
cs.setStringX(5, foreignSchema);
cs.setStringX(6, foreignTable);
cs.setStringX(7, getOptions());
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
return executeCatalogQuery(cs);
}
@@ -1978,6 +2029,7 @@ private ClientResultSet getCrossReferenceX(String primaryCatalog,
//
//
public ResultSet getTypeInfo() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
try
{
synchronized (connection_) {
@@ -1997,6 +2049,7 @@ private ClientResultSet getTypeInfoX() throws SqlException {
checkForClosedConnectionX();
// check if the last call's resultset is closed or not.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs = prepareMetaDataQuery(
"SYSIBM.SQLGETTYPEINFO(?,?)");
@@ -2020,6 +2073,7 @@ public ResultSet getIndexInfo(String catalog,
String table,
boolean unique,
boolean approximate) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
try
{
synchronized (connection_) {
@@ -2041,12 +2095,15 @@ private ClientResultSet getIndexInfoX(String catalog,
boolean unique,
boolean approximate) throws SqlException {
checkForClosedConnectionX();
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
// validate the input table name
+//IC see: https://issues.apache.org/jira/browse/DERBY-2607
if (table == null) {
throw new SqlException(agent_.logWriter_,
new ClientMessageId(SQLState.TABLE_NAME_CANNOT_BE_NULL));
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs = prepareMetaDataQuery(
"SYSIBM.SQLSTATISTICS(?,?,?,?,?,?)");
@@ -2077,6 +2134,7 @@ public ResultSet getUDTs(String catalog,
String schemaPattern,
String typeNamePattern,
int[] types) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
try
{
synchronized (connection_) {
@@ -2098,6 +2156,7 @@ private ClientResultSet getUDTsX(String catalog,
int[] types) throws SqlException {
checkForClosedConnectionX();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs = prepareMetaDataQuery(
"SYSIBM.SQLUDTS(?,?,?,?,?)");
@@ -2105,6 +2164,7 @@ private ClientResultSet getUDTsX(String catalog,
cs.setStringX(2, schemaPattern);
cs.setStringX(3, typeNamePattern);
int i = 0;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5491
String udtTypes = "";
while (types != null && i < types.length) {
if (i > 0) {
@@ -2115,6 +2175,18 @@ private ClientResultSet getUDTsX(String catalog,
}
cs.setStringX(4, udtTypes);
cs.setStringX(5, getOptions());
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
return executeCatalogQuery(cs);
}
@@ -2122,6 +2194,8 @@ private ClientResultSet getUDTsX(String catalog,
// helper method for the catalog queries only
private String getOptions() {
int cursorHold;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
if (connection_.holdability() == ResultSet.HOLD_CURSORS_OVER_COMMIT) {
cursorHold = 1;
} else {
@@ -2134,6 +2208,7 @@ private String getOptions() {
// Derby uses a PreparedStatement argument rather than a callable statement
private ClientResultSet executeCatalogQuery(ClientPreparedStatement cs)
throws SqlException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
try {
return cs.executeQueryX();
} catch (SqlException e) {
@@ -2177,6 +2252,7 @@ public boolean supportsGetGeneratedKeys() throws SQLException {
public ResultSet getSuperTypes(String catalog,
String schemaPattern,
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
String typeNamePattern) throws SQLException {
try
{
@@ -2202,6 +2278,7 @@ private ClientResultSet getSuperTypesX() throws SqlException {
"CAST(NULL AS VARCHAR(128)) AS SUPERTYPE_SCHEM," +
"VARCHAR('', 128) AS SUPERTYPE_NAME " +
"FROM SYSIBM.SYSDUMMY1 WHERE 1=0 WITH UR ";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement ps =
connection_.prepareDynamicCatalogQuery(sql);
return ps.executeQueryX();
@@ -2209,6 +2286,7 @@ private ClientResultSet getSuperTypesX() throws SqlException {
public ResultSet getSuperTables(String catalog,
String schemaPattern,
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
String tableNamePattern) throws SQLException {
try
{
@@ -2227,6 +2305,7 @@ public ResultSet getSuperTables(String catalog,
private ClientResultSet getSuperTablesX() throws SqlException {
checkForClosedConnectionX();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
String sql = "SELECT CAST(NULL AS VARCHAR(128)) AS TABLE_CAT," +
"CAST(NULL AS VARCHAR(128)) AS TABLE_SCHEM," +
"VARCHAR('', 128) AS TABLE_NAME," +
@@ -2241,6 +2320,7 @@ private ClientResultSet getSuperTablesX() throws SqlException {
public ResultSet getAttributes(String catalog,
String schemaPattern,
String typeNamePattern,
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
String attributeNamePattern) throws SQLException {
try
{
@@ -2259,10 +2339,12 @@ public ResultSet getAttributes(String catalog,
private ClientResultSet getAttributesX() throws SqlException {
checkForClosedConnectionX();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
String sql = "SELECT CAST(NULL AS VARCHAR(128)) AS TYPE_CAT," +
"CAST(NULL AS VARCHAR(128)) AS TYPE_SCHEM," +
"VARCHAR('', 128) AS TYPE_NAME," +
"VARCHAR('',128) AS ATTR_NAME," +
+//IC see: https://issues.apache.org/jira/browse/DERBY-137
"0 AS DATA_TYPE," +
"VARCHAR('',129) AS ATTR_TYPE_NAME," +
"0 AS ATTR_SIZE," +
@@ -2283,6 +2365,7 @@ private ClientResultSet getAttributesX() throws SqlException {
"FROM SYSIBM.SYSDUMMY1 WHERE 1=0 WITH UR";
ClientPreparedStatement ps =
connection_.prepareDynamicCatalogQuery(sql);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
return ps.executeQueryX();
}
@@ -2293,6 +2376,7 @@ public boolean supportsResultSetHoldability(int holdability) throws SQLException
public int getResultSetHoldability() throws SQLException {
checkForClosedConnection();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
return ResultSet.HOLD_CURSORS_OVER_COMMIT;
}
@@ -2313,6 +2397,7 @@ public int getJDBCMajorVersion() throws SQLException {
public int getJDBCMinorVersion() throws SQLException {
checkForClosedConnection();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6324
return JVMInfo.jdbcMinorVersion();
}
@@ -2323,6 +2408,7 @@ public int getSQLStateType() throws SQLException {
public boolean locatorsUpdateCopy() throws SQLException {
checkForClosedConnection();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2789
return true;
}
@@ -2456,9 +2542,11 @@ final public boolean serverSupportLongRDBNAM() {
private boolean getMetaDataInfoBoolean(int infoCallIndex) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
try
{
if ( !metaDataInfoIsCached_) { metaDataInfoCall(); }
+//IC see: https://issues.apache.org/jira/browse/DERBY-5896
if ( serverSupportsBooleanValues() )
{
@@ -2594,6 +2682,7 @@ private boolean getMetaDataInfoBooleanWithTypeServer(int infoCallIndex,
// Stored Procedure will return a String containing a
// comma seperated list of all the supported result Set types
// not throwing any exception right now even if the the type is wrong as per the spec
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
try
{
String returnedFromSP = null;
@@ -2603,8 +2692,10 @@ private boolean getMetaDataInfoBooleanWithTypeServer(int infoCallIndex,
metaDataInfoCall();
returnedFromSP = (String) metaDataInfoCache_[infoCallIndex];
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
StringTokenizer st = new StringTokenizer(returnedFromSP, ",");
while (st.hasMoreTokens()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5093
if ((Integer.parseInt(st.nextToken())) == type) {
return true;
}
@@ -2641,10 +2732,12 @@ private boolean getMetaDataInfoInt_SupportsResultSetConcurrency(int infoCallInde
metaDataInfoCall();
returnedFromSP = (String) metaDataInfoCache_[infoCallIndex];
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
StringTokenizer st = new StringTokenizer(returnedFromSP, ";");
while (st.hasMoreTokens()) {
StringTokenizer stForConc =
new StringTokenizer(st.nextToken(), ",");
+//IC see: https://issues.apache.org/jira/browse/DERBY-5093
if ((Integer.parseInt(stForConc.nextToken())) == type) {
while (stForConc.hasMoreTokens()) {
if ((Integer.parseInt(stForConc.nextToken())) == concurrency) {
@@ -2677,11 +2770,13 @@ private boolean getMetaDataInfoBoolean_supportsConvert(int infoCallIndex, int fr
metaDataInfoCall();
returnedFromSP = (String) metaDataInfoCache_[infoCallIndex];
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
StringTokenizer st = new StringTokenizer(returnedFromSP, ";");
while (st.hasMoreTokens()) {
StringTokenizer stForType =
new StringTokenizer(st.nextToken(), ",");
+//IC see: https://issues.apache.org/jira/browse/DERBY-5093
if ((Integer.parseInt(stForType.nextToken())) == fromType) {
while (st.hasMoreTokens()) {
if ((Integer.parseInt(st.nextToken())) == toType) {
@@ -2705,6 +2800,7 @@ private boolean getMetaDataInfoBoolean_supportsConvert(int infoCallIndex, int fr
private void metaDataInfoCall() throws SqlException {
synchronized (connection_) {
ClientResultSet rs;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
// These remote calls return a result set containing a single row.
// Each column in the row corresponds to a particular get meta data info
@@ -2714,6 +2810,7 @@ private void metaDataInfoCall() throws SqlException {
rs = (ClientResultSet) ps.executeQueryX();
rs.nextX();
int ColumnCount;
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
try {
ColumnCount = ((ColumnMetaData) rs.getMetaDataX()).getColumnCount();
} catch ( SQLException se ) {
@@ -2739,6 +2836,7 @@ private void metaDataInfoCall() throws SqlException {
* @exception SQLException if a database access error occurs
*/
public final boolean supportsStoredFunctionsUsingCallSyntax()
+//IC see: https://issues.apache.org/jira/browse/DERBY-970
throws SQLException
{
checkForClosedConnection();
@@ -2818,6 +2916,7 @@ private ClientResultSet getSchemasX(String catalog, String schemaPattern)
checkServerJdbcVersionX("getSchemas(String, String)", 4, 0);
String call = "SYSIBM.SQLTABLES(?, ?, '', '', 'GETSCHEMAS=2')";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement cs = prepareMetaDataQuery(call);
if (catalog == null) {
cs.setNullX(1, Types.VARCHAR);
@@ -2897,6 +2996,7 @@ private ClientResultSet getClientInfoPropertiesX() throws SqlException {
* @exception SQLException if a database access error occurs
*/
public RowIdLifetime getRowIdLifetime() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
checkForClosedConnection();
return RowIdLifetime.ROWID_UNSUPPORTED;
}
@@ -2941,6 +3041,7 @@ public T unwrap(Class interfaces)
public boolean generatedKeyAlwaysReturned() { return true; }
public ResultSet getPseudoColumns
+//IC see: https://issues.apache.org/jira/browse/DERBY-4869
( String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern )
throws SQLException
{
@@ -2962,6 +3063,9 @@ public T unwrap(Class interfaces)
private ClientResultSet getPseudoColumnsX() throws SqlException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
checkForClosedConnectionX();
String sql =
"SELECT \n" +
@@ -2979,8 +3083,13 @@ private ClientResultSet getPseudoColumnsX() throws SqlException
" VARCHAR('NO',128) AS IS_NULLABLE \n" +
" FROM SYSIBM.SYSDUMMY1 WHERE 1=0 WITH UR"
;
+//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
ClientPreparedStatement ps =
connection_.prepareDynamicCatalogQuery(sql);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
+//IC see: https://issues.apache.org/jira/browse/DERBY-1224
return ps.executeQueryX();
}
@@ -2997,6 +3106,7 @@ private ClientResultSet getPseudoColumnsX() throws SqlException
private ClientPreparedStatement prepareMetaDataQuery(String cmd)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
throws SqlException {
ClientPreparedStatement ps;
@@ -3004,8 +3114,11 @@ private ClientPreparedStatement prepareMetaDataQuery(String cmd)
connection_.prepareStatementX("CALL " + cmd,
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY,
+//IC see: https://issues.apache.org/jira/browse/DERBY-966
+//IC see: https://issues.apache.org/jira/browse/DERBY-1005
connection_.holdability(),
ClientStatement.NO_GENERATED_KEYS,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2653
null, null);
return ps;
}
@@ -3019,7 +3132,10 @@ private ClientPreparedStatement prepareMetaDataQuery(String cmd)
*/
protected void checkForClosedConnection() throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
checkForClosedConnectionX();
} catch ( SqlException se ) {
throw se.getSQLException();
@@ -3050,6 +3166,9 @@ private void checkForClosedConnectionX() throws SqlException {
* specified JDBC version
*/
private void checkServerJdbcVersionX(String method, int major, int minor)
+//IC see: https://issues.apache.org/jira/browse/DERBY-924
+//IC see: https://issues.apache.org/jira/browse/DERBY-925
+//IC see: https://issues.apache.org/jira/browse/DERBY-970
throws SqlException
{
if (serverJdbcMajorVersion < major ||
diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ClientJDBCObjectFactory.java b/java/org.apache.derby.client/org/apache/derby/client/am/ClientJDBCObjectFactory.java
index be63b5fd4b..96fca86691 100644
--- a/java/org.apache.derby.client/org/apache/derby/client/am/ClientJDBCObjectFactory.java
+++ b/java/org.apache.derby.client/org/apache/derby/client/am/ClientJDBCObjectFactory.java
@@ -56,6 +56,7 @@ public interface ClientJDBCObjectFactory {
* @throws java.sql.SQLException on error
*/
ClientPooledConnection newClientPooledConnection(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
BasicClientDataSource ds,
LogWriter logWriter,
String user,
@@ -74,6 +75,7 @@ ClientPooledConnection newClientPooledConnection(
* @return an XA connection
* @throws java.sql.SQLException on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
ClientXAConnection newClientXAConnection(BasicClientDataSource ds,
LogWriter logWriter,String user,String password)
throws SQLException;
@@ -98,9 +100,11 @@ ClientXAConnection newClientXAConnection(BasicClientDataSource ds,
* @return a CallableStatement object
* @throws SqlException on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientCallableStatement newCallableStatement(Agent agent,
ClientConnection connection, String sql,
int type,int concurrency,int holdability,
+//IC see: https://issues.apache.org/jira/browse/DERBY-941
ClientPooledConnection cpc) throws SqlException;
/**
@@ -115,6 +119,7 @@ ClientCallableStatement newCallableStatement(Agent agent,
* @throws SqlException on error
*/
LogicalConnection newLogicalConnection(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientConnection physicalConnection,
ClientPooledConnection pooledConnection)
throws SqlException;
@@ -131,7 +136,10 @@ 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;
@@ -158,8 +166,10 @@ public LogicalConnection newCachingLogicalConnection(
* @return a PreparedStatement object
* @throws SqlException on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement newPreparedStatement(Agent agent,
ClientConnection connection,
+//IC see: https://issues.apache.org/jira/browse/DERBY-941
String sql,Section section,ClientPooledConnection cpc)
throws SqlException;
@@ -195,9 +205,11 @@ ClientPreparedStatement newPreparedStatement(Agent agent,
* @return a PreparedSatement object
* @throws SqlException on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientPreparedStatement newPreparedStatement(Agent agent,
ClientConnection connection,String sql,
int type,int concurrency,int holdability,int autoGeneratedKeys,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2653
String [] columnNames, int[] columnIndexes, ClientPooledConnection cpc)
throws SqlException;
@@ -210,7 +222,10 @@ ClientPreparedStatement newPreparedStatement(Agent agent,
* @param cacheInteractor the statement cache interactor
* @return A logical prepared statement.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-3328
+//IC see: https://issues.apache.org/jira/browse/DERBY-3326
LogicalPreparedStatement newLogicalPreparedStatement(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
PreparedStatement ps,
StatementKey stmtKey,
StatementCacheInteractor cacheInteractor);
@@ -224,6 +239,7 @@ LogicalPreparedStatement newLogicalPreparedStatement(
* @return A logical callable statement.
*/
LogicalCallableStatement newLogicalCallableStatement(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
CallableStatement cs,
StatementKey stmtKey,
StatementCacheInteractor cacheInteractor);
@@ -243,7 +259,9 @@ LogicalCallableStatement newLogicalCallableStatement(
* @return a client connection
* @throws SqlException on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientConnection newNetConnection(
+//IC see: https://issues.apache.org/jira/browse/DERBY-1028
LogWriter logWriter,
int driverManagerLoginTimeout,String serverName,
int portNumber,String databaseName, Properties properties)
@@ -264,10 +282,14 @@ ClientConnection newNetConnection(
* @return a client connection
* @throws SqlException on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
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;
@@ -294,9 +316,13 @@ ClientConnection newNetConnection(
* @return a client connection
* @throws SqlException on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
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;
@@ -321,6 +347,7 @@ ClientConnection newNetConnection(
* @return a result set
* @throws SqlException on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientResultSet newNetResultSet(
Agent netAgent,
MaterialStatement netStatement,
@@ -363,6 +390,7 @@ ClientDatabaseMetaData newNetDatabaseMetaData(Agent netAgent,
* @throws SqlException on error
*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientStatement newStatement(Agent agent,
ClientConnection connection, int type,
int concurrency, int holdability,
@@ -400,6 +428,7 @@ ClientStatement newStatement(Agent agent,
* @return a ParameterMetaData implementation
*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientParameterMetaData newParameterMetaData(ColumnMetaData columnMetaData);
/**
@@ -414,5 +443,6 @@ ClientStatement newStatement(Agent agent,
* @return a batch exception
*/
public BatchUpdateException newBatchUpdateException
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
( LogWriter logWriter, ClientMessageId msgid, Object[] args, long[] updateCounts, SqlException cause );
}
diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ClientParameterMetaData.java b/java/org.apache.derby.client/org/apache/derby/client/am/ClientParameterMetaData.java
index 46781235ce..0954f9de0e 100644
--- a/java/org.apache.derby.client/org/apache/derby/client/am/ClientParameterMetaData.java
+++ b/java/org.apache.derby.client/org/apache/derby/client/am/ClientParameterMetaData.java
@@ -60,6 +60,7 @@ public int getParameterMode(int param) throws SQLException {
{
columnMetaData_.checkForValidColumnIndex(param);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
if (columnMetaData_.sqlxParmmode_[param - 1] ==
ParameterMetaData.parameterModeUnknown) {
return ParameterMetaData.parameterModeUnknown;
diff --git a/java/org.apache.derby.client/org/apache/derby/client/am/ClientPreparedStatement.java b/java/org.apache.derby.client/org/apache/derby/client/am/ClientPreparedStatement.java
index 1989ebcd60..7872cbc504 100644
--- a/java/org.apache.derby.client/org/apache/derby/client/am/ClientPreparedStatement.java
+++ b/java/org.apache.derby.client/org/apache/derby/client/am/ClientPreparedStatement.java
@@ -281,6 +281,7 @@ private void initPreparedStatement(String sql) throws SqlException {
positionedUpdateCursorName_ = cursorName;
// Get a new section from the same package as the query section
setSection(agent_.sectionManager_.getPositionedUpdateSection(cursorName, false)); // false means get a regular section
+//IC see: https://issues.apache.org/jira/browse/DERBY-6082
if (getSection() == null) {
throw new SqlException(agent_.logWriter_,
@@ -295,6 +296,7 @@ private void initPreparedStatement(String sql) throws SqlException {
// if the cursor name supplied in the sql string is different from the cursorName
// set by setCursorName(), then server will return "cursor name not defined" error,
// and no subsititution is made here.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6082
if (getSection().getClientCursorName() != null && // cursor name is user defined
cursorName.compareTo(getSection().getClientCursorName()) == 0)
// client's cursor name is substituted with section's server cursor name
@@ -312,6 +314,7 @@ private void initPreparedStatement(String sql) throws SqlException {
void prepare() throws SqlException {
try {
// flow prepare, no static initialization is needed
+//IC see: https://issues.apache.org/jira/browse/DERBY-3426
flowPrepareDescribeInputOutput();
} catch (SqlException e) {
this.markClosed();
@@ -323,6 +326,7 @@ void prepare() throws SqlException {
//------------------- Prohibited overrides from Statement --------------------
public void addBatch(String sql) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4869
if (agent_.loggingEnabled()) {
agent_.logWriter_.traceEntry(this, "addBatch", sql);
}
@@ -366,6 +370,7 @@ public ResultSet executeQuery() throws SQLException {
if (agent_.loggingEnabled()) {
agent_.logWriter_.traceEntry(this, "executeQuery");
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientResultSet resultSet = executeQueryX();
if (agent_.loggingEnabled()) {
agent_.logWriter_.traceExit(this, "executeQuery", resultSet);
@@ -380,6 +385,7 @@ public ResultSet executeQuery() throws SQLException {
}
// also called by some DBMD methods
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
ClientResultSet executeQueryX() throws SqlException {
flowExecute(executeQueryMethod__);
return resultSet_;
@@ -387,6 +393,7 @@ ClientResultSet executeQueryX() throws SqlException {
public int executeUpdate() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
try
{
synchronized (connection_) {
@@ -412,6 +419,8 @@ private long executeUpdateX() throws SqlException {
}
public void setNull(int parameterIndex, int jdbcType) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
try
{
synchronized (connection_) {
@@ -428,6 +437,7 @@ public void setNull(int parameterIndex, int jdbcType) throws SQLException {
agent_.checkForSupportedDataType(jdbcType);
final int paramType =
+//IC see: https://issues.apache.org/jira/browse/DERBY-1956
getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.getPossibleTypesForNull( paramType ).checkType( jdbcType )){
@@ -455,6 +465,7 @@ void setNullX(int parameterIndex, int jdbcType) throws SqlException {
if (!parameterMetaData_.nullable_[parameterIndex - 1]) {
throw new SqlException(agent_.logWriter_,
new ClientMessageId(SQLState.LANG_NULL_INTO_NON_NULL),
+//IC see: https://issues.apache.org/jira/browse/DERBY-5873
parameterIndex);
}
setInput(parameterIndex, null);
@@ -480,10 +491,12 @@ public void setBoolean(int parameterIndex, boolean x) throws SQLException {
final int paramType =
getColumnMetaDataX().getColumnType(parameterIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1956
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ) {
PossibleTypes.throw22005Exception(agent_.logWriter_,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
Types.BOOLEAN,
paramType);
@@ -514,6 +527,7 @@ public void setByte(int parameterIndex, byte x) throws SQLException {
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType( paramType ) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
Types.TINYINT,
paramType);
@@ -521,6 +535,7 @@ public void setByte(int parameterIndex, byte x) throws SQLException {
parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
Types.TINYINT;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5873
setInput(parameterIndex, Short.valueOf(x));
}
}
@@ -544,6 +559,7 @@ public void setShort(int parameterIndex, short x) throws SQLException {
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
Types.SMALLINT,
paramType);
@@ -561,6 +577,7 @@ public void setShort(int parameterIndex, short x) throws SQLException {
// also used by DBMD methods
void setShortX(int parameterIndex, short x) throws SqlException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
Types.SMALLINT;
setInput(parameterIndex, x);
@@ -568,6 +585,7 @@ void setShortX(int parameterIndex, short x) throws SqlException {
}
public void setInt(int parameterIndex, int x) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
try
{
synchronized (connection_) {
@@ -596,6 +614,7 @@ public void setInt(int parameterIndex, int x) throws SQLException {
// also used by DBMD methods
void setIntX(int parameterIndex, int x) throws SqlException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
Types.INTEGER;
setInput(parameterIndex, x);
@@ -616,9 +635,12 @@ public void setLong(int parameterIndex, long x) throws SQLException {
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.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.INTEGER,
paramType);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2495
setLongX(parameterIndex, x);
}
}
@@ -632,7 +654,9 @@ void setLongX(final int parameterIndex, final long x)
{
// Column numbers starts at 1, clientParamtertype_[0] refers to column 1
parameterMetaData_.clientParamtertype_[parameterIndex - 1]
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
= Types.BIGINT;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5873
setInput(parameterIndex, x);
}
@@ -650,6 +674,7 @@ public void setFloat(int parameterIndex, float x) throws SQLException {
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
Types.FLOAT,
paramType);
@@ -675,11 +700,17 @@ public void setDouble(int parameterIndex, double x) throws SQLException {
}
final int paramType =
+//IC see: https://issues.apache.org/jira/browse/DERBY-1956
+//IC see: https://issues.apache.org/jira/browse/DERBY-1956
+//IC see: https://issues.apache.org/jira/browse/DERBY-1956
+//IC see: https://issues.apache.org/jira/browse/DERBY-1956
+//IC see: https://issues.apache.org/jira/browse/DERBY-1956
getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
Types.DOUBLE,
paramType);
@@ -687,6 +718,7 @@ public void setDouble(int parameterIndex, double x) throws SQLException {
parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
Types.DOUBLE;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Double d = x;
setInput(parameterIndex, d);
}
@@ -708,10 +740,13 @@ public void setBigDecimal(int parameterIndex, BigDecimal x)
final int paramType =
getColumnMetaDataX().getColumnType(parameterIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1956
+//IC see: https://issues.apache.org/jira/browse/DERBY-1956
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType( paramType ) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
Types.BIGINT,
paramType);
@@ -745,17 +780,22 @@ public void setDate(int parameterIndex, Date x, Calendar calendar)
}
final int paramType =
+//IC see: https://issues.apache.org/jira/browse/DERBY-1956
getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_DATE.checkType(paramType) ){
PossibleTypes.throw22005Exception(agent_.logWriter_ ,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
Types.DATE,
paramType);
}
checkForClosedStatement();
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
if (calendar == null) {
throw new SqlException(agent_.logWriter_,
@@ -763,6 +803,7 @@ public void setDate(int parameterIndex, Date x, Calendar calendar)
"null", "calendar", "setDate()");
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
Types.DATE;
@@ -794,10 +835,12 @@ public void setTime(int parameterIndex, Time x, Calendar calendar)
final int paramType =
getColumnMetaDataX().getColumnType(parameterIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1956
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_TIME.checkType( paramType ) ){
PossibleTypes.throw22005Exception( agent_.logWriter_,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
Types.TIME,
paramType );
}
@@ -808,6 +851,7 @@ public void setTime(int parameterIndex, Time x, Calendar calendar)
"null", "calendar", "setTime()");
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
Types.TIME;
@@ -840,10 +884,12 @@ public void setTimestamp(int parameterIndex, Timestamp x, Calendar calendar)
final int paramType =
getColumnMetaDataX().getColumnType(parameterIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1956
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_TIMESTAMP.checkType( paramType ) ) {
PossibleTypes.throw22005Exception(agent_.logWriter_,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
Types.TIMESTAMP,
paramType);
@@ -855,6 +901,7 @@ public void setTimestamp(int parameterIndex, Timestamp x, Calendar calendar)
"null", "calendar", "setTimestamp()");
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
Types.TIMESTAMP;
@@ -886,9 +933,11 @@ public void setString(int parameterIndex, String x) throws SQLException {
final int paramType =
getColumnMetaDataX().getColumnType(parameterIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1956
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_STRING.checkType( paramType ) ){
PossibleTypes.throw22005Exception(agent_.logWriter_ ,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
Types.VARCHAR,
paramType);
}
@@ -904,6 +953,7 @@ public void setString(int parameterIndex, String x) throws SQLException {
// also used by DBMD methods
void setStringX(int parameterIndex, String x) throws SqlException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
Types.LONGVARCHAR;
@@ -915,6 +965,7 @@ void setStringX(int parameterIndex, String x) throws SqlException {
}
public void setBytes(int parameterIndex, byte[] x) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-852
try
{
synchronized (connection_) {
@@ -923,11 +974,13 @@ public void setBytes(int parameterIndex, byte[] x) throws SQLException {
}
final int paramType =
+//IC see: https://issues.apache.org/jira/browse/DERBY-1956
getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_BYTES.checkType( paramType ) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
Types.VARBINARY,
paramType );
}
@@ -942,7 +995,9 @@ public void setBytes(int parameterIndex, byte[] x) throws SQLException {
}
// also used by CallableLocatorProcedures
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
void setBytesX(int parameterIndex, byte[] x) throws SqlException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6125
parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
Types.LONGVARBINARY;
@@ -970,12 +1025,14 @@ public void setBinaryStream(int parameterIndex,
{
synchronized (connection_) {
if (agent_.loggingEnabled()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5873
agent_.logWriter_.traceEntry(this, "setBinaryStream",
parameterIndex, " ", 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
+//IC see: https://issues.apache.org/jira/browse/DERBY-3016
Replication
XRExx
@@ -167,6 +174,7 @@ public interface SQLState {
String SERVICE_MISSING_IMPLEMENTATION = "XBM02.D";
String MISSING_PRODUCT_VERSION = "XBM05.D";
String SERVICE_WRONG_BOOT_PASSWORD = "XBM06.D";
+//IC see: https://issues.apache.org/jira/browse/DERBY-5283
String SERVICE_PROPERTIES_MISSING = "XBM0A.D";
String SERVICE_PROPERTIES_EDIT_FAILED = "XBM0B.D";
String MISSING_FILE_PRIVILEGE = "XBM0C.D";
@@ -189,7 +197,9 @@ public interface SQLState {
String REGISTERED_CLASS_LINAKGE_ERROR = "XBM0V.S";
String REGISTERED_CLASS_INSTANCE_ERROR = "XBM0W.S";
String INVALID_LOCALE_DESCRIPTION = "XBM0X.D";
+//IC see: https://issues.apache.org/jira/browse/DERBY-2334
String INVALID_COLLATION = "XBM03.D";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3320
String COLLATOR_NOT_FOUND_FOR_LOCALE = "XBM04.D";
String SERVICE_DIRECTORY_NOT_IN_BACKUP = "XBM0Y.D";
String UNABLE_TO_COPY_FILE_FROM_BACKUP = "XBM0Z.D";
@@ -201,6 +211,7 @@ public interface SQLState {
** Communications
*/
String LOGIN_TIMEOUT = "XBDA0.C.1";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6094
/*
** Upgrade
@@ -221,6 +232,7 @@ public interface SQLState {
String GENERATED_CLASS_INSTANCE_ERROR = "XBCM2.S";
String GENERATED_CLASS_NO_SUCH_METHOD = "XBCM3.S";
String GENERATED_CLASS_LIMIT_EXCEEDED = "XBCM4.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
/*
** Cryptography
@@ -239,6 +251,7 @@ public interface SQLState {
String ENCRYPTION_NOCHANGE_ALGORITHM = "XBCXD.S";
String ENCRYPTION_NOCHANGE_PROVIDER = "XBCXE.S";
String ENCRYPTION_NO_PROVIDER_CLASS = "XBCXF.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6626
String ENCRYPTION_NOT_A_PROVIDER = "XBCXF.S.1";
String ENCRYPTION_BAD_PROVIDER = "XBCXG.S";
String ENCRYPTION_BAD_ALG_FORMAT = "XBCXH.S";
@@ -246,6 +259,7 @@ public interface SQLState {
String ENCRYPTION_BAD_JCE = "XBCXJ.S";
String ENCRYPTION_BAD_EXTERNAL_KEY = "XBCXK.S";
String ENCRYPTION_UNABLE_KEY_VERIFICATION = "XBCXL.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-746
String ENCRYPTION_INVALID_EXKEY_LENGTH = "XBCXM.S";
String ENCRYPTION_ILLEGAL_EXKEY_CHARS = "XBCXN.S";
String ENCRYPTION_PREPARED_XACT_EXIST = "XBCXO.S";
@@ -265,6 +279,7 @@ public interface SQLState {
String PROPERTY_INVALID_VALUE = "XCY00.S";
String PROPERTY_UNSUPPORTED_CHANGE = "XCY02.S";
String PROPERTY_MISSING = "XCY03.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
String PROPERTY_SYNTAX_INVALID = "XCY04.S";
String PROPERTY_CANT_UNDO_NATIVE = "XCY05.S.2";
String PROPERTY_DBO_LACKS_CREDENTIALS = "XCY05.S.3";
@@ -276,6 +291,7 @@ public interface SQLState {
String LOCK_TIMEOUT = "40XL1";
String LOCK_TIMEOUT_LOG = "40XL1.T.1";
String SELF_DEADLOCK = "40XL2";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6554
/*
** Store - access.protocol.Interface statement exceptions
@@ -388,8 +404,11 @@ public interface SQLState {
String RAWSTORE_CANNOT_CHANGE_LOGDEVICE = "XSRS8.S";
String RAWSTORE_RECORD_VANISHED = "XSRS9.S";
String BACKUP_BLOCKING_OPERATIONS_IN_PROGRESS = "XSRSA.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-239
String BACKUP_OPERATIONS_NOT_ALLOWED = "XSRSB.S";
String RAWSTORE_CANNOT_BACKUP_INTO_DATABASE_DIRECTORY = "XSRSC.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-304
+//IC see: https://issues.apache.org/jira/browse/DERBY-239
/*
** RawStore - Log.Generic statement exceptions
@@ -449,6 +468,7 @@ public interface SQLState {
** RawStore - Transactions.Basic transaction exceptions
*/
String TRANSACTION_PREFIX="40";
+//IC see: https://issues.apache.org/jira/browse/DERBY-1140
String XACT_PROTOCOL_VIOLATION = "40XT0";
String XACT_COMMIT_EXCEPTION = "40XT1";
@@ -458,6 +478,7 @@ public interface SQLState {
String XACT_CANNOT_ACTIVATE_TRANSACTION = "40XT6";
String XACT_NOT_SUPPORTED_IN_INTERNAL_XACT = "40XT7";
String XACT_PROTOCOL_VIOLATION_DETAILED = "40XT8";
+//IC see: https://issues.apache.org/jira/browse/DERBY-4729
/*
** RawStore - Transactions.Basic system exceptions
@@ -494,8 +515,11 @@ public interface SQLState {
String DATA_UNEXPECTED_OVERFLOW_PAGE = "XSDAL.S";
String DATA_SQLDATA_READ_INSTANTIATION_EXCEPTION = "XSDAM.S";
String DATA_SQLDATA_READ_ILLEGAL_ACCESS_EXCEPTION = "XSDAN.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-4982
String DATA_DOUBLE_LATCH_INTERNAL_ERROR = "XSDAO.S";
String DATA_UNEXPECTED_NO_SPACE_ON_PAGE = "XSDAP.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6320
+//IC see: https://issues.apache.org/jira/browse/DERBY-4923
/*
** RawStore - Data.Generic transaction exceptions
@@ -511,8 +535,10 @@ public interface SQLState {
String DATA_MULTIPLE_JBMS_FORCE_LOCK = "XSDB8.D";
String DATA_CORRUPT_STREAM_CONTAINER = "XSDB9.D";
String DATA_OBJECT_ALLOCATION_FAILED = "XSDBA.D";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3725
String DATA_UNKNOWN_PAGE_FORMAT_2 = "XSDBB.D";
String DATA_BAD_CONTAINERINFO_WRITE = "XSDBC.D";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3727
/*
** RawStore - Data.Filesystem statement exceptions
@@ -528,8 +554,10 @@ public interface SQLState {
String FILE_READ_ONLY = "XSDFB.S";
String FILE_IO_GARBLED = "XSDFD.S";
String FILE_UNEXPECTED_EXCEPTION = "XSDFF.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-239
String BACKUP_FILE_IO_ERROR = "XSDFH.S";
String FILE_NEW_PAGE_DURING_RECOVERY = "XSDFI.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-5886
String FILE_CANNOT_REMOVE_ENCRYPT_FILE = "XSDFJ.S";
String FILE_CANNOT_REMOVE_JAR_FILE = "XSDFK.S";
@@ -544,6 +572,7 @@ public interface SQLState {
String FILE_WRITE_PAGE_EXCEPTION = "XSDG1.D";
String FILE_BAD_CHECKSUM = "XSDG2.D";
String FILE_CONTAINER_EXCEPTION = "XSDG3.D";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6504
String UNABLE_TO_ARRAYCOPY = "XSDG4.D";
String FILE_DATABASE_NOT_IN_CREATE = "XSDG5.D";
String DATA_DIRECTORY_NOT_FOUND_IN_BACKUP = "XSDG6.D";
@@ -593,6 +622,7 @@ public interface SQLState {
*/
String CONNECTIVITY_PREFIX="08";
+//IC see: https://issues.apache.org/jira/browse/DERBY-1140
/*
** Language
@@ -671,9 +701,12 @@ public interface SQLState {
String LANG_COL_NOT_NULL = "01503";
String LANG_INDEX_DUPLICATE = "01504";
String LANG_VALUE_TRUNCATED = "01505";
+//IC see: https://issues.apache.org/jira/browse/DERBY-335
String LANG_SYNONYM_UNDEFINED = "01522";
String LANG_NULL_ELIMINATED_IN_SET_FUNCTION = "01003";
+//IC see: https://issues.apache.org/jira/browse/DERBY-1582
String LANG_PRIVILEGE_NOT_REVOKED = "01006";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
String LANG_ROLE_NOT_REVOKED = "01007";
String LANG_WITH_ADMIN_OPTION_NOT_REVOKED = "01008";
String LANG_GEN_COL_DROPPED = "01009";
@@ -696,6 +729,7 @@ public interface SQLState {
/*
** SQL Data exceptions
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1140
String SQL_DATA_PREFIX="22";
String LANG_MISSING_PARMS = "07000";
@@ -704,25 +738,33 @@ public interface SQLState {
String LANG_STRING_TRUNCATION = "22001";
String LANG_CONCAT_STRING_OVERFLOW = "54006";
String LANG_OUTSIDE_RANGE_FOR_DATATYPE = "22003";
+//IC see: https://issues.apache.org/jira/browse/DERBY-843
+//IC see: https://issues.apache.org/jira/browse/DERBY-1198
String YEAR_EXCEEDS_MAXIMUM = "22003.S.1";
String DECIMAL_TOO_MANY_DIGITS = "22003.S.2";
String NUMERIC_OVERFLOW = "22003.S.3";
String CLIENT_LENGTH_OUTSIDE_RANGE_FOR_DATATYPE = "22003.S.4";
+//IC see: https://issues.apache.org/jira/browse/DERBY-1445
String LANG_DATA_TYPE_GET_MISMATCH = "22005"; // same 22005 error
+//IC see: https://issues.apache.org/jira/browse/DERBY-839
String UNSUPPORTED_ENCODING = "22005.S.1";
String CHARACTER_CONVERTER_NOT_AVAILABLE = "22005.S.2";
+//IC see: https://issues.apache.org/jira/browse/DERBY-845
String CANT_CONVERT_UNICODE_TO_EBCDIC = "22005.S.3";
+//IC see: https://issues.apache.org/jira/browse/DERBY-848
String NET_UNRECOGNIZED_JDBC_TYPE = "22005.S.4";
String NET_INVALID_JDBC_TYPE_FOR_PARAM = "22005.S.5";
String UNRECOGNIZED_JAVA_SQL_TYPE = "22005.S.6";
String CANT_CONVERT_UNICODE_TO_UTF8 = "22005.S.7";
+//IC see: https://issues.apache.org/jira/browse/DERBY-4757
String LANG_DATE_RANGE_EXCEPTION = "22007.S.180";
String LANG_DATE_SYNTAX_EXCEPTION = "22007.S.181";
String LANG_INVALID_FUNCTION_ARGUMENT = "22008.S";
String LANG_SEQUENCE_GENERATOR_EXHAUSTED = "2200H.S";
String LANG_SUBSTR_START_OR_LEN_OUT_OF_RANGE = "22011";
+//IC see: https://issues.apache.org/jira/browse/DERBY-2769
String LANG_SUBSTR_START_ADDING_LEN_OUT_OF_RANGE = "22011.S.1";
String LANG_DIVIDE_BY_ZERO = "22012";
String LANG_SQRT_OF_NEG_NUMBER = "22013";
@@ -733,26 +775,34 @@ public interface SQLState {
String LANG_INVALID_TRIM_CHARACTER = "22020";
String LANG_INVALID_ESCAPE_SEQUENCE = "22025";
String LANG_INVALID_TRIM_SET = "22027";
+//IC see: https://issues.apache.org/jira/browse/DERBY-849
String LANG_STRING_TOO_LONG = "22028";
String LANG_ESCAPE_IS_NULL = "22501";
String LANG_INVALID_ROW_COUNT_FIRST = "2201W";
String LANG_INVALID_ROW_COUNT_OFFSET = "2201X";
String LANG_ROW_COUNT_OFFSET_FIRST_IS_NULL = "2201Z";
+//IC see: https://issues.apache.org/jira/browse/DERBY-4208
/*
** Integrity violations.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1140
String INTEGRITY_VIOLATION_PREFIX="23";
String LANG_NULL_INTO_NON_NULL = "23502";
String LANG_DUPLICATE_KEY_CONSTRAINT = "23505";
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
+//IC see: https://issues.apache.org/jira/browse/DERBY-6419
String LANG_DEFERRED_DUPLICATE_KEY_CONSTRAINT_T = "23506.T.1";
String LANG_DEFERRED_DUPLICATE_KEY_CONSTRAINT_S = "23507.S.1";
String LANG_FK_VIOLATION = "23503";
String LANG_CHECK_CONSTRAINT_VIOLATED = "23513";
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
String LANG_DEFERRED_CHECK_CONSTRAINT_T = "23514.T.1";
String LANG_DEFERRED_CHECK_CONSTRAINT_S = "23515.S.1";
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
String LANG_DEFERRED_FK_CONSTRAINT_T = "23516.T.1";
String LANG_DEFERRED_FK_CONSTRAINT_S = "23517.S.1";
// From SQL/XML[2006] spec; there are others, but
@@ -764,9 +814,11 @@ public interface SQLState {
String LANG_INVALID_XML_CONTEXT_ITEM = "2200V";
String LANG_XQUERY_SERIALIZATION_ERROR = "2200W";
+//IC see: https://issues.apache.org/jira/browse/DERBY-1149
String CANNOT_CLOSE_ACTIVE_CONNECTION = "25001";
String INVALID_TRANSACTION_STATE_ACTIVE_CONNECTION = "25001.S.1";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
String LANG_UNEXPECTED_USER_EXCEPTION = "38000";
String EXTERNAL_ROUTINE_NO_SQL = "38001";
@@ -777,6 +829,8 @@ public interface SQLState {
String LANG_SYNTAX_OR_ACCESS_VIOLATION = "42000";
// Fix for Derby-1828 - access rule violations should use SQL state 42
+//IC see: https://issues.apache.org/jira/browse/DERBY-1828
+//IC see: https://issues.apache.org/jira/browse/DERBY-2633
String AUTH_NO_TABLE_PERMISSION = "42500";
String AUTH_NO_TABLE_PERMISSION_FOR_GRANT = "42501";
String AUTH_NO_COLUMN_PERMISSION = "42502";
@@ -792,8 +846,11 @@ public interface SQLState {
String AUTH_USER_IN_READ_AND_WRITE_LISTS = "4250C";
String AUTH_DUPLICATE_USERS = "4250D";
String AUTH_INTERNAL_BAD_UUID = "4250E";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
String AUTH_ROLE_DBO_ONLY = "4251A";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3333
String AUTH_PUBLIC_ILLEGAL_AUTHORIZATION_ID = "4251B";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3722
String AUTH_ROLE_GRANT_CIRCULARITY = "4251C";
String DBO_ONLY = "4251D";
String HIDDEN_COLUMN = "4251E";
@@ -817,6 +874,7 @@ public interface SQLState {
String LANG_DB2_INVALID_COLS_SPECIFIED = "42802";
String LANG_DB2_INVALID_SELECT_COL_FOR_HAVING = "42803";
String LANG_DB2_ADD_UNIQUE_OR_PRIMARY_KEY_ON_NULL_COLS = "42831";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3523
String LANG_ADD_PRIMARY_KEY_ON_NULL_COLS = "42831.S.1";
String LANG_DB2_REPLACEMENT_ERROR = "42815.S.713";
String LANG_DB2_COALESCE_DATATYPE_MISMATCH = "42815.S.171";
@@ -832,8 +890,10 @@ public interface SQLState {
String LANG_NO_AGGREGATES_IN_WHERE_CLAUSE = "42903";
String LANG_DB2_VIEW_REQUIRES_COLUMN_NAMES = "42908";
+//IC see: https://issues.apache.org/jira/browse/DERBY-64
String LANG_TABLE_REQUIRES_COLUMN_NAMES = "42909";
String LANG_DELETE_RULE_VIOLATION = "42915";
+//IC see: https://issues.apache.org/jira/browse/DERBY-335
String LANG_SYNONYM_CIRCULAR = "42916";
String LANG_SYNTAX_ERROR = "42X01";
String LANG_LEXICAL_ERROR = "42X02";
@@ -855,8 +915,10 @@ public interface SQLState {
String LANG_DUPLICATE_COLUMN_NAME_UPDATE = "42X16";
String LANG_INVALID_JOIN_ORDER_SPEC = "42X17";
String LANG_NOT_COMPARABLE = "42818";
+//IC see: https://issues.apache.org/jira/browse/DERBY-5885
String LANG_NON_BOOLEAN_WHERE_CLAUSE = "42X19.S.1";
String LANG_UNTYPED_PARAMETER_IN_WHERE_CLAUSE = "42X19.S.2";
+//IC see: https://issues.apache.org/jira/browse/DERBY-4079
String LANG_INTEGER_LITERAL_EXPECTED = "42X20";
String LANG_CURSOR_NOT_UPDATABLE = "42X23";
String LANG_INVALID_COL_HAVING_CLAUSE = "42X24";
@@ -880,7 +942,9 @@ public interface SQLState {
String LANG_NOT_STORABLE = "42821";
String LANG_NULL_RESULT_SET_META_DATA = "42X43";
String LANG_INVALID_COLUMN_LENGTH = "42X44";
+//IC see: https://issues.apache.org/jira/browse/DERBY-81
String LANG_INVALID_FUNCTION_ARG_TYPE = "42X45";
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
String LANG_AMBIGUOUS_FUNCTION_NAME = "42X46";
String LANG_AMBIGUOUS_PROCEDURE_NAME = "42X47";
String LANG_INVALID_PRECISION = "42X48";
@@ -905,6 +969,7 @@ public interface SQLState {
//42X67
String LANG_NO_FIELD_FOUND = "42X68";
String LANG_PRIMITIVE_REFERENCING_EXPRESSION = "42X69";
+//IC see: https://issues.apache.org/jira/browse/DERBY-64
String LANG_TABLE_DEFINITION_R_C_L_MISMATCH = "42X70";
String LANG_INVALID_COLUMN_TYPE_CREATE_TABLE = "42X71";
String LANG_NO_STATIC_FIELD_FOUND = "42X72";
@@ -916,15 +981,19 @@ public interface SQLState {
String LANG_ORDER_BY_COLUMN_NOT_FOUND = "42X78";
String LANG_DUPLICATE_COLUMN_FOR_ORDER_BY = "42X79";
String LANG_QUALIFIED_COLUMN_NAME_NOT_ALLOWED = "42877";
+//IC see: https://issues.apache.org/jira/browse/DERBY-2459
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
String LANG_UNION_ORDER_BY = "42878";
String LANG_DISTINCT_ORDER_BY = "42879";
String LANG_DISTINCT_ORDER_BY_EXPRESSION = "4287A";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6009
String LANG_TABLE_VALUE_CTOR_RESTRICTION = "4287B";
String LANG_EMPTY_VALUES_CLAUSE = "42X80";
String LANG_EMPTY_COLUMN_LIST = "42X81";
String LANG_USING_CARDINALITY_VIOLATION = "42X82";
String LANG_CANT_DROP_BACKING_INDEX = "42X84";
String LANG_CONSTRAINT_SCHEMA_MISMATCH = "42X85";
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
String LANG_DROP_OR_ALTER_NON_EXISTING_CONSTRAINT = "42X86";
String LANG_ALL_RESULT_EXPRESSIONS_UNTYPED = "42X87";
String LANG_CONDITIONAL_NON_BOOLEAN = "42X88";
@@ -935,8 +1004,10 @@ public interface SQLState {
String LANG_INVALID_CREATE_CONSTRAINT_COLUMN_LIST = "42X93";
String LANG_OBJECT_NOT_FOUND = "42X94";
String LANG_DB_CLASS_PATH_HAS_MISSING_JAR = "42X96";
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
String LANG_INCONSISTENT_CONSTRAINT_CHARACTERISTICS = "42X97";
String LANG_NO_PARAMS_IN_VIEWS = "42X98";
+//IC see: https://issues.apache.org/jira/browse/DERBY-64
String LANG_NO_PARAMS_IN_TABLES = "42X99";
String LANG_UNASSIGNABLE_GENERATION_CLAUSE = "42XA0";
String LANG_AGGREGATE_IN_GENERATION_CLAUSE = "42XA1";
@@ -956,25 +1027,33 @@ public interface SQLState {
String LANG_SEQ_INVALID_START = "42XAG";
String LANG_NEXT_VALUE_FOR_ILLEGAL = "42XAH";
String LANG_SEQUENCE_REFERENCED_TWICE = "42XAI";
+//IC see: https://issues.apache.org/jira/browse/DERBY-4539
String LANG_DUPLICATE_CS_CLAUSE = "42XAJ";
String LANG_TARGET_NOT_BASE_TABLE = "42XAK";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6652
String LANG_SOURCE_NOT_BASE_OR_VTI = "42XAL";
String LANG_SAME_EXPOSED_NAME = "42XAM";
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
String LANG_NOT_NULL_CHARACTERISTICS = "42XAN";
String LANG_NO_SUBQUERIES_IN_MATCHED_CLAUSE = "42XAO";
String LANG_NO_SYNONYMS_IN_MERGE = "42XAP";
String LANG_NO_DCL_IN_MERGE = "42XAQ";
String LANG_SYSTEM_SEQUENCE = "42XAR";
+//IC see: https://issues.apache.org/jira/browse/DERBY-5466
String LANG_BAD_DISTINCT_AGG = "42XAS";
String LANG_INVALID_ROWID_SCOPE = "42XAT";
+//IC see: https://issues.apache.org/jira/browse/DERBY-4555
+//IC see: https://issues.apache.org/jira/browse/DERBY-6894
String LANG_INVALID_INPUT_COLUMN_NAME = "42XAU";
String LANG_INVALID_NUMBEROF_HEADER_LINES = "42XAV";
String LANG_INVALID_USER_AGGREGATE_DEFINITION2 = "42Y00";
String LANG_INVALID_CHECK_CONSTRAINT = "42Y01";
// String LANG_NO_ALTER_TABLE_COMPRESS_ON_TARGET_TABLE = "42Y02";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3610
String LANG_NO_SUCH_METHOD_ALIAS = "42Y03.S.0";
String LANG_NO_SUCH_PROCEDURE = "42Y03.S.1";
String LANG_NO_SUCH_FUNCTION = "42Y03.S.2";
+//IC see: https://issues.apache.org/jira/browse/DERBY-5945
String LANG_PROC_USED_AS_FUNCTION = "42Y03.S.3";
String LANG_FUNCTION_USED_AS_PROC = "42Y03.S.4";
String LANG_INVALID_FULL_STATIC_METHOD_NAME = "42Y04";
@@ -1059,10 +1138,12 @@ public interface SQLState {
String LANG_NO_AGGREGATES_IN_ON_CLAUSE = "42Z07";
String LANG_NO_BULK_INSERT_REPLACE_WITH_TRIGGER = "42Z08";
String LANG_NO_AGGREGATES_IN_MERGE_MATCHING_CLAUSE = "42Z09";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6693
// MORE GENERIC LANGUAGE STUFF
String LANG_UDT_BUILTIN_CONFLICT = "42Z10";
String LANG_STREAM_INVALID_ACCESS = "42Z12.U";
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
// String LANG_UPDATABLE_VTI_BAD_GETMETADATA = "42Z14";
@@ -1072,8 +1153,10 @@ public interface SQLState {
String LANG_MODIFY_COLUMN_INVALID_LENGTH = "42Z17";
String LANG_MODIFY_COLUMN_FKEY_CONSTRAINT = "42Z18";
String LANG_MODIFY_COLUMN_REFERENCED = "42Z19";
+//IC see: https://issues.apache.org/jira/browse/DERBY-119
String LANG_MODIFY_COLUMN_EXISTING_CONSTRAINT = "42Z20";
String LANG_MODIFY_COLUMN_EXISTING_PRIMARY_KEY = "42Z20.S.1";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3523
String LANG_AI_INVALID_INCREMENT = "42Z21";
String LANG_AI_INVALID_TYPE = "42Z22";
@@ -1106,6 +1189,7 @@ public interface SQLState {
String LANG_COLUMN_ID_ARRAY = "42Z48.U";
String LANG_GRANT_REVOKE_WITH_LEGACY_ACCESS = "42Z60";
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
// 42Z70 - 42Z7Z: For Derby-specific XML compilation errors
// (not defined by SQL/XML standard).
@@ -1131,6 +1215,7 @@ public interface SQLState {
// MORE GENERIC LANGUAGE STUFF
// String LANG_UPDATABLE_VTI_BAD_GETRESULTSETCONCURRENCY = "42Z89";
+//IC see: https://issues.apache.org/jira/browse/DERBY-2717
String LANG_UPDATABLE_VTI_NON_UPDATABLE_RS = "42Z90";
String LANG_SUBQUERY = "42Z91";
String LANG_REPEATABLE_READ = "42Z92";
@@ -1154,9 +1239,12 @@ public interface SQLState {
String LANG_XML_NOT_ALLOWED_DJRS = "42ZB3";
String LANG_NOT_TABLE_FUNCTION = "42ZB4";
String LANG_NO_COSTING_CONSTRUCTOR = "42ZB5";
+//IC see: https://issues.apache.org/jira/browse/DERBY-4092
String LANG_TABLE_FUNCTION_NOT_ALLOWED = "42ZB6";
String LANG_BAD_TABLE_FUNCTION_PARAM_REF = "42ZB7";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3634
+//IC see: https://issues.apache.org/jira/browse/DERBY-4069
String LANG_NO_SUCH_WINDOW = "42ZC0";
String LANG_WINDOW_LIMIT_EXCEEDED = "42ZC1";
String LANG_WINDOW_FUNCTION_CONTEXT_ERROR = "42ZC2";
@@ -1172,6 +1260,7 @@ public interface SQLState {
String LANG_VARARGS_RETURN_RESULT_SETS = "42ZCB";
// bad optimizer overrides
+//IC see: https://issues.apache.org/jira/browse/DERBY-6267
String LANG_BAD_ROW_SOURCE_COUNT = "42ZCC";
String LANG_NOT_LEFT_DEEP = "42ZCD";
String LANG_UNRESOLVED_ROW_SOURCE = "42ZCE";
@@ -1187,8 +1276,10 @@ public interface SQLState {
//following 1 does not match the DB2 sql state, it is a Derby specific behavior which is not compatible with DB2
String LANG_OPERATION_NOT_ALLOWED_ON_SESSION_SCHEMA_TABLES = "XCL51.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-180
// error messages for the Lucene plugin
+//IC see: https://issues.apache.org/jira/browse/DERBY-590
String LUCENE_NOT_A_STRING_TYPE = "42XBA";
String LUCENE_NO_PRIMARY_KEY = "42XBB";
String LUCENE_UNSUPPORTED_TYPE = "42XBC";
@@ -1198,10 +1289,15 @@ public interface SQLState {
String LUCENE_ALREADY_LOADED = "42XBG";
String LUCENE_ALREADY_UNLOADED = "42XBH";
String LUCENE_BAD_INDEX = "42XBI";
+//IC see: https://issues.apache.org/jira/browse/DERBY-590
String LUCENE_BAD_COLUMN_NAME = "42XBJ";
+//IC see: https://issues.apache.org/jira/browse/DERBY-590
String LUCENE_BAD_VERSION = "42XBK";
+//IC see: https://issues.apache.org/jira/browse/DERBY-590
String LUCENE_ENCRYPTED_DB = "42XBL";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6596
String ARGUMENT_MAY_NOT_BE_NULL = "42XBM";
+//IC see: https://issues.apache.org/jira/browse/DERBY-590
String LUCENE_FIELD_KEY_CONFLICT = "42XBN";
String LUCENE_DUPLICATE_FIELD_NAME = "42XBO";
@@ -1303,9 +1399,12 @@ public interface SQLState {
String RTS_PROJECTION_TIME = "43X97.U";
String RTS_PR = "43X98.U";
String RTS_ROW_RS = "43X99.U";
+//IC see: https://issues.apache.org/jira/browse/DERBY-4079
String RTS_RC = "43X9A.U";
String RTS_RC_RS = "43X9B.U";
String RTS_WINDOW_RS = "43X9C.U";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3634
+//IC see: https://issues.apache.org/jira/browse/DERBY-4069
String RTS_SCALAR_AGG_RS = "43Y00.U";
String RTS_INDEX_KEY_OPT = "43Y01.U";
@@ -1350,6 +1449,7 @@ public interface SQLState {
String RTS_REFACTION_DEPENDENT = "43Y53.U";
String RTS_BEGIN_DEPENDENT_NUMBER = "43Y54.U";
String RTS_END_DEPENDENT_NUMBER = "43Y55.U";
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
String RTS_USER_SUPPLIED_OPTIMIZER_OVERRIDES_FOR_TABLE = "43Y56.U";
String RTS_USER_SUPPLIED_OPTIMIZER_OVERRIDES_FOR_JOIN = "43Y57.U";
@@ -1388,7 +1488,9 @@ public interface SQLState {
String LANG_CANT_INVALIDATE_OPEN_RESULT_SET = "X0X95.S";
String LANG_CANT_CHANGE_ISOLATION_HOLD_CURSOR = "X0X03.S";
//following three for auto-generated keys feature in JDBC3.0
+//IC see: https://issues.apache.org/jira/browse/DERBY-2653
String INVALID_COLUMN_ARRAY_LENGTH = "X0X0D.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-2631
String LANG_INVALID_AUTOGEN_COLUMN_POSITION = "X0X0E.S";
String LANG_INVALID_AUTOGEN_COLUMN_NAME = "X0X0F.S";
@@ -1412,6 +1514,7 @@ public interface SQLState {
String LANG_INVALID_FK_NO_REF_KEY = "X0Y44.S";
String LANG_ADD_FK_CONSTRAINT_VIOLATION = "X0Y45.S";
String LANG_INVALID_FK_NO_REF_TAB = "X0Y46.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6576
String LANG_INVALID_FK_REF_KEY = "X0Y47.S";
String LANG_SCHEMA_NOT_EMPTY = "X0Y54.S";
String LANG_INDEX_ROW_COUNT_MISMATCH = "X0Y55.S";
@@ -1419,6 +1522,7 @@ public interface SQLState {
String LANG_ADDING_NON_NULL_COLUMN_TO_NON_EMPTY_TABLE = "X0Y57.S";
String LANG_ADD_PRIMARY_KEY_FAILED1 = "X0Y58.S";
String LANG_ADD_CHECK_CONSTRAINT_FAILED = "X0Y59.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3523
String LANG_NULL_DATA_IN_PRIMARY_KEY_OR_UNIQUE_CONSTRAINT = "X0Y63.S";
String LANG_NULL_DATA_IN_PRIMARY_KEY = "X0Y63.S.1";
String LANG_NO_COMMIT_IN_NESTED_CONNECTION = "X0Y66.S";
@@ -1430,6 +1534,7 @@ public interface SQLState {
String LANG_NO_BULK_INSERT_REPLACE_WITH_TRIGGER_DURING_EXECUTION = "X0Y72.S";
String LANG_NO_SET_TRAN_ISO_IN_GLOBAL_CONNECTION = "X0Y77.S";
String LANG_INVALID_CALL_TO_EXECUTE_QUERY = "X0Y78.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-1364
String MULTIPLE_RESULTS_ON_EXECUTE_QUERY = "X0Y78.S.1";
String USE_EXECUTE_UPDATE_WITH_NO_RESULTS = "X0Y78.S.2";
String LANG_INVALID_CALL_TO_EXECUTE_UPDATE = "X0Y79.S";
@@ -1437,15 +1542,21 @@ public interface SQLState {
String LANG_IGNORE_MISSING_INDEX_ROW_DURING_DELETE = "X0Y83.S";
String LANG_TOO_MUCH_CONTENTION_ON_SEQUENCE = "X0Y84.T";
String LANG_UNKNOWN_SEQUENCE_PREALLOCATOR = "X0Y85.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6626
String LANG_NOT_A_SEQUENCE_PREALLOCATOR = "X0Y85.S.1";
String LANG_CANT_FLUSH_PREALLOCATOR = "X0Y86.S";
String LANG_BAD_UDA_OR_FUNCTION_NAME = "X0Y87.S";
String LANG_UNKNOWN_TOOL_NAME = "X0Y88.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6626
String LANG_UNKNOWN_CUSTOM_TOOL_NAME = "X0Y88.S.1";
String LANG_BAD_OPTIONAL_TOOL_ARGS = "X0Y89.S";
String LANG_CANT_INSTANTIATE_CLASS = "X0Y90.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
+//IC see: https://issues.apache.org/jira/browse/DERBY-6419
String LANG_SET_CONSTRAINT_NOT_DEFERRABLE = "X0Y91.S";
String LANG_CANNOT_CHANGE_COLUMN_NAMES = "X0Y92.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6117
// TEMPORARY EXECUTION RESTRICTIONS
@@ -1461,6 +1572,7 @@ public interface SQLState {
String LANG_INVALID_COLUMN_POSITION = "XCL14.S";
String LANG_INVALID_COMPARE_TO = "XCL15.S";
String LANG_RESULT_SET_NOT_OPEN = "XCL16.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-721
String LANG_STREAM_RETRIEVED_ALREADY = "XCL18.S";
String LANG_MISSING_ROW = "XCL19.S";
String LANG_CANT_UPGRADE_CATALOGS = "XCL20.S";
@@ -1498,6 +1610,7 @@ public interface SQLState {
String LANG_CANT_UPGRADE_DATABASE = "XCL50.S";
String LANG_STATEMENT_CANCELLED_OR_TIMED_OUT = "XCL52.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-31
/*
** Language errors that match DB2
@@ -1510,28 +1623,41 @@ public interface SQLState {
*/
String INVALID_ROLE_SYS = "4293A";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3073
+//IC see: https://issues.apache.org/jira/browse/DERBY-2207
/*
SQL standard 0A - feature not supported
*/
String UNSUPPORTED_PREFIX="0A";
+//IC see: https://issues.apache.org/jira/browse/DERBY-1140
String NOT_IMPLEMENTED = "0A000.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-1185
String JDBC_METHOD_NOT_IMPLEMENTED = "0A000.S.1";
+//IC see: https://issues.apache.org/jira/browse/DERBY-924
+//IC see: https://issues.apache.org/jira/browse/DERBY-925
+//IC see: https://issues.apache.org/jira/browse/DERBY-970
String JDBC_METHOD_NOT_SUPPORTED_BY_SERVER = "0A000.S.2";
+//IC see: https://issues.apache.org/jira/browse/DERBY-843
+//IC see: https://issues.apache.org/jira/browse/DERBY-1198
String UNSUPPORTED_HOLDABILITY_PROPERTY = "0A000.S.3";
String CANCEL_NOT_SUPPORTED_BY_SERVER = "0A000.S.4";
+//IC see: https://issues.apache.org/jira/browse/DERBY-846
String SECMECH_NOT_SUPPORTED = "0A000.S.5";
String DRDA_COMMAND_NOT_IMPLEMENTED = "0A000.C.6";
String DATA_TYPE_NOT_SUPPORTED = "0A000.S.7";
+//IC see: https://issues.apache.org/jira/browse/DERBY-1393
/*
** Authorization and Authentication
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1828
+//IC see: https://issues.apache.org/jira/browse/DERBY-2633
String AUTHORIZATION_SPEC_PREFIX="28";
String AUTH_SET_CONNECTION_READ_ONLY_IN_ACTIVE_XACT = "25501";
@@ -1539,6 +1665,7 @@ public interface SQLState {
String AUTH_DDL_WITH_READ_ONLY_CONNECTION = "25503";
String AUTH_CANNOT_SET_READ_WRITE = "25505";
String AUTH_INVALID_USER_NAME = "28502";
+//IC see: https://issues.apache.org/jira/browse/DERBY-2735
/*
** Dependency manager
@@ -1555,6 +1682,7 @@ public interface SQLState {
String NEED_TO_REGISTER_PARAM = "07004";
String COLUMN_NOT_FOUND = "S0022";
//String NO_COMMIT_WHEN_AUTO = "XJ007.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-839
String NO_SAVEPOINT_ROLLBACK_OR_RELEASE_WHEN_AUTO = "XJ008.S";
String REQUIRES_CALLABLE_STATEMENT = "XJ009.S";
String NO_SAVEPOINT_WHEN_AUTO = "XJ010.S";
@@ -1566,8 +1694,10 @@ public interface SQLState {
String NO_SAVEPOINT_IN_TRIGGER = "XJ017.S";
String NULL_COLUMN_NAME = "XJ018.S";
String TYPE_MISMATCH = "XJ020.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-839
String UNSUPPORTED_TYPE = "XJ021.S";
String SET_STREAM_FAILURE = "XJ022.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-562
String SET_STREAM_INEXACT_LENGTH_DATA = "XJ023.S";
String NEGATIVE_STREAM_LENGTH = "XJ025.S";
String NO_AUTO_COMMIT_ON = "XJ030.S";
@@ -1592,8 +1722,11 @@ public interface SQLState {
String NO_SETXXX_FOR_EXEC_USING = "XJ069.S";
String BLOB_BAD_POSITION = "XJ070.S";
String BLOB_NONPOSITIVE_LENGTH = "XJ071.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-839
String BLOB_NULL_PATTERN_OR_SEARCH_STR = "XJ072.S";
String BLOB_ACCESSED_AFTER_COMMIT = "XJ073.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-31
+//IC see: https://issues.apache.org/jira/browse/DERBY-842
String INVALID_QUERYTIMEOUT_VALUE = "XJ074.S";
String BLOB_POSITION_TOO_LARGE = "XJ076.S";
String BLOB_UNABLE_TO_READ_PATTERN = "XJ077.S";
@@ -1606,6 +1739,7 @@ public interface SQLState {
String COLUMN_NOT_FROM_BASE_TABLE = "XJ084.U";
String STREAM_EOF = "XJ085.S";
String CURSOR_NOT_POSITIONED_ON_INSERT_ROW = "XJ086.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-2444
String POS_AND_LENGTH_GREATER_THAN_LOB = "XJ087.S";
@@ -1617,6 +1751,7 @@ public interface SQLState {
String SAVEPOINT_NOT_CREATED_BY_CONNECTION = "XJ097.S";
String BAD_AUTO_GEN_KEY_VALUE = "XJ098.S";
String READER_UNDER_RUN = "XJ099.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-842
String REGOUTPARAM_SCALE_DOESNT_MATCH_SETTER = "XJ100.S";
String TABLE_NAME_CANNOT_BE_NULL = "XJ103.S";
String SHARED_KEY_LENGTH_ERROR = "XJ104.S";
@@ -1628,6 +1763,7 @@ public interface SQLState {
String FOREIGN_TABLE_NAME_IS_NULL = "XJ111.S";
String SECURITY_EXCEPTION_ENCOUNTERED = "XJ112.S";
String UNABLE_TO_OPEN_FILE = "XJ113.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-842
String CURSOR_INVALID_CURSOR_NAME = "XJ114.S";
String UNABLE_TO_OPEN_RESULTSET_WITH_REQUESTED_HOLDABILTY = "XJ115.S";
String TOO_MANY_COMMANDS_FOR_BATCH = "XJ116.S";
@@ -1642,6 +1778,8 @@ public interface SQLState {
//wrapper related
String UNABLE_TO_UNWRAP = "XJ128.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-843
+//IC see: https://issues.apache.org/jira/browse/DERBY-1198
String EXCEEDED_MAX_SECTIONS = "XJ200.S";
String CURSOR_INVALID_NAME = "XJ202.S";
String CURSOR_DUPLICATE_NAME = "XJ203.S";
@@ -1653,26 +1791,32 @@ public interface SQLState {
String STORED_PROC_LOAD_MODULE_NOT_FOUND = "XJ210.S";
String BATCH_CHAIN_BREAKING_EXCEPTION = "XJ211.S";
String INVALID_ATTRIBUTE_SYNTAX = "XJ212.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-848
String TRACELEVEL_FORMAT_INVALID = "XJ213.C";
+//IC see: https://issues.apache.org/jira/browse/DERBY-1328
String IO_ERROR_UPON_LOB_FREE = "XJ214.S";
String LOB_OBJECT_INVALID = "XJ215.S";
String LOB_OBJECT_LENGTH_UNKNOWN_YET = "XJ216.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-2257
String LOB_LOCATOR_INVALID = "XJ217.S";
//XN - Network-level messages
String NET_CONNECTION_RESET_NOT_ALLOWED_IN_UNIT_OF_WORK = "XN001.S";
String NET_SECKTKN_NOT_RETURNED = "XN002.U";
String NET_QUERY_PROCESSING_TERMINATED = "XN008.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-848
String NET_ERROR_GETTING_BLOB_LENGTH = "XN009.S";
String NET_NULL_PROCEDURE_NAME = "XN010.S";
String NET_PROCEDURE_NAME_LENGTH_OUT_OF_RANGE = "XN011.S";
String NET_WRONG_XA_VERSION = "XN012.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-847
String NET_INVALID_SCROLL_ORIENTATION = "XN013.S";
String NET_EXCEPTION_ON_READ = "XN014.S";
String NET_INPUTSTREAM_LENGTH_TOO_SMALL = "XN015.S";
String NET_EXCEPTION_ON_STREAMLEN_VERIFICATION = "XN016.S";
String NET_PREMATURE_EOS = "XN017.S";
String NET_READER_LENGTH_TOO_SMALL = "XN018.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-1350
String NET_XARETVAL_ERROR = "XN019.S";
String NET_MARSHALLING_UDT_ERROR = "XN020.S";
String NET_UDT_COERCION_ERROR = "XN021.S";
@@ -1682,6 +1826,8 @@ public interface SQLState {
// XML - Derby-specific XML errors not covered by
// SQL standard.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1772
+//IC see: https://issues.apache.org/jira/browse/DERBY-1758
String LANG_MISSING_XML_CLASSES = "XML00";
String LANG_UNEXPECTED_XML_EXCEPTION = "XML01";
@@ -1699,6 +1845,7 @@ public interface SQLState {
String MALFORMED_URL = "XJ028.C";
String BOOT_DATABASE_FAILED = "XJ040.C";
String CREATE_DATABASE_FAILED = "XJ041.C";
+//IC see: https://issues.apache.org/jira/browse/DERBY-4428
String CONFLICTING_BOOT_ATTRIBUTES = "XJ048.C";
String CONFLICTING_CREATE_ATTRIBUTES = "XJ049.C";
String CONFLICTING_RESTORE_ATTRIBUTES = "XJ081.C";
@@ -1708,15 +1855,21 @@ public interface SQLState {
// 08004 SQL State means the server rejected the connection request
String LOGIN_FAILED = "08004";
+//IC see: https://issues.apache.org/jira/browse/DERBY-846
String NET_CONNECT_AUTH_FAILED = "08004.C.1";
String NET_DATABASE_NOT_FOUND = "08004.C.2";
+//IC see: https://issues.apache.org/jira/browse/DERBY-1828
+//IC see: https://issues.apache.org/jira/browse/DERBY-2633
String AUTH_DATABASE_CONNECTION_REFUSED = "08004.C.3";
//DERBY-1828: AUTH_DATABASE_CONNECTION_REFUSED used to be "04501.C";
String AUTH_SHUTDOWN_NOT_DB_OWNER = "08004.C.4";
String AUTH_ENCRYPT_NOT_DB_OWNER = "08004.C.5";
String AUTH_HARD_UPGRADE_NOT_DB_OWNER = "08004.C.6";
//DERBY-1828: AUTH_x_NOT_DB_OWNER used to be "2850H/I/J.C";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3021
String CANNOT_CONNECT_TO_DB_IN_SLAVE_MODE = "08004.C.7";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3189
+//IC see: https://issues.apache.org/jira/browse/DERBY-2954
String AUTH_REPLICATION_NOT_DB_OWNER = "08004.C.8";
//DERBY-2109: new state/msg (considered sql state 28101.C not appropriate)
String AUTH_SHUTDOWN_MISSING_PERMISSION = "08004.C.9";
@@ -1727,19 +1880,23 @@ public interface SQLState {
String NET_CONNECT_SECMEC_INCOMPATIBLE_SCHEME = "08004.C.12";
String AUTH_EMPTY_CREDENTIALS = "08004.C.13";
String AUTH_DECRYPT_NOT_DB_OWNER = "08004.C.14";
+//IC see: https://issues.apache.org/jira/browse/DERBY-5792
// There can be multiple causes for 08003, which according
// to SQL2003 spec means "connection does not exist"
// We use a suffix to distinguish them. Because of the suffix
// you *must* add a severity code
+//IC see: https://issues.apache.org/jira/browse/DERBY-1350
String NO_CURRENT_CONNECTION = "08003";
String NOGETCONN_ON_CLOSED_POOLED_CONNECTION = "08003.C.1";
+//IC see: https://issues.apache.org/jira/browse/DERBY-841
String LOB_METHOD_ON_CLOSED_CONNECTION = "08003.C.2";
String PHYSICAL_CONNECTION_ALREADY_CLOSED = "08003.C.3";
// 08006 means connection exception - connection failure
String DRDA_CONNECTION_TERMINATED = "08006.C";
+//IC see: https://issues.apache.org/jira/browse/DERBY-846
String CONNECTION_FAILED_ON_RESET = "08006.C.1";
// Use this version of SOCKET_EXCEPTION any time *except* when trying to
@@ -1770,15 +1927,20 @@ public interface SQLState {
String CONNECT_PASSWORD_LENGTH_OUT_OF_RANGE = "08001.C.6";
String CONNECT_USERID_ISNULL = "08001.C.7";
String CONNECT_PASSWORD_ISNULL = "08001.C.8";
+//IC see: https://issues.apache.org/jira/browse/DERBY-847
String NET_DBNAME_TOO_LONG = "08001.C.9";
String NET_SECTKN_TOO_LONG = "08001.C.10";
String NET_USERID_TOO_LONG = "08001.C.11";
String NET_PASSWORD_TOO_LONG = "08001.C.12";
+//IC see: https://issues.apache.org/jira/browse/DERBY-4009
String NET_EXTNAM_TOO_LONG = "08001.C.13";
String NET_SRVNAM_TOO_LONG = "08001.C.14";
// database severity
+//IC see: https://issues.apache.org/jira/browse/DERBY-843
+//IC see: https://issues.apache.org/jira/browse/DERBY-1198
String SHUTDOWN_DATABASE = "08006.D";
+//IC see: https://issues.apache.org/jira/browse/DERBY-4428
String DROP_DATABASE = "08006.D.1";
//the following 2 exceptions are internal and never get seen by the user.
@@ -1801,14 +1963,17 @@ public interface SQLState {
String SCROLL_SENSITIVE_NOT_SUPPORTED = "01J10";
String UNABLE_TO_OBTAIN_MESSAGE_TEXT_FROM_SERVER = "01J12";
String NUMBER_OF_ROWS_TOO_LARGE_FOR_INT = "01J13";
+//IC see: https://issues.apache.org/jira/browse/DERBY-1543
String SQL_AUTHORIZATION_WITH_NO_AUTHENTICATION = "01J14";
String PASSWORD_EXPIRES_SOON = "01J15";
+//IC see: https://issues.apache.org/jira/browse/DERBY-5647
String DBO_PASSWORD_EXPIRES_SOON = "01J16";
String AUTH_ENCRYPT_ALREADY_BOOTED = "01J17";
String CURSOR_OPERATION_CONFLICT = "01001";
+//IC see: https://issues.apache.org/jira/browse/DERBY-690
//following are no applicable severity
String JAVA_EXCEPTION = "XJ001.U";
@@ -1817,9 +1982,11 @@ public interface SQLState {
/*
** Messages whose SQL states are prescribed by DRDA
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-846
String DRDA_NO_AUTOCOMMIT_UNDER_XA = "2D521.S.1";
String DRDA_INVALID_XA_STATE_ON_COMMIT_OR_ROLLBACK = "2D521.S.2";
String DRDA_CURSOR_NOT_OPEN = "24501.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-847
// 58009 means connection is terminated by a DRDA-protocol error. This can be caused by any number
// of reasons, so this SQL State has a lot of instances. Exceptions that are
@@ -1838,6 +2005,7 @@ public interface SQLState {
String NET_DSS_CHAINED_WITH_SAME_ID = "58009.C.16";
String NET_PREMATURE_EOS_DISCONNECT = "58009.C.17";
String NET_INVALID_FDOCA_ID = "58009.C.18";
+//IC see: https://issues.apache.org/jira/browse/DERBY-1350
String NET_SECTKN_NOT_RETURNED = "58009.C.19";
String NET_NVCM_NVCS_BOTH_NON_NULL = "58009.C.20";
String NET_SQLCDTA_INVALID_FOR_RDBNAM = "58009.C.21";
@@ -1882,9 +2050,12 @@ public interface SQLState {
String DELIMITERS_ARE_NOT_MUTUALLY_EXCLUSIVE ="XIE0J.S";
String PERIOD_AS_CHAR_DELIMITER_NOT_ALLOWED ="XIE0K.S";
String TABLE_NOT_FOUND ="XIE0M.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
String IMPORTFILE_HAS_INVALID_HEXSTRING ="XIE0N.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
String LOB_DATA_FILE_NOT_FOUND ="XIE0P.S";
String LOB_DATA_FILE_NULL ="XIE0Q.S";
+//IC see: https://issues.apache.org/jira/browse/DERBY-2193
String UNEXPECTED_IMPORT_ERROR ="XIE0R.S";
String DATA_FILE_EXISTS ="XIE0S.S";
String LOB_DATA_FILE_EXISTS ="XIE0T.S";
@@ -1894,6 +2065,7 @@ public interface SQLState {
/*
** Security XK...
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2466
String POLICY_NOT_RELOADED ="XK000.S";
String NO_SUCH_USER ="XK001.S";
@@ -1901,13 +2073,18 @@ public interface SQLState {
** Replication XRExx
*/
String LOGMODULE_DOES_NOT_SUPPORT_REPLICATION = "XRE00";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3016
String REPLICATION_LOG_CORRUPTED = "XRE01";
+//IC see: https://issues.apache.org/jira/browse/DERBY-2921
String REPLICATION_MASTER_SLAVE_VERSION_MISMATCH = "XRE02";
String REPLICATION_UNEXPECTED_EXCEPTION = "XRE03";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3417
String REPLICATION_CONNECTION_EXCEPTION = "XRE04.C.1";
String REPLICATION_CONNECTION_LOST = "XRE04.C.2";
String REPLICATION_LOG_OUT_OF_SYNCH = "XRE05.C";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3064
String REPLICATION_MASTER_TIMED_OUT = "XRE06";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3392
String REPLICATION_NOT_IN_MASTER_MODE = "XRE07";
String REPLICATION_SLAVE_STARTED_OK = "XRE08";
String CANNOT_START_SLAVE_ALREADY_BOOTED = "XRE09.C";
@@ -1917,6 +2094,7 @@ public interface SQLState {
String REPLICATION_FAILOVER_SUCCESSFUL = "XRE20.D";
String REPLICATION_FAILOVER_UNSUCCESSFUL = "XRE21.C";
String REPLICATION_MASTER_ALREADY_BOOTED = "XRE22.C";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3551
String REPLICATION_UNLOGGED_OPERATIONS_IN_PROGRESS = "XRE23";
String REPLICATION_NOT_IN_SLAVE_MODE = "XRE40";
String SLAVE_OPERATION_DENIED_WHILE_CONNECTED = "XRE41.C";
diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/sanity/AssertFailure.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/sanity/AssertFailure.java
index d359446357..2f292a283c 100644
--- a/java/org.apache.derby.commons/org/apache/derby/shared/common/sanity/AssertFailure.java
+++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/sanity/AssertFailure.java
@@ -68,6 +68,7 @@ public class AssertFailure extends RuntimeException {
* additional information about what went wrong.
**/
public AssertFailure(String message, Throwable nestedError) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2579
super(message, nestedError);
threadDump = dumpThreads();
}
@@ -130,6 +131,7 @@ public void printStackTrace(PrintWriter s) {
* Tells if generating a thread dump is supported in the running JVM.
*/
private boolean supportsThreadDump() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5256
try {
// This checks that we are on a jvm >= 1.5 where we
// can actually do threaddumps.
@@ -154,6 +156,7 @@ private boolean supportsThreadDump() {
*/
private String dumpThreads() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5256
if (!supportsThreadDump()) {
return "(Skipping thread dump because it is not " +
"supported on JVM 1.4)";
@@ -166,6 +169,7 @@ private String dumpThreads() {
// Load the class and method we need with reflection.
final Method m;
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Class> c = Class.forName(
"org.apache.derby.shared.common.sanity.ThreadDump");
m = c.getMethod("getStackDumpString", new Class[] {});
@@ -179,6 +183,7 @@ private String dumpThreads() {
//Try to get a thread dump and deal with various situations.
try {
String dump = (String) AccessController.doPrivileged
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
(new PrivilegedExceptionAction(){
public Object run() throws
IllegalArgumentException,
diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/sanity/SanityManager.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/sanity/SanityManager.java
index 6a19b6387b..f897d345e7 100644
--- a/java/org.apache.derby.commons/org/apache/derby/shared/common/sanity/SanityManager.java
+++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/sanity/SanityManager.java
@@ -155,6 +155,7 @@ public static final void THROWASSERT(String msgIfFail) {
// XXX (nat) Hmm, should we check ASSERT here? The caller is
// not expecting this function to return, whether assertions
// are compiled in or not.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2580
THROWASSERT(msgIfFail, null);
}
@@ -170,6 +171,7 @@ public static final void THROWASSERT(String msgIfFail) {
* @see org.apache.derby.shared.common.sanity.AssertFailure
*/
public static final void THROWASSERT(String msg, Throwable t) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2580
AssertFailure af = new AssertFailure("ASSERT FAILED " + msg, t);
if (DEBUG) {
if (DEBUG_ON("AssertFailureTrace")) {
@@ -191,6 +193,7 @@ public static final void THROWASSERT(String msg, Throwable t) {
* @see org.apache.derby.shared.common.sanity.AssertFailure
*/
public static final void THROWASSERT(Throwable t) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2580
THROWASSERT(t.toString(), t);
}
@@ -249,6 +252,7 @@ public static final boolean DEBUG_ON(String flag) {
if (AllDebugOn) return true;
else if (AllDebugOff) return false;
else {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Boolean flagValue = DebugFlags.get(flag);
if (! DEBUGDEBUG.equals(flag)) {
if (DEBUG_ON(DEBUGDEBUG)) {
diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/security/SystemPermission.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/security/SystemPermission.java
index d9b4931a4d..45e16e65ee 100644
--- a/java/org.apache.derby.commons/org/apache/derby/shared/common/security/SystemPermission.java
+++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/security/SystemPermission.java
@@ -120,12 +120,14 @@ final public class SystemPermission extends BasicPermission {
LEGAL_ACTIONS.add(CONTROL);
LEGAL_ACTIONS.add(MONITOR);
LEGAL_ACTIONS.add(SHUTDOWN);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
LEGAL_ACTIONS.add( USE_DERBY_INTERNALS );
}
/** Constant representing {@code SystemPermission("engine, "monitor")}. */
public static final SystemPermission ENGINE_MONITOR =
new SystemPermission(ENGINE, MONITOR);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6733
/**
* Actions for this permission.
@@ -147,6 +149,7 @@ final public class SystemPermission extends BasicPermission {
* @see BasicPermission#BasicPermission(String)
*/
public SystemPermission(String name, String actions) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
super( name );
validateNameAndActions(name, actions);
}
@@ -282,6 +285,8 @@ public boolean implies(Permission permission)
private static int getActionMask(String actions) {
int mask = 0;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3462
+//IC see: https://issues.apache.org/jira/browse/DERBY-3491
StringTokenizer st = new StringTokenizer(actions, ",");
while (st.hasMoreTokens()) {
int validAction = LEGAL_ACTIONS.indexOf(st.nextElement());
@@ -411,6 +416,7 @@ private void readObject(ObjectInputStream s)
@Override
public String toString()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return getClass().getName() +
"( " +
doubleQuote( getName() ) +
diff --git a/java/org.apache.derby.commons/org/apache/derby/shared/common/util/ArrayUtil.java b/java/org.apache.derby.commons/org/apache/derby/shared/common/util/ArrayUtil.java
index 455cfe884b..ec43c0c535 100644
--- a/java/org.apache.derby.commons/org/apache/derby/shared/common/util/ArrayUtil.java
+++ b/java/org.apache.derby.commons/org/apache/derby/shared/common/util/ArrayUtil.java
@@ -30,6 +30,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
/**
Utility class for constructing and reading and writing arrays from/to
+//IC see: https://issues.apache.org/jira/browse/DERBY-3177
formatId streams and for performing other operations on arrays.
@version 0.1
@@ -60,6 +61,7 @@ public abstract class ArrayUtil
*/
public static T[] copy( T[] original )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
return (original == null) ?
null :
Arrays.copyOf(original, original.length);
@@ -86,6 +88,7 @@ public static boolean[] copy( boolean[] original )
*/
public static byte[] copy( byte[] original )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6188
return (original == null) ? null : (byte[]) original.clone();
}
@@ -110,6 +113,7 @@ public static int[] copy( int[] original )
*/
public static long[] copy( long[] original )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
return (original == null) ? null : (long[]) original.clone();
}
@@ -146,6 +150,7 @@ public static int[][] copy2( int[][] original )
*/
@SafeVarargs
public static List asReadOnlyList(T... array) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
if (array == null) {
return Collections.emptyList();
} else {
@@ -360,6 +365,7 @@ public static String toString(int[] value)
{
if (value == null || value.length == 0)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5071
return "null";
}
else
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/DefaultInfo.java b/java/org.apache.derby.engine/org/apache/derby/catalog/DefaultInfo.java
index ef18932b7b..1f0e7444a8 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/DefaultInfo.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/DefaultInfo.java
@@ -22,6 +22,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
package org.apache.derby.catalog;
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
An interface for describing a default for a column or parameter in Derby systems.
*/
public interface DefaultInfo
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/DependableFinder.java b/java/org.apache.derby.engine/org/apache/derby/catalog/DependableFinder.java
index 0493996350..3c1881bea5 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/DependableFinder.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/DependableFinder.java
@@ -52,6 +52,7 @@ public interface DependableFinder
*/
public Dependable getDependable(DataDictionary dd,
UUID dependableObjectID) throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2138
/**
* The name of the class of Dependables as a "SQL Object" which this
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/GetProcedureColumns.java b/java/org.apache.derby.engine/org/apache/derby/catalog/GetProcedureColumns.java
index 4d757e2b5c..90a41ef6d2 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/GetProcedureColumns.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/GetProcedureColumns.java
@@ -39,11 +39,13 @@ Licensed to the Apache Software Foundation (ASF) under one or more
This class is called from a Query constructed in
java/org.apache.derby.impl.jdbc/metadata.properties:
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
The VTI will return columns 3-14, an extra column to the specification
METHOD_ID is returned to distinguish between overloaded methods.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
PROCEDURE_CAT String => procedure catalog (may be null)
PROCEDURE_SCHEM String => procedure schema (may be null)
PROCEDURE_NAME String => procedure name
@@ -57,6 +59,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
procedureColumnReturn - procedure return value
procedureColumnResult - result column in ResultSet
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
DATA_TYPE int => SQL type from java.sql.Types
TYPE_NAME String => SQL type name, for a UDT type the
type name is fully qualified
@@ -83,6 +86,7 @@ private int translate(int val) {
if (!isFunction) { return val; }
switch (val) {
case DatabaseMetaData.procedureColumnUnknown:
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
return DatabaseMetaData.functionColumnUnknown;
case DatabaseMetaData.procedureColumnIn:
return DatabaseMetaData.functionColumnIn;
@@ -132,6 +136,7 @@ public GetProcedureColumns(AliasInfo aliasInfo, String aliasType) throws SQLExce
// compile time aliasInfo will be null.
if (aliasInfo != null) {
isProcedure = aliasType.equals("P");
+//IC see: https://issues.apache.org/jira/browse/DERBY-925
isFunction = aliasType.equals("F");
procedure = (RoutineAliasInfo) aliasInfo;
method_count = (short) procedure.getParameterCount();
@@ -150,6 +155,7 @@ public GetProcedureColumns(AliasInfo aliasInfo, String aliasType) throws SQLExce
}
if (isFunction) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
nullable = (short) DatabaseMetaData.functionNullable;
sqlType = procedure.getReturnType();
columnName = ""; // COLUMN_NAME is VARCHAR NOT NULL
@@ -171,6 +177,7 @@ public boolean next() throws SQLException {
sqlType = tableFunctionReturnType.getRowTypes()[ idx ];
columnName = tableFunctionReturnType.getRowColumnNames()[ idx ];
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
columnType = (short) DatabaseMetaData.functionColumnResult;
}
else if (paramCursor > -1) {
@@ -197,6 +204,7 @@ public String getString(int column) throws SQLException
{
case 1: // COLUMN_NAME:
return columnName;
+//IC see: https://issues.apache.org/jira/browse/DERBY-925
case 4: //_TYPE_NAME:
return sqlType.getTypeName();
@@ -219,6 +227,7 @@ public int getInt(int column) throws SQLException
{
switch (column)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-137
case 3: // DATA_TYPE:
if (sqlType != null) {
return sqlType.getJDBCTypeId();
@@ -241,6 +250,7 @@ else if (type == Types.DATE || type == Types.TIME
// No corresponding SQL type
return 0;
+//IC see: https://issues.apache.org/jira/browse/DERBY-319
case 6: // LENGTH (in bytes):
if (sqlType != null)
return sqlType.getMaximumWidthInBytes();
@@ -265,6 +275,7 @@ public short getShort(int column) throws SQLException
{
case 2: // COLUMN_TYPE:
return columnType;
+//IC see: https://issues.apache.org/jira/browse/DERBY-925
case 7: // SCALE:
if (sqlType != null)
@@ -292,6 +303,7 @@ public short getShort(int column) throws SQLException
//FIXME
case 9: // NULLABLE:
return nullable;
+//IC see: https://issues.apache.org/jira/browse/DERBY-925
case 11: // METHOD_ID:
return method_count;
@@ -315,6 +327,7 @@ public void close()
EmbedResultSetMetaData.getResultColumnDescriptor("COLUMN_NAME", Types.VARCHAR, false, 128),
EmbedResultSetMetaData.getResultColumnDescriptor("COLUMN_TYPE", Types.SMALLINT, false),
+//IC see: https://issues.apache.org/jira/browse/DERBY-137
EmbedResultSetMetaData.getResultColumnDescriptor("DATA_TYPE", Types.INTEGER, false),
EmbedResultSetMetaData.getResultColumnDescriptor("TYPE_NAME", Types.VARCHAR, false, 22),
EmbedResultSetMetaData.getResultColumnDescriptor("PRECISION", Types.INTEGER, false),
@@ -329,5 +342,6 @@ public void close()
};
private static final ResultSetMetaData metadata =
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
new EmbedResultSetMetaData(columnInfo);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/Java5SystemProcedures.java b/java/org.apache.derby.engine/org/apache/derby/catalog/Java5SystemProcedures.java
index 14310cec5f..e88b7658d3 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/Java5SystemProcedures.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/Java5SystemProcedures.java
@@ -100,12 +100,14 @@ public class Java5SystemProcedures
throws SQLException
{
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
ClassFactoryContext cfc = (ClassFactoryContext) getContext( ClassFactoryContext.CONTEXT_ID );
ClassFactory classFactory = cfc.getClassFactory();
String toolClassName = findToolClassName( toolName, optionalArgs );
OptionalTool tool = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6626
Class> toolClass;
try {
toolClass = classFactory.loadApplicationClass( toolClassName );
@@ -117,6 +119,7 @@ public class Java5SystemProcedures
}
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
tool = (OptionalTool) toolClass.getConstructor().newInstance();
}
catch (InstantiationException ie) { throw wrap( ie ); }
@@ -164,6 +167,7 @@ private static StandardException badTool( String toolName )
}
private static StandardException badCustomTool(String className) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6626
return StandardException.newException(
SQLState.LANG_UNKNOWN_CUSTOM_TOOL_NAME, className);
}
@@ -199,6 +203,7 @@ private static String[] stripCustomClassName( String... optionalArgs )
*/
private static Context getContext( final String contextID )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getContext( contextID );
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/Statistics.java b/java/org.apache.derby.engine/org/apache/derby/catalog/Statistics.java
index da8cb13230..cafe2586bd 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/Statistics.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/Statistics.java
@@ -23,9 +23,11 @@ Licensed to the Apache Software Foundation (ASF) under one or more
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
This interface is used in the column SYS.SYSSTATISTICS.STATISTICS. It
encapsulates information collected by the UPDATE STATISTICS command
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
and is used internally by the Derby optimizer to estimate cost
and selectivity of different query plans.
@@ -39,6 +41,7 @@ public interface Statistics
* @return Number of rows.
*/
long getRowEstimate();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4938
/**
* @param predicates The predicates to evaluate
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/SystemProcedures.java b/java/org.apache.derby.engine/org/apache/derby/catalog/SystemProcedures.java
index 5b62b5548d..19e126bbe4 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/SystemProcedures.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/SystemProcedures.java
@@ -87,6 +87,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
Currently information on those can be found at url:
ftp://ftp.software.ibm.com/ps/products/db2/info/vr8/pdf/letter/db2l2e80.pdf
+//IC see: https://issues.apache.org/jira/browse/DERBY-475
+//IC see: https://issues.apache.org/jira/browse/DERBY-592
Also used for builtin-routines, such as SYSFUN functions, when direct calls
into Java libraries cannot be made.
@@ -100,6 +102,7 @@ public class SystemProcedures {
private final static String ODBC_DRIVER_OPTION = "'ODBC'";
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
Method used by Derby Network Server to get localized message (original call
from jcc.
@@ -134,6 +137,8 @@ public static void SQLCAMESSAGE(int sqlcode, short errmcLen, String sqlerrmc,
// translated and append to make the final result.
for (int index=0; ; numMessages++)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6802
+//IC see: https://issues.apache.org/jira/browse/DERBY-6823
if (sqlerrmc.indexOf(MessageUtils.SQLERRMC_MESSAGE_DELIMITER, index) == -1)
break;
index = sqlerrmc.indexOf(MessageUtils.SQLERRMC_MESSAGE_DELIMITER, index) +
@@ -153,6 +158,8 @@ public static void SQLCAMESSAGE(int sqlcode, short errmcLen, String sqlerrmc,
String[] errMsg = new String[2];
for (int i=0; i() {
public Object run() {
Policy.getPolicy().refresh();
@@ -2129,9 +2181,12 @@ public static double RAND(int seed)
* @throws SQLException Error setting the permission
*/
public static void SYSCS_SET_USER_ACCESS(String userName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2735
String connectionPermission)
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3158
+//IC see: https://issues.apache.org/jira/browse/DERBY-3159
try {
if (userName == null)
@@ -2167,6 +2222,7 @@ else if (connectionPermission == null)
if (addListProperty != null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
String addList = getProperty( addListProperty, Securable.SET_USER_ACCESS );
setDatabaseProperty
(
@@ -2194,6 +2250,7 @@ private static void removeFromAccessList(
String listProperty, String userName)
throws SQLException, StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
String removeList = getProperty( listProperty, Securable.SET_USER_ACCESS );
if (removeList != null)
{
@@ -2216,6 +2273,7 @@ public static String SYSCS_GET_USER_ACCESS(String userName)
{
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3160
if (userName == null)
{
throw StandardException.newException(SQLState.AUTH_INVALID_USER_NAME,
@@ -2223,6 +2281,7 @@ public static String SYSCS_GET_USER_ACCESS(String userName)
}
String fullUserList =
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
getProperty( Property.FULL_ACCESS_USERS_PROPERTY, Securable.GET_USER_ACCESS );
if (IdUtil.idOnList(userName, fullUserList))
{
@@ -2242,6 +2301,7 @@ public static String SYSCS_GET_USER_ACCESS(String userName)
{
defaultAccess = StringUtil.SQLToUpperCase(defaultAccess);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2735
else
{
defaultAccess = Property.FULL_ACCESS; // is the default.
@@ -2261,6 +2321,7 @@ public static String SYSCS_GET_USER_ACCESS(String userName)
* @throws SQLException on error
*/
public static void SYSCS_INVALIDATE_STORED_STATEMENTS()
+//IC see: https://issues.apache.org/jira/browse/DERBY-5578
throws SQLException
{
LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();
@@ -2270,6 +2331,7 @@ public static void SYSCS_INVALIDATE_STORED_STATEMENTS()
// make sure that application code doesn't bypass security checks
// by calling this public entry point
SecurityUtil.authorize( Securable.INVALIDATE_STORED_STATEMENTS );
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
dd.invalidateAllSPSPlans(lcc);
} catch (StandardException se) {
@@ -2286,8 +2348,10 @@ public static void SYSCS_INVALIDATE_STORED_STATEMENTS()
* @throws SQLException on error
*/
public static void SYSCS_EMPTY_STATEMENT_CACHE()
+//IC see: https://issues.apache.org/jira/browse/DERBY-2772
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
try {
// make sure that application code doesn't bypass security checks
// by calling this public entry point
@@ -2313,6 +2377,7 @@ public static void SYSCS_EMPTY_STATEMENT_CACHE()
* @throws StandardException on error
*/
public static void SYSCS_SET_XPLAIN_MODE(int mode)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
throws SQLException, StandardException
{
try {
@@ -2336,6 +2401,7 @@ public static void SYSCS_SET_XPLAIN_MODE(int mode)
* @throws StandardException on error
*/
public static int SYSCS_GET_XPLAIN_MODE()
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
throws SQLException, StandardException
{
try {
@@ -2360,6 +2426,7 @@ public static int SYSCS_GET_XPLAIN_MODE()
public static void SYSCS_SET_XPLAIN_SCHEMA(String schemaName)
throws SQLException, StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
try {
// make sure that application code doesn't bypass security checks
// by calling this public entry point
@@ -2420,6 +2487,7 @@ private static void createXplainSchema(String schemaName)
Connection conn = getDefaultConn();
if (!hasSchema(conn, schemaName))
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5017
String escapedSchema = IdUtil.normalToDelimited(schemaName);
Statement s = conn.createStatement();
s.executeUpdate("CREATE SCHEMA " + escapedSchema);
@@ -2462,6 +2530,7 @@ private static void createXplainTable(
public static String SYSCS_GET_XPLAIN_SCHEMA()
throws SQLException, StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
try {
// make sure that application code doesn't bypass security checks
// by calling this public entry point
@@ -2489,6 +2558,7 @@ public static String SYSCS_GET_XPLAIN_SCHEMA()
)
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5762
userName = normalizeUserName( userName );
LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();
@@ -2500,6 +2570,7 @@ public static String SYSCS_GET_XPLAIN_SCHEMA()
// make sure that application code doesn't bypass security checks
// by calling this public entry point
SecurityUtil.authorize( Securable.CREATE_USER );
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
DataDictionary dd = lcc.getDataDictionary();
String dbo = dd.getAuthorizationDatabaseOwner();
@@ -2619,6 +2690,7 @@ public static String SYSCS_GET_XPLAIN_SCHEMA()
)
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
try {
// make sure that application code doesn't bypass security checks
// by calling this public entry point
@@ -2626,6 +2698,7 @@ public static String SYSCS_GET_XPLAIN_SCHEMA()
}
catch (StandardException se) { throw PublicAPI.wrapStandardException( se ); }
+//IC see: https://issues.apache.org/jira/browse/DERBY-5762
resetAuthorizationIDPassword( normalizeUserName( userName ), password );
}
@@ -2684,6 +2757,7 @@ public static String SYSCS_GET_XPLAIN_SCHEMA()
{
String currentUser = ConnectionUtil.getCurrentLCC().getStatementContext().getSQLSessionContext().getCurrentUser();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5762
resetAuthorizationIDPassword( currentUser, password );
}
@@ -2700,11 +2774,13 @@ public static String SYSCS_GET_XPLAIN_SCHEMA()
)
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5762
userName = normalizeUserName( userName );
try {
// make sure that application code doesn't bypass security checks
// by calling this public entry point
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
SecurityUtil.authorize( Securable.DROP_USER );
LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();
@@ -2760,6 +2836,7 @@ private static void checkLegalUser( DataDictionary dd, String userName )
* @throws SQLException on error
*/
private static String normalizeUserName( String userName )
+//IC see: https://issues.apache.org/jira/browse/DERBY-5762
throws SQLException
{
try {
@@ -2773,6 +2850,7 @@ private static String normalizeUserName( String userName )
* @throws SQLException on error
*/
public static String SYSCS_GET_DATABASE_NAME()
+//IC see: https://issues.apache.org/jira/browse/DERBY-6725
throws SQLException
{
//DERBY-6725(Add a system function which returns the name of the database.)
@@ -2821,6 +2899,7 @@ public static Long SYSCS_PEEK_AT_IDENTITY( String schemaName, String tableName )
*/
private static ModuleFactory getMonitor()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6725
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/TriggerNewTransitionRows.java b/java/org.apache.derby.engine/org/apache/derby/catalog/TriggerNewTransitionRows.java
index 8b1f2d5d5f..7a60db8062 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/TriggerNewTransitionRows.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/TriggerNewTransitionRows.java
@@ -91,6 +91,7 @@ public ResultSet executeQuery() throws SQLException {
}
public int getResultSetConcurrency() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
return ResultSet.CONCUR_READ_ONLY;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/TriggerOldTransitionRows.java b/java/org.apache.derby.engine/org/apache/derby/catalog/TriggerOldTransitionRows.java
index 1fc4529768..1faf1bbe7c 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/TriggerOldTransitionRows.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/TriggerOldTransitionRows.java
@@ -91,6 +91,7 @@ public ResultSet executeQuery() throws SQLException {
}
public int getResultSetConcurrency() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
return ResultSet.CONCUR_READ_ONLY;
}
public void close() throws SQLException {
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/TypeDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/catalog/TypeDescriptor.java
index 572becbaa9..5709fd797c 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/TypeDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/TypeDescriptor.java
@@ -74,6 +74,7 @@ The return value from getMaximumWidth() for types where the maximum
*/
TypeDescriptor DOUBLE = DataTypeDescriptor.DOUBLE.getCatalogType();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5466
///////////////////////////////////////////////////////////////////////
//
@@ -103,6 +104,7 @@ is the number of bytes (i.e. 4).
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-319
Returns the maximum width of the type IN BYTES. This is the
maximum number of bytes that could be returned for this type
if the corresponding getXXX() method is used. For example,
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/UUID.java b/java/org.apache.derby.engine/org/apache/derby/catalog/UUID.java
index 884f191f5b..94773846ba 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/UUID.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/UUID.java
@@ -23,6 +23,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
An interface for accessing Derby UUIDs, unique identifiers.
The values in the
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/types/BaseTypeIdImpl.java b/java/org.apache.derby.engine/org/apache/derby/catalog/types/BaseTypeIdImpl.java
index 4c768109f8..a32f48fa81 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/types/BaseTypeIdImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/types/BaseTypeIdImpl.java
@@ -248,6 +248,8 @@ public int getTypeFormatId()
// will lose the format id. This can happen if you pass one of these
// objects across the network. Here we recover the format id.
//
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
if ( TypeId.BOOLEAN_NAME.equals( unqualifiedName ) ) {
return StoredFormatIds.BOOLEAN_TYPE_ID_IMPL; }
else if ( TypeId.BIGINT_NAME.equals( unqualifiedName ) ) {
@@ -363,6 +365,7 @@ private void setTypeIdSpecificInstanceVariables()
case StoredFormatIds.BOOLEAN_TYPE_ID_IMPL:
schemaName = null;
unqualifiedName = TypeId.BOOLEAN_NAME;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4868
JDBCTypeId = Types.BOOLEAN;
break;
@@ -384,6 +387,8 @@ private void setTypeIdSpecificInstanceVariables()
JDBCTypeId = Types.TINYINT;
break;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
case StoredFormatIds.BIGINT_TYPE_ID_IMPL:
schemaName = null;
unqualifiedName = TypeId.BIGINT_NAME;
@@ -435,6 +440,7 @@ private void setTypeIdSpecificInstanceVariables()
case StoredFormatIds.CLOB_TYPE_ID_IMPL:
schemaName = null;
unqualifiedName = TypeId.CLOB_NAME;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
JDBCTypeId = Types.CLOB;
break;
@@ -459,6 +465,7 @@ private void setTypeIdSpecificInstanceVariables()
case StoredFormatIds.BLOB_TYPE_ID_IMPL:
schemaName = null;
unqualifiedName = TypeId.BLOB_NAME;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
JDBCTypeId = Types.BLOB;
break;
@@ -483,6 +490,7 @@ private void setTypeIdSpecificInstanceVariables()
case StoredFormatIds.XML_TYPE_ID_IMPL:
schemaName = null;
unqualifiedName = TypeId.XML_NAME;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
JDBCTypeId = Types.SQLXML;
break;
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/types/DefaultInfoImpl.java b/java/org.apache.derby.engine/org/apache/derby/catalog/types/DefaultInfoImpl.java
index 9352b9d330..d4a183e393 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/types/DefaultInfoImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/types/DefaultInfoImpl.java
@@ -59,6 +59,7 @@ public class DefaultInfoImpl implements DefaultInfo, Formatable
private String[] referencedColumnNames;
private String originalCurrentSchema;
+//IC see: https://issues.apache.org/jira/browse/DERBY-167
final private static int BITS_MASK_IS_DEFAULTVALUE_AUTOINC = 0x1 << 0;
final private static int BITS_MASK_IS_GENERATED_COLUMN = 0x2;
@@ -77,6 +78,7 @@ public DefaultInfoImpl(boolean isDefaultValueAutoinc,
String defaultText,
DataValueDescriptor defaultValue)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-167
this.type = calcType(isDefaultValueAutoinc);
this.defaultText = defaultText;
this.defaultValue = defaultValue;
@@ -117,6 +119,7 @@ public String getDefaultText()
*/
public String[] getReferencedColumnNames()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3177
return ArrayUtil.copy( referencedColumnNames );
}
@@ -156,6 +159,7 @@ public void readExternal( ObjectInput in )
defaultText = (String) in.readObject();
defaultValue = (DataValueDescriptor) in.readObject();
type = in.readInt();
+//IC see: https://issues.apache.org/jira/browse/DERBY-167
if ( isGeneratedColumn() )
{
@@ -178,6 +182,7 @@ public void writeExternal( ObjectOutput out )
{
out.writeObject( defaultText );
out.writeObject( defaultValue );
+//IC see: https://issues.apache.org/jira/browse/DERBY-167
out.writeInt(type);
if ( isGeneratedColumn() )
@@ -222,6 +227,7 @@ public void setDefaultValue(DataValueDescriptor defaultValue)
* @see DefaultInfo#isDefaultValueAutoinc
*/
public boolean isDefaultValueAutoinc(){
+//IC see: https://issues.apache.org/jira/browse/DERBY-167
return (type & BITS_MASK_IS_DEFAULTVALUE_AUTOINC ) != 0;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/types/IndexDescriptorImpl.java b/java/org.apache.derby.engine/org/apache/derby/catalog/types/IndexDescriptorImpl.java
index 8c4c881df2..186a295bd5 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/types/IndexDescriptorImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/types/IndexDescriptorImpl.java
@@ -127,6 +127,9 @@ public IndexDescriptorImpl(String indexType,
this.indexType = indexType;
this.isUnique = isUnique;
this.isUniqueWithDuplicateNulls = isUniqueWithDuplicateNulls;
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
+//IC see: https://issues.apache.org/jira/browse/DERBY-6419
this.isUniqueDeferrable = isUniqueDeferrable;
this.hasDeferrableChecking = hasDeferrableChecking;
this.baseColumnPositions = ArrayUtil.copy( baseColumnPositions );
@@ -146,6 +149,7 @@ public IndexDescriptorImpl()
*/
public boolean isUniqueWithDuplicateNulls()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
return isUniqueWithDuplicateNulls;
}
@@ -155,6 +159,9 @@ public boolean isUniqueWithDuplicateNulls()
*/
public boolean hasDeferrableChecking()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
+//IC see: https://issues.apache.org/jira/browse/DERBY-6419
return hasDeferrableChecking;
}
@@ -181,6 +188,7 @@ public boolean isUnique()
/** @see IndexDescriptor#baseColumnPositions */
public int[] baseColumnPositions()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3177
return ArrayUtil.copy( baseColumnPositions );
}
@@ -236,12 +244,14 @@ public boolean isDescending(Integer keyColumnPosition)
/** @see IndexDescriptor#isAscending */
public boolean[] isAscending()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3177
return ArrayUtil.copy( isAscending );
}
/** @see IndexDescriptor#setBaseColumnPositions */
public void setBaseColumnPositions(int[] baseColumnPositions)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3177
this.baseColumnPositions = ArrayUtil.copy( baseColumnPositions );
}
@@ -260,7 +270,11 @@ public void setNumberOfOrderedColumns(int numberOfOrderedColumns)
public String toString()
{
StringBuilder sb = new StringBuilder(60);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6623
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
+//IC see: https://issues.apache.org/jira/browse/DERBY-6419
if (isUnique || isUniqueDeferrable)
sb.append("UNIQUE ");
else if (isUniqueWithDuplicateNulls)
@@ -312,6 +326,7 @@ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundExcept
indexType = (String)fh.get("indexType");
//isUniqueWithDuplicateNulls attribute won't be present if the index
//was created in older versions
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
if (fh.containsKey("isUniqueWithDuplicateNulls"))
isUniqueWithDuplicateNulls = fh.getBoolean(
"isUniqueWithDuplicateNulls");
@@ -320,6 +335,9 @@ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundExcept
// hasDeferrableChecking won't be present if the index
// was created in old versions (< 10_11).
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
+//IC see: https://issues.apache.org/jira/browse/DERBY-6419
if (fh.containsKey("hasDeferrableChecking")) {
hasDeferrableChecking = fh.getBoolean("hasDeferrableChecking");
} else {
@@ -353,8 +371,12 @@ public void writeExternal(ObjectOutput out) throws IOException
fh.putInt("orderedColumns", numberOfOrderedColumns);
fh.put("indexType", indexType);
//write the new attribut older versions will simply ignore it
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
fh.putBoolean("isUniqueWithDuplicateNulls",
isUniqueWithDuplicateNulls);
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
+//IC see: https://issues.apache.org/jira/browse/DERBY-6419
fh.putBoolean("hasDeferrableChecking", hasDeferrableChecking);
fh.putBoolean("isUniqueDeferrable", isUniqueDeferrable);
out.writeObject(fh);
@@ -388,6 +410,7 @@ public boolean equals(Object other)
** Check all the fields for equality except for the array
** elements (this is hardest, so save for last)
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
if ((id.isUnique == this.isUnique) &&
(id.isUniqueWithDuplicateNulls ==
this.isUniqueWithDuplicateNulls) &&
@@ -407,6 +430,7 @@ public boolean equals(Object other)
{
/* If any array element is not equal, return false */
if ((id.baseColumnPositions[i] !=
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
this.baseColumnPositions[i]) ||
(id.isAscending[i] != this.isAscending[i]))
{
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/types/ReferencedColumnsDescriptorImpl.java b/java/org.apache.derby.engine/org/apache/derby/catalog/types/ReferencedColumnsDescriptorImpl.java
index 04fb0478ab..e67278b9c8 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/types/ReferencedColumnsDescriptorImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/types/ReferencedColumnsDescriptorImpl.java
@@ -95,6 +95,8 @@ public ReferencedColumnsDescriptorImpl( int[] referencedColumns)
public ReferencedColumnsDescriptorImpl( int[] referencedColumns,
int[] referencedColumnsInTriggerAction)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3177
+//IC see: https://issues.apache.org/jira/browse/DERBY-3177
this.referencedColumns = ArrayUtil.copy( referencedColumns );
this.referencedColumnsInTriggerAction = ArrayUtil.copy( referencedColumnsInTriggerAction );
}
@@ -108,6 +110,7 @@ public ReferencedColumnsDescriptorImpl()
*/
public int[] getReferencedColumnPositions()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3177
return ArrayUtil.copy( referencedColumns );
}
@@ -116,6 +119,7 @@ public int[] getReferencedColumnPositions()
*/
public int[] getTriggerActionReferencedColumnPositions()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3177
return ArrayUtil.copy( referencedColumnsInTriggerAction );
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/types/RoutineAliasInfo.java b/java/org.apache.derby.engine/org/apache/derby/catalog/types/RoutineAliasInfo.java
index c7f59decc8..7a7dd900db 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/types/RoutineAliasInfo.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/types/RoutineAliasInfo.java
@@ -99,6 +99,7 @@ public class RoutineAliasInfo extends MethodAliasInfo
bits 0-3 sqlAllowed = MODIFIES_SQL_DATA, READS_SQL_DATA,CONTAINS_SQL, or NO_SQL
bit 4 on if function is DETERMINISTIC, off otherwise
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
bit 5 on if running with definer's right, off otherwise
*/
private short sqlOptions;
@@ -137,6 +138,7 @@ public RoutineAliasInfo() {
boolean hasVarargs
)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
this(methodName,
parameterCount,
parameterNames,
@@ -172,6 +174,7 @@ public RoutineAliasInfo(String methodName,
super(methodName);
this.parameterCount = parameterCount;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3177
this.parameterNames = ArrayUtil.copy( parameterNames );
setParameterTypes( parameterTypes );
this.parameterModes = ArrayUtil.copy( parameterModes );
@@ -181,6 +184,7 @@ public RoutineAliasInfo(String methodName,
if ( isDeterministic ) { this.sqlOptions = (short) (sqlOptions | DETERMINISTIC_MASK); }
if ( hasVarargs ) { this.sqlOptions = (short) (sqlOptions | VARARGS_MASK); }
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
if (definersRights) {
this.sqlOptions = (short) (sqlOptions | SECURITY_DEFINER_MASK);
}
@@ -234,6 +238,7 @@ public int getParameterCount() {
*/
public TypeDescriptor[] getParameterTypes()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3177
return TypeDescriptorImpl.copyTypeDescriptors( parameterTypes );
}
@@ -276,6 +281,7 @@ public boolean hasVarargs()
public boolean hasDefinersRights()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
return ( (sqlOptions & SECURITY_DEFINER_MASK) != 0 );
}
@@ -403,14 +409,17 @@ public String toString() {
if (i != 0)
sb.append(',');
+//IC see: https://issues.apache.org/jira/browse/DERBY-475
if (returnType == null) {
// This is a PROCEDURE. We only want to print the
// parameter mode (ex. "IN", "OUT", "INOUT") for procedures--
// we don't do it for functions since use of the "IN" keyword
// is not part of the FUNCTION syntax.
+//IC see: https://issues.apache.org/jira/browse/DERBY-337
sb.append(RoutineAliasInfo.parameterMode(parameterModes[i]));
sb.append(' ');
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-1963
sb.append(IdUtil.normalToDelimited(parameterNames[i]));
sb.append(' ');
sb.append(parameterTypes[i].getSQLstring());
@@ -418,6 +427,7 @@ public String toString() {
if ( hasVarargs() ) { sb.append( " ... " ); }
sb.append(')');
+//IC see: https://issues.apache.org/jira/browse/DERBY-475
if (returnType != null) {
// this a FUNCTION, so syntax requires us to append the return type.
sb.append(" RETURNS " + returnType.getSQLstring());
@@ -432,9 +442,11 @@ public String toString() {
case PS_DERBY: sb.append( "DERBY " ); break;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3570
if ( isDeterministic() )
{ sb.append( " DETERMINISTIC " ); }
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
if ( hasDefinersRights())
{ sb.append( " EXTERNAL SECURITY DEFINER " ); }
@@ -447,6 +459,7 @@ public String toString() {
sb.append(dynamicResultSets);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-475
if (returnType != null) {
// this a FUNCTION, so append the syntax telling what to
// do with a null parameter.
@@ -459,6 +472,7 @@ public String toString() {
public static String parameterMode(int parameterMode) {
switch (parameterMode) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
case (ParameterMetaData.parameterModeIn):
return "IN";
case (ParameterMetaData.parameterModeOut):
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/types/RowMultiSetImpl.java b/java/org.apache.derby.engine/org/apache/derby/catalog/types/RowMultiSetImpl.java
index 3a7732f54b..c3ff988474 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/types/RowMultiSetImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/types/RowMultiSetImpl.java
@@ -87,6 +87,7 @@ public RowMultiSetImpl()
*/
public RowMultiSetImpl( String[] columnNames, TypeDescriptor[] types )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3177
_columnNames = ArrayUtil.copy( columnNames );
setTypes( types );
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/types/StatisticsImpl.java b/java/org.apache.derby.engine/org/apache/derby/catalog/types/StatisticsImpl.java
index e215b31241..d05aac9dda 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/types/StatisticsImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/types/StatisticsImpl.java
@@ -64,6 +64,7 @@ public StatisticsImpl()
/** {@inheritDoc} */
public long getRowEstimate() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4938
return numRows;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/types/TypeDescriptorImpl.java b/java/org.apache.derby.engine/org/apache/derby/catalog/types/TypeDescriptorImpl.java
index ef63fa4d5f..b94740b7b2 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/types/TypeDescriptorImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/types/TypeDescriptorImpl.java
@@ -137,6 +137,7 @@ public TypeDescriptorImpl(
this.isNullable = isNullable;
this.maximumWidth = maximumWidth;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
this.scale = JDBC40Translation.UNKNOWN_SCALE;
this.precision = JDBC40Translation.UNKNOWN_PRECISION;
}
@@ -168,6 +169,7 @@ public TypeDescriptorImpl(
}
public TypeDescriptorImpl(
+//IC see: https://issues.apache.org/jira/browse/DERBY-2334
TypeDescriptorImpl source,
int precision,
int scale,
@@ -207,6 +209,7 @@ public TypeDescriptorImpl(
/** copy an array of type descriptors */
public static TypeDescriptor[] copyTypeDescriptors( TypeDescriptor[] original )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3177
return (original == null) ? null : (TypeDescriptor[]) original.clone();
}
@@ -238,6 +241,7 @@ public int getMaximumWidth()
public int getMaximumWidthInBytes()
{
switch (typeId.getJDBCTypeId()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-319
case Types.BIT:
case Types.TINYINT:
@@ -305,6 +309,7 @@ public int getMaximumWidthInBytes()
// ODBC does not define a BOOLEAN data type.
// However, 1 seems to me like a reasonable byte length for a BOOLEAN.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4703
case Types.BOOLEAN: return 1;
case Types.ARRAY:
@@ -479,6 +484,7 @@ public boolean equals(Object object)
return false;
else
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2524
switch (typeId.getJDBCTypeId()) {
case Types.CHAR:
case Types.VARCHAR:
@@ -567,6 +573,8 @@ public void writeExternal( ObjectOutput out )
//with. For character data types, it really represents the collation
//type of the character data type. For all the other data types, it
//represents the scale of that data type.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2524
+//IC see: https://issues.apache.org/jira/browse/DERBY-1478
switch (typeId.getJDBCTypeId()) {
case Types.CHAR:
case Types.VARCHAR:
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/types/TypesImplInstanceGetter.java b/java/org.apache.derby.engine/org/apache/derby/catalog/types/TypesImplInstanceGetter.java
index 4e5af1dfcb..c21dd74715 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/types/TypesImplInstanceGetter.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/types/TypesImplInstanceGetter.java
@@ -33,6 +33,8 @@ public Object getNewInstance() {
case StoredFormatIds.INT_TYPE_ID_IMPL:
case StoredFormatIds.SMALLINT_TYPE_ID_IMPL:
case StoredFormatIds.TINYINT_TYPE_ID_IMPL:
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
case StoredFormatIds.BIGINT_TYPE_ID_IMPL:
case StoredFormatIds.DOUBLE_TYPE_ID_IMPL:
case StoredFormatIds.REAL_TYPE_ID_IMPL:
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/types/UDTAliasInfo.java b/java/org.apache.derby.engine/org/apache/derby/catalog/types/UDTAliasInfo.java
index 61d1b06032..143eb11588 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/types/UDTAliasInfo.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/types/UDTAliasInfo.java
@@ -115,6 +115,7 @@ public void writeExternal( ObjectOutput out )
* needed to recreate this alias.
*/
public String toString() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4485
return "LANGUAGE JAVA";
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/catalog/types/UserDefinedTypeIdImpl.java b/java/org.apache.derby.engine/org/apache/derby/catalog/types/UserDefinedTypeIdImpl.java
index 90af5d786d..9c43827d50 100644
--- a/java/org.apache.derby.engine/org/apache/derby/catalog/types/UserDefinedTypeIdImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/catalog/types/UserDefinedTypeIdImpl.java
@@ -87,6 +87,8 @@ public UserDefinedTypeIdImpl(String className) throws StandardException
// If the name begins with a quote, then it is the schema-qualified name
// of a UDT. Parse the name.
//
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
if ( className.charAt( 0 ) == '"' )
{
String[] nameParts = IdUtil.parseMultiPartSQLIdentifier( className );
diff --git a/java/org.apache.derby.engine/org/apache/derby/database/Database.java b/java/org.apache.derby.engine/org/apache/derby/database/Database.java
index f39ed0c2db..ffac67ca12 100644
--- a/java/org.apache.derby.engine/org/apache/derby/database/Database.java
+++ b/java/org.apache.derby.engine/org/apache/derby/database/Database.java
@@ -22,6 +22,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
package org.apache.derby.database;
/*
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
The org.apache.derby.iapi.db.Database interface is all the externally
available methods on a database. These are methods that might be called from
an SQL-J CALL statement.
@@ -116,6 +117,8 @@ public void backupAndEnableLogArchiveMode(
*/
public void disableLogArchiveMode(boolean deleteOnlineArchivedLogFiles)
throws SQLException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-239
+//IC see: https://issues.apache.org/jira/browse/DERBY-523
/**
* Freeze the database temporarily so a backup can be taken.
diff --git a/java/org.apache.derby.engine/org/apache/derby/diag/ContainedRoles.java b/java/org.apache.derby.engine/org/apache/derby/diag/ContainedRoles.java
index f0ba85d4a1..0e7ecd5d36 100644
--- a/java/org.apache.derby.engine/org/apache/derby/diag/ContainedRoles.java
+++ b/java/org.apache.derby.engine/org/apache/derby/diag/ContainedRoles.java
@@ -59,6 +59,7 @@ public class ContainedRoles extends VTITemplate {
RoleClosureIterator rci;
String nextRole;
boolean initialized;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3930
String role;
boolean inverse;
@@ -108,6 +109,7 @@ public boolean next() throws SQLException {
if (!initialized) {
initialized = true;
LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3930
DataDictionary dd = lcc.getDataDictionary();
RoleGrantDescriptor rdDef =
dd.getRoleDefinitionDescriptor(role);
@@ -120,6 +122,7 @@ public boolean next() throws SQLException {
rci = dd.createRoleClosureIterator
(lcc.getLastActivation().
getTransactionController(),
+//IC see: https://issues.apache.org/jira/browse/DERBY-3930
role, !inverse);
} finally {
dd.doneReading(mode, lcc);
@@ -172,5 +175,7 @@ public String getString(int columnIndex) throws SQLException {
private static final ResultSetMetaData metadata =
new EmbedResultSetMetaData(columnInfo);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3930
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/diag/DiagUtil.java b/java/org.apache.derby.engine/org/apache/derby/diag/DiagUtil.java
index c2f842278d..60399ae9fc 100644
--- a/java/org.apache.derby.engine/org/apache/derby/diag/DiagUtil.java
+++ b/java/org.apache.derby.engine/org/apache/derby/diag/DiagUtil.java
@@ -45,6 +45,7 @@ abstract class DiagUtil
static void checkAccess() throws StandardException
{
LanguageConnectionContext lcc = (LanguageConnectionContext)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
getContextOrNull(LanguageConnectionContext.CONTEXT_ID);
DataDictionary dd = lcc.getDataDictionary();
@@ -67,6 +68,7 @@ static void checkAccess() throws StandardException
*/
private static Context getContextOrNull( final String contextID )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getContextOrNull( contextID );
diff --git a/java/org.apache.derby.engine/org/apache/derby/diag/ErrorLogReader.java b/java/org.apache.derby.engine/org/apache/derby/diag/ErrorLogReader.java
index ca12f81db2..0cae844da3 100644
--- a/java/org.apache.derby.engine/org/apache/derby/diag/ErrorLogReader.java
+++ b/java/org.apache.derby.engine/org/apache/derby/diag/ErrorLogReader.java
@@ -56,6 +56,7 @@ find the timestamp (timestampConstant) of interest in the error log.
SELECT vti.ts, threadid, cast(xid as int) as xid_int, cast(lccid as int) as lccid_int, logtext
FROM new org.apache.derby.diag.ErrorLogReader() vti,
(VALUES timestampConstant) t(ts)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
WHERE vti.ts <= t.ts AND
vti.ts >
(SELECT MAX(ts) IS NULL ? '2000-01-01 00:00:00.1' : MAX(ts)
@@ -122,6 +123,7 @@ public ErrorLogReader() throws StandardException
{
DiagUtil.checkAccess();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
final String home = AccessController.doPrivileged
(
new PrivilegedAction()
@@ -267,6 +269,7 @@ public String getString(int columnNumber)
/* Executing prepared statement is a special case as
* it could span multiple lines
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-5071
StringBuffer output = new StringBuffer(64);
if (line.indexOf(BEGIN_EXECUTING_STRING) == -1)
{
@@ -279,6 +282,7 @@ public String getString(int columnNumber)
int endIndex = line.indexOf(END_EXECUTING_STRING, drdaidIndex);
if (endIndex == -1)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5071
output.append(line.substring(line.indexOf(END_DRDAID_STRING, drdaidIndex) + 3));
}
else
@@ -300,6 +304,7 @@ public String getString(int columnNumber)
endIndex = line.indexOf(END_EXECUTING_STRING);
if (endIndex == -1)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5071
output.append(line);
}
else
@@ -342,11 +347,13 @@ public boolean wasNull()
EmbedResultSetMetaData.getResultColumnDescriptor("LCCID", Types.VARCHAR, false, 15),
EmbedResultSetMetaData.getResultColumnDescriptor("DATABASE", Types.VARCHAR, false, 128),
EmbedResultSetMetaData.getResultColumnDescriptor("DRDAID", Types.VARCHAR, true, 50),
+//IC see: https://issues.apache.org/jira/browse/DERBY-104
EmbedResultSetMetaData.getResultColumnDescriptor("LOGTEXT",Types.VARCHAR, false, Limits.DB2_VARCHAR_MAXWIDTH)
};
private static final ResultSetMetaData metadata =
new EmbedResultSetMetaData(columnInfo);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/diag/ErrorMessages.java b/java/org.apache.derby.engine/org/apache/derby/diag/ErrorMessages.java
index 9f46cf7e35..edc93afffb 100644
--- a/java/org.apache.derby.engine/org/apache/derby/diag/ErrorMessages.java
+++ b/java/org.apache.derby.engine/org/apache/derby/diag/ErrorMessages.java
@@ -109,6 +109,7 @@ public boolean next() {
if (retCode) {
SQLState =StandardException.getSQLStateFromIdentifier(k);
message = MessageService.getTextMessage(k);
+//IC see: https://issues.apache.org/jira/browse/DERBY-104
message = StringUtil.truncate(message, Limits.DB2_VARCHAR_MAXWIDTH);
}
return retCode;
@@ -157,6 +158,7 @@ private void loadProperties() throws IOException
p = new Properties();
for (int i = 0; i < 50; i++) {
msgFile = i;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
InputStream is = java.security.AccessController.doPrivileged(this);
if (is == null)
continue;
@@ -224,11 +226,13 @@ public final InputStream run() {
private static final ResultColumnDescriptor[] columnInfo = {
EmbedResultSetMetaData.getResultColumnDescriptor("SQL_STATE", Types.VARCHAR, true, 5),
+//IC see: https://issues.apache.org/jira/browse/DERBY-104
EmbedResultSetMetaData.getResultColumnDescriptor("MESSAGE", Types.VARCHAR, true, Limits.DB2_VARCHAR_MAXWIDTH),
EmbedResultSetMetaData.getResultColumnDescriptor("SEVERITY", Types.INTEGER, true),
};
private static final ResultSetMetaData metadata =
new EmbedResultSetMetaData(columnInfo);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/diag/LockTable.java b/java/org.apache.derby.engine/org/apache/derby/diag/LockTable.java
index cf3619bb8f..907c98bcad 100644
--- a/java/org.apache.derby.engine/org/apache/derby/diag/LockTable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/diag/LockTable.java
@@ -53,6 +53,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
the database.
This virtual table can be invoked by calling it directly
+//IC see: https://issues.apache.org/jira/browse/DERBY-714
+//IC see: https://issues.apache.org/jira/browse/DERBY-571
select * from SYSCS_DIAG.LOCK_TABLE
The LockTable virtual table takes a snap shot of the lock table while
@@ -78,6 +80,7 @@
STATE varchar(5) - nullable. GRANT or WAIT
TABLETYPE varchar(9) - not nullable. 'T' for user table, 'S' for system table
LOCKCOUNT varchar(5) - not nullable. Internal lock count.
INDEXNAME varchar(128) - normally null. If non-null, a lock is held on
+//IC see: https://issues.apache.org/jira/browse/DERBY-2592
the index.
@@ -106,8 +109,10 @@ public class LockTable extends VTITemplate implements VTICosting {
/**
The normal way of instantiating a LockTable, equivalent to
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
LockTable(org.apache.derby.diag.LockTable->TABLE_AND_ROWLOCK).
Only shows row and table lock and not latches. Latches are generally
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
held for very short duration and are not of interest to Derby
users. Only under abnormal circumstances will one be interested in
looking at latches.
@@ -138,6 +143,7 @@ public ResultSetMetaData getMetaData()
/**
@see java.sql.ResultSet#next
@exception SQLException if no transaction context can be found, or other
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
Derby internal errors are encountered.
*/
public boolean next() throws SQLException
@@ -149,6 +155,7 @@ public boolean next() throws SQLException
LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();
tc = lcc.getTransactionExecute();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2164
LockFactory lf = tc.getAccessManager().getLockFactory();
lockTable = lf.makeVirtualLockTable();
initialized = true;
@@ -236,6 +243,7 @@ private Hashtable dumpLock(
Latch lock)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Hashtable attributes = new Hashtable(17);
Object lock_type = lock.getQualifier();
@@ -295,11 +303,13 @@ else if (!(lock instanceof org.apache.derby.impl.services.locks.ActiveLock))
return null; // can't deal with this for now
Long value = (Long)attributes.get(VirtualLockTable.CONTAINERID);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
conglomId = tc.findConglomid(value.longValue());
attributes.put(VirtualLockTable.CONGLOMID, conglomId);
}
attributes.put(VirtualLockTable.LOCKOBJ, lock);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
Object owner = lock.getCompatabilitySpace().getOwner();
attributes.put(VirtualLockTable.XACTID,
(owner == null) ? "" : owner.toString());
@@ -341,6 +351,7 @@ else if (!(lock instanceof org.apache.derby.impl.services.locks.ActiveLock))
};
private static final ResultSetMetaData metadata =
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
new EmbedResultSetMetaData(columnInfo);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/diag/SpaceTable.java b/java/org.apache.derby.engine/org/apache/derby/diag/SpaceTable.java
index dfd654b917..7dd621f555 100644
--- a/java/org.apache.derby.engine/org/apache/derby/diag/SpaceTable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/diag/SpaceTable.java
@@ -51,6 +51,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
This virtual table can be invoked by calling it
directly, and supplying the schema name and table name as arguments.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4051
SELECT * FROM TABLE(SYSCS_DIAG.SPACE_TABLE('MYSCHEMA', 'MYTABLE')) T;
If the schema name is not supplied, the default schema is used.
SELECT * FROM TABLE(SYSCS_DIAG.SPACE_TABLE('MYTABLE')) T;
@@ -99,6 +100,7 @@ TABLEID char(36) - not nullable. The UUID of the table.
select v.*
from SYS.SYSSCHEMAS s,
SYS.SYSTABLES t,
+//IC see: https://issues.apache.org/jira/browse/DERBY-4051
TABLE(SYSCS_DIAG.SPACE_TABLE(SCHEMANAME, TABLENAME)) v
where s.SCHEMAID = t.SCHEMAID;
@@ -140,6 +142,7 @@ private void getConglomInfo(LanguageConnectionContext lcc)
if ( tableName != null )
{
// if schemaName is null, it gets the default schema
+//IC see: https://issues.apache.org/jira/browse/DERBY-3012
SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, true);
TableDescriptor td = dd.getTableDescriptor(tableName,sd, tc);
if (td == null) // table does not exist
@@ -215,6 +218,7 @@ public boolean next() throws SQLException
{
LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();
tc = lcc.getTransactionExecute();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3012
getConglomInfo(lcc);
initialized = true;
@@ -377,6 +381,7 @@ public boolean supportsMultipleInstantiations(VTIEnvironment vtiEnvironment)
private static final ResultSetMetaData metadata =
new EmbedResultSetMetaData(columnInfo);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/diag/StatementCache.java b/java/org.apache.derby.engine/org/apache/derby/diag/StatementCache.java
index 88a8705944..f6e96e40ea 100644
--- a/java/org.apache.derby.engine/org/apache/derby/diag/StatementCache.java
+++ b/java/org.apache.derby.engine/org/apache/derby/diag/StatementCache.java
@@ -56,6 +56,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
ID CHAR(36) - not nullable. Internal identifier of the compiled statement.
SCHEMANAME VARCHAR(128) - nullable. Schema the statement was compiled in.
SQL_TEXT VARCHAR(32672) - not nullable. Text of the statement
+//IC see: https://issues.apache.org/jira/browse/DERBY-6065
UNICODE BIT/BOOLEAN - not nullable. Always true.
VALID BIT/BOOLEAN - not nullable. True if the statement is currently valid, false otherwise
COMPILED_AT TIMESTAMP nullable - time statement was compiled, requires STATISTICS TIMING to be enabled.
@@ -64,6 +65,7 @@ SQL_TEXT VARCHAR(32672) - not nullable. Text of the statement
The internal identifier of a cached statement matches the toString() method of a PreparedStatement object for a Derby database.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
This class also provides a static method to empty the statement cache, StatementCache.emptyCache()
@@ -82,17 +84,21 @@ public StatementCache() throws StandardException {
LanguageConnectionContext lcc = (LanguageConnectionContext)
getContextOrNull(LanguageConnectionContext.CONTEXT_ID);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
+//IC see: https://issues.apache.org/jira/browse/DERBY-2772
CacheManager statementCache =
lcc.getLanguageConnectionFactory().getStatementCache();
if (statementCache != null) {
final Collection values = statementCache.values();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
data = new Vector(values.size());
for (Iterator i = values.iterator(); i.hasNext(); ) {
final CachedStatement cs = (CachedStatement) i.next();
final GenericPreparedStatement ps =
(GenericPreparedStatement) cs.getPreparedStatement();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
data.add(ps);
}
}
@@ -106,6 +112,7 @@ public boolean next() {
position++;
for (; position < data.size(); position++) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
currentPs = (GenericPreparedStatement) data.get(position);
if (currentPs != null)
@@ -131,6 +138,7 @@ public String getString(int colId) {
return ((GenericStatement) currentPs.statement).getCompilationSchema();
case 3:
String sql = currentPs.getSource();
+//IC see: https://issues.apache.org/jira/browse/DERBY-104
sql = StringUtil.truncate(sql, Limits.DB2_VARCHAR_MAXWIDTH);
return sql;
default:
@@ -144,6 +152,7 @@ public boolean getBoolean(int colId) {
case 4:
// was/is UniCode column, but since Derby 10.0 all
// statements are compiled and submitted as UniCode.
+//IC see: https://issues.apache.org/jira/browse/DERBY-571
return true;
case 5:
return currentPs.isValid();
@@ -170,6 +179,7 @@ public boolean wasNull() {
EmbedResultSetMetaData.getResultColumnDescriptor("ID", Types.CHAR, false, 36),
EmbedResultSetMetaData.getResultColumnDescriptor("SCHEMANAME", Types.VARCHAR, true, 128),
+//IC see: https://issues.apache.org/jira/browse/DERBY-104
EmbedResultSetMetaData.getResultColumnDescriptor("SQL_TEXT", Types.VARCHAR, false, Limits.DB2_VARCHAR_MAXWIDTH),
EmbedResultSetMetaData.getResultColumnDescriptor("UNICODE", Types.BIT, false),
EmbedResultSetMetaData.getResultColumnDescriptor("VALID", Types.BIT, false),
@@ -179,6 +189,7 @@ public boolean wasNull() {
private static final ResultSetMetaData metadata =
new EmbedResultSetMetaData(columnInfo);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
public ResultSetMetaData getMetaData() {
@@ -191,6 +202,7 @@ public ResultSetMetaData getMetaData() {
*/
private static Context getContextOrNull( final String contextID )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getContextOrNull( contextID );
diff --git a/java/org.apache.derby.engine/org/apache/derby/diag/StatementDuration.java b/java/org.apache.derby.engine/org/apache/derby/diag/StatementDuration.java
index 355cd387d3..f14d1cb58b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/diag/StatementDuration.java
+++ b/java/org.apache.derby.engine/org/apache/derby/diag/StatementDuration.java
@@ -114,6 +114,7 @@ public StatementDuration() throws StandardException
{
DiagUtil.checkAccess();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
final String home = AccessController.doPrivileged
(
new PrivilegedAction()
@@ -167,6 +168,7 @@ public boolean next() throws SQLException
throw new SQLException(ex.getMessage());
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
hashTable = new Hashtable();
}
@@ -204,6 +206,7 @@ public boolean next() throws SQLException
/* NOTE: We need to use the LCCID as the key
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
String[] previousRow = hashTable.put(newRow[3],
newRow);
if (previousRow == null)
@@ -256,6 +259,7 @@ private Timestamp stringToTimestamp( String raw ) throws SQLException
// Date.toString(), which is always formatted using the pattern
// specified below, and always in US locale.
//
+//IC see: https://issues.apache.org/jira/browse/DERBY-5414
SimpleDateFormat sdf =
new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US);
@@ -325,6 +329,7 @@ private String setupColumn(int columnNumber)
/* Executing prepared statement is a special case as
* it could span multiple lines
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-5071
StringBuffer output = new StringBuffer(64);
if (line.indexOf(BEGIN_EXECUTING_STRING) == -1)
{
@@ -337,6 +342,7 @@ private String setupColumn(int columnNumber)
int endIndex = line.indexOf(END_EXECUTING_STRING, lccidIndex);
if (endIndex == -1)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5071
output.append(line.substring(line.indexOf(END_XID_STRING, lccidIndex) + 3));
}
else
@@ -358,6 +364,7 @@ private String setupColumn(int columnNumber)
endIndex = line.indexOf(END_EXECUTING_STRING);
if (endIndex == -1)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5071
output.append(line);
}
else
@@ -392,11 +399,13 @@ public boolean wasNull()
EmbedResultSetMetaData.getResultColumnDescriptor("THREADID", Types.VARCHAR, false, 80),
EmbedResultSetMetaData.getResultColumnDescriptor("XID", Types.VARCHAR, false, 15),
EmbedResultSetMetaData.getResultColumnDescriptor("LCCID", Types.VARCHAR, false, 10),
+//IC see: https://issues.apache.org/jira/browse/DERBY-104
EmbedResultSetMetaData.getResultColumnDescriptor("LOGTEXT", Types.VARCHAR, true, Limits.DB2_VARCHAR_MAXWIDTH),
EmbedResultSetMetaData.getResultColumnDescriptor("DURATION", Types.VARCHAR, false, 10),
};
private static final ResultSetMetaData metadata =
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
new EmbedResultSetMetaData(columnInfo);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/diag/TransactionTable.java b/java/org.apache.derby.engine/org/apache/derby/diag/TransactionTable.java
index c4905fe86a..11eaadd395 100644
--- a/java/org.apache.derby.engine/org/apache/derby/diag/TransactionTable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/diag/TransactionTable.java
@@ -49,6 +49,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
This virtual table can be invoked by calling it
directly
select * from SYSCS_DIAG.TRANSACTION_TABLE
+//IC see: https://issues.apache.org/jira/browse/DERBY-714
+//IC see: https://issues.apache.org/jira/browse/DERBY-571
The TransactionTable virtual table takes a snap shot of the
transaction table while the system is in flux, so it is possible that some
@@ -64,6 +66,7 @@
XID varchar(15) - not nullable. The transaction id, this can be joined
GLOBAL_XID varchar(140) - nullable. The global transaction id, only
set if this transaction is a participant in a distributed transaction.
USERNAME varchar(128) - nullable. The user name, or APP by default.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
May appear null if the transaction is started by Derby.
TYPE varchar(30) - not nullable. UserTransaction or an internal
transaction spawned by Derby.
@@ -110,6 +113,7 @@ public boolean next() throws SQLException
{
LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2164
transactionTable = lcc.getTransactionExecute().
getAccessManager().getTransactionInfo();
@@ -176,6 +180,7 @@ public String getString(int columnNumber)
case 7:
str = info.getStatementTextString();
+//IC see: https://issues.apache.org/jira/browse/DERBY-104
str = StringUtil.truncate(str, Limits.DB2_VARCHAR_MAXWIDTH);
break;
@@ -236,10 +241,12 @@ public boolean supportsMultipleInstantiations(VTIEnvironment vtiEnvironment)
EmbedResultSetMetaData.getResultColumnDescriptor("TYPE", Types.VARCHAR, false, 30),
EmbedResultSetMetaData.getResultColumnDescriptor("STATUS", Types.VARCHAR, false, 8),
EmbedResultSetMetaData.getResultColumnDescriptor("FIRST_INSTANT", Types.VARCHAR, true, 20),
+//IC see: https://issues.apache.org/jira/browse/DERBY-104
EmbedResultSetMetaData.getResultColumnDescriptor("SQL_TEXT", Types.VARCHAR, true, Limits.DB2_VARCHAR_MAXWIDTH),
};
private static final ResultSetMetaData metadata =
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
new EmbedResultSetMetaData(columnInfo);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/db/ConsistencyChecker.java b/java/org.apache.derby.engine/org/apache/derby/iapi/db/ConsistencyChecker.java
index 66e0c0788f..1f65dfef6c 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/db/ConsistencyChecker.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/db/ConsistencyChecker.java
@@ -141,15 +141,18 @@ public static boolean checkTable(String schemaName, String tableName)
// make sure that application code doesn't bypass security checks
// by calling this public entry point
SecurityUtil.authorize( Securable.CHECK_TABLE );
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
dd = lcc.getDataDictionary();
dvf = lcc.getDataValueFactory();
ExecutionFactory ef = lcc.getLanguageConnectionFactory().getExecutionFactory();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2661
sd = dd.getSchemaDescriptor(schemaName, tc, true);
td = dd.getTableDescriptor(tableName, sd, tc);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3012
if (td == null)
{
@@ -177,6 +180,7 @@ public static boolean checkTable(String schemaName, String tableName)
/* Get a row template for the base table */
baseRow = ef.getValueRow(td.getNumberOfColumns());
+//IC see: https://issues.apache.org/jira/browse/DERBY-2661
/* Fill the row with nulls of the correct type */
ColumnDescriptorList cdl = td.getColumnDescriptorList();
@@ -269,6 +273,7 @@ public static boolean checkTable(String schemaName, String tableName)
/* Get one row template for the index scan, and one for the fetch */
indexRow = ef.getValueRow(baseColumns + 1);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2661
/* Fill the row with nulls of the correct type */
for (int column = 0; column < baseColumns; column++)
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/db/OptimizerTrace.java b/java/org.apache.derby.engine/org/apache/derby/iapi/db/OptimizerTrace.java
index 06570ba4ab..5734e1f216 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/db/OptimizerTrace.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/db/OptimizerTrace.java
@@ -34,6 +34,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
/**
This class provides static methods for controlling the
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
optimizer tracing in a Derby database.
*/
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/db/PropertyInfo.java b/java/org.apache.derby.engine/org/apache/derby/iapi/db/PropertyInfo.java
index 9635191128..c00d6b3f3c 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/db/PropertyInfo.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/db/PropertyInfo.java
@@ -51,6 +51,7 @@ public final class PropertyInfo
/**
Set or delete the value of a property of the database on the current connection.
For security reasons (see DERBY-6616), this code is duplicated in SystemProcedures.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
@param key the property key
@param value the new value, if null the property is deleted.
@@ -63,10 +64,12 @@ public static void setDatabaseProperty(String key, String value) throws SQLExcep
LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
SecurityUtil.authorize( Securable.SET_DATABASE_PROPERTY );
Authorizer a = lcc.getAuthorizer();
a.authorize((Activation) null, Authorizer.PROPERTY_WRITE_OP);
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
// Get the current transaction controller
TransactionController tc = lcc.getTransactionExecute();
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/AutoloadedDriver.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/AutoloadedDriver.java
index f0f18d80c0..cd21bf5872 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/AutoloadedDriver.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/AutoloadedDriver.java
@@ -111,6 +111,7 @@ public boolean acceptsURL(String url) throws SQLException {
// the application is looking for a connection from some other
// driver.
//
+//IC see: https://issues.apache.org/jira/browse/DERBY-2788
return !_engineForcedDown && InternalDriver.embeddedDriverAcceptsURL(url);
}
@@ -193,6 +194,7 @@ public boolean jdbcCompliant() {
public Logger getParentLogger() throws SQLFeatureNotSupportedException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
throw (SQLFeatureNotSupportedException) Util.notImplemented( "getParentLogger()" );
}
@@ -215,6 +217,7 @@ public static Driver getDriverModule() throws SQLException {
}
if ( !isBooted() ) { JDBCBoot.boot(); }
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
return _driverModule;
}
@@ -231,6 +234,8 @@ public static void registerDriverModule( Driver driver )
try {
if (_autoloadedDriver == null) {
//Support JDBC 4 or higher (DERBY-2905)
+//IC see: https://issues.apache.org/jira/browse/DERBY-5029
+//IC see: https://issues.apache.org/jira/browse/DERBY-2095
_autoloadedDriver = makeAutoloadedDriver();
DriverManager.registerDriver(_autoloadedDriver);
}
@@ -250,6 +255,7 @@ public static void unregisterDriverModule()
_engineForcedDown = true;
try {
// deregister is false if user set deregister=false attribute (DERBY-2905)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
if (InternalDriver.getDeregister() && _autoloadedDriver != null) {
deregisterDriver(_autoloadedDriver);
_autoloadedDriver = null;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement.java
index f6ad989cd2..94840d639a 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement.java
@@ -646,6 +646,7 @@ final PreparedStatement getPreparedStatement() throws SQLException {
*/
public CallableStatement createDuplicateStatement(Connection conn, CallableStatement oldStatement) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5877
CallableStatement newStatement = conn.prepareCall(
sql, resultSetType, resultSetConcurrency, resultSetHoldability);
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement42.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement42.java
index 435a53bb31..49d48f6090 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement42.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement42.java
@@ -69,6 +69,7 @@ public void registerOutParameter( String parameterName, SQLType sqlType, Strin
}
public void setObject
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
( int parameterIndex, java.lang.Object x, SQLType sqlType )
throws SQLException
{
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java
index adf062e175..924fe45a37 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java
@@ -374,6 +374,7 @@ public final void setTypeMap(java.util.Map> map) throws SQLExce
public final Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
+//IC see: https://issues.apache.org/jira/browse/DERBY-5877
throws SQLException {
try {
resultSetHoldability =
@@ -509,7 +510,9 @@ public final PreparedStatement prepareStatement(
* Generate an exception reporting that there is no current connection.
* @return a no-current-connection exception
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
final SQLException noCurrentConnection() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6253
return ExceptionFactory.getInstance().getSQLException(
SQLState.NO_CURRENT_CONNECTION, null, null, null);
}
@@ -522,11 +525,13 @@ final SQLException noCurrentConnection() {
final EngineConnection getRealConnection() throws SQLException {
if (isClosed)
throw noCurrentConnection();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
return control.getRealConnection();
}
final void notifyException(SQLException sqle) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-24
if (!isClosed)
control.notifyException(sqle);
}
@@ -573,6 +578,7 @@ Connection, otherwise set only the Connection related state (ie.
public void setState(boolean complete) throws SQLException {
if (complete) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5017
Connection conn = getRealConnection();
conn.setTransactionIsolation(stateIsolationLevel);
conn.setReadOnly(stateReadOnly);
@@ -580,13 +586,16 @@ public void setState(boolean complete) throws SQLException {
// make the underlying connection pick my holdability state
// since holdability is a state of the connection handle
// not the underlying transaction.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5050
conn.setHoldability(stateHoldability);
}
}
public final BrokeredStatement newBrokeredStatement(
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
BrokeredStatementControl statementControl) throws SQLException {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3525
return new BrokeredStatement(statementControl);
} catch (SQLException sqle) {
notifyException(sqle);
@@ -681,6 +690,7 @@ public final void addWarning(SQLWarning w) throws SQLException
*/
public String toString()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-412
if ( connString == null )
{
String wrappedString;
@@ -742,6 +752,7 @@ public final int getHoldability() throws SQLException {
// JDBC 4.0 methods
public final Array createArrayOf(String typeName, Object[] elements)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
throws SQLException {
try {
return getRealConnection().createArrayOf(typeName, elements);
@@ -1004,6 +1015,7 @@ final int statementHoldabilityCheck(int resultSetHoldability)
int holdability = control.checkHoldCursors(resultSetHoldability, true);
if (holdability != resultSetHoldability) {
SQLWarning w =
+//IC see: https://issues.apache.org/jira/browse/DERBY-3461
SQLWarningFactory.newSQLWarning(SQLState.HOLDABLE_RESULT_SET_NOT_AVAILABLE);
addWarning(w);
@@ -1033,6 +1045,7 @@ public Object getLOBMapping(int key) throws SQLException {
* @throws java.sql.SQLException on error
*/
public String getCurrentSchemaName() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3192
try {
return getRealConnection().getCurrentSchemaName();
}
@@ -1046,6 +1059,7 @@ public String getCurrentSchemaName() throws SQLException {
* @see org.apache.derby.iapi.jdbc.EngineConnection
*/
public void resetFromPool()
+//IC see: https://issues.apache.org/jira/browse/DERBY-3596
throws SQLException {
getRealConnection().resetFromPool();
}
@@ -1061,6 +1075,7 @@ public void resetFromPool()
*/
public String getSchema() throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4869
try {
return getRealConnection().getSchema();
}
@@ -1087,6 +1102,7 @@ public void setSchema( String schemaName ) throws SQLException
}
public void abort(Executor executor) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
if (!isClosed) {
((EngineConnection) getRealConnection()).abort(executor);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredConnection42.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredConnection42.java
index 24f6a1426b..a3819bf24a 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredConnection42.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredConnection42.java
@@ -50,6 +50,7 @@ public BrokeredConnection42(BrokeredConnectionControl control)
}
public BrokeredCallableStatement newBrokeredStatement(BrokeredStatementControl statementControl, String sql) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
try {
return new BrokeredCallableStatement42(statementControl, sql);
} catch (SQLException sqle) {
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement.java
index 7040e825c9..3c36631bb7 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement.java
@@ -717,6 +717,7 @@ public final Statement getStatement() throws SQLException {
public PreparedStatement createDuplicateStatement(Connection conn, PreparedStatement oldStatement) throws SQLException {
PreparedStatement newStatement;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5877
if (generatedKeys == null) {
newStatement = conn.prepareStatement(
@@ -742,6 +743,8 @@ public PreparedStatement createDuplicateStatement(Connection conn, PreparedState
}
public final long getVersionCounter() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5459
+//IC see: https://issues.apache.org/jira/browse/DERBY-2402
return ((EnginePreparedStatement)getPreparedStatement()).
getVersionCounter();
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredStatement.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredStatement.java
index 5c2b43dbca..f64692a606 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredStatement.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/BrokeredStatement.java
@@ -32,6 +32,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
/**
A Statement implementation that forwards all of its requests to an underlying Statement.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
This class implements the JDBC 4.1 interface.
*/
public class BrokeredStatement implements EngineStatement
@@ -54,6 +55,7 @@ My control. Use the controlCheck() method to obtain the control
private String cursorName;
private Boolean escapeProcessing;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3525
BrokeredStatement(BrokeredStatementControl control) throws SQLException
{
this.control = control;
@@ -120,6 +122,8 @@ public final int executeUpdate(String sql) throws SQLException
*/
public void close() throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4310
+//IC see: https://issues.apache.org/jira/browse/DERBY-4155
control.closeRealStatement();
}
@@ -434,6 +438,7 @@ public final int executeUpdate(String sql,
*/
public final boolean getMoreResults(int current) throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
return getStatement().getMoreResults(current);
}
@@ -477,6 +482,7 @@ public final int getResultSetHoldability()
public Statement createDuplicateStatement(Connection conn, Statement oldStatement) throws SQLException {
Statement newStatement;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3525
newStatement = conn.createStatement(resultSetType, resultSetConcurrency,
resultSetHoldability);
@@ -571,6 +577,7 @@ public T unwrap(Class iface) throws SQLException {
* @exception SQLException if an error occurs
*/
public final boolean isClosed() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
return getStatement().isClosed();
}
@@ -584,7 +591,9 @@ protected final void checkIfClosed()
throws SQLException
{
if (isClosed()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6253
throw ExceptionFactory.getInstance().getSQLException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
SQLState.ALREADY_CLOSED, null, null,
new Object[]{ "Statement" });
}
@@ -598,6 +607,7 @@ protected final void checkIfClosed()
* @return an exception indicating that unwrap failed
*/
final SQLException unableToUnwrap(Class iface) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6253
return ExceptionFactory.getInstance().getSQLException(
SQLState.UNABLE_TO_UNWRAP, null, null,
new Object[]{ iface });
@@ -610,6 +620,7 @@ final SQLException unableToUnwrap(Class iface) {
* @throws SQLException if the forwarding call fails.
*/
public final boolean isPoolable() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
return getStatement().isPoolable();
}
@@ -631,6 +642,7 @@ public final void setPoolable(boolean poolable) throws SQLException {
public void closeOnCompletion() throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4869
((EngineStatement) getStatement()).closeOnCompletion();
}
@@ -647,10 +659,12 @@ public boolean isCloseOnCompletion() throws SQLException
public long[] executeLargeBatch() throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
return ((EngineStatement) getStatement()).executeLargeBatch();
}
public long executeLargeUpdate( String sql ) throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
return ((EngineStatement) getStatement()).executeLargeUpdate( sql );
}
public long executeLargeUpdate( String sql, int autoGeneratedKeys) throws SQLException
@@ -667,10 +681,12 @@ public long executeLargeUpdate( String sql, String[] columnNames ) throws SQLEx
}
public long getLargeMaxRows() throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
return ((EngineStatement) getStatement()).getLargeMaxRows();
}
public long getLargeUpdateCount() throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
return ((EngineStatement) getStatement()).getLargeUpdateCount();
}
public void setLargeMaxRows( long max ) throws SQLException
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/CharacterStreamDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/CharacterStreamDescriptor.java
index f2ffeb1b33..76bb918cef 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/CharacterStreamDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/CharacterStreamDescriptor.java
@@ -85,6 +85,7 @@ private CharacterStreamDescriptor(Builder b) {
byteLength = b.byteLength;
charLength = b.charLength;
maxCharLength = b.maxCharLength;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3936
stream = b.stream;
}
@@ -166,6 +167,7 @@ public long getMaxCharLength() {
* @return An {@code InputStream} reference.
*/
public InputStream getStream() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3936
return stream;
}
@@ -193,6 +195,7 @@ public String toString() {
bufferable + ":positionAware=" +
positionAware + ":byteLength=" + byteLength + ":charLength=" +
charLength + ":curBytePos=" + curBytePos + ":curCharPos=" +
+//IC see: https://issues.apache.org/jira/browse/DERBY-3936
curCharPos + ":dataOffset=" + dataOffset + ":stream=" +
stream.getClass());
}
@@ -296,6 +299,7 @@ public Builder byteLength(long length) {
* @return The builder.
*/
public Builder copyState(CharacterStreamDescriptor csd) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3936
this.bufferable = csd.bufferable;
this.byteLength = csd.byteLength;
this.charLength = csd.charLength;
@@ -354,6 +358,7 @@ public Builder maxCharLength(long length) {
* @return The builder.
*/
public Builder stream(InputStream stream) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3936
if (SanityManager.DEBUG) {
SanityManager.ASSERT(stream != null);
}
@@ -375,6 +380,7 @@ public Builder stream(InputStream stream) {
public CharacterStreamDescriptor build() {
// Do validation only in sane builds.
if (SanityManager.DEBUG) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
SanityManager.ASSERT(curBytePos >= 0, "Negative curBytePos");
SanityManager.ASSERT(curCharPos >= 1 ||
curCharPos == BEFORE_FIRST, "Invalid curCharPos " +
@@ -396,11 +402,13 @@ public CharacterStreamDescriptor build() {
// If we're in the header section, the character position must
// be before the first character.
if (curBytePos < dataOffset) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
SanityManager.ASSERT(curCharPos == BEFORE_FIRST,
"curCharPos in header, " + toString());
}
// Byte length minus data offset must be equal to or greater
// then the character length.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3936
if (byteLength > 0 && charLength > 0) {
SanityManager.ASSERT(byteLength - dataOffset >= charLength,
"Less than one byte per char, " + toString());
@@ -423,6 +431,7 @@ public CharacterStreamDescriptor build() {
* @return The textual representation of the builder.
*/
public String toString() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
String str = "CharacterStreamBuiler@" + hashCode() +
":bufferable=" + bufferable + ", isPositionAware=" +
positionAware + ", curBytePos=" + curBytePos +
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/DRDAServerStarter.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/DRDAServerStarter.java
index 7eb114f3b6..a5bead4203 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/DRDAServerStarter.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/DRDAServerStarter.java
@@ -138,6 +138,7 @@ public void setStartInfo(InetAddress listenAddress, int portNumber, PrintWriter
* @throws SecurityException
*/
private void findStartStopMethods(final Class> serverClass)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1966
throws SecurityException, NoSuchMethodException
{
// Methods are public so no need for privilege blocks.
@@ -179,6 +180,7 @@ public void boot(boolean create,
Constructor serverConstructor;
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
serverConstructor = AccessController.doPrivileged(
new PrivilegedExceptionAction() {
public Constructor run() throws NoSuchMethodException, SecurityException
@@ -207,6 +209,7 @@ public Constructor run() throws NoSuchMethodException, SecurityException
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-1966
findStartStopMethods(serverClass);
if (listenAddress == null) {
@@ -214,10 +217,12 @@ public Constructor run() throws NoSuchMethodException, SecurityException
new Object[]{userArg, passwordArg});
} else {
server = serverConstructor.newInstance(new Object[]
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
{listenAddress, portNumber,
userArg, passwordArg});
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
serverThread = getMonitor().getDaemonThread( this, "NetworkServerStarter", false);
serverThread.start();
}
@@ -233,6 +238,7 @@ public void run()
{
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1966
runServerMethod.invoke( server,
new Object[] {consoleWriter });
}
@@ -259,7 +265,9 @@ public void stop()
{
serverShutdownMethod.invoke( server,
null);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2564
AccessController.doPrivileged(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
new PrivilegedAction() {
public Object run() {
serverThread.interrupt();
@@ -298,6 +306,7 @@ public Object run() {
*/
private static ModuleFactory getMonitor()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/Driver42.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/Driver42.java
index 4f69ed62fc..09b1d03ce8 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/Driver42.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/Driver42.java
@@ -74,6 +74,7 @@ public BrokeredConnection newBrokeredConnection(
public EmbedResultSet newEmbedResultSet
(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
EmbedConnection conn, ResultSet results, boolean forMetaData,
org.apache.derby.impl.jdbc.EmbedStatement statement,
boolean isAtomic
@@ -83,6 +84,7 @@ public BrokeredConnection newBrokeredConnection(
}
public CallableStatement newEmbedCallableStatement(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
EmbedConnection conn,
String stmt,
int resultSetType,
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/EmbeddedDataSourceInterface.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/EmbeddedDataSourceInterface.java
index a197a81360..4ec6530455 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/EmbeddedDataSourceInterface.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/EmbeddedDataSourceInterface.java
@@ -67,6 +67,7 @@ public interface EmbeddedDataSourceInterface extends javax.sql.DataSource {
* @throws SQLException on error
*/
public Connection getConnection(String username,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
String password,
boolean requestPassword)
throws SQLException;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/EmbeddedXADataSourceInterface.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/EmbeddedXADataSourceInterface.java
index f4cdf8ada8..c629c7b9ac 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/EmbeddedXADataSourceInterface.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/EmbeddedXADataSourceInterface.java
@@ -37,6 +37,9 @@ public interface EmbeddedXADataSourceInterface extends EmbeddedDataSourceInterfa
/** Added by Java 9 */
public default ShardingKeyBuilder createShardingKeyBuilder()
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
+//IC see: https://issues.apache.org/jira/browse/DERBY-6974
throws SQLException
{
throw new java.sql.SQLFeatureNotSupportedException();
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/EngineConnection.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/EngineConnection.java
index ba5acba106..2257ac199c 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/EngineConnection.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/EngineConnection.java
@@ -134,6 +134,7 @@ public void addWarning(SQLWarning newWarning)
public void setSchema( String schemaName ) throws SQLException;
void abort(Executor executor) throws SQLException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
void setNetworkTimeout(Executor executor, int millis) throws SQLException;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/FailedProperties40.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/FailedProperties40.java
index e5b13fbf61..195413a200 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/FailedProperties40.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/FailedProperties40.java
@@ -38,6 +38,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
public class FailedProperties40 {
private final HashMap failedProps_ =
+//IC see: https://issues.apache.org/jira/browse/DERBY-1380
new HashMap();
private final String firstKey_;
private final String firstValue_;
@@ -73,6 +74,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.engine/org/apache/derby/iapi/jdbc/InternalDriver.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/InternalDriver.java
index 4e3d74e96c..fe4e1b42b2 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/InternalDriver.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/InternalDriver.java
@@ -121,6 +121,7 @@ public static final InternalDriver activeDriver()
}
public InternalDriver() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
contextServiceFactory = getContextService();
}
@@ -138,12 +139,14 @@ public void boot(boolean create, Properties properties) throws StandardException
active = true;
mbean = ((ManagementService)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
getSystemModule(Module.JMX)).registerMBean(
new JDBC(this),
JDBCMBean.class,
"type=JDBC");
// Register with the driver manager
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
AutoloadedDriver.registerDriverModule(this);
}
@@ -155,6 +158,7 @@ public void stop() {
}
((ManagementService)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
getSystemModule(Module.JMX)).unregisterMBean(
mbean);
@@ -162,6 +166,7 @@ public void stop() {
contextServiceFactory = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
AutoloadedDriver.unregisterDriverModule();
}
@@ -170,6 +175,7 @@ public void stop() {
*/
public boolean acceptsURL(String url) throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1459
return active && embeddedDriverAcceptsURL( url );
}
@@ -180,6 +186,7 @@ public boolean acceptsURL(String url) throws SQLException
*/
public static boolean embeddedDriverAcceptsURL(String url) throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
if ( url == null )
{
throw Util.generateCsSQLException( SQLState.MALFORMED_URL, "null" );
@@ -187,6 +194,7 @@ public static boolean embeddedDriverAcceptsURL(String url) throws SQLException
return
// need to reject network driver's URL's
+//IC see: https://issues.apache.org/jira/browse/DERBY-535
!url.startsWith(Attribute.JCC_PROTOCOL) && !url.startsWith(Attribute.DNC_PROTOCOL) &&
(url.startsWith(Attribute.PROTOCOL) || url.equals(Attribute.SQLJ_NESTED));
@@ -201,6 +209,7 @@ public Connection connect( String url, Properties info, int loginTimeoutSeconds
* If we are below the low memory watermark for obtaining
* a connection, then don't even try. Just throw an exception.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-444
if (EmbedConnection.memoryState.isLowMemory())
{
throw EmbedConnection.NO_MEM;
@@ -233,6 +242,7 @@ public Connection connect( String url, Properties info, int loginTimeoutSeconds
// convert the ;name=value attributes in the URL into
// properties.
+//IC see: https://issues.apache.org/jira/browse/DERBY-444
FormatableProperties finfo = null;
try {
@@ -280,6 +290,7 @@ public Connection connect( String url, Properties info, int loginTimeoutSeconds
boolean deregister = Boolean.valueOf(
finfo.getProperty(Attribute.DEREGISTER_ATTR))
.booleanValue();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
InternalDriver.setDeregister(deregister);
}
@@ -289,12 +300,14 @@ public Connection connect( String url, Properties info, int loginTimeoutSeconds
//checkShutdownPrivileges(user);
getMonitor().shutdown();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
throw Util.generateCsSQLException(
SQLState.CLOUDSCAPE_SYSTEM_SHUTDOWN);
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6094
EmbedConnection conn;
if ( loginTimeoutSeconds <= 0 ) { conn = getNewEmbedConnection( url, finfo ); }
@@ -308,6 +321,7 @@ public Connection connect( String url, Properties info, int loginTimeoutSeconds
return conn;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-444
catch (OutOfMemoryError noMemory)
{
EmbedConnection.memoryState.setLowMemory();
@@ -324,12 +338,14 @@ public Connection connect( String url, Properties info, int loginTimeoutSeconds
* Enforce the login timeout.
*/
private EmbedConnection timeLogin(
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
String url, Properties info, int loginTimeoutSeconds)
throws SQLException
{
try {
LoginCallable callable = new LoginCallable(this, url, info);
Future task = _executorPool.submit(callable);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6167
long now = System.currentTimeMillis();
long giveUp = now + loginTimeoutSeconds * 1000L;
@@ -447,6 +463,7 @@ private void checkShutdownPrivileges(String user) throws SQLException {
// the check
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3491
final Permission sp = new SystemPermission(
SystemPermission.ENGINE, SystemPermission.SHUTDOWN);
checkSystemPrivileges(user, sp);
@@ -462,6 +479,7 @@ private void checkShutdownPrivileges(String user) throws SQLException {
}
public int getMajorVersion() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return getMonitor().getEngineVersion().getMajorVersion();
}
@@ -470,6 +488,8 @@ public int getMinorVersion() {
}
public boolean jdbcCompliant() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-561
+//IC see: https://issues.apache.org/jira/browse/DERBY-530
return true;
}
@@ -632,6 +652,7 @@ public AuthenticationService getAuthenticationService() {
//
if (this.authenticationService == null) {
this.authenticationService = (AuthenticationService)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
findService(AuthenticationService.MODULE,
"authentication"
);
@@ -644,6 +665,7 @@ public AuthenticationService getAuthenticationService() {
Methods to be overloaded in sub-implementations such as
a tracing driver.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
EmbedConnection getNewEmbedConnection( final String url, final Properties info)
throws SQLException
{
@@ -720,6 +742,7 @@ public boolean isActive() {
*
*/
public Connection getNewNestedConnection(EmbedConnection conn) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
return new EmbedConnection(conn);
}
@@ -762,6 +785,7 @@ public PreparedStatement newEmbedPreparedStatement(
int autoGeneratedKeys,
int[] columnIndexes,
String[] columnNames)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
throws SQLException
{
return new EmbedPreparedStatement(conn,
@@ -815,6 +839,7 @@ public DatabaseMetaData newEmbedDatabaseMetaData(
* @throws SQLException on error
*/
public EmbedResultSet newEmbedResultSet(EmbedConnection conn,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
ResultSet results, boolean forMetaData, EmbedStatement statement,
boolean isAtomic) throws SQLException {
return new EmbedResultSet(conn, results, forMetaData, statement,
@@ -830,6 +855,7 @@ public EmbedResultSet newEmbedResultSet(EmbedConnection conn,
*/
public EmbedResultSetMetaData newEmbedResultSetMetaData(
ResultColumnDescriptor[] columnInfo) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-940
return new EmbedResultSetMetaData(columnInfo);
}
@@ -937,6 +963,7 @@ public DriverPropertyInfo[] getPropertyInfo(String url, Properties info)
optionsNoDB[attrIndex].description = MessageService.getTextMessage(connStringAttributes[i][1]);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
optionsNoDB[0].choices = getMonitor().getServiceList(Property.DATABASE_MODULE);
// since database name is not stored in FormatableProperties, we
// assign here explicitly
@@ -987,6 +1014,7 @@ public Logger getParentLogger()
* deregister itself
*/
public static void setDeregister(boolean deregister) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
InternalDriver.deregister = deregister;
}
@@ -1007,12 +1035,14 @@ public static boolean getDeregister() {
*/
private static ContextService getContextService()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
{
public ContextService run()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return ContextService.getFactory();
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/JDBC.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/JDBC.java
index 82b5eea5d4..56bfb5dc76 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/JDBC.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/JDBC.java
@@ -58,6 +58,7 @@ public boolean isCompliantDriver()
}
public boolean acceptsURL(String url)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
throws SQLException
{
return driver.acceptsURL(url);
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/JDBCBoot.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/JDBCBoot.java
index 45c17e1049..337717f588 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/JDBCBoot.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/JDBCBoot.java
@@ -59,6 +59,7 @@ void addProperty(String name, String value) {
*/
public static void boot() {
PrintWriter pw = DriverManager.getLogWriter();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
if (pw == null) {
pw = new PrintWriter(System.err, true);
@@ -88,6 +89,7 @@ public void boot(String protocol, final PrintWriter logging) {
// on DERBY-4480. Moving the boot method out of EmbeddedDriver
// somehow created a race condition during simultaneous getConnection() calls.
//
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
synchronized(NETWORK_SERVER_AUTOSTART_CLASS_NAME)
{
if (InternalDriver.activeDriver() == null)
@@ -99,6 +101,7 @@ public void boot(String protocol, final PrintWriter logging) {
addProperty("derby.service.jdbc", InternalDriver.class.getName());
addProperty("derby.service.authentication", AuthenticationService.MODULE);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
boot( bootProperties, logging);
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/ResourceAdapter.java b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/ResourceAdapter.java
index 488716eb30..a0fa23c62f 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/ResourceAdapter.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/jdbc/ResourceAdapter.java
@@ -38,6 +38,7 @@ There is one instance of ResourceAdapter per Resource Manager (database).
global transactions, i.e., it does not know of in-doubt global transactions
re-created by recovery.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
The following is an overall design of the JTA implementation in Derby,
most of it has little to do with the ResourceAdapter interface itself.
Design Overview
@@ -164,6 +165,7 @@ transactions, store must deal with (throw exception) when someone wants to
First some ugly pictures. Some links are not shown to reduce
clutter. Externally visible object is in bold .
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
*
* When user ask for an XAConnection via a XADataSource, the following objects
@@ -426,5 +428,6 @@ public interface ResourceAdapter {
* @throws XAException on error
*/
public void cancelXATransaction(XAXactId xid, String messageId)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2871
throws XAException;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/security/SecurityUtil.java b/java/org.apache.derby.engine/org/apache/derby/iapi/security/SecurityUtil.java
index 94ea60f689..6a4770344d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/security/SecurityUtil.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/security/SecurityUtil.java
@@ -59,6 +59,7 @@ public class SecurityUtil {
*/
private final static SystemPermission USE_DERBY_INTERNALS = new SystemPermission
( SystemPermission.ENGINE, SystemPermission.USE_DERBY_INTERNALS );
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
/**
* Creates a (read-only) Subject representing a given user
@@ -70,6 +71,7 @@ public class SecurityUtil {
* @see User Names & Authorization Identifiers in Derby
*/
static public Subject createSystemPrincipalSubject(String user) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
final Set principals = new HashSet();
// add the authenticated user
if (user != null) {
@@ -133,6 +135,7 @@ static private String getAuthorizationId(String name) {
static public void checkSubjectHasPermission(final Subject subject,
final Permission perm) {
// the checks
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
final PrivilegedAction runCheck
= new PrivilegedAction() {
public Void run() {
@@ -186,10 +189,12 @@ static public void checkUserHasPermission(String user,
* to perform the indicated operation.
*/
public static void authorize( Securable operation )
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
throws StandardException
{
LanguageConnectionContext lcc = (LanguageConnectionContext)
getContextOrNull( LanguageConnectionContext.CONTEXT_ID );
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( lcc.usesSqlAuthorization() )
{
@@ -216,6 +221,7 @@ public static void authorize( Securable operation )
*/
public static void checkDerbyInternalsPrivilege()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() != null )
{
AccessController.checkPermission( USE_DERBY_INTERNALS );
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/CacheManager.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/CacheManager.java
index deb461f59c..10354fcc53 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/CacheManager.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/CacheManager.java
@@ -296,10 +296,12 @@ Discard all objects that match the partialKey (or exact key).
* @throws StandardException if an error occurs when registering the MBean
*/
void registerMBean(String dbName) throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6733
/**
* Deregister the MBean that monitors this cache. If there is no MBean
* for this instance, this is a no-op.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6733
void deregisterMBean();
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/Cacheable.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/Cacheable.java
index b8f5b18c99..7f26081a57 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/Cacheable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/Cacheable.java
@@ -32,6 +32,7 @@ class must be public and it must have a public no-arg constructor. This is becau
A Cacheable object has five states:
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
No identity - The object is only accessable by the cache manager
Identity, clean, unkept - The object has an identity, is clean but is only accessable by the cache manager
Identity, clean, kept - The object has an identity, is clean, and is in use by one or more threads
@@ -142,6 +143,7 @@ then the object should create a new object, call its initParameter() with the pa
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Returns true if the object is dirty.
May be called when the object is kept or unkept.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/CacheableFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/CacheableFactory.java
index 3fd044e83b..d243a8ff71 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/CacheableFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/CacheableFactory.java
@@ -22,6 +22,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
package org.apache.derby.iapi.services.cache;
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Any object that implements this interface can be cached using the services of
the CacheManager/CacheFactory. In addition to implementing this interface the
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/ClassSize.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/ClassSize.java
index 5f79d8a3f3..38643ebddb 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/ClassSize.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/ClassSize.java
@@ -61,8 +61,10 @@ public class ClassSize
int tmpRefSize = fetchRefSizeFromSystemProperties();
// If we didn't understand the properties, or were not allowed to read
// them, use a heuristic.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3731
if (tmpRefSize < 4) {
Runtime runtime = Runtime.getRuntime();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3731
runtime.gc();
runtime.runFinalization();
long memBase = runtime.totalMemory() - runtime.freeMemory();
@@ -204,6 +206,7 @@ private static int estimateBaseFromCatalog( Class> cls, boolean addToCatalog)
return 0;
ClassSizeCatalog catalog = ClassSizeCatalog.getInstance();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
if( SanityManager.DEBUG)
SanityManager.ASSERT( catalog != null, "The class size catalog could not be initialized.");
@@ -309,8 +312,10 @@ public static int estimateMemoryUsage( String str)
*/
private static final int fetchRefSizeFromSystemProperties() {
// Try the direct way first, by looking for 'sun.arch.data.model'
+//IC see: https://issues.apache.org/jira/browse/DERBY-3731
String dataModel = getSystemProperty("sun.arch.data.model");
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
return Integer.parseInt(dataModel) / 8;
} catch (NumberFormatException ignoreNFE) {}
@@ -344,6 +349,7 @@ private static final int fetchRefSizeFromSystemProperties() {
*/
private static final String getSystemProperty(final String propName) {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return AccessController.doPrivileged(
new PrivilegedAction() {
public String run() {
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/ClassSizeCatalog.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/ClassSizeCatalog.java
index 5709533290..e93e4fe1d6 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/ClassSizeCatalog.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/cache/ClassSizeCatalog.java
@@ -36,6 +36,7 @@ abstract class ClassSizeCatalog extends Hashtable {
// try to compile it. This may fail because ClassSizeCatalogImpl.java
// is not created until everything else has been compiled. Bury
// ClassSizeCatalogImpl in a string.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
String className = ClassSizeCatalog.class.getName() + "Impl";
try {
Class> clazz = Class.forName(className);
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/Attributes.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/Attributes.java
index b2a3a60f4b..97f24ffbd1 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/Attributes.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/Attributes.java
@@ -25,6 +25,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.io.IOException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
class Attributes extends Vector {
private int classFileSize;
@@ -35,6 +36,7 @@ class Attributes extends Vector {
void put(ClassFormatOutput out) throws IOException {
int size = size();
for (int i = 0; i < size; i++) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
elementAt(i).put(out);
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassEnumeration.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassEnumeration.java
index 94a1370058..c140bd5a64 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassEnumeration.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassEnumeration.java
@@ -39,6 +39,7 @@ class ClassEnumeration implements Enumeration {
ClassHolder cpt;
Enumeration inner;
CONSTANT_Index_info position;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
HashSet foundClasses;
Enumeration classList;
@@ -49,6 +50,7 @@ class ClassEnumeration implements Enumeration {
{
this.cpt = cpt;
inner = e;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
foundClasses = new HashSet(30, 0.8f);
findMethodReferences(methods, foundClasses);
findFieldReferences(fields, foundClasses);
@@ -108,6 +110,7 @@ private void findClassReferences(HashSet foundClasses)
}
private void findMethodReferences( Enumeration methods,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
HashSet foundClasses)
{
while (methods.hasMoreElements())
@@ -119,6 +122,7 @@ private void findMethodReferences( Enumeration methods,
}
private void findFieldReferences( Enumeration fields,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
HashSet foundClasses)
{
while (fields.hasMoreElements())
@@ -129,6 +133,7 @@ private void findFieldReferences( Enumeration fields,
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
void distillClasses(String fieldOrMethodSig, HashSet foundClasses)
{
if (fieldOrMethodSig == null || fieldOrMethodSig.length() < 1)
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassFormatOutput.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassFormatOutput.java
index 22e787f1a8..122457de4d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassFormatOutput.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassFormatOutput.java
@@ -55,6 +55,7 @@ public ClassFormatOutput(java.io.OutputStream stream) {
public void putU1(int i) throws IOException {
// ensure the format of the class file is not
// corrupted by writing an incorrect, truncated value.
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
if (i > 255)
ClassFormatOutput.limit("U1", 255, i);
write(i);
@@ -96,6 +97,7 @@ public byte[] getData() {
* @throws IOException Thrown when limit is exceeded.
*/
static void limit(String name, int limit, int value)
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
throws IOException
{
throw new IOException(name + "(" + value + " > " + limit + ")");
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassHolder.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassHolder.java
index 0623ce9e3c..f8ba3441fe 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassHolder.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassHolder.java
@@ -108,6 +108,7 @@ public class ClassHolder {
protected ClassHolder(int estimatedConstantPoolCount) {
// Constant Pool Information
// 100 is the estimate of the number of entries that will be generated
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
cptEntries = new Vector(estimatedConstantPoolCount);
cptHashTable = new Hashtable(estimatedConstantPoolCount, (float)0.75);
@@ -145,6 +146,7 @@ private void put(ClassFormatOutput out) throws IOException {
// (as it is stored as a U2).
// Special case to allow somewhat easier debugging
// of the resulting failure.
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
out.putU2("constant_pool", cptEntries.size());
cptPut(out);
@@ -214,6 +216,7 @@ public ByteArray getFileFormat() throws IOException {
ClassFormatOutput cfo = new ClassFormatOutput(classFileSize + 200);
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
put(cfo);
@@ -422,6 +425,7 @@ protected int addEntry(Object key, ConstantPoolEntry item) {
if (key != null)
cptHashTable.put(key, item);
cptEntries.add(item);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
cptEstimatedSize += item.classFileSize();
@@ -536,6 +540,7 @@ private int addString(String value) {
protected void cptPut(ClassFormatOutput out) throws IOException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
for (Enumeration e = cptEntries.elements(); e.hasMoreElements(); ) {
ConstantPoolEntry item = e.nextElement();
if (item == null) {
@@ -551,6 +556,7 @@ protected void cptPut(ClassFormatOutput out) throws IOException {
*/
public ConstantPoolEntry getEntry(int index) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return cptEntries.get(index);
}
@@ -657,6 +663,7 @@ protected int findIndexIndex(int tag, int i1, int i2) {
}
protected ConstantPoolEntry findMatchingEntry(Object key) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return cptHashTable.get(key);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassInput.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassInput.java
index 2720720207..06d81cb4c0 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassInput.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassInput.java
@@ -37,6 +37,7 @@ class ClassInput extends DataInputStream {
}
int getU1() throws IOException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6857
return readUnsignedByte();
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassInvestigator.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassInvestigator.java
index 204e1704e2..ae8978c9da 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassInvestigator.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/ClassInvestigator.java
@@ -140,9 +140,11 @@ public Enumeration implementedInterfaces()
{
int interfaceCount = interfaces == null ? 0 : interfaces.length;
Vector implemented = new Vector(interfaceCount);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
for (int i = 0; i < interfaceCount; i++)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
implemented.add(className(interfaces[i]));
}
return implemented.elements();
@@ -150,6 +152,7 @@ public Enumeration implementedInterfaces()
public Enumeration getFields() {
if (field_info == null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return Collections.enumeration( new Vector() );
}
@@ -178,6 +181,7 @@ private Enumeration getClasses(Enumeration methods, Enumeration strings = new HashSet(30, 0.8f);
int size = cptEntries.size();
@@ -244,6 +248,7 @@ else if (name.equals("InnerClasses"))
attribute_info = null;
// fields
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
for (Enumeration e = getFields(); e.hasMoreElements(); ) {
ClassMember member = e.nextElement();
@@ -270,6 +275,7 @@ else if (name.equals("Synthetic"))
}
// methods
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
for (Enumeration e = getMethods(); e.hasMoreElements(); ) {
ClassMember member = e.nextElement();
@@ -304,6 +310,7 @@ private void processCodeAttribute(ClassMember member, AttributeEntry ae) throws
ClassInput ci = new ClassInput(new java.io.ByteArrayInputStream(ae.infoIn));
+//IC see: https://issues.apache.org/jira/browse/DERBY-3941
DataInputUtil.skipFully(ci, 4);// puts us at code_length
int len = ci.getU4();
DataInputUtil.skipFully(ci, len);// puts us at exception_table_length
@@ -330,6 +337,7 @@ private void processCodeAttribute(ClassMember member, AttributeEntry ae) throws
System.err.println("ERROR - Unknown code attribute " + name);
len = ci.getU4();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3941
DataInputUtil.skipFully(ci, len);
}
@@ -400,6 +408,7 @@ private void renameMembers(Enumeration e, Hashtable classNameMap, H
for (; e.hasMoreElements(); ) {
ClassMember member = e.nextElement();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
String oldMemberName = nameIndexToString(member.name_index);
String newMemberName = (String) memberNameMap.get(oldMemberName);
@@ -462,6 +471,7 @@ private void doRenameString(int index, String newName) {
newCpe.index = index;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
cptEntries.set(index, newCpe);
}
@@ -470,6 +480,7 @@ private static ConstantPoolEntry getConstant(ClassInput in)
ConstantPoolEntry item;
final int tag = in.getU1();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6857
switch (tag) {
case VMDescriptor.CONSTANT_Class:
@@ -482,6 +493,7 @@ private static ConstantPoolEntry getConstant(ClassInput in)
case VMDescriptor.CONSTANT_Fieldref:
case VMDescriptor.CONSTANT_Methodref:
case VMDescriptor.CONSTANT_InterfaceMethodref:
+//IC see: https://issues.apache.org/jira/browse/DERBY-6857
case VMDescriptor.CONSTANT_InvokeDynamic:
item = new CONSTANT_Index_info(tag, in.getU2(), in.getU2());
break;
@@ -506,6 +518,7 @@ private static ConstantPoolEntry getConstant(ClassInput in)
item = new CONSTANT_Utf8_info(in.readUTF());
break;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6857
case VMDescriptor.CONSTANT_MethodHandle:
item = new CONSTANT_Index_info(tag, in.getU1(), in.getU2());
break;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/MemberTable.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/MemberTable.java
index e4c950ad1e..beb27686f1 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/MemberTable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/classfile/MemberTable.java
@@ -34,6 +34,7 @@ class MemberTable {
private MemberTableHash mutableMTH = null;
public MemberTable(int count) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
entries = new Vector(count);
hashtable = new Hashtable((count > 50) ? count : 50);
mutableMTH = new MemberTableHash(null, null);
@@ -46,6 +47,7 @@ void addEntry(ClassMember item) {
entries.size());
/* Add to the Vector */
entries.add(item);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
/* Add to the Hashtable */
hashtable.put(mth, mth);
@@ -59,6 +61,7 @@ ClassMember find(String name, String descriptor) {
mutableMTH.setHashCode();
/* search the hash table */
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
MemberTableHash mth = hashtable.get(mutableMTH);
if (mth == null)
{
@@ -84,6 +87,7 @@ int size() {
int classFileSize() {
int size = 0;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Vector lentries = entries;
int count = lentries.size();
for (int i = 0; i < count; i++) {
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/compiler/ClassBuilder.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/compiler/ClassBuilder.java
index 07dcdc3626..7acb679686 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/compiler/ClassBuilder.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/compiler/ClassBuilder.java
@@ -85,6 +85,7 @@ class using the ClassBuilder's ClassFactory.
* the default no-arg constructor will be defined.
*/
ByteArray getClassBytecode() throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
/**
* the class's unqualified name
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/compiler/MethodBuilder.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/compiler/MethodBuilder.java
index 69d1b16358..17326c3ca2 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/compiler/MethodBuilder.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/compiler/MethodBuilder.java
@@ -62,6 +62,7 @@ public interface MethodBuilder {
/**
Push a parameter value.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ... =>
...,param_value
@@ -72,6 +73,7 @@ public interface MethodBuilder {
/**
Push a byte constant onto the stack
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ... =>
...,byte_value
@@ -90,6 +92,7 @@ public interface MethodBuilder {
/**
Push a short constant onto the stack
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ... =>
...,short_value
@@ -99,6 +102,7 @@ public interface MethodBuilder {
/**
Push a int constant onto the stack
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ... =>
...,int_value
@@ -108,6 +112,7 @@ public interface MethodBuilder {
/**
Push a long constant onto the stack
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ... =>
...,long_value
@@ -117,6 +122,7 @@ public interface MethodBuilder {
/**
Push a float constant onto the stack
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ... =>
...,float_value
@@ -126,6 +132,7 @@ public interface MethodBuilder {
/**
Push a double constant onto the stack
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ... =>
...,double_value
@@ -135,6 +142,7 @@ public interface MethodBuilder {
/**
Push a String constant onto the stack
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ... =>
...,String_value
@@ -144,6 +152,7 @@ public interface MethodBuilder {
/**
Push a typed null onto the stack
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ... =>
...,null
@@ -166,6 +175,7 @@ public interface MethodBuilder {
This call requires the instance (reference) to be pushed by the caller.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ...,field_ref =>
...,field_value
@@ -176,6 +186,8 @@ This call requires the instance (reference) to be pushed by the caller.
/**
Push the contents of the described static field onto the stack.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ... =>
...,field_value
@@ -183,6 +195,7 @@ This call requires the instance (reference) to be pushed by the caller.
public void getStaticField(String declaringClass, String fieldName, String fieldType);
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
Pop the top stack value and store it in the local field.
This call pushes the this instance required to access the field itself.
This call does not leave any value on the stack.
@@ -212,6 +225,9 @@ This call requires the instance (reference) to be pushed by the caller.
Like the Java language 'field = value', this leaves the value on the stack.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ...,value =>
...,value
@@ -224,6 +240,7 @@ This call requires the instance (reference) to be pushed by the caller.
Like the Java language 'field = value', this leaves the value on the stack.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ...,field_ref,value =>
...,value
@@ -238,6 +255,7 @@ can be pushed onto the stack between the pushNewStart() and pushNewComplete() me
calls.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ... => [unchanged]
...
@@ -253,6 +271,7 @@ Complete the sequence that was started with pushNewStart().
to the newly created object.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ...,value* => [numArgs number of values will be popped]
...,new_ref
@@ -265,6 +284,7 @@ Complete the sequence that was started with pushNewStart().
Create an instance of an array and push it onto the stack.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ... =>
...,array_ref
@@ -278,6 +298,8 @@ Complete the sequence that was started with pushNewStart().
/**
Push this onto the stack.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ... =>
...,this_ref
@@ -289,6 +311,7 @@ Complete the sequence that was started with pushNewStart().
by upcasting method parameters. It does not put any casting code into the
byte code stream. Can only be used for refrences.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ...,ref =>
...,ref
@@ -299,6 +322,7 @@ Complete the sequence that was started with pushNewStart().
Cast the top stack value. Correctly down-casts a reference or casts
a primitive type (e.g. int to short).
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ...,value =>
...,cast_value
@@ -311,6 +335,7 @@ a primitive type (e.g. int to short).
Pop the top stack value and push a boolean that is the result of
an instanceof check on the popped reference.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ...,ref =>
...,boolean_value
.
@@ -319,7 +344,9 @@ a primitive type (e.g. int to short).
/**
* Pop the top value off the stack
+//IC see: https://issues.apache.org/jira/browse/DERBY-167
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ..., value =>
...
.
@@ -349,6 +376,8 @@ a primitive type (e.g. int to short).
on the stack. If the stack contains a single
value then that is popped and used as the returned value.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack value =>
:empty:
or
@@ -361,6 +390,7 @@ a primitive type (e.g. int to short).
public void methodReturn();
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-742
Initiate a conditional sequence.
The top value on the stack (a reference) is popped and compared to 'null'.
If the value is null then the code following this call until the startElseCode()
@@ -381,11 +411,13 @@ the completeConditional() is called.
Each path through the ?: statement must leave the stack at the same depth
as the other.
+//IC see: https://issues.apache.org/jira/browse/DERBY-742
If the if or else code pops values from the stack that were before the conditional
value, then they must use the same number of values from the stack.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ...,ref =>
...
.
@@ -395,6 +427,7 @@ the completeConditional() is called.
public void conditionalIfNull();
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-742
Initiate a conditional sequence.
The top value on the stack must be a boolean and will be popped. If it
is true then the code following this call until the startElseCode()
@@ -403,6 +436,7 @@ the completeConditional() is called. See conditionalIfNull() for example
and restrictions.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ...,boolean_value =>
...
.
@@ -410,6 +444,7 @@ the completeConditional() is called. See conditionalIfNull() for example
public void conditionalIf();
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-742
Complete the true code path of a conditional.
*/
public void startElseCode();
@@ -477,6 +512,8 @@ Call a method previously described by describeMethod().
static methods
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ...,value* => [numArgs number of values will be popped]
...,return_value [void methods will not push a value]
@@ -493,6 +530,7 @@ Call a method previously described by describeMethod().
Call super(). Caller must only add this to a constructor.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ... =>
...
@@ -503,6 +541,7 @@ Call super(). Caller must only add this to a constructor.
/**
Pop an array refrence off the stack and push an element from that array.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ...,array_ref =>
...,value
@@ -514,6 +553,7 @@ Call super(). Caller must only add this to a constructor.
/**
Pop an array reference off the stack, store a value in the array at the passed in offset.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ...,array_ref, value =>
...
@@ -526,6 +566,7 @@ Call super(). Caller must only add this to a constructor.
/**
Swap the top two values on the stack.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ...,valueA,valueB =>
...,valueB,valueA
@@ -535,6 +576,7 @@ Call super(). Caller must only add this to a constructor.
/**
Duplicate the top value on the stack.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ...,value =>
...,value,value
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/context/ContextManager.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/context/ContextManager.java
index 33f44c485e..a532463e89 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/context/ContextManager.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/context/ContextManager.java
@@ -82,6 +82,7 @@ private static final class CtxStack {
// expensive, but those operations are infrequent.
private Context top_ = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-938
void push(Context context) {
stack_.add(context);
top_ = context;
@@ -89,6 +90,7 @@ void push(Context context) {
void pop() {
stack_.remove(stack_.size()-1);
top_ = stack_.isEmpty() ?
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
null : stack_.get(stack_.size()-1);
}
void remove(Context context) {
@@ -103,7 +105,9 @@ Context top() {
}
boolean isEmpty() { return stack_.isEmpty(); }
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
List getUnmodifiableList() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2884
return view_;
}
}
@@ -136,6 +140,7 @@ public void pushContext(Context newContext)
checkInterrupt();
final String contextId = newContext.getIdName();
CtxStack idStack = ctxTable.get(contextId);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
// if the stack is null, create a new one.
if (idStack == null) {
@@ -159,6 +164,7 @@ public void pushContext(Context newContext)
public Context getContext(String contextId) {
checkInterrupt();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
final CtxStack idStack = ctxTable.get(contextId);
if (SanityManager.DEBUG)
SanityManager.ASSERT( idStack == null ||
@@ -181,6 +187,7 @@ public void popContext()
// remove the top context from the global stack
Context theContext = holder.remove(holder.size()-1);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
// now find its id and remove it from there, too
final String contextId = theContext.getIdName();
@@ -210,6 +217,7 @@ void popContext(Context theContext)
final String contextId = theContext.getIdName();
final CtxStack idStack = ctxTable.get(contextId);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
// now remove it from its id's stack.
idStack.remove(theContext);
@@ -218,6 +226,7 @@ void popContext(Context theContext)
/**
* Is the ContextManager empty containing no Contexts.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1095
final boolean isEmpty()
{
return holder.isEmpty();
@@ -236,7 +245,9 @@ final boolean isEmpty()
* @see org.apache.derby.iapi.sql.conn.StatementContext#resetSavePoint()
*/
public final List getContextStack(String contextId) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
final CtxStack cs = ctxTable.get(contextId);
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
return cs == null ?
Collections.emptyList() :
cs.getUnmodifiableList();
@@ -267,6 +278,7 @@ public boolean cleanupOnError(Throwable error, boolean diagActive)
if (error instanceof ThreadDeath)
seenThreadDeath = (ThreadDeath) error;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4010
if (error instanceof PassThroughException) {
error = error.getCause();
}
@@ -279,6 +291,7 @@ public boolean cleanupOnError(Throwable error, boolean diagActive)
if (! shutdown)
{
// report an id for the message if possible
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
ContextImpl lcc =
(ContextImpl)getContext(ContextId.LANG_CONNECTION);
if (lcc != null) {
@@ -297,6 +310,7 @@ public boolean cleanupOnError(Throwable error, boolean diagActive)
if (!shutdown) // Do this only during normal processing.
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
ContextImpl sc = (ContextImpl) getContext(org.apache.derby.shared.common.reference.ContextId.LANG_STATEMENT);
// Output the SQL statement that failed in the log file.
if (sc != null)
@@ -341,6 +355,7 @@ the vector interface to do this.
break;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Context ctx = (holder.get(index));
lastHandler = ctx.isLastHandler(errorSeverity);
@@ -551,6 +566,9 @@ private boolean reportError(Throwable t) {
*/
public int getErrorSeverity(Throwable error) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4856
+//IC see: https://issues.apache.org/jira/browse/DERBY-4929
+//IC see: https://issues.apache.org/jira/browse/DERBY-289
if (error instanceof StandardException) {
return ((StandardException) error).getErrorCode();
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/context/ContextService.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/context/ContextService.java
index e47be138de..c0a8682aba 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/context/ContextService.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/context/ContextService.java
@@ -63,6 +63,7 @@ public final class ContextService //OLD extends Hashtable
and this is enforced by synchronization outside the ContextManager.
E.g for JDBC connections, synchronization at the JDBC level.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
ContextManagerStack containing ContextManagers - the current
thread is actively using multiple different ContextManagers,
with nesting. All ContextManagers in the stack will have
@@ -70,6 +71,7 @@ public final class ContextService //OLD extends Hashtable
set to -1. This is because nesting is solely represented by
the stack, with the current context manager on top of the stack.
This supports multiple levels of nesting across two stacks, e.g.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
C1->C2->C2->C1->C2.
@@ -77,6 +79,7 @@ public final class ContextService //OLD extends Hashtable
fast access to a list of candidate contexts. If one of the contexts has its activeThread
equal to the current thread then it is the current context manager.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
If the thread has pushed multiple contexts (e.g. open a new non-nested Derby connection
from a server side method) then threadContextList will contain a Stack. The value for each cm
will be a push order, with higher numbers being more recently pushed.
@@ -95,6 +98,7 @@ the context manager keeps track of the number of times it has been pushed (set).
for the lifetime of the request. In this case this variable will contain a WeakReference.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
Single thread for Connection execution.
threadContextList.get() == cm
@@ -184,6 +188,7 @@ public ContextService() {
ContextService.factory = this;
allContexts = new HashSet();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
}
@@ -193,11 +198,13 @@ public ContextService() {
public static void stop()
{
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
// For some unknown reason, the ContextManager and
// ContextService objects will not be garbage collected
// without the next two lines.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1095
ContextService fact = ContextService.factory;
if (fact != null) {
synchronized (fact) {
@@ -229,6 +236,7 @@ public static ContextService getFactory()
public static Context getContext(String contextId)
{
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
ContextManager cm = getFactory().getCurrentContextManager();
@@ -252,6 +260,8 @@ public static Context getContext(String contextId)
public static Context getContextOrNull(String contextId)
{
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
ContextService csf = factory;
@@ -301,6 +311,7 @@ public ContextManager getCurrentContextManager() {
if (list == null)
return null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
return ((ContextManagerStack) list).peek();
}
@@ -345,6 +356,7 @@ public void resetCurrentContextManager(ContextManager cm) {
}
if (cm.activeCount != -1) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1095
if (--cm.activeCount == 0) {
cm.activeThread = null;
@@ -364,6 +376,7 @@ public void resetCurrentContextManager(ContextManager cm) {
}
ContextManagerStack stack = (ContextManagerStack) tcl.get();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
// Remove the context manager at the top of the stack.
stack.pop();
@@ -410,6 +423,8 @@ public void resetCurrentContextManager(ContextManager cm) {
private boolean addToThreadList(Thread me, ContextManager associateCM) {
ThreadLocal tcl = threadContextList;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
if (tcl == null) {
// The context service is already stopped.
@@ -429,6 +444,7 @@ private boolean addToThreadList(Thread me, ContextManager associateCM) {
return true;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
ContextManagerStack stack;
if (list instanceof ContextManager) {
@@ -449,6 +465,7 @@ private boolean addToThreadList(Thread me, ContextManager associateCM) {
// Nested, need to create a Stack of ContextManagers,
// the top of the stack will be the active one.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
stack = new ContextManagerStack();
tcl.set(stack);
@@ -466,6 +483,7 @@ private boolean addToThreadList(Thread me, ContextManager associateCM) {
{
// existing stack, nesting represented
// by stack entries, not activeCount.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
stack = (ContextManagerStack) list;
}
@@ -567,6 +585,7 @@ public void notifyAllActiveThreads(Context c) {
synchronized (this) {
for (ContextManager cm : allContexts) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
Thread active = cm.activeThread;
@@ -576,11 +595,13 @@ public void notifyAllActiveThreads(Context c) {
if (active == null)
continue;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2564
final Thread fActive = active;
if (cm.setInterrupted(c))
{
try {
AccessController.doPrivileged(
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
new PrivilegedAction() {
public Void run() {
fActive.interrupt();
@@ -600,6 +621,7 @@ public Void run() {
* Remove a ContextManager from the list of all active
* contexts managers.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1095
synchronized void removeContext(ContextManager cm)
{
if (allContexts != null)
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/context/SystemContext.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/context/SystemContext.java
index 29fc8149b1..0e98fd5f88 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/context/SystemContext.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/context/SystemContext.java
@@ -50,6 +50,7 @@ public void cleanupOnError(Throwable t) {
return;
popMe();
+//IC see: https://issues.apache.org/jira/browse/DERBY-1095
if (severity >= ExceptionSeverity.SYSTEM_SEVERITY)
doShutdown = true;
@@ -77,6 +78,7 @@ public void cleanupOnError(Throwable t) {
} finally {
// we need this to happen even if we fail to print out a notice
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
getMonitor().shutdown();
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/crypto/CipherFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/crypto/CipherFactory.java
index 7a9e5d9337..71fae9ab47 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/crypto/CipherFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/crypto/CipherFactory.java
@@ -77,6 +77,7 @@ public String changeBootPassword(String changeString, Properties properties, Cip
throws StandardException;
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-862
Verify the external encryption key. Throws exception if unable to verify
that the encryption key is the same as that
used during database creation or if there are any problems when trying to do the
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/daemon/Serviceable.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/daemon/Serviceable.java
index f96b2f4e54..29d2d13f75 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/daemon/Serviceable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/daemon/Serviceable.java
@@ -110,6 +110,7 @@ public interface Serviceable {
If it doesn't make any difference if this work is done on a the user thread
immediately or if it is performed by another thread asynchronously
later, then return false.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
@return true if this work shold happen immediately on the user thread
*/
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/diag/DiagnosticUtil.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/diag/DiagnosticUtil.java
index c809ce37db..7d17006dc9 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/diag/DiagnosticUtil.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/diag/DiagnosticUtil.java
@@ -24,6 +24,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
/**
The Diagnostic framework is meant to provide a way to include as much
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
diagnostic capability within the distributed release of the Derby
product without adversely affecting the runtime speed or foot print of
a running configuration that needs not use this information.
@@ -82,6 +83,7 @@ public static Diagnosticable findDiagnostic(Object ref)
className.substring(0, lastDot) +
"D_" + className.substring(lastDot);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Class> diagClass;
try {
@@ -97,6 +99,7 @@ public static Diagnosticable findDiagnostic(Object ref)
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Constructor> constructor = diagClass.getConstructor();
Diagnosticable diag_obj = (Diagnosticable) diagClass.getConstructor().newInstance();
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/AccessibleByteArrayOutputStream.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/AccessibleByteArrayOutputStream.java
index cd532ab6bd..87cd73a68b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/AccessibleByteArrayOutputStream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/AccessibleByteArrayOutputStream.java
@@ -69,6 +69,7 @@ public byte[] getInternalByteArray() {
*/
public void readFrom(InputStream in) throws IOException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-552
byte[] buffer = new byte[8192];
for(;;)
@@ -90,6 +91,7 @@ public void readFrom(InputStream in) throws IOException
*/
public InputStream getInputStream()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5090
return new ByteArrayInputStream(buf, 0, count);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/ArrayInputStream.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/ArrayInputStream.java
index f9b5631cf1..e3c9254799 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/ArrayInputStream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/ArrayInputStream.java
@@ -49,6 +49,7 @@ public final class ArrayInputStream extends InputStream implements LimitObjectIn
*
*/
public ArrayInputStream() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6885
this(ArrayUtil.EMPTY_BYTE_ARRAY);
}
@@ -72,6 +73,7 @@ public ArrayInputStream(byte[] data) {
/**
Set the array of bytes to be read.
Position is set to zero.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2118
@param data The data in the stream
*/
@@ -84,6 +86,7 @@ public void setData(byte[] data) {
/**
Return a reference to the array of bytes this stream is going to read
from so that caller may load it with stuff
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
@return the data in the stream
*/
@@ -176,6 +179,7 @@ public void setLimit(int offset, int length) throws IOException {
start = offset;
end = offset + length;
position = start;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2118
if ((offset < 0) || (length < 0) || (end > pageData.length)) {
start = end = position = 0;
@@ -192,6 +196,7 @@ public final void setLimit(int length) throws IOException {
start = position;
end = position + length;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2118
if (end > pageData.length) {
start = end = position = 0;
throw new EOFException();
@@ -204,6 +209,7 @@ public final void setLimit(int length) throws IOException {
@see Limit#clearLimit
*/
public final int clearLimit() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2118
start = 0;
int remainingBytes = end - position;
end = pageData.length;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/CloseFilterInputStream.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/CloseFilterInputStream.java
index b22920be39..836a687390 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/CloseFilterInputStream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/CloseFilterInputStream.java
@@ -36,6 +36,7 @@ public class CloseFilterInputStream
/** Message, modeled after CloseFilterInputStream in the client. */
private static final String MESSAGE =
+//IC see: https://issues.apache.org/jira/browse/DERBY-5090
MessageService.getTextMessage(MessageId.OBJECT_CLOSED);
/** Tells if this stream has been closed. */
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/CompressedNumber.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/CompressedNumber.java
index 151e970852..d3bb50b5dc 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/CompressedNumber.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/CompressedNumber.java
@@ -54,6 +54,7 @@ public abstract class CompressedNumber {
Write a compressed integer only supporting signed values.
Formats are (with x representing value bits):
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
1 Byte - 00xxxxxx Represents the value <= 63 (0x3f)
2 Byte - 01xxxxxx xxxxxxxx Represents the value > 63 && <= 16383 (0x3fff)
4 byte - 1xxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx Represents the value > 16383 && <= MAX_INT
@@ -291,6 +292,7 @@ public static final int sizeInt(int value) {
Formats are (with x representing value bits):
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
2 byte - 00xxxxxx xxxxxxxx Represents the value <= 16383 (0x3fff)
4 byte - 01xxxxxx xxxxxxxx xxxxxxxx xxxxxxxx Represents the value > 16383 && <= 0x3fffffff
8 byte - 1xxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx Represents the value > 0x3fffffff && <= MAX_LONG
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/DebugByteTeeOutputStream.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/DebugByteTeeOutputStream.java
index 8f0faa4d49..d22db9e5ab 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/DebugByteTeeOutputStream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/DebugByteTeeOutputStream.java
@@ -46,6 +46,7 @@ public void write(byte[] b, int off, int len) throws IOException {
void checkObject(Formatable f) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2598
ByteArrayInputStream in =
new ByteArrayInputStream(tee.getInternalByteArray(), 0, tee.size());
@@ -77,6 +78,7 @@ void checkObject(Formatable f) {
// for debugging purposes print this both to derby.log and to
// System.out.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2598
String err_msg =
"FormatableError:read error : " + t.toString() +
"\nFormatableError:class written : " + f.getClass();
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/DynamicByteArrayOutputStream.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/DynamicByteArrayOutputStream.java
index b79bdeda12..8449ee1c8b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/DynamicByteArrayOutputStream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/DynamicByteArrayOutputStream.java
@@ -231,6 +231,7 @@ public void discardLeft(int amountToShrinkBy) {
expansion.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
buf.length < 128k - increase by 4k
buf.length < 1Mb - increase by 128k
otherwise increase by 1Mb.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/FileUtil.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/FileUtil.java
index 53d1865aed..4f867ba2a7 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/FileUtil.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/FileUtil.java
@@ -206,6 +206,8 @@ public static boolean copyDirectory( StorageFactory storageFactory,
if (entry.isDirectory())
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-304
+//IC see: https://issues.apache.org/jira/browse/DERBY-239
if(copySubDirs) {
if (!copyDirectory( storageFactory, entry,
new File(to,fileName), buffer,
@@ -239,10 +241,15 @@ public static boolean copyFile( StorageFactory storageFactory, StorageFile from,
InputStream from_s = null;
FileOutputStream to_s = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6503
try {
from_s = from.getInputStream();
to_s = new FileOutputStream( to);
limitAccessToOwner(to);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5363
+//IC see: https://issues.apache.org/jira/browse/DERBY-5363
+//IC see: https://issues.apache.org/jira/browse/DERBY-5363
+//IC see: https://issues.apache.org/jira/browse/DERBY-5363
if (buf == null)
buf = new byte[BUFFER_SIZE]; // reuse this buffer to copy files
@@ -311,7 +318,9 @@ public static boolean copyDirectory( WritableStorageFactory storageFactory,
return false;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6503
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5363
to.limitAccessToOwner();
} catch (IOException ioe) {
return false;
@@ -519,6 +528,7 @@ public static void limitAccessToOwner(File file) throws IOException {
Property.STORAGE_USE_DEFAULT_FILE_PERMISSIONS);
if (value != null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6865
if (Boolean.parseBoolean(value.trim())) {
return;
}
@@ -535,6 +545,7 @@ public static void limitAccessToOwner(File file) throws IOException {
// First attempt to limit access using the java.io.File class.
// If it is successful, that's it and we're done.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6521
if (limitAccessToOwnerViaFile(file)) {
return;
}
@@ -597,6 +608,7 @@ private static boolean limitAccessToOwnerViaFileAttributeView(File file)
throws IOException {
Path fileP = file.toPath();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6865
PosixFileAttributeView posixView = Files.getFileAttributeView(
fileP, PosixFileAttributeView.class);
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/FormatIdInputStream.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/FormatIdInputStream.java
index dceb62b6c3..823f369ba3 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/FormatIdInputStream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/FormatIdInputStream.java
@@ -44,6 +44,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
information about the streams format and capabilites.
*/
public final class FormatIdInputStream extends DataInputStream
+//IC see: https://issues.apache.org/jira/browse/DERBY-4520
+//IC see: https://issues.apache.org/jira/browse/DERBY-3650
implements ErrorObjectInput, Resetable, CloneableStream
{
protected ClassFactory cf;
@@ -204,6 +206,7 @@ ClassFactory getClassFactory() {
if (cf == null) {
ClassFactoryContext cfc =
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
(ClassFactoryContext) getContextOrNull
(ClassFactoryContext.CONTEXT_ID);
@@ -265,6 +268,7 @@ public InputStream cloneStream() {
*/
private static Context getContextOrNull( final String contextID )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getContextOrNull( contextID );
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/Formatable.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/Formatable.java
index d88f8a30cf..8f4c5f85f4 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/Formatable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/Formatable.java
@@ -24,6 +24,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.io.Externalizable;
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
Derby interface for creating a stored form for
an object and re-constructing an equivalent object
from this stored form. The object which creates the
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/FormatableArrayHolder.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/FormatableArrayHolder.java
index 0ce8298d58..2c68b60901 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/FormatableArrayHolder.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/FormatableArrayHolder.java
@@ -75,6 +75,7 @@ public FormatableArrayHolder(Object[] array)
"array input to constructor is null, code can't handle this.");
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6188
setArray( array );
}
@@ -91,6 +92,7 @@ public void setArray(Object[] array)
"array input to setArray() is null, code can't handle this.");
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6188
this.array = ArrayUtil.copy( array );
}
@@ -105,6 +107,7 @@ public void setArray(Object[] array)
*/
public E[] getArray(Class arrayClass)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6292
return Arrays.copyOf(array, array.length, arrayClass);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/FormatableBitSet.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/FormatableBitSet.java
index 7bf016def8..49daf0d23b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/FormatableBitSet.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/FormatableBitSet.java
@@ -74,6 +74,7 @@ public final class FormatableBitSet implements Formatable, Cloneable
private transient int lengthAsBits;
private final void checkPosition(int p) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
if (p < 0 || lengthAsBits <= p) {
throw new
IllegalArgumentException("Bit position "+p+
@@ -99,6 +100,7 @@ private final void checkPosition(int p) {
*/
public FormatableBitSet()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6885
value = ArrayUtil.EMPTY_BYTE_ARRAY;
}
@@ -109,6 +111,7 @@ public FormatableBitSet()
*/
public FormatableBitSet(int numBits)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
if (numBits < 0) {
throw new
IllegalArgumentException("Bit set size "+ numBits +
@@ -135,6 +138,7 @@ private void initializeBits(int numBits)
*/
public FormatableBitSet(byte[] newValue)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6188
value = ArrayUtil.copy( newValue );
bitsInLastByte = 8;
lengthAsBits = calculateLength(newValue.length);
@@ -182,6 +186,7 @@ public Object clone()
*/
public boolean invariantHolds() {
// Check that all bits will fit in byte array
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
final int arrayLengthAsBits = value.length*8;
if (lengthAsBits > arrayLengthAsBits) { return false; }
@@ -275,6 +280,7 @@ public byte[] getByteArray()
value = data;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6188
return ArrayUtil.copy( value );
}
@@ -292,10 +298,12 @@ public byte[] getByteArray()
*/
public void grow(int n)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
if (SanityManager.DEBUG) {
SanityManager.ASSERT(invariantHolds(), "broken invariant");
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
if (n < 0) {
throw new IllegalArgumentException("Bit set cannot grow from "+
lengthAsBits+" to "+n+" bits");
@@ -307,6 +315,7 @@ public void grow(int n)
int newNumBytes = FormatableBitSet.numBytesFromBits(n);
// is there enough room in the existing array
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
if (newNumBytes > value.length) {
/*
** We didn't have enough bytes in value, so we need
@@ -333,10 +342,12 @@ public void grow(int n)
*/
public void shrink(int n)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
if (SanityManager.DEBUG) {
SanityManager.ASSERT(invariantHolds(), "broken invariant");
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
if (n < 0 || n > lengthAsBits) {
throw new
IllegalArgumentException("Bit set cannot shrink from "+
@@ -377,6 +388,7 @@ public void shrink(int n)
*/
public boolean equals(Object other)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5022
if (other instanceof FormatableBitSet)
{
FormatableBitSet that = (FormatableBitSet) other;
@@ -508,6 +520,7 @@ public int hashCode()
public final boolean isSet(int position)
{
checkPosition(position);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
final int byteIndex = udiv8(position);
final byte bitIndex = umod8(position);
return ((value[byteIndex] & (0x80>>bitIndex)) != 0);
@@ -535,6 +548,7 @@ public final boolean get(int position)
public void set(int position)
{
checkPosition(position);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
final int byteIndex = udiv8(position);
final byte bitIndex = umod8(position);
value[byteIndex] |= (0x80>>bitIndex);
@@ -548,7 +562,9 @@ public void set(int position)
*/
public void clear(int position)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
checkPosition(position);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
final int byteIndex = udiv8(position);
final byte bitIndex = umod8(position);
value[byteIndex] &= ~(0x80>>bitIndex);
@@ -574,6 +590,7 @@ public void clear()
* @return the number of bytes
*/
private static int numBytesFromBits(int bits) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
return (bits + 7) >> 3;
}
@@ -588,6 +605,7 @@ private static int numBytesFromBits(int bits) {
private static byte
numBitsInLastByte(int bits)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
if (bits == 0) return 0;
byte lastbits = umod8(bits);
return (lastbits != 0 ? lastbits : 8);
@@ -606,6 +624,7 @@ public String toString()
StringBuffer str = new StringBuffer(getLength()*8*3);
str.append("{");
boolean first = true;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
for (int inPosition = 0; inPosition < getLength(); inPosition++)
{
if (isSet(inPosition))
@@ -645,6 +664,7 @@ public static int maxBitsForSpace(int numBytes)
* @return the zero-based index of the first set bit in the argument byte
*/
private static byte firstSet(byte v) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
if ((v & 0x80) != 0) {
return 0;
}
@@ -704,6 +724,7 @@ public int anySetBit() {
* beyondBit is set
*/
public int anySetBit(int beyondBit) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
if (SanityManager.DEBUG) {
SanityManager.ASSERT(invariantHolds(), "broken invariant");
}
@@ -735,6 +756,7 @@ public int anySetBit(int beyondBit) {
*/
public void or(FormatableBitSet otherBit)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
if (otherBit == null) {
return;
}
@@ -761,6 +783,7 @@ public void or(FormatableBitSet otherBit)
*/
public void copyFrom( FormatableBitSet that )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6188
System.arraycopy( that.getByteArray(), 0, value, 0, that.getLengthInBytes());
}
@@ -837,6 +860,7 @@ public void xor(FormatableBitSet otherBit)
*/
public int getNumBitsSet()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2191
if (SanityManager.DEBUG) {
SanityManager.ASSERT(invariantHolds(),"broken invariant");
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/InputStreamUtil.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/InputStreamUtil.java
index 01382af6b4..ee3e06b4f3 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/InputStreamUtil.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/InputStreamUtil.java
@@ -121,6 +121,7 @@ public static int readLoop(InputStream in,
* if the param 'is' equals null.
*/
public static long skipUntilEOF(InputStream is) throws IOException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3770
if(is == null)
throw new NullPointerException();
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/LimitInputStream.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/LimitInputStream.java
index 0c8061e18a..7ed8d7a0c9 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/LimitInputStream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/LimitInputStream.java
@@ -153,6 +153,7 @@ public void setInput(InputStream in) {
* @return {@code false}
*/
public boolean markSupported() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4245
return false;
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/StoredFormatIds.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/StoredFormatIds.java
index acf5f2c184..ce59a5d3cc 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/StoredFormatIds.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/StoredFormatIds.java
@@ -37,6 +37,7 @@ and another may restore (read) the object. The implication of this
The interface(s) the stored object must support. Any implementation
which reads the object must support these interfaces.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6168
The format of the stored object. All implementations which support
the format must be able to read and write it.
@@ -48,6 +49,7 @@ The interface(s) the stored object must support. Any implementation
When you add a format id to this file, please include the list
of interfaces an implementation must support when it supports
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
the format id. When Derby code reads a stored form it returns an
object of a Class which supports the stored form. A reader may
cast this object to any interface listed in this file. It is an error for
@@ -58,6 +60,7 @@ the reader to cast the object to a class or interface not listed in this
states the name of the class. The first implementation of a format defines
the stored form.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
This interface defines all the format ids for Derby.
If you define a format id please be sure to declare it in this
file. If you remove support for a one please document that the
@@ -320,6 +323,7 @@ class org.apache.derby.impl.sql.catalog.TableDescriptorFinder
(MIN_ID_2 + 137);
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
class org.apache.derby.impl.sql.catalog.CoreDDFinderClassInfo
*/
static public final int ROUTINE_PERMISSION_FINDER_V01_ID =
@@ -338,6 +342,7 @@ class org.apache.derby.impl.sql.catalog.CoreDDFinderClassInfo
(MIN_ID_2 + 463);
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-3666
class org.apache.derby.impl.sql.catalog.CoreDDFinderClassInfo
*/
static public final int ROLE_GRANT_FINDER_V01_ID =
@@ -1456,6 +1461,7 @@ class org.apache.derby.impl.sql.GenericColumnDescriptor
public static final int ACCESS_T_INTCOL_V1_ID =
(MIN_ID_4 + 4);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
public static final int ACCESS_B2I_V4_ID =
(MIN_ID_2 + 466);
@@ -1464,6 +1470,7 @@ class org.apache.derby.impl.sql.GenericColumnDescriptor
(MIN_ID_2 + 467);
public static final int ACCESS_B2I_V5_ID =
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
(MIN_ID_2 + 470);
/******************************************************************
**
@@ -1566,6 +1573,7 @@ class org.apache.derby.impl.sql.GenericColumnDescriptor
/* org.apache.derby.impl.store.raw.log.ChecksumOperation */
public static final int LOGOP_CHECKSUM =
(MIN_ID_2 + 453);
+//IC see: https://issues.apache.org/jira/browse/DERBY-96
/* org.apache.derby.impl.store.raw.data.CompressSpacePageOperation10_2 */
public static final int LOGOP_COMPRESS10_2_SPACE =
@@ -1578,6 +1586,7 @@ class org.apache.derby.impl.sql.GenericColumnDescriptor
/* org.apache.derby.impl.store.raw.data.EncryptContainerOperation */
public static final int LOGOP_ENCRYPT_CONTAINER =
(MIN_ID_2 + 459);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1156
/* org.apache.derby.impl.store.raw.data.EncryptContainerUndoOperation */
public static final int LOGOP_ENCRYPT_CONTAINER_UNDO =
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/TypedFormat.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/TypedFormat.java
index afd2bac034..7ed900c406 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/TypedFormat.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/io/TypedFormat.java
@@ -21,6 +21,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
package org.apache.derby.iapi.services.io;
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
Derby interface for identifying the format id for the
stored form of an object. Objects of different classes may
have the same format id if:
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/jmx/ManagementService.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/jmx/ManagementService.java
index 765533a18c..497b768dbf 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/jmx/ManagementService.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/jmx/ManagementService.java
@@ -72,6 +72,7 @@ public interface ManagementService extends ManagementMBean {
* @throws StandardException on error
*/
public Object registerMBean(T bean,
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
Class beanInterface,
String keyProperties)
throws StandardException;
@@ -92,5 +93,6 @@ public Object registerMBean(T bean,
* @return the quoted value
* @see javax.management.ObjectName#quote(String)
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6733
String quotePropertyValue(String value);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/ClassFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/ClassFactory.java
index bb10f2957e..5db3c843bb 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/ClassFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/ClassFactory.java
@@ -60,6 +60,7 @@ public GeneratedClass loadGeneratedClass(String fullyQualifiedName, ByteArray cl
@param className The name of the class to load
@return the corresponding class object
@exception ClassNotFoundException Class cannot be found, or
+//IC see: https://issues.apache.org/jira/browse/DERBY-485
a SecurityException or LinkageException was thrown loading the class.
*/
public Class loadApplicationClass(String className)
@@ -71,6 +72,7 @@ public Class loadApplicationClass(String className)
@param classDescriptor Descriptor for class
@return the corresponding class
@exception ClassNotFoundException Class cannot be found, or
+//IC see: https://issues.apache.org/jira/browse/DERBY-485
a SecurityException or LinkageException was thrown loading the class.
*/
public Class loadApplicationClass(ObjectStreamClass classDescriptor)
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/ClassFactoryContext.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/ClassFactoryContext.java
index 438ee719e8..aca71316b5 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/ClassFactoryContext.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/ClassFactoryContext.java
@@ -83,6 +83,7 @@ public final ClassFactory getClassFactory() {
*/
public final void cleanupOnError(Throwable error) {
if (error instanceof StandardException) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1095
StandardException se = (StandardException) error;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/ClassInfo.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/ClassInfo.java
index 79832ea9ac..5223c1aa56 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/ClassInfo.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/ClassInfo.java
@@ -70,6 +70,7 @@ public final Class getClassObject() {
*/
public Object getNewInstance()
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throws InstantiationException,
IllegalAccessException,
InvocationTargetException,
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/ClassInspector.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/ClassInspector.java
index 5b65c0b120..bc53610bb2 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/ClassInspector.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/ClassInspector.java
@@ -78,6 +78,7 @@ public ClassInspector(ClassFactory cf) {
public boolean instanceOf(String className, Object obj)
throws ClassNotFoundException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Class> clazz = getClass(className);
// is className an untyped null
if (clazz == null)
@@ -99,6 +100,7 @@ public boolean assignableTo(String fromClassName, String toClassName)
{
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Class> toClass = getClass(toClassName);
// is toClass an untyped null
if (toClass == null) {
@@ -132,6 +134,7 @@ public boolean assignableTo(String fromClassName, String toClassName)
public boolean accessible(String className)
throws ClassNotFoundException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Class> theClass = getClass(className);
if (theClass == null)
return false;
@@ -362,6 +365,7 @@ public Member findPublicField(String receiverType,
Exception e = null;
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Class> receiverClass = getClass(receiverType);
if (receiverClass == null)
return null;
@@ -451,6 +455,8 @@ public Member findPublicConstructor(String receiverType,
boolean[] isParam)
throws ClassNotFoundException, StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Class> receiverClass = getClass(receiverType);
if (receiverClass == null)
return null;
@@ -520,6 +526,7 @@ public Class[][] getTypeBounds( Class parameterizedInterface, Class implementati
throws StandardException
{
if ( implementation == null ) { return null; }
+//IC see: https://issues.apache.org/jira/browse/DERBY-6243
Type[] genericInterfaces = implementation.getGenericInterfaces();
for ( Type genericInterface : genericInterfaces )
@@ -573,6 +580,7 @@ public boolean isVarArgsMethod( Member member )
* @throws StandardException on error
*/
public Class>[] getGenericParameterTypes(
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
Class parameterizedType, Class implementation )
throws StandardException
{
@@ -596,6 +604,7 @@ public Class>[] getGenericParameterTypes(
return null;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
return parameterTypes.toArray(new Class>[parameterTypes.size()]);
}
@@ -863,6 +872,7 @@ public static boolean primitiveType(String typeName)
if (ambiguous)
{
/* Put the parameter type names into a single string */
+//IC see: https://issues.apache.org/jira/browse/DERBY-5071
StringBuffer parmTypesString = new StringBuffer();
for (int i = 0; i < paramClasses.length; i++)
{
@@ -899,6 +909,7 @@ public static boolean primitiveType(String typeName)
@param className Name of class
@return the class
@exception ClassNotFoundException Class cannot be found, or
+//IC see: https://issues.apache.org/jira/browse/DERBY-485
a SecurityException or LinkageException was thrown loading the class.
*/
public Class> getClass(String className) throws ClassNotFoundException {
@@ -1055,6 +1066,7 @@ protected boolean classConvertableFromTo(Class fromClass, Class toClass, boolean
//
// OUT and INOUT args are arrays. Compare the cell types rather than the array types.
//
+//IC see: https://issues.apache.org/jira/browse/DERBY-4958
if ( fromClass.isArray() && toClass.isArray() )
{
return classConvertableFromTo( fromClass.getComponentType(), toClass.getComponentType(), mixTypes );
@@ -1185,6 +1197,7 @@ public String getDeclaringClass(Member method)
* parameterized type.
*/
private Class[][] findTypeBounds(ParameterizedType pt) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6243
Type[] actualTypeArguments = pt.getActualTypeArguments();
int argCount = actualTypeArguments.length;
Class[][] retval = new Class[argCount][];
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/GeneratedByteCode.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/GeneratedByteCode.java
index 7acdf54c9e..d845715b71 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/GeneratedByteCode.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/GeneratedByteCode.java
@@ -40,6 +40,8 @@ public interface GeneratedByteCode {
*/
public void initFromContext(Context context)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-418
+//IC see: https://issues.apache.org/jira/browse/DERBY-1142
/**
Set the Generated Class. Call by the class manager just after
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/InstanceGetter.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/InstanceGetter.java
index 9e2f3531a6..522cad2c76 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/InstanceGetter.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/loader/InstanceGetter.java
@@ -37,6 +37,7 @@ public interface InstanceGetter {
*/
public Object getNewInstance()
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throws InstantiationException,
IllegalAccessException,
InvocationTargetException,
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/locks/Latch.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/locks/Latch.java
index 21119321fb..064cec61be 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/locks/Latch.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/locks/Latch.java
@@ -28,6 +28,7 @@ public interface Latch {
/**
Get the compatibility space the latch is held in.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
@return the latch's compatibility space
*/
@@ -35,6 +36,7 @@ public interface Latch {
/**
Get the object the latch is held on.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
@return the object the latch is held on
*/
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/locks/LockFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/locks/LockFactory.java
index 64adc94084..e144b02dd1 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/locks/LockFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/locks/LockFactory.java
@@ -49,6 +49,7 @@ public interface LockFactory extends PropertySetCallback {
public CompatibilitySpace createCompatibilitySpace(LockOwner owner);
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
Lock an object within a compatibility space
and associate the lock with a group object,
waits up to timeout milli-seconds for the object to become unlocked. A
@@ -76,6 +77,7 @@ public interface LockFactory extends PropertySetCallback {
could not be granted.
@exception StandardException if a deadlock has occurred (message id
+//IC see: https://issues.apache.org/jira/browse/DERBY-6323
will be LockFactory.Deadlock), or if the wait for the lock timed
out (message id will be LockFactory.TimeOut), or if another thread
interrupted this thread while it was waiting for the lock (this will
@@ -84,6 +86,7 @@ interrupted this thread while it was waiting for the lock (this will
any other error occurs when locking the object
*/
public boolean lockObject(CompatibilitySpace compatibilitySpace,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
Object group, Lockable ref, Object qualifier,
int timeout)
throws StandardException;
@@ -139,6 +142,7 @@ public void transfer(CompatibilitySpace compatibilitySpace,
public boolean anyoneBlocked();
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
Return true if locks are held in this compatibility space and
this group.
@@ -168,6 +172,7 @@ public boolean areLocksHeld(CompatibilitySpace compatibilitySpace,
Zero duration means the lock is released as soon as it is obtained.
A compatibility space in an space where lock requests are assumed to be
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
compatible and granted by the lock manager if the trio
{compatibilitySpace, ref, qualifier} are equal (i.e. reference equality
for qualifier and compatibilitySpace, equals() method for ref).
@@ -187,6 +192,7 @@ public boolean areLocksHeld(CompatibilitySpace compatibilitySpace,
could not be granted.
@exception StandardException if a deadlock has occurred (message id
+//IC see: https://issues.apache.org/jira/browse/DERBY-6323
will be LockFactory.Deadlock), or if the wait for the lock timed
out (message id will be LockFactory.TimeOut), or if another thread
interrupted this thread while it was waiting for the lock (this will
@@ -196,6 +202,7 @@ interrupted this thread while it was waiting for the lock (this will
*/
public boolean zeroDurationlockObject(CompatibilitySpace compatibilitySpace,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
Lockable ref, Object qualifier,
int timeout)
throws StandardException;
@@ -214,6 +221,7 @@ public boolean isLockHeld(CompatibilitySpace compatibilitySpace,
Object group, Lockable ref, Object qualifier);
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-4565
Get the lock timeout in milliseconds. A negative number means that
there is no timeout.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/locks/Lockable.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/locks/Lockable.java
index da8ca67665..3a329843d7 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/locks/Lockable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/locks/Lockable.java
@@ -42,6 +42,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
Otherwise the request is granted if the following expression evaluates
to true for every other lock { CSn, Qn} held on L
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/locks/ShExLockable.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/locks/ShExLockable.java
index ddc764d889..632a77962d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/locks/ShExLockable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/locks/ShExLockable.java
@@ -102,6 +102,7 @@ public boolean lockAttributes(int flag, Hashtable attributes)
return false;
// No containerId, but need something in there so it can print
attributes.put(VirtualLockTable.CONTAINERID, -1);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
attributes.put(VirtualLockTable.LOCKNAME, this.toString() );
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/memory/LowMemory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/memory/LowMemory.java
index 290d3dc607..0b05fec93d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/memory/LowMemory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/memory/LowMemory.java
@@ -101,6 +101,7 @@ public void setLowMemory() {
interrupted = true;
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
if (interrupted) {
// reinstate flag
Thread.currentThread().interrupt();
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/DerbyObservable.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/DerbyObservable.java
index 67698a0a38..cf6dcfc64f 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/DerbyObservable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/DerbyObservable.java
@@ -67,6 +67,7 @@ public synchronized void addObserver(DerbyObserver observer)
{
if (observer == null) { throw new IllegalArgumentException("Null arguments not allowed."); }
+//IC see: https://issues.apache.org/jira/browse/DERBY-6891
if (!_observers.contains(observer)) { _observers.add(observer); }
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/ModuleControl.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/ModuleControl.java
index a31010cb3d..c3df2fca5e 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/ModuleControl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/ModuleControl.java
@@ -56,6 +56,7 @@ be found through a findModule(). In this case the module's stop() method
This attributes properties set has the second default properties set as
its default. This set (which could be null) contains the properties
that the user set on their DriverManager.getConnection() call, and are thus
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
not owned by Derby code, and thus must not be modified by Derby
code.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/ModuleFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/ModuleFactory.java
index 016d9603f0..b15f41904b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/ModuleFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/ModuleFactory.java
@@ -181,6 +181,7 @@ implement the passed in protocol (java interface class name).
Do not call directly - use Monitor.startPersistentService()
+//IC see: https://issues.apache.org/jira/browse/DERBY-927
The poperty set passed in is for boot options for the modules
required to start the service. It does not support defining different
or new modules implementations.
@@ -277,6 +278,7 @@ public Object startModule(boolean create, Object service, String protocol,
/**
Return a property from the JVM's system set.
+//IC see: https://issues.apache.org/jira/browse/DERBY-623
In a Java2 environment this will be executed as a privileged block
if and only if the property starts with 'derby.'.
If a SecurityException occurs, null is returned.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/Monitor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/Monitor.java
index dd0c7b839d..5402d5b2d1 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/Monitor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/Monitor.java
@@ -169,6 +169,7 @@ by another service (or the monitor itself) but are not fundamentally part of the
The properties set of the service (i.e. that passed into Monitor.createPersistentService()
or Monitor.startService()).
The System (JVM) properties set (i.e. java.lang.System.getProperties()).
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
The application properties set (i.e. obtained from the derby.properties file).
The default implementation properties set (i.e. obtained from the
/org/apache/derby/modules.properties resource).
@@ -285,8 +286,11 @@ Execute the run() method of startCode (if startCode was not null).
@SuppressWarnings("ResultOfObjectAllocationIgnored")
public static void startMonitor(Properties bootProperties, PrintWriter logging) {
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6117
+//IC see: https://issues.apache.org/jira/browse/DERBY-6617
try {
new org.apache.derby.impl.services.monitor.FileMonitor(bootProperties, logging);
} catch (AccessControlException e) {
@@ -301,6 +305,7 @@ of the monitor (ModuleFactory).
public static boolean setMonitor(ModuleFactory theMonitor) {
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
synchronized (syncMe) {
@@ -315,6 +320,7 @@ public static boolean setMonitor(ModuleFactory theMonitor) {
public static void clearMonitor() {
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
// the monitor reference needs to remain valid
@@ -330,6 +336,7 @@ public static void clearMonitor() {
*/
public static ModuleFactory getMonitor() {
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
return monitor;
@@ -360,6 +367,7 @@ public static HeaderPrintWriter getStream() {
*/
public static String getServiceName(Object serviceModule) {
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
return monitor.getServiceName(serviceModule);
@@ -383,6 +391,7 @@ then an instance will be created (see prologue) and booted as follows.
*/
public static Object startSystemModule(String factoryInterface)
throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
// Verify that we have permission to execute this method.
SecurityUtil.checkDerbyInternalsPrivilege();
@@ -404,6 +413,7 @@ public static Object startSystemModule(String factoryInterface)
public static Object findSystemModule(String factoryInterface) throws StandardException
{
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
Object module = getMonitor().findModule((Object) null,
@@ -421,8 +431,10 @@ public static Object findSystemModule(String factoryInterface) throws StandardEx
public static Object getSystemModule(String factoryInterface)
{
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3424
ModuleFactory monitor = getMonitor();
if (monitor == null)
return null;
@@ -455,6 +467,7 @@ public static Object bootServiceModule(boolean create, Object serviceModule,
throws StandardException {
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
Object module = monitor.startModule(create, serviceModule, factoryInterface,
@@ -490,6 +503,7 @@ public static Object bootServiceModule(boolean create, Object serviceModule,
throws StandardException {
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
Object module = monitor.startModule(create, serviceModule, factoryInterface, identifier, properties);
@@ -512,6 +526,7 @@ public static Object bootServiceModule(boolean create, Object serviceModule,
public static Object findServiceModule(Object serviceModule, String factoryInterface)
throws StandardException {
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
Object module = getMonitor().findModule(serviceModule, factoryInterface, (String) null);
@@ -522,6 +537,7 @@ public static Object findServiceModule(Object serviceModule, String factoryInter
public static Object getServiceModule(Object serviceModule, String factoryInterface)
{
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
Object module = getMonitor().findModule(serviceModule, factoryInterface, (String) null);
@@ -549,6 +565,7 @@ public static Object getServiceModule(Object serviceModule, String factoryInterf
*/
public static Object findService(String factoryInterface, String serviceName) {
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
return monitor.findService(factoryInterface, serviceName);
@@ -571,6 +588,7 @@ public static Object findService(String factoryInterface, String serviceName) {
If true is returned then findService should be used to see if the service
exists or not.
+//IC see: https://issues.apache.org/jira/browse/DERBY-927
The poperty set passed in is for boot options for the modules
required to start the service. It does not support defining different
or new modules implementations.
@@ -640,6 +658,9 @@ public static Object createPersistentService(String factoryInterface, String ser
throws StandardException {
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
if (SanityManager.DEBUG) {
@@ -653,13 +674,16 @@ public static void removePersistentService(String name)
throws StandardException
{
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
// For now we only allow dropping in-memory databases.
// This is mostly due to the fact that the current implementation for
// the on-disk back end doesn't handle logDevice when dropping.
// Security is another concern.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4590
if (!name.startsWith(PersistentService.INMEMORY + ":")) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4428
throw StandardException.newException(
SQLState.SERVICE_DIRECTORY_REMOVE_ERROR, name);
}
@@ -748,6 +772,7 @@ public static void logMessage(String messageText) {
}
public static void logTextMessage(String messageID, Object... args) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6262
getStream().println(MessageService.getTextMessage(messageID, args));
}
@@ -768,6 +793,7 @@ public static Locale getLocaleFromString(String localeDescription)
public static boolean isFullUpgrade(Properties startParams, String oldVersionInfo) throws StandardException {
// Verify that we have permission to execute this method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
SecurityUtil.checkDerbyInternalsPrivilege();
boolean fullUpgrade = Boolean.valueOf(startParams.getProperty(Attribute.UPGRADE_ATTR)).booleanValue();
@@ -813,6 +839,7 @@ public static boolean isDesiredType(Properties startParams, int desiredProperty
* if the bit intersect of the two values is no zero.
*/
public static boolean isDesiredType(int engineType, int desiredType) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2164
return (engineType & desiredType) != 0;
}
@@ -847,6 +874,7 @@ public static boolean isDesiredCreateType(Properties p, int type)
boolean plainCreate = Boolean.valueOf(p.getProperty(Attribute.CREATE_ATTR)).booleanValue();
if (plainCreate) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2164
return (type & EngineType.STANDALONE_DB) != 0;
}
@@ -858,6 +886,7 @@ public static boolean isDesiredCreateType(Properties p, int type)
* Logs the stack trace of the specified throwable object.
*/
public static void logThrowable(Throwable t) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2432
t.printStackTrace(getStream().getPrintWriter());
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/PersistentService.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/PersistentService.java
index 41c558c2b2..7769dc0d99 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/PersistentService.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/monitor/PersistentService.java
@@ -158,6 +158,7 @@ public void saveServiceProperties(String serviceName,
@exception StandardException Properties cannot be saved.
*/
public void saveServiceProperties(String serviceName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-5260
Properties properties)
throws StandardException;
@@ -179,6 +180,7 @@ public String createServiceRoot(String name, boolean deleteExisting)
cannot be converted into a canonical form.
@exception StandardException if an error happens when converting the
+//IC see: https://issues.apache.org/jira/browse/DERBY-6323
name (name probably invalid)
*/
public String getCanonicalServiceName(String name)
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/property/PropertyFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/property/PropertyFactory.java
index 3d9ada546f..32142d3343 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/property/PropertyFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/property/PropertyFactory.java
@@ -42,10 +42,12 @@ Licensed to the Apache Software Foundation (ASF) under one or more
An PropertyFactory is typically obtained from the Monitor:
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
// Get the current validation factory.
PropertyFactory af;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
af = (PropertyFactory) Monitor.findServiceModule(this, org.apache.derby.shared.common.reference.Module.PropertyFactory);
**/
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/property/PropertyUtil.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/property/PropertyUtil.java
index f58bce3778..92dace5df4 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/property/PropertyUtil.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/property/PropertyUtil.java
@@ -104,6 +104,7 @@ static int whereSet(String key, Dictionary set) {
boolean dbOnly = isDBOnly(set);
if (!dbOnly) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if (getMonitor().getJVMProperty(key) != null) {
return SET_IN_JVM;
}
@@ -129,6 +130,7 @@ public static boolean isDBOnly(Dictionary set) {
boolean dbOnly = Boolean.valueOf(
(value != null ? value.trim() : null)).booleanValue();
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
return dbOnly;
}
@@ -153,11 +155,13 @@ public static boolean isDBOnly(Properties set) {
*/
public static String[] getServicePropertyList()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6166
return ArrayUtil.copy( servicePropertyList );
}
/**
Find a system wide property.
+//IC see: https://issues.apache.org/jira/browse/DERBY-623
@param key The key to lookup
@return the value of the property or null if it does not exist.
@@ -176,6 +180,7 @@ public static String getSystemProperty(String key) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
This method can be used by a system that is not running Derby,
just to maintain the same lookup logic and security manager concerns
for finding derby.properties and reading system properties.
@@ -187,6 +192,7 @@ public static String getSystemProperty(String key) {
public static String getSystemProperty(String key, String defaultValue) {
ModuleFactory monitor = getMonitorLite();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
String value = monitor.getJVMProperty(key);
@@ -337,6 +343,9 @@ public static String getServiceProperty(PersistentSet set, String key, String de
(value != null ? value.trim() : value)).booleanValue();
if (!dbOnly) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
value = getMonitor().getJVMProperty(key);
if (value != null)
return value;
@@ -378,6 +387,7 @@ public static String getServiceProperty(PersistentSet set, String key)
@return true of the property is set to 'true, TRUE', false otherwise
*/
public static boolean getSystemBoolean(String key) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3388
return getSystemBoolean(key, false);
}
@@ -545,6 +555,7 @@ public static boolean booleanProperty(String p, Serializable v, boolean defaultV
String vS = ((String) v).trim();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
if ("TRUE".equals(StringUtil.SQLToUpperCase(vS)))
return true;
if ("FALSE".equals(StringUtil.SQLToUpperCase(vS)))
@@ -616,6 +627,7 @@ public static boolean isServiceProperty(String key)
* @exception StandardException on error
*/
public static boolean existsBuiltinUser (
+//IC see: https://issues.apache.org/jira/browse/DERBY-3673
PersistentSet set,
String username)
throws StandardException
@@ -704,6 +716,7 @@ public static boolean localNativeAuthenticationEnabled( Properties properties )
private static boolean systemPropertiesExistsBuiltinUser(String username)
{
ModuleFactory monitor = getMonitorLite();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
try {
Properties JVMProperties = System.getProperties();
@@ -758,6 +771,7 @@ private static boolean propertiesContainsBuiltinUser(Properties props,
*/
private static ModuleFactory getMonitor()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/property/PropertyValidation.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/property/PropertyValidation.java
index 7d01a029df..50829584ba 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/property/PropertyValidation.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/property/PropertyValidation.java
@@ -57,6 +57,7 @@ public Serializable doValidateApplyAndMap(TransactionController tc,
synchronized (this) {
for (int i = 0; i < notifyOnSet.size() ; i++) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
PropertySetCallback psc = notifyOnSet.get(i);
if (!psc.validate(key, value, d))
continue;
@@ -101,6 +102,7 @@ public Serializable doMap(String key,
Serializable mappedValue = null;
if (notifyOnSet != null) {
for (int i = 0; i < notifyOnSet.size() && mappedValue == null; i++) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
PropertySetCallback psc = notifyOnSet.get(i);
mappedValue = psc.map(key, value, set);
}
@@ -126,6 +128,7 @@ public void validateSingleProperty(String key,
if (notifyOnSet != null) {
for (int i = 0; i < notifyOnSet.size(); i++) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
PropertySetCallback psc = notifyOnSet.get(i);
psc.validate(key, value, set);
}
@@ -135,8 +138,10 @@ public void validateSingleProperty(String key,
public synchronized void addPropertySetNotification(PropertySetCallback who){
if (notifyOnSet == null)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
notifyOnSet = new Vector(1,1);
notifyOnSet.add(who);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/services/uuid/UUIDFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/services/uuid/UUIDFactory.java
index 7d439c3a6e..6f4c856f24 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/services/uuid/UUIDFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/services/uuid/UUIDFactory.java
@@ -38,6 +38,7 @@ Internal comment (not for user documentation):
*/
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Generates and recreates unique identifiers.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/LanguageFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/LanguageFactory.java
index 1a61cc2901..2607c53e97 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/LanguageFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/LanguageFactory.java
@@ -67,6 +67,8 @@ public interface LanguageFactory
*/
public ResultDescription getResultDescription
(
+//IC see: https://issues.apache.org/jira/browse/DERBY-4610
+//IC see: https://issues.apache.org/jira/browse/DERBY-3049
ResultDescription inputResultDescription,
int[] theCols
);
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/ParameterValueSet.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/ParameterValueSet.java
index 558c762532..0de5d47524 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/ParameterValueSet.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/ParameterValueSet.java
@@ -43,6 +43,7 @@ public interface ParameterValueSet
*/
void initialize(DataTypeDescriptor[] types) throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2335
/**
Set the mode of the parameter, called when setting up static method calls and stored procedures.
@@ -116,6 +117,7 @@ void registerOutParameter(int parameterIndex, int sqlType, int scale)
/**
Set the value of this user defined parameter to the passed in Object.
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
@param parameterIndex The position of the parameter
@param value It's value
@@ -133,6 +135,7 @@ void registerOutParameter(int parameterIndex, int sqlType, int scale)
/**
* Tells whether all the parameters are set and ready for execution.
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
OUT are not required to be set.
*
* @return true if all parameters are set, false if at least one
@@ -176,6 +179,7 @@ void registerOutParameter(int parameterIndex, int sqlType, int scale)
/**
Check that there are not output parameters defined
by the parameter set. If there are unknown parameter
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
types they are forced to input types. i.e. Derby static method
calls with parameters that are array.
@@ -216,6 +220,7 @@ void registerOutParameter(int parameterIndex, int sqlType, int scale)
* @exception StandardException if a database-access error occurs.
*/
DataValueDescriptor getReturnValueForSet() throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
/**
* Return the scale of the given parameter index in this pvs.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/PreparedStatement.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/PreparedStatement.java
index 2d7c19fe14..d0fffebe69 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/PreparedStatement.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/PreparedStatement.java
@@ -38,6 +38,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*
*/
public interface PreparedStatement
+//IC see: https://issues.apache.org/jira/browse/DERBY-2380
extends Dependent
{
@@ -74,6 +75,7 @@ public interface PreparedStatement
*
* @exception StandardException thrown if unable to perform
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-4279
void rePrepare(LanguageConnectionContext lcc)
throws StandardException;
@@ -206,6 +208,7 @@ ResultSet executeSubStatement(LanguageConnectionContext lcc,
* @throws StandardException if the index is out of range
*/
DataTypeDescriptor getParameterType( int idx ) throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6206
/**
* Return the SQL string that this statement is for.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/ResultColumnDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/ResultColumnDescriptor.java
index 2fd10c85b6..4e45e05c31 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/ResultColumnDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/ResultColumnDescriptor.java
@@ -57,6 +57,7 @@ public interface ResultColumnDescriptor
* is not in a schema (i.e. is a derived column), it returns NULL.
*/
String getSourceSchemaName();
+//IC see: https://issues.apache.org/jira/browse/DERBY-189
/**
* Get the name of the underlying(base) table this column comes from, if any.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/ResultSet.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/ResultSet.java
index 72b645561d..0281829f36 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/ResultSet.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/ResultSet.java
@@ -85,6 +85,7 @@ Only valid of returnsRows() returns false.
* @return The number of rows affect by the statement, so far.
*/
long modifiedRowCount();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
/**
* Returns a ResultDescription object, which describes the results
@@ -95,6 +96,8 @@ Only valid of returnsRows() returns false.
* @return A ResultDescription describing the results of the
* statement.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-4610
+//IC see: https://issues.apache.org/jira/browse/DERBY-3049
ResultDescription getResultDescription();
Activation getActivation();
@@ -221,6 +224,7 @@ Only valid of returnsRows() returns false.
* methods: getLastRow(), getNextRow(), getPreviousRow(),
* getFirstRow(), getRelativeRow(..) or getAbsoluteRow(..).
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1361
void clearCurrentRow();
/**
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/Statement.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/Statement.java
index 2653f30875..a2d7efec1a 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/Statement.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/Statement.java
@@ -70,6 +70,7 @@ public interface Statement
* execution-only version of the module (the prepare() method
* relies on compilation).
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
PreparedStatement prepare(LanguageConnectionContext lcc, boolean allowInternalSyntax) throws StandardException;
/**
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/StatementUtil.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/StatementUtil.java
index c1bc26d193..fc854e92f6 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/StatementUtil.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/StatementUtil.java
@@ -53,6 +53,7 @@ public static String typeName(int typeNumber)
break;
default:
+//IC see: https://issues.apache.org/jira/browse/DERBY-5879
retval = "UNKNOWN";
break;
}
@@ -86,6 +87,7 @@ public static String typeName(int typeNumber)
*/
public static SchemaDescriptor getSchemaDescriptor
(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6267
String schemaName,
boolean raiseError,
DataDictionary dataDictionary,
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/ASTVisitor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/ASTVisitor.java
index c5b7d51085..4db5f9f6fc 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/ASTVisitor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/ASTVisitor.java
@@ -1,6 +1,7 @@
/*
Derby - Class org.apache.derby.iapi.sql.compile.ASTVisitor
+//IC see: https://issues.apache.org/jira/browse/DERBY-4415
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/CompilerContext.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/CompilerContext.java
index 266a257194..c0a030212a 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/CompilerContext.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/CompilerContext.java
@@ -161,6 +161,8 @@ public interface CompilerContext extends Context
*/
OptimizerFactory getOptimizerFactory();
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
/**
* Get the TypeCompilerFactory from this CompilerContext.
@@ -317,6 +319,7 @@ public interface CompilerContext extends Context
*
*/
void createDependency(Dependent d, Provider p) throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
/**
* Add an object to the pool that is created at compile time
@@ -346,6 +349,7 @@ public interface CompilerContext extends Context
* @throws NullPointerException if {@code objs} is null
*/
void setSavedObjects(List objs);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
/**
* Set the in use state for the compiler context.
@@ -353,6 +357,7 @@ public interface CompilerContext extends Context
* @param inUse The new inUse state for the compiler context.
*/
void setInUse(boolean inUse);
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
/**
* Return the in use state for the compiler context.
@@ -382,6 +387,7 @@ public interface CompilerContext extends Context
*
*/
void setReliability(int reliability);
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
/**
* Return the reliability requirements of this clause. See setReliability()
@@ -399,6 +405,7 @@ public interface CompilerContext extends Context
* @return the compilation schema descirptor
*/
SchemaDescriptor getCompilationSchema();
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
/**
* Set the compilation schema descriptor for this compilation context.
@@ -408,6 +415,7 @@ public interface CompilerContext extends Context
* @return the previous compilation schema descirptor
*/
SchemaDescriptor setCompilationSchema(SchemaDescriptor newDefault);
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
/**
* Push a default schema to use when compiling.
@@ -422,6 +430,7 @@ public interface CompilerContext extends Context
*/
void pushCompilationSchema(SchemaDescriptor sd);
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
/**
* Pop the default schema to use when compiling.
@@ -438,6 +447,7 @@ public interface CompilerContext extends Context
*
* @exception StandardException Thrown on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
StoreCostController getStoreCostController(long conglomerateNumber)
throws StandardException;
@@ -447,6 +457,7 @@ StoreCostController getStoreCostController(long conglomerateNumber)
* @exception StandardException Thrown on error
*/
SortCostController getSortCostController() throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
/**
* Set the parameter list.
@@ -528,6 +539,7 @@ StoreCostController getStoreCostController(long conglomerateNumber)
* @param privType One of the privilege types in
* org.apache.derby.iapi.sql.conn.Authorizer.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
void pushCurrentPrivType( int privType);
void popCurrentPrivType();
@@ -554,6 +566,7 @@ StoreCostController getStoreCostController(long conglomerateNumber)
* @param privType CREATE_SCHEMA_PRIV, MODIFY_SCHEMA_PRIV or DROP_SCHEMA_PRIV
*/
void addRequiredSchemaPriv(String schema, String aid, int privType);
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
/**
* Add a routine execute privilege to the list of used routine privileges.
@@ -579,6 +592,7 @@ StoreCostController getStoreCostController(long conglomerateNumber)
/**
* @return The list of required privileges.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
List getRequiredPermissionsList();
/**
@@ -610,6 +624,7 @@ StoreCostController getStoreCostController(long conglomerateNumber)
*/
public boolean passesPrivilegeFilters( Visitable visitable )
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6429
/**
* Record that the compiler is entering a named scope. Increment the
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/JoinStrategy.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/JoinStrategy.java
index 3247ebd747..14f8fa7b26 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/JoinStrategy.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/JoinStrategy.java
@@ -116,6 +116,7 @@ OptimizablePredicateList getBasePredicates(
* @return The extra selectivity due to non-base predicates
*/
double nonBasePredicateSelectivity(Optimizable innerTable,
+//IC see: https://issues.apache.org/jira/browse/DERBY-582
OptimizablePredicateList predList)
throws StandardException;
@@ -178,6 +179,7 @@ public int maxCapacity( int userSpecifiedCapacity,
/** Get the operator symbol used to represent this join strategy in optimizer traces */
String getOperatorSymbol();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6211
/**
* Get the name of the result set method for base table scans
@@ -188,6 +190,7 @@ public int maxCapacity( int userSpecifiedCapacity,
* @param validatingCheckConstraint True of this is a special scan to
* validate a check constraint.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
String resultSetMethodName(
boolean bulkFetch,
boolean multiprobe,
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/OptTrace.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/OptTrace.java
index de2398a6f4..5c1fe7a805 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/OptTrace.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/OptTrace.java
@@ -103,6 +103,7 @@ public interface OptTrace
/** Say that we are remembering the current plan as the best join order so far. */
public void traceRememberingBestJoinOrder
( int joinPosition, int[] bestJoinOrder, int planType, CostEstimate planCost, JBitSet assignedTableMap );
+//IC see: https://issues.apache.org/jira/browse/DERBY-6211
/** Say that we are skipping a plan because it consumes too much memory. */
public void traceSkippingBecauseTooMuchMemory( int maxMemoryPerTable );
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/Optimizable.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/Optimizable.java
index 4a2055ab56..1554039f3b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/Optimizable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/Optimizable.java
@@ -376,6 +376,7 @@ public boolean feasibleJoinStrategy(OptimizablePredicateList predList,
*/
public boolean memoryUsageOK( double rowCount, int maxMemoryPerTable)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-106
/**
* Return the maximum capacity of the hash table, for hash join strategy
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/OptimizablePredicate.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/OptimizablePredicate.java
index a667a854cc..b3a021c332 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/OptimizablePredicate.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/OptimizablePredicate.java
@@ -134,6 +134,7 @@ int hasEqualOnColumnList(int[] baseColumnPositions,
*/
double selectivity(Optimizable optTable)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-582
/**
* Get the position of the index column that this predicate restricts.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/OptimizerFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/OptimizerFactory.java
index f727150eaf..dcb7df4978 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/OptimizerFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/OptimizerFactory.java
@@ -62,6 +62,7 @@ public Optimizer getOptimizer( OptimizableList optimizableList,
DataDictionary dDictionary,
RequiredRowOrdering requiredRowOrdering,
int numTablesInQuery,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6267
OptimizerPlan overridingPlan,
LanguageConnectionContext lcc)
throws StandardException;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/OptimizerPlan.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/OptimizerPlan.java
index 480fccb0d6..5db6b2ebdd 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/OptimizerPlan.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/OptimizerPlan.java
@@ -93,6 +93,7 @@ else if ( utd instanceof AliasDescriptor )
(
DataDictionary dataDictionary,
LanguageConnectionContext lcc,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6267
CompilerContext cc
)
throws StandardException;
@@ -155,6 +156,7 @@ public static final class Join extends OptimizerPlan
(
DataDictionary dataDictionary,
LanguageConnectionContext lcc,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6267
CompilerContext cc
)
throws StandardException
@@ -225,6 +227,7 @@ public static class DeadEnd extends OptimizerPlan
public DeadEnd( String name )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6211
_name = name;
}
@@ -272,6 +275,7 @@ protected RowSource() {}
(
DataDictionary dataDictionary,
LanguageConnectionContext lcc,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6267
CompilerContext cc
)
throws StandardException
@@ -363,6 +367,8 @@ public TableFunctionRS( AliasDescriptor ad )
(
DataDictionary dataDictionary,
LanguageConnectionContext lcc,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6267
+//IC see: https://issues.apache.org/jira/browse/DERBY-6267
CompilerContext cc
)
throws StandardException
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/Visitor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/Visitor.java
index 9c7e91f9d1..aecd59a1a9 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/Visitor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/compile/Visitor.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.iapi.sql.compile.Visitor
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/Authorizer.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/Authorizer.java
index e639556c09..faad1de73b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/Authorizer.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/Authorizer.java
@@ -128,6 +128,7 @@ public void authorize(Activation activation, int operation)
/**
Verify the connected user possesses the indicated permissions
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
@param requiredPermissionsList the required permissions
@param activation holds the execution logic
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/ConnectionUtil.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/ConnectionUtil.java
index ba73fc4231..e71cc8ae89 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/ConnectionUtil.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/ConnectionUtil.java
@@ -46,6 +46,7 @@ public static LanguageConnectionContext getCurrentLCC()
LanguageConnectionContext lcc = (LanguageConnectionContext)
getContextOrNull(LanguageConnectionContext.CONTEXT_ID);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if (lcc == null)
throw new SQLException(
@@ -64,6 +65,7 @@ public static LanguageConnectionContext getCurrentLCC()
*/
private static Context getContextOrNull( final String contextID )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getContextOrNull( contextID );
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
index 3d9eb636c0..96c8232749 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
@@ -100,6 +100,7 @@ public interface LanguageConnectionContext extends Context {
* @exception StandardException thrown if something goes wrong
*/
void initialize() throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
/**
* Get value of logStatementText.
@@ -137,6 +138,8 @@ public interface LanguageConnectionContext extends Context {
* Add the activation to those known about by this connection.
*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-418
+//IC see: https://issues.apache.org/jira/browse/DERBY-1142
void addActivation(Activation a)
throws StandardException;
@@ -230,6 +233,7 @@ void removeActivation(Activation a)
public TableDescriptor getTableDescriptorForDeclaredGlobalTempTable(String tableName);
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-130
Reset the connection before it is returned (indirectly) by
a PooledConnection object. See EmbeddedConnection.
*/
@@ -237,6 +241,7 @@ public void resetFromPool()
throws StandardException;
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
Do a commit, as internally needed by Derby. E.g.
a commit for sync, or a commit for autocommit. Skips
checks that a user isn't doing something bad like issuing
@@ -279,6 +284,7 @@ Do a commit, as issued directly by a user (e.g. via Connection.commit()
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
Do a rollback, as internally needed by Derby. E.g.
a rollback for sync, or a rollback for an internal error. Skips
checks that a user isn't doing something bad like issuing
@@ -477,6 +483,8 @@ public void setDefaultSchema(SchemaDescriptor sd)
*/
public void setDefaultSchema(Activation a, SchemaDescriptor sd)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3327
+//IC see: https://issues.apache.org/jira/browse/DERBY-1331
/**
* Reset any occurence of schemaName as current default schema in
@@ -606,8 +614,10 @@ public boolean verifyAllHeldResultSetsAreClosed()
* @return StatementContext The statement context.
*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-231
StatementContext pushStatementContext(boolean isAtomic, boolean isForReadOnly, String stmtText,
ParameterValueSet pvs, boolean rollbackParentContext, long timeoutMillis);
+//IC see: https://issues.apache.org/jira/browse/DERBY-31
/**
* Pop a StatementContext of the context stack.
@@ -882,8 +892,10 @@ public void popTriggerExecutionContext(TriggerExecutionContext tec)
* metadata query is getting executed.
*/
public PreparedStatement prepareInternalStatement(SchemaDescriptor compilationSchema,
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
String sqlText, boolean isForReadOnly, boolean allowInternalSyntax)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-231
/**
* Return a PreparedStatement object for the query.
@@ -1088,6 +1100,7 @@ public void autoincrementCreateCounter(String s, String t, String c,
*/
public String getCurrentRoleIdDelimited(Activation a)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3667
/**
* Checks whether the given role can be legally set for the current user.
@@ -1103,6 +1116,7 @@ public String getCurrentRoleIdDelimited(Activation a)
*/
public boolean roleIsSettable(Activation a, String role)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
/**
* Create a new SQL session context for the current activation on the basis
@@ -1126,6 +1140,9 @@ public boolean roleIsSettable(Activation a, String role)
*/
public void pushNestedSessionContext(Activation a,
boolean definersRights,
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
+//IC see: https://issues.apache.org/jira/browse/DERBY-6419
String definer)
throws StandardException;
@@ -1167,6 +1184,7 @@ public void pushNestedSessionContext(Activation a,
*/
public void setupSubStatementSessionContext(Activation a)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
/**
* Create a fresh SQLSessionContext for this connection.
@@ -1271,6 +1289,7 @@ public void setupSubStatementSessionContext(Activation a)
*/
public void setReferencedColumnMap(TableDescriptor td,
FormatableBitSet map);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4895
/**
* Set the constraint mode for this constraint to {@code deferred}.
@@ -1283,6 +1302,8 @@ public void setReferencedColumnMap(TableDescriptor td,
* @throws StandardException
*/
public void setConstraintDeferred(Activation a,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6670
+//IC see: https://issues.apache.org/jira/browse/DERBY-6665
ConstraintDescriptor cd,
boolean deferred) throws StandardException;
@@ -1320,8 +1341,11 @@ public void setDeferredAll(Activation a, boolean deferred)
* constraints.
* @return the set
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6670
+//IC see: https://issues.apache.org/jira/browse/DERBY-6665
HashMap
getDeferredHashTables();
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
/**
* Check that deferred constraints are valid, if not roll back the
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/LanguageConnectionFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/LanguageConnectionFactory.java
index e13573035d..0c2311ddda 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/LanguageConnectionFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/LanguageConnectionFactory.java
@@ -70,6 +70,7 @@ public interface LanguageConnectionFactory {
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-231
Get a Statement
@param compilationSchema schema
@param statementText the text for the statement
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/StatementContext.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/StatementContext.java
index 0293bc64e1..dbacc61025 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/StatementContext.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/StatementContext.java
@@ -56,6 +56,7 @@ public interface StatementContext extends Context {
*/
public void setInUse(boolean inTrigger, boolean isAtomic, boolean isForReadOnly,
String stmtText, ParameterValueSet pvs, long timeoutMillis);
+//IC see: https://issues.apache.org/jira/browse/DERBY-231
/**
* Mark this context as not in use. This is important because we
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/depend/DependencyManager.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/depend/DependencyManager.java
index 3a1e98a971..2ca5344656 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/depend/DependencyManager.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/depend/DependencyManager.java
@@ -33,6 +33,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
Dependency Manager Interface
The dependency manager tracks needs that dependents have of providers. This
+//IC see: https://issues.apache.org/jira/browse/DERBY-1539
is a general purpose interface which is associated with a
DataDictinary object; infact the dependencymanager is really the
datadictionary keeping track of dependencies between objects that it handles
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/AliasDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/AliasDescriptor.java
index a5c67ea2c5..f37b12b68f 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/AliasDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/AliasDescriptor.java
@@ -60,6 +60,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
public final class AliasDescriptor
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
extends PrivilegedSQLObject
implements Provider, Dependent
{
@@ -194,6 +195,7 @@ public String getSchemaName()
*/
public String getQualifiedName()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4476
return IdUtil.mkQualifiedName(getSchemaName(), aliasName);
}
@@ -364,6 +366,7 @@ public String getClassType()
/** @see TupleDescriptor#getDescriptorType */
public String getDescriptorType()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-335
return getAliasType(aliasType);
}
@@ -406,6 +409,7 @@ public String getSpecificName()
*/
public boolean isPersistent()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1809
return !getSchemaUUID().toString().equals(SchemaDescriptor.SYSFUN_SCHEMA_UUID);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/CatalogRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/CatalogRowFactory.java
index 24c6212695..c1389b48b8 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/CatalogRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/CatalogRowFactory.java
@@ -74,6 +74,7 @@ public abstract class CatalogRowFactory
public CatalogRowFactory(UUIDFactory uuidf,
ExecutionFactory ef,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
DataValueFactory dvf)
{
@@ -192,6 +193,7 @@ public boolean isIndexUnique(int indexNumber)
public String generateIndexName( int indexNumber )
{
indexNumber++;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
return catalogName + "_INDEX" + indexNumber;
}
@@ -223,6 +225,7 @@ public void initInfo(int columnCount,
indexCount = (indexColumnPositions != null) ?
indexColumnPositions.length : 0;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
this.catalogName = catalogName;
this.columnCount = columnCount;
@@ -239,6 +242,7 @@ public void initInfo(int columnCount,
indexNames[ictr] = generateIndexName(ictr);
indexUUID[ictr] = uf.recreateUUID(uuidStrings[ictr + 2 ]);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
this.indexColumnPositions = ArrayUtil.copy2( indexColumnPositions );
this.indexUniqueness = ArrayUtil.copy( indexUniqueness );
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/CheckConstraintDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/CheckConstraintDescriptor.java
index 07e9744a94..2088d056da 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/CheckConstraintDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/CheckConstraintDescriptor.java
@@ -145,6 +145,7 @@ public boolean needsToFire(int stmtType, int[] modifiedCols)
/*
** If we are disabled, we never fire
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
if (!enforced())
{
return false;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ColPermsDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ColPermsDescriptor.java
index 375b903c3e..c4a5516b2f 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ColPermsDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ColPermsDescriptor.java
@@ -53,6 +53,7 @@ public ColPermsDescriptor( DataDictionary dd,
this.columns = columns;
//tableUUID can be null only if the constructor with colPermsUUID
//has been invoked.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
if (tableUUID != null)
tableName = dd.getTableDescriptor(tableUUID).getName();
}
@@ -64,12 +65,14 @@ public ColPermsDescriptor( DataDictionary dd,
String grantee,
String grantor,
UUID tableUUID,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
String type) throws StandardException
{
this( dd, grantee, grantor, tableUUID, type, (FormatableBitSet) null);
}
public ColPermsDescriptor( DataDictionary dd,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
UUID colPermsUUID) throws StandardException
{
super(dd,null,null);
@@ -88,6 +91,7 @@ public int getCatalogNumber()
public String toString()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
return "colPerms: grantee=" + getGrantee() +
",colPermsUUID=" + getUUID() +
",grantor=" + getGrantor() +
@@ -115,6 +119,7 @@ public boolean equals( Object other)
*/
public int hashCode()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
return super.keyHashCode() + tableUUID.hashCode() +
((type == null) ? 0 : type.hashCode());
}
@@ -124,6 +129,7 @@ public int hashCode()
*/
public boolean checkOwner(String authorizationId) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
TableDescriptor td = getDataDictionary().getTableDescriptor(tableUUID);
if (td.getSchemaDescriptor().getAuthorizationId().equals(authorizationId))
return true;
@@ -164,6 +170,7 @@ public String getClassType()
*/
public DependableFinder getDependableFinder()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
return getDependableFinder(
StoredFormatIds.COLUMNS_PERMISSION_FINDER_V01_ID);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptor.java
index 4f7d2ea768..ec8f413d5f 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptor.java
@@ -72,6 +72,7 @@ public final class ColumnDescriptor extends TupleDescriptor
//the increment value or to change the start value. If none of the above,
//then it will be set to -1
long autoinc_create_or_modify_Start_Increment = -1;
+//IC see: https://issues.apache.org/jira/browse/DERBY-783
/**
* Constructor for a ColumnDescriptor when the column involved
@@ -103,8 +104,14 @@ public ColumnDescriptor(String columnName, int columnPosition,
DefaultInfo columnDefaultInfo,
TableDescriptor table,
UUID defaultUUID, long autoincStart, long autoincInc,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6903
+//IC see: https://issues.apache.org/jira/browse/DERBY-6904
+//IC see: https://issues.apache.org/jira/browse/DERBY-6905
+//IC see: https://issues.apache.org/jira/browse/DERBY-6906
+//IC see: https://issues.apache.org/jira/browse/DERBY-534
long userChangedWhat, boolean autoincCycle)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-783
this(columnName, columnPosition, columnType, columnDefault,
columnDefaultInfo, table, defaultUUID, autoincStart,
autoincInc,autoincCycle);
@@ -133,6 +140,11 @@ public ColumnDescriptor(String columnName, int columnPosition,
DataTypeDescriptor columnType, DataValueDescriptor columnDefault,
DefaultInfo columnDefaultInfo,
TableDescriptor table,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6903
+//IC see: https://issues.apache.org/jira/browse/DERBY-6904
+//IC see: https://issues.apache.org/jira/browse/DERBY-6905
+//IC see: https://issues.apache.org/jira/browse/DERBY-6906
+//IC see: https://issues.apache.org/jira/browse/DERBY-534
UUID defaultUUID, long autoincStart, long autoincInc, boolean autoincCycle)
{
this.columnName = columnName;
@@ -152,6 +164,7 @@ public ColumnDescriptor(String columnName, int columnPosition,
columnDefaultInfo);
this.autoincStart = autoincStart;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3175
this.autoincValue = autoincStart;
this.autoincInc = autoincInc;
this.autoincCycle = autoincCycle;
@@ -181,9 +194,15 @@ public ColumnDescriptor(String columnName, int columnPosition,
public ColumnDescriptor(String columnName, int columnPosition,
DataTypeDescriptor columnType, DataValueDescriptor columnDefault,
DefaultInfo columnDefaultInfo,
+//IC see: https://issues.apache.org/jira/browse/DERBY-189
UUID uuid,
UUID defaultUUID,
long autoincStart, long autoincInc, long autoincValue, boolean autoincCycle)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6903
+//IC see: https://issues.apache.org/jira/browse/DERBY-6904
+//IC see: https://issues.apache.org/jira/browse/DERBY-6905
+//IC see: https://issues.apache.org/jira/browse/DERBY-6906
+//IC see: https://issues.apache.org/jira/browse/DERBY-534
{
this.columnName = columnName;
@@ -199,8 +218,19 @@ public ColumnDescriptor(String columnName, int columnPosition,
columnDefaultInfo);
this.autoincStart = autoincStart;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3175
this.autoincValue = autoincValue;
this.autoincInc = autoincInc;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6903
+//IC see: https://issues.apache.org/jira/browse/DERBY-6904
+//IC see: https://issues.apache.org/jira/browse/DERBY-6905
+//IC see: https://issues.apache.org/jira/browse/DERBY-6906
+//IC see: https://issues.apache.org/jira/browse/DERBY-534
+//IC see: https://issues.apache.org/jira/browse/DERBY-6903
+//IC see: https://issues.apache.org/jira/browse/DERBY-6904
+//IC see: https://issues.apache.org/jira/browse/DERBY-6905
+//IC see: https://issues.apache.org/jira/browse/DERBY-6906
+//IC see: https://issues.apache.org/jira/browse/DERBY-534
this.autoincCycle = autoincCycle;
}
@@ -251,6 +281,7 @@ public void setColumnName(String newColumnName)
*/
public void setTableDescriptor(TableDescriptor tableDescriptor)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-189
this.table = tableDescriptor;
}
@@ -353,6 +384,7 @@ public boolean isAutoincrement()
}
public boolean updatableByCursor()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-189
return false;
}
@@ -369,6 +401,7 @@ public boolean hasGenerationClause()
* Is this column to have autoincremented value always ?
*/
public boolean isAutoincAlways(){
+//IC see: https://issues.apache.org/jira/browse/DERBY-167
return (columnDefaultInfo == null) && isAutoincrement();
}
@@ -384,6 +417,11 @@ public long getAutoincStart()
public boolean getAutoincCycle()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6903
+//IC see: https://issues.apache.org/jira/browse/DERBY-6904
+//IC see: https://issues.apache.org/jira/browse/DERBY-6905
+//IC see: https://issues.apache.org/jira/browse/DERBY-6906
+//IC see: https://issues.apache.org/jira/browse/DERBY-534
return autoincCycle;
}
@@ -413,11 +451,13 @@ public long getAutoincInc()
*/
public long getAutoincValue()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3175
return autoincValue;
}
public long getAutoinc_create_or_modify_Start_Increment()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-783
return autoinc_create_or_modify_Start_Increment;
}
public void setAutoinc_create_or_modify_Start_Increment(int c_or_m)
@@ -452,6 +492,7 @@ public String toString()
"columnType: " + columnType + "\n" +
"columnDefault: " + columnDefault + "\n" +
"uuid: " + uuid + "\n" +
+//IC see: https://issues.apache.org/jira/browse/DERBY-4087
"defaultUUID: " + defaultUUID ;
}
else
@@ -475,6 +516,7 @@ public String getDescriptorType()
private static void assertAutoinc(boolean autoinc,
+//IC see: https://issues.apache.org/jira/browse/DERBY-167
long autoincInc,
DefaultInfo defaultInfo){
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptorList.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptorList.java
index cf0eade141..bfd1cfda35 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptorList.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptorList.java
@@ -64,6 +64,7 @@ public ColumnDescriptor getColumnDescriptor(UUID tableID,
{
ColumnDescriptor returnValue = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
for (ColumnDescriptor columnDescriptor : this)
{
if ( columnName.equals( columnDescriptor.getColumnName() ) &&
@@ -89,6 +90,7 @@ public ColumnDescriptor getColumnDescriptor(UUID tableID, int columnID)
{
ColumnDescriptor returnValue = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
for (ColumnDescriptor columnDescriptor : this)
{
if ( ( columnID == columnDescriptor.getPosition() ) &&
@@ -111,6 +113,7 @@ public ColumnDescriptor getColumnDescriptor(UUID tableID, int columnID)
*/
public ColumnDescriptor elementAt(int n)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return get(n);
}
@@ -128,6 +131,7 @@ public String[] getColumnNames()
for (int index = 0; index < size; index++)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
ColumnDescriptor columnDescriptor = elementAt(index);
strings[index] = columnDescriptor.getColumnName();
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ConglomerateDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ConglomerateDescriptor.java
index abfd96de32..e11b840b23 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ConglomerateDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ConglomerateDescriptor.java
@@ -60,6 +60,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
public final class ConglomerateDescriptor extends UniqueTupleDescriptor
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
implements Provider
{
// Implementation
@@ -109,6 +110,7 @@ public final class ConglomerateDescriptor extends UniqueTupleDescriptor
this.forConstraint = forConstraint;
if (uuid == null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
UUIDFactory uuidFactory = DataDescriptorGenerator.getMonitor().getUUIDFactory();
uuid = uuidFactory.createUUID();
}
@@ -230,6 +232,7 @@ public IndexRowGenerator getIndexDescriptor()
*/
public void setColumnNames(String[] columnNames)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
this.columnNames = ArrayUtil.copy( columnNames );
}
@@ -241,6 +244,7 @@ public void setColumnNames(String[] columnNames)
*/
public String[] getColumnNames()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
return ArrayUtil.copy( columnNames );
}
@@ -309,6 +313,7 @@ public String toString()
if (SanityManager.DEBUG)
{
StringBuffer keyString = new StringBuffer();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5071
if (indexable && columnNames != null )
{
@@ -457,6 +462,7 @@ public ConglomerateDescriptor drop(LanguageConnectionContext lcc,
* has a uniqueness requirement.
*/
needNewConglomerate =
+//IC see: https://issues.apache.org/jira/browse/DERBY-3502
(indexRowGenerator.isUnique() && !othersIRG.isUnique()) ||
(indexRowGenerator.isUniqueWithDuplicateNulls() &&
!othersIRG.isUniqueWithDuplicateNulls());
@@ -612,6 +618,7 @@ public ConglomerateDescriptor describeSharedConglomerate(
continue;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3502
if (descriptors[i].getIndexDescriptor().isUnique())
{
/* Given criteria #1 and #4 described above, if we
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ConglomerateDescriptorList.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ConglomerateDescriptorList.java
index 3973e1a167..0040d48e37 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ConglomerateDescriptorList.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ConglomerateDescriptorList.java
@@ -30,6 +30,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.util.Arrays;
public class ConglomerateDescriptorList extends
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
ArrayList
{
@@ -72,6 +73,8 @@ public ConglomerateDescriptor[] getConglomerateDescriptors(long conglomerateNumb
int size = size(), j = 0;
ConglomerateDescriptor[] draft = new ConglomerateDescriptor[size];
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
for (ConglomerateDescriptor conglomerateDescriptor : this)
{
if (conglomerateNumber == conglomerateDescriptor.getConglomerateNumber())
@@ -98,6 +101,7 @@ public ConglomerateDescriptor getConglomerateDescriptor(String conglomerateName)
{
ConglomerateDescriptor returnValue = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
for (ConglomerateDescriptor conglomerateDescriptor : this)
{
if (conglomerateName.equals(conglomerateDescriptor.getConglomerateName()))
@@ -125,6 +129,7 @@ public ConglomerateDescriptor getConglomerateDescriptor(UUID uuid)
{
ConglomerateDescriptor returnValue = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
for (ConglomerateDescriptor conglomerateDescriptor : this)
{
if (uuid.equals(conglomerateDescriptor.getUUID()))
@@ -151,6 +156,7 @@ public ConglomerateDescriptor[] getConglomerateDescriptors(UUID uuid)
int size = size(), j = 0;
ConglomerateDescriptor[] draft = new ConglomerateDescriptor[size];
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
for (ConglomerateDescriptor conglomerateDescriptor : this)
{
if (uuid.equals(conglomerateDescriptor.getUUID()))
@@ -176,6 +182,7 @@ public ConglomerateDescriptor[] getConglomerateDescriptors(UUID uuid)
public void dropConglomerateDescriptor(UUID tableID, ConglomerateDescriptor cgDesc)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Iterator iterator = iterator();
while (iterator.hasNext())
{
@@ -202,6 +209,7 @@ public void dropConglomerateDescriptor(UUID tableID, ConglomerateDescriptor cgDe
public void dropConglomerateDescriptorByUUID(UUID conglomerateID)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Iterator iterator = iterator();
while (iterator.hasNext())
{
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java
index 3e1ec4834a..ab1690500e 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java
@@ -48,6 +48,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
public abstract class ConstraintDescriptor
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
extends UniqueTupleDescriptor
implements Provider, Dependent
{
@@ -60,6 +61,7 @@ public abstract class ConstraintDescriptor
// field that we want users to be able to know about
public static final int SYSCONSTRAINTS_STATE_FIELD = 6;
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
TableDescriptor table;
final String constraintName;
private boolean deferrable;
@@ -101,6 +103,7 @@ public abstract class ConstraintDescriptor
this.table = table;
this.constraintName = constraintName;
this.deferrable = deferrable;
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
this.initiallyDeferred = initiallyDeferred;
this.referencedColumns = referencedColumns;
this.constraintId = constraintId;
@@ -172,6 +175,7 @@ public boolean deferrable()
}
public void setDeferrable(boolean b) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
deferrable = b;
}
@@ -208,6 +212,7 @@ public void setInitiallyDeferred(boolean b) {
*/
public int[] getReferencedColumns()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
return ArrayUtil.copy( referencedColumns );
}
@@ -250,6 +255,7 @@ public int[] getKeyColumns()
*/
public boolean enforced()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
return enforced;
}
@@ -360,6 +366,7 @@ public boolean areColumnsComparable(ColumnDescriptorList otherColumns)
int index;
for (index = 0; index < mySize && index < otherSize; index++)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
myColumn = myColDl.elementAt(index);
otherColumn = otherColumns.elementAt(index);
@@ -448,7 +455,9 @@ public String toString()
"constraintName: " + constraintName + "\n" +
"constraintId: " + constraintId + "\n" +
"deferrable: " + deferrable + "\n" +
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
"initiallyDeferred: " + initiallyDeferred + "\n" +
+//IC see: https://issues.apache.org/jira/browse/DERBY-6148
"referencedColumns: " +
Arrays.toString(referencedColumns) + "\n" +
"schemaDesc: " + schemaDesc + "\n"
@@ -547,6 +556,7 @@ public void prepareToInvalidate(Provider p, int action,
case DependencyManager.SET_CONSTRAINTS_DISABLE:
case DependencyManager.SET_TRIGGERS_ENABLE:
case DependencyManager.SET_TRIGGERS_DISABLE:
+//IC see: https://issues.apache.org/jira/browse/DERBY-6672
case DependencyManager.RENAME:
//When REVOKE_PRIVILEGE gets sent (this happens for privilege
//types SELECT, UPDATE, DELETE, INSERT, REFERENCES, TRIGGER), we
@@ -554,9 +564,12 @@ public void prepareToInvalidate(Provider p, int action,
//the ConstraintDescriptor drop itself.
//Ditto for role grant conferring a privilege.
case DependencyManager.REVOKE_PRIVILEGE:
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
case DependencyManager.REVOKE_ROLE:
+//IC see: https://issues.apache.org/jira/browse/DERBY-3743
case DependencyManager.INTERNAL_RECOMPILE_REQUEST:
// Only used by Activations
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
case DependencyManager.RECHECK_PRIVILEGES:
break;
@@ -601,6 +614,7 @@ public void makeInvalid(int action, LanguageConnectionContext lcc)
*/
//Let's handle REVOKE_PRIVILEGE and REVOKE_ROLE first
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
if (action == DependencyManager.REVOKE_PRIVILEGE ||
action == DependencyManager.REVOKE_ROLE)
{
@@ -616,6 +630,7 @@ public void makeInvalid(int action, LanguageConnectionContext lcc)
// when the CHECK constraint is dropped explicitly.
//
getDataDictionary().getDependencyManager().invalidateFor( table, DependencyManager.ALTER_TABLE, lcc );
+//IC see: https://issues.apache.org/jira/browse/DERBY-6434
lcc.getLastActivation().addWarning(
StandardException.newWarning(
@@ -652,6 +667,7 @@ public void makeInvalid(int action, LanguageConnectionContext lcc)
(action != DependencyManager.SET_TRIGGERS_ENABLE) &&
(action != DependencyManager.SET_TRIGGERS_DISABLE) &&
(action != DependencyManager.INTERNAL_RECOMPILE_REQUEST) &&
+//IC see: https://issues.apache.org/jira/browse/DERBY-6672
(action != DependencyManager.RECHECK_PRIVILEGES) &&
(action != DependencyManager.RENAME)
)
@@ -700,6 +716,7 @@ public ConglomerateDescriptor drop(LanguageConnectionContext lcc,
if (clearDependencies)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5017
DependencyManager dm = dd.getDependencyManager();
dm.clearDependencies(lcc, this);
}
@@ -724,6 +741,9 @@ public ConglomerateDescriptor drop(LanguageConnectionContext lcc,
// Bug 4307
// We need to get the conglomerate descriptors from the
// dd in case we dropped other constraints in a cascade operation.
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
+//IC see: https://issues.apache.org/jira/browse/DERBY-6419
ConglomerateDescriptor[]conglomDescs =
dd.getConglomerateDescriptors(getConglomerateId());
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptorList.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptorList.java
index 205284e6e6..9497911880 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptorList.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptorList.java
@@ -212,6 +212,7 @@ public ConstraintDescriptorList getConstraintDescriptorList(boolean enforced)
{
ConstraintDescriptor cd = elementAt(index);
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
if (cd.enforced() == enforced)
{
cdl.add(cd);
@@ -229,6 +230,7 @@ public ConstraintDescriptorList getConstraintDescriptorList(boolean enforced)
*/
public ConstraintDescriptor elementAt(int n)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return get(n);
}
@@ -249,6 +251,7 @@ public ConstraintDescriptorList getSubList(int type)
for (int index = 0; index < size; index++)
{
ConstraintDescriptor cd = elementAt(index);
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
if (cd.getConstraintType() == type)
{
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/DDUtils.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/DDUtils.java
index d75a0db66b..e2e2df8002 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/DDUtils.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/DDUtils.java
@@ -62,6 +62,7 @@ public class DDUtils
ReferencedKeyConstraintDescriptor refCd;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
String[] refColumnNames = otherConstraintInfo.getReferencedColumnNames();
@@ -129,6 +130,7 @@ public class DDUtils
columnNamesMatch(refColumnNames,
cd.getColumnDescriptors()))
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6576
if (cd.deferrable()) {
final int onDelete = otherConstraintInfo.
getReferentialActionDeleteRule();
@@ -181,6 +183,7 @@ public static boolean columnNamesMatch(String []columnNames, ColumnDescriptorLis
for (int index = 0; index < columnNames.length; index++)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
String name = cdl.elementAt(index).getColumnName();
if (!name.equals(columnNames[index]))
{
@@ -237,6 +240,7 @@ public static boolean columnNamesMatch(String []columnNames, ColumnDescriptorLis
//check whether the foreign key relation ships referential action
//is not violating the restrictions we have in the current system.
TableDescriptor refTd = otherConstraintInfo.getReferencedTableDescriptor(dd);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Hashtable deleteConnHashtable = new Hashtable();
//find whether the foreign key is self referencing.
boolean isSelfReferencingFk = (refTd.getUUID().equals(td.getUUID()));
@@ -245,6 +249,7 @@ public static boolean columnNamesMatch(String []columnNames, ColumnDescriptorLis
int currentSelfRefValue = getCurrentDeleteConnections(dd, td, -1, deleteConnHashtable, false, true);
validateDeleteConnection(dd, td, refTd,
refAction,
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
deleteConnHashtable,
new Hashtable(deleteConnHashtable),
true, myConstraintName, false ,
@@ -276,6 +281,7 @@ public static boolean columnNamesMatch(String []columnNames, ColumnDescriptorLis
DataDictionary dd,
TableDescriptor td,
int refActionType,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Hashtable dch,
boolean prevNotCascade,
boolean findSelfRef
@@ -318,6 +324,7 @@ public static boolean columnNamesMatch(String []columnNames, ColumnDescriptorLis
String refTableName = refTd.getSchemaName() + "." + refTd.getName();
//check with the existing references.
Integer rAction = dch.get(refTableName);
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
if(rAction != null) // we already looked at this table
{
@@ -345,6 +352,7 @@ public static boolean columnNamesMatch(String []columnNames, ColumnDescriptorLis
//not specified on the current link. It is actually the
//value of what happens to the table whose delete
// connections we are finding.
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
dch.put(refTableName, Integer.valueOf(childRefAction));
//find the next delete conectiions on this path for non
@@ -380,6 +388,7 @@ public static boolean columnNamesMatch(String []columnNames, ColumnDescriptorLis
TableDescriptor actualTd, // the table we are adding the foriegn key.
TableDescriptor refTd,
int refActionType,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Hashtable dch,
Hashtable ech, //existing delete connections
boolean checkImmediateRefTable,
@@ -403,7 +412,9 @@ public static boolean columnNamesMatch(String []columnNames, ColumnDescriptorLis
if(checkImmediateRefTable)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5017
String refTableName = refTd.getSchemaName() + "." + refTd.getName();
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
rAction = dch.get(refTableName);
// check possible invalide cases incase of self referencing foreign key
@@ -455,6 +466,7 @@ public static boolean columnNamesMatch(String []columnNames, ColumnDescriptorLis
** CASCADE, otherwise we should throw error.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
if( isSelfReferencingFk &&
dch.contains(Integer.valueOf(StatementType.RA_CASCADE)) &&
refActionType != StatementType.RA_CASCADE)
@@ -509,6 +521,7 @@ public static boolean columnNamesMatch(String []columnNames, ColumnDescriptorLis
** of cycles , all the nodes in the cycle have same type of
** referential action.
**/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6330
cycleString.append(refActionType);
}
@@ -567,6 +580,7 @@ public static boolean columnNamesMatch(String []columnNames, ColumnDescriptorLis
//check for this is non self referencing cycles case
//In cases of cycle, whole cycle should have the same refAction
// value. Other wise we should throw an exception
+//IC see: https://issues.apache.org/jira/browse/DERBY-6330
cycleString.append(raDeleteRule);
boolean isFormingCycle = (nextRefTd.getUUID().equals(actualTd.getUUID()));
if(isFormingCycle)
@@ -602,6 +616,7 @@ public static boolean columnNamesMatch(String []columnNames, ColumnDescriptorLis
String nextRefTableName = nextRefTd.getSchemaName() + "." + nextRefTd.getName();
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
rAction = ech.get(nextRefTableName);
if(rAction != null)
{
@@ -620,6 +635,7 @@ public static boolean columnNamesMatch(String []columnNames, ColumnDescriptorLis
}else
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
rAction = dch.get(nextRefTableName);
if(rAction == null)
{
@@ -774,6 +790,7 @@ private static void checkForMultiplePathInvalidCases(int currentRefAction,
DataDictionary dd,
TableDescriptor td,
int refActionType,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Hashtable newDconnHashTable,
String myConstraintName
)
@@ -789,6 +806,7 @@ private static void checkForMultiplePathInvalidCases(int currentRefAction,
//are adding the foreign key and check whether we violate their existing rules.
String addTableName = td.getSchemaName() + "." + td.getName();;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
for (ConstraintDescriptor cd : dd.getConstraintDescriptors(td))
{
if ((cd instanceof ReferencedKeyConstraintDescriptor))
@@ -804,6 +822,7 @@ private static void checkForMultiplePathInvalidCases(int currentRefAction,
//Note: More than one table can refer to the same
//ReferencedKeyConstraintDescriptor, so we need to find all the tables.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Hashtable dConnHashtable = new Hashtable();
for (int inner = 0; inner < size; inner++)
{
@@ -830,6 +849,7 @@ private static void checkForMultiplePathInvalidCases(int currentRefAction,
**referential action and only one SET NULL path.
**/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
for (Enumeration e = dConnHashtable.keys() ; e.hasMoreElements() ;)
{
String tName = e.nextElement();
@@ -877,6 +897,7 @@ private static StandardException generateError(String messageId,
String raRuleStringId;
switch (raRule){
case StatementType.RA_CASCADE:
+//IC see: https://issues.apache.org/jira/browse/DERBY-5879
raRuleStringId = "CASCADE";
break;
case StatementType.RA_RESTRICT:
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/DataDescriptorGenerator.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/DataDescriptorGenerator.java
index 466fe11a56..b4b26d0b1b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/DataDescriptorGenerator.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/DataDescriptorGenerator.java
@@ -608,6 +608,7 @@ public PermDescriptor newPermDescriptor(
*/
static ModuleFactory getMonitor()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
index cc0bc096c5..ee9fe61bd7 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
@@ -412,6 +412,7 @@ public SchemaDescriptor getSchemaDescriptor(UUID schemaId, TransactionController
*/
public SchemaDescriptor getSchemaDescriptor(UUID schemaId,
int isolationLevel,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3678
TransactionController tc)
throws StandardException;
@@ -426,6 +427,7 @@ public SchemaDescriptor getSchemaDescriptor(UUID schemaId,
* @exception StandardException
*/
public boolean existsSchemaOwnedBy(String authid,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3673
TransactionController tc)
throws StandardException;
@@ -502,6 +504,8 @@ public boolean isSystemSchemaName( String name)
* @exception StandardException Thrown on failure
*/
public void dropRoleGrant(String roleName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
String grantee,
String grantor,
TransactionController tc)
@@ -554,6 +558,7 @@ public void dropRoleGrantsByName(String roleName,
* @throws StandardException
*/
public RoleClosureIterator createRoleClosureIterator
+//IC see: https://issues.apache.org/jira/browse/DERBY-3722
(TransactionController tc,
String role,
boolean inverse
@@ -617,6 +622,7 @@ public boolean isSchemaEmpty(SchemaDescriptor sd)
* @exception StandardException Thrown on failure
*/
public TableDescriptor getTableDescriptor(String tableName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3012
SchemaDescriptor schema, TransactionController tc)
throws StandardException;
@@ -768,6 +774,7 @@ public void updateSYSCOLPERMSforAddColumnToUserTable(UUID tableID, TransactionCo
*/
public void updateSYSCOLPERMSforDropColumn(UUID tableID,
TransactionController tc, ColumnDescriptor columnDescriptor)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1543
throws StandardException;
@@ -1216,6 +1223,7 @@ public TriggerDescriptor getTriggerDescriptor(String name, SchemaDescriptor sd)
throws StandardException;
public int[] examineTriggerNodeAndCols(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6783
Visitable actionStmt,
String oldReferencingName,
String newReferencingName,
@@ -1354,6 +1362,7 @@ public int[] examineTriggerNodeAndCols(
* @throws StandardException
*/
public String getTriggerActionString(
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
Visitable actionStmt,
String oldReferencingName,
String newReferencingName,
@@ -1364,6 +1373,7 @@ public String getTriggerActionString(
TableDescriptor triggerTableDescriptor,
int triggerEventMask,
boolean createTriggerTime,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6783
List replacements,
int[] cols)
throws StandardException;
@@ -1404,6 +1414,9 @@ public TriggerDescriptorList getTriggerDescriptors(TableDescriptor td)
TriggerDescriptor triggerd,
UUID formerUUID,
int[] colsToSet,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3850
+//IC see: https://issues.apache.org/jira/browse/DERBY-177
+//IC see: https://issues.apache.org/jira/browse/DERBY-3693
TransactionController tc
) throws StandardException;
@@ -1439,6 +1452,7 @@ public TriggerDescriptorList getTriggerDescriptors(TableDescriptor td)
*/
@SuppressWarnings("UseOfObsoleteCollectionType")
public Hashtable
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
hashAllConglomerateDescriptorsByNumber(TransactionController tc)
throws StandardException;
@@ -1622,6 +1636,7 @@ public void updateConglomerateDescriptor(ConglomerateDescriptor cd,
*
* @exception StandardException Thrown on failure
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
List getDependentsDescriptorList(String dependentID)
throws StandardException;
@@ -1636,6 +1651,7 @@ List getDependentsDescriptorList(String dependentID)
*
* @exception StandardException Thrown on failure
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
List getProvidersDescriptorList(String providerID)
throws StandardException;
@@ -1725,6 +1741,8 @@ public AliasDescriptor getAliasDescriptor(String schemaID, String aliasName, cha
Get the list of routines matching the schema and routine name.
*/
public List getRoutineList(
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
String schemaID,
String routineName,
char nameSpace) throws StandardException;
@@ -1847,6 +1865,8 @@ public RowLocation getRowLocationTemplate( LanguageConnectionContext lcc, TableD
* holds the lock.
*/
public NumberDataValue getSetAutoincrementValue(RowLocation rl,
+//IC see: https://issues.apache.org/jira/browse/DERBY-5687
+//IC see: https://issues.apache.org/jira/browse/DERBY-4437
TransactionController tc,
boolean doUpdate,
NumberDataValue newValue,
@@ -1922,6 +1942,8 @@ public void setAutoincrementValue(TransactionController tc,
* @throws StandardException if the sequence does not cycle and its range is exhausted
*/
public void getCurrentValueAndAdvance
+//IC see: https://issues.apache.org/jira/browse/DERBY-5687
+//IC see: https://issues.apache.org/jira/browse/DERBY-4437
( String sequenceUUIDstring, NumberDataValue returnValue )
throws StandardException;
@@ -2072,6 +2094,7 @@ To use this method, a feature implemented in a certain release (DataDictionary v
* actions to PermssionDescriptor's dependents.
*/
public boolean addRemovePermissionsDescriptor( boolean add,
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
PermissionsDescriptor perm,
String grantee,
TransactionController tc)
@@ -2101,6 +2124,7 @@ public TablePermsDescriptor getTablePermissions( UUID tableUUID, String authoriz
*/
public TablePermsDescriptor getTablePermissions( UUID tablePermsUUID)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
/**
* Get one user's column privileges for a table.
@@ -2143,6 +2167,7 @@ public ColPermsDescriptor getColumnPermissions( UUID tableUUID,
* @exception StandardException
*/
public ColPermsDescriptor getColumnPermissions( UUID tableUUID,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
String privTypeStr,
boolean forGrant,
String authorizationId)
@@ -2158,6 +2183,7 @@ public ColPermsDescriptor getColumnPermissions( UUID tableUUID,
*/
public ColPermsDescriptor getColumnPermissions( UUID colPermsUUID)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
/**
* Get one user's permissions for a routine (function or procedure).
@@ -2260,6 +2286,7 @@ public RoleGrantDescriptor getRoleDefinitionDescriptor(String roleName)
*/
public RoleGrantDescriptor getRoleGrantDescriptor(UUID uuid)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
/**
* Get a descriptor for a role grant
@@ -2271,6 +2298,7 @@ public RoleGrantDescriptor getRoleGrantDescriptor(UUID uuid)
* @throws StandardException error
*/
public RoleGrantDescriptor getRoleGrantDescriptor(String roleName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
String grantee,
String grantor)
throws StandardException;
@@ -2302,6 +2330,7 @@ public void dropDependentsStoredDependencies(UUID dependentsUUID,
* @return boolean true if such a grant exists
*/
public boolean existsGrantToAuthid(String authId,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3673
TransactionController tc)
throws StandardException;
@@ -2461,6 +2490,7 @@ public DependableFinder getColumnDependableFinder(
public BulkInsertCounter getBulkInsertCounter
( String sequenceUUIDString, boolean restart )
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
/**
* Flush the updated values of the BulkInsertCounter to disk and to the original, cached
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/DefaultDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/DefaultDescriptor.java
index 87b870f3b9..c9754da386 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/DefaultDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/DefaultDescriptor.java
@@ -40,6 +40,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
public final class DefaultDescriptor
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
extends UniqueTupleDescriptor
implements Provider, Dependent
{
@@ -208,6 +209,7 @@ public void prepareToInvalidate(Provider p, int action,
throw StandardException.newException(SQLState.LANG_PROVIDER_HAS_DEPENDENT_OBJECT,
dm.getActionString(action),
+//IC see: https://issues.apache.org/jira/browse/DERBY-5879
p.getObjectName(), "DEFAULT",
td.getQualifiedName() + "." +
cd.getColumnName());
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/FileInfoDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/FileInfoDescriptor.java
index 2615f43287..a7eb513eb4 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/FileInfoDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/FileInfoDescriptor.java
@@ -36,6 +36,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* A Descriptor for a file that has been stored in the database.
*/
public final class FileInfoDescriptor extends UniqueSQLObjectDescriptor
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
implements Provider
{
/** A type tho indicate the file is a jar file **/
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ForeignKeyConstraintDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ForeignKeyConstraintDescriptor.java
index ee569e0a87..24ab7d8baa 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ForeignKeyConstraintDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ForeignKeyConstraintDescriptor.java
@@ -85,6 +85,7 @@ protected ForeignKeyConstraintDescriptor(
super(dataDictionary, table, constraintName, deferrable,
initiallyDeferred, fkColumns,
constraintId, indexId, schemaDesc, enforced);
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
this.referencedConstraintDescriptor = referencedConstraintDescriptor;
this.raDeleteRule = raDeleteRule;
@@ -126,6 +127,7 @@ protected ForeignKeyConstraintDescriptor(
{
super(dataDictionary, table, constraintName, deferrable,
initiallyDeferred, fkColumns,
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
constraintId, indexId, schemaDesc, enforced);
this.referencedConstraintId = referencedConstraintId;
this.raDeleteRule = raDeleteRule;
@@ -242,6 +244,7 @@ public boolean needsToFire(int stmtType, int[] modifiedCols)
/*
** If we are disabled, we never fire
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
if (!enforced())
{
return false;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/GenericDescriptorList.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/GenericDescriptorList.java
index cbbffa912f..fa0e8216f2 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/GenericDescriptorList.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/GenericDescriptorList.java
@@ -26,6 +26,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.util.ArrayList;
public class GenericDescriptorList
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
extends ArrayList
{
private boolean scanned;
@@ -64,6 +65,7 @@ public boolean getScanned()
*/
public E getUniqueTupleDescriptor(UUID uuid)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
for (E ud : this)
{
if (ud.getUUID().equals(uuid))
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/IndexLister.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/IndexLister.java
index 987496c2f7..a24077a6c7 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/IndexLister.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/IndexLister.java
@@ -83,6 +83,7 @@ public IndexRowGenerator[] getIndexRowGenerators()
throws StandardException
{
if ( indexRowGenerators == null ) { getAllIndexes(); }
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
return ArrayUtil.copy(indexRowGenerators);
}
@@ -97,6 +98,7 @@ public long[] getIndexConglomerateNumbers()
throws StandardException
{
if ( indexConglomerateNumbers == null ) { getAllIndexes(); }
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
return ArrayUtil.copy( indexConglomerateNumbers );
}
@@ -112,6 +114,7 @@ public IndexRowGenerator[] getDistinctIndexRowGenerators()
throws StandardException
{
if ( distinctIndexRowGenerators == null ) { getAllIndexes(); }
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
return ArrayUtil.copy(distinctIndexRowGenerators);
}
@@ -127,6 +130,7 @@ public long[] getDistinctIndexConglomerateNumbers()
throws StandardException
{
if ( distinctIndexConglomerateNumbers == null ) { getAllIndexes(); }
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
return ArrayUtil.copy( distinctIndexConglomerateNumbers );
}
@@ -140,6 +144,7 @@ public long[] getDistinctIndexConglomerateNumbers()
*/
public String[] getDistinctIndexNames() throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5111
if ( distinctIndexNames == null ) { getAllIndexes(); }
return ArrayUtil.copy( distinctIndexNames );
}
@@ -213,6 +218,7 @@ private void getAllIndexes()
if ( ! cd.isIndex())
continue;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
indexRowGenerators[++j] = cd.getIndexDescriptor();
indexConglomerateNumbers[j] = cd.getConglomerateNumber();
if (!(cd.isConstraint()))
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/IndexRowGenerator.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/IndexRowGenerator.java
index 62444637fb..d98f5ccd48 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/IndexRowGenerator.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/IndexRowGenerator.java
@@ -92,6 +92,9 @@ public IndexRowGenerator(String indexType,
id = new IndexDescriptorImpl(indexType,
isUnique,
isUniqueWithDuplicateNulls,
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
+//IC see: https://issues.apache.org/jira/browse/DERBY-6419
isUniqueDeferrable,
hasDeferrableChecking,
baseColumnPositions,
@@ -245,6 +248,7 @@ public void getIndexRow(ExecRow baseRow,
* @exception StandardException Standard exception policy.
**/
public int[] getColumnCollationIds(ColumnDescriptorList columnList)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
throws StandardException
{
int[] base_cols = id.baseColumnPositions();
@@ -283,11 +287,15 @@ public IndexRowGenerator()
*/
public boolean isUniqueWithDuplicateNulls()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
return id.isUniqueWithDuplicateNulls();
}
public boolean hasDeferrableChecking()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
+//IC see: https://issues.apache.org/jira/browse/DERBY-6419
return id.hasDeferrableChecking();
}
@@ -397,6 +405,7 @@ private ExecutionFactory getExecutionFactory()
ExecutionContext ec;
ec = (ExecutionContext)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
getContext(ExecutionContext.CONTEXT_ID);
ef = ec.getExecutionFactory();
}
@@ -442,6 +451,7 @@ public int getTypeFormatId()
*/
private static Context getContext( final String contextID )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getContext( contextID );
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/KeyConstraintDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/KeyConstraintDescriptor.java
index 1e2323863b..9dda0a7207 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/KeyConstraintDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/KeyConstraintDescriptor.java
@@ -79,6 +79,7 @@ public ConglomerateDescriptor getIndexConglomerateDescriptor(DataDictionary
{
super(dataDictionary, table, constraintName, deferrable,
initiallyDeferred, referencedColumns,
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
constraintId, schemaDesc, enforced);
this.indexId = indexId;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/PasswordHasher.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/PasswordHasher.java
index 1f6ee64089..d912e2eb06 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/PasswordHasher.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/PasswordHasher.java
@@ -108,6 +108,7 @@ public class PasswordHasher
)
{
_messageDigestAlgorithm = messageDigestAlgorithm;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
_salt = ArrayUtil.copy( salt );
_iterations = iterations;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/PermDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/PermDescriptor.java
index 05344a8c8e..f3acbe23a3 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/PermDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/PermDescriptor.java
@@ -212,6 +212,7 @@ public String getClassType() {
* @see Dependable#getDependableFinder
*/
public DependableFinder getDependableFinder() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
return getDependableFinder(
StoredFormatIds.PERM_DESCRIPTOR_FINDER_V01_ID);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/PermissionsDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/PermissionsDescriptor.java
index 31badd7f49..86777233a7 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/PermissionsDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/PermissionsDescriptor.java
@@ -32,6 +32,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* system tables.
*/
public abstract class PermissionsDescriptor extends TupleDescriptor
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
implements Cloneable, Provider
{
protected UUID oid;
@@ -56,6 +57,7 @@ public Object clone()
catch( java.lang.CloneNotSupportedException cnse)
{
if( SanityManager.DEBUG)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
SanityManager.THROWASSERT("Could not clone a " +
getClass().getName(), cnse);
return null;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/PrivilegedSQLObject.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/PrivilegedSQLObject.java
index 616bfc32bf..b78222fbf6 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/PrivilegedSQLObject.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/PrivilegedSQLObject.java
@@ -27,6 +27,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* This is a descriptor for schema object which can have privileges granted on it.
*/
public abstract class PrivilegedSQLObject
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
extends UniqueSQLObjectDescriptor
implements Provider
{
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ReferencedKeyConstraintDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ReferencedKeyConstraintDescriptor.java
index f8c21bbf81..925b3b552e 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ReferencedKeyConstraintDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ReferencedKeyConstraintDescriptor.java
@@ -90,6 +90,7 @@ protected ReferencedKeyConstraintDescriptor(int constraintType,
{
super(dataDictionary, table, constraintName, deferrable,
initiallyDeferred, columns,
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
constraintId, indexId, schemaDesc, enforced);
this.referenceCount = referenceCount;
this.constraintType = constraintType;
@@ -131,6 +132,8 @@ public boolean hasSelfReferencingFK(ConstraintDescriptorList cdl, int type)
cdl = getForeignKeyConstraints(type);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
for (ConstraintDescriptor cd : cdl)
{
if (! (cd instanceof ForeignKeyConstraintDescriptor))
@@ -160,6 +163,7 @@ public ConstraintDescriptorList getNonSelfReferencingFK(int type)
throws StandardException
{
ConstraintDescriptorList result = new ConstraintDescriptorList();
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
if (SanityManager.DEBUG)
{
@@ -168,6 +172,7 @@ public ConstraintDescriptorList getNonSelfReferencingFK(int type)
ForeignKeyConstraintDescriptor fkcd;
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
for (ConstraintDescriptor cd : getForeignKeyConstraints(type))
{
if (! (cd instanceof ForeignKeyConstraintDescriptor))
@@ -178,6 +183,7 @@ public ConstraintDescriptorList getNonSelfReferencingFK(int type)
fkcd = (ForeignKeyConstraintDescriptor) cd;
if(!(fkcd.getTableId().equals(getTableId())))
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
result.add(fkcd);
}
}
@@ -305,6 +311,7 @@ public boolean needsToFire(int stmtType, int[] modifiedCols)
/*
** If we are disabled, we never fire
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
if (!enforced())
{
return false;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/RoleGrantDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/RoleGrantDescriptor.java
index bba404255d..062983cdb6 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/RoleGrantDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/RoleGrantDescriptor.java
@@ -47,6 +47,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* upgrading an older database that did not forbid this.
*/
public class RoleGrantDescriptor extends TupleDescriptor
+//IC see: https://issues.apache.org/jira/browse/DERBY-3666
implements Provider
{
private final UUID uuid;
@@ -71,6 +72,9 @@ public class RoleGrantDescriptor extends TupleDescriptor
*
*/
public RoleGrantDescriptor(DataDictionary dd,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
UUID uuid,
String roleName,
String grantee,
@@ -87,6 +91,7 @@ public RoleGrantDescriptor(DataDictionary dd,
}
public UUID getUUID() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
return uuid;
}
@@ -116,6 +121,7 @@ public void setWithAdminOption(boolean b) {
public String toString() {
if (SanityManager.DEBUG) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
return "uuid: " + uuid + "\n" +
"roleName: " + roleName + "\n" +
"grantor: " + grantor + "\n" +
@@ -148,6 +154,7 @@ public void drop(LanguageConnectionContext lcc) throws StandardException
DataDictionary dd = getDataDictionary();
TransactionController tc = lcc.getTransactionExecute();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
dd.dropRoleGrant(roleName, grantee, grantor, tc);
}
@@ -164,6 +171,7 @@ public void drop(LanguageConnectionContext lcc) throws StandardException
*/
public UUID getObjectID()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3666
return uuid;
}
@@ -208,6 +216,7 @@ public String getClassType()
*/
public DependableFinder getDependableFinder()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
return getDependableFinder(StoredFormatIds.ROLE_GRANT_FINDER_V01_ID);
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/RoutinePermsDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/RoutinePermsDescriptor.java
index 76aa5020a4..604fec6ef6 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/RoutinePermsDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/RoutinePermsDescriptor.java
@@ -44,11 +44,13 @@ public RoutinePermsDescriptor( DataDictionary dd,
UUID routineUUID,
boolean hasExecutePermission) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
super (dd, grantee, grantor);
this.routineUUID = routineUUID;
this.hasExecutePermission = hasExecutePermission;
//routineUUID can be null only if the constructor with routineePermsUUID
//has been invoked.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
if (routineUUID != null)
routineName = dd.getAliasDescriptor(routineUUID).getObjectName();
}
@@ -58,6 +60,7 @@ public RoutinePermsDescriptor( DataDictionary dd,
String grantor,
UUID routineUUID) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
this( dd, grantee, grantor, routineUUID, true);
}
@@ -66,12 +69,14 @@ public RoutinePermsDescriptor( DataDictionary dd,
*/
public RoutinePermsDescriptor( DataDictionary dd,
String grantee,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
String grantor) throws StandardException
{
this( dd, grantee, grantor, (UUID) null);
}
public RoutinePermsDescriptor( DataDictionary dd, UUID routineePermsUUID)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
throws StandardException
{
this( dd, null, null, null, true);
@@ -89,6 +94,7 @@ public int getCatalogNumber()
public String toString()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
return "routinePerms: grantee=" + getGrantee() +
",routinePermsUUID=" + getUUID() +
",grantor=" + getGrantor() +
@@ -121,6 +127,7 @@ public int hashCode()
*/
public boolean checkOwner(String authorizationId) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
UUID sd = getDataDictionary().getAliasDescriptor(routineUUID).getSchemaUUID();
if (getDataDictionary().getSchemaDescriptor(sd, null).getAuthorizationId().equals(authorizationId))
return true;
@@ -161,6 +168,7 @@ public String getClassType()
*/
public DependableFinder getDependableFinder()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
return getDependableFinder(
StoredFormatIds.ROUTINE_PERMISSION_FINDER_V01_ID);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java
index 902eb17e0d..d5fa6822ca 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java
@@ -74,6 +74,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*
*/
public class SPSDescriptor extends UniqueSQLObjectDescriptor
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
implements Dependent, Provider
{
/**
@@ -216,6 +217,7 @@ public void revalidate(LanguageConnectionContext lcc)
super( dataDictionary );
// Added this check when setUUID was removed, see DERBY-4918.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4918
if (uuid == null) {
throw new IllegalArgumentException("UUID is null");
}
@@ -225,6 +227,7 @@ public void revalidate(LanguageConnectionContext lcc)
this.text = text;
this.usingText = usingText;
this.valid = valid;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
this.compileTime = DataTypeUtilities.clone( compileTime );
this.sd = dataDictionary.getSchemaDescriptor(suuid, null);
this.preparedStatement = preparedStatement;
@@ -371,6 +374,7 @@ public final synchronized void prepareAndRelease(LanguageConnectionContext lcc)
// stored statements always stored as unicode.
Statement stmt = lcf.getStatement(dd.getSchemaDescriptor(compSchemaId, null), text, true);
+//IC see: https://issues.apache.org/jira/browse/DERBY-231
try
{
@@ -401,6 +405,7 @@ public final synchronized void prepareAndRelease(LanguageConnectionContext lcc)
setParams(preparedStatement.getParameterTypes());
if (!dd.isReadOnlyUpgrade()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
/*
** Indicate that we are going to write the data
@@ -409,6 +414,7 @@ public final synchronized void prepareAndRelease(LanguageConnectionContext lcc)
*/
dd.startWriting(lcc);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4918
DependencyManager dm = dd.getDependencyManager();
/*
** Clear out all the dependencies that exist
@@ -485,6 +491,7 @@ public final char getType()
* @return type as a string
*/
public final String getTypeAsString() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4918
return String.valueOf(type);
}
@@ -517,6 +524,7 @@ public static boolean validType(char type)
*/
public final synchronized Timestamp getCompileTime()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
return DataTypeUtilities.clone( compileTime );
}
@@ -593,13 +601,16 @@ public final UUID getUUID() {
public final synchronized DataTypeDescriptor[] getParams()
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4918
if (params == null && !lookedUpParams) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
List tmpDefaults = new ArrayList();
params = getDataDictionary().getSPSParams(this, tmpDefaults);
paramDefaults = tmpDefaults.toArray();
lookedUpParams = true;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
return ArrayUtil.copy(params);
}
@@ -610,6 +621,7 @@ public final synchronized DataTypeDescriptor[] getParams()
*/
public final synchronized void setParams(DataTypeDescriptor params[])
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
this.params = ArrayUtil.copy(params);
}
@@ -631,6 +643,7 @@ public final synchronized Object[] getParameterDefaults()
getParams();
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
return ArrayUtil.copy( paramDefaults );
}
@@ -641,6 +654,7 @@ public final synchronized Object[] getParameterDefaults()
*/
public final synchronized void setParameterDefaults(Object[] values)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
this.paramDefaults = ArrayUtil.copy( values );
}
@@ -688,6 +702,7 @@ public final synchronized ExecPreparedStatement getPreparedStatement(boolean rec
(preparedStatement == null)))
{
ContextManager cm = getContextService().getCurrentContextManager();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
/*
** Find the language connection context. Get
@@ -699,6 +714,7 @@ public final synchronized ExecPreparedStatement getPreparedStatement(boolean rec
if (!lcc.getDataDictionary().isReadOnlyUpgrade()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
final String savepoint = lcc.getUniqueSavepointName();
@@ -754,6 +770,7 @@ public final synchronized ExecPreparedStatement getPreparedStatement(boolean rec
nestedTC.rollbackToSavePoint(savepoint, false, null);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6554
if (
(nestedTC != null) &&
( se.isLockTimeout() || se.isSelfDeadlock() )
@@ -1018,6 +1035,12 @@ public final synchronized void makeInvalid(int action,
case DependencyManager.CREATE_TRIGGER:
case DependencyManager.DROP_TRIGGER:
case DependencyManager.DROP_COLUMN:
+//IC see: https://issues.apache.org/jira/browse/DERBY-1489
+//IC see: https://issues.apache.org/jira/browse/DERBY-1909
+//IC see: https://issues.apache.org/jira/browse/DERBY-1926
+//IC see: https://issues.apache.org/jira/browse/DERBY-1489
+//IC see: https://issues.apache.org/jira/browse/DERBY-1909
+//IC see: https://issues.apache.org/jira/browse/DERBY-1926
case DependencyManager.DROP_COLUMN_RESTRICT:
case DependencyManager.UPDATE_STATISTICS:
case DependencyManager.DROP_STATISTICS:
@@ -1030,9 +1053,15 @@ public final synchronized void makeInvalid(int action,
if (valid == true)
{
valid = false;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6003
+//IC see: https://issues.apache.org/jira/browse/DERBY-4835
+//IC see: https://issues.apache.org/jira/browse/DERBY-5289
+//IC see: https://issues.apache.org/jira/browse/DERBY-5105
+//IC see: https://issues.apache.org/jira/browse/DERBY-5263
preparedStatement = null;
updateSYSSTATEMENTS(lcc, INVALIDATE, null);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
dm.invalidateFor(
this, DependencyManager.USER_RECOMPILE_REQUEST, lcc);
break;
@@ -1121,6 +1150,7 @@ private void updateSYSSTATEMENTS(LanguageConnectionContext lcc, int mode, Transa
{
DataDictionary dd = getDataDictionary();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
if (dd.isReadOnlyUpgrade())
return;
@@ -1148,6 +1178,7 @@ private UUID recreateUUID(String idString)
{
if (uuidFactory == null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
uuidFactory = DataDescriptorGenerator.getMonitor().getUUIDFactory();
}
return uuidFactory.recreateUUID(idString);
@@ -1170,6 +1201,7 @@ private UUID recreateUUID(String idString)
*/
private static ContextService getContextService()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getFactory();
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/SchemaDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/SchemaDescriptor.java
index 65e5e8ed5a..25014984a4 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/SchemaDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/SchemaDescriptor.java
@@ -41,6 +41,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
public final class SchemaDescriptor extends UniqueTupleDescriptor
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
implements Provider
{
@@ -258,6 +259,7 @@ public void setUUID(UUID oid)
*/
public int getCollationType()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2530
return collationType;
}
@@ -363,6 +365,7 @@ public boolean isSystemSchema()
*/
public boolean isSchemaWithGrantableRoutines()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
if (!isSystem)
return true;
@@ -407,6 +410,8 @@ public String getDescriptorType()
* @throws StandardException Schema could not be dropped.
*/
public void drop(LanguageConnectionContext lcc,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3327
+//IC see: https://issues.apache.org/jira/browse/DERBY-1331
Activation activation) throws StandardException
{
DataDictionary dd = getDataDictionary();
@@ -447,6 +452,8 @@ public void drop(LanguageConnectionContext lcc,
** LCC is free to set the new default schema to
** some system defined default.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-3327
+//IC see: https://issues.apache.org/jira/browse/DERBY-1331
lcc.resetSchemaUsages(activation, getSchemaName());
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/SequenceDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/SequenceDescriptor.java
index 4f43f907ce..9a48c0ba3d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/SequenceDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/SequenceDescriptor.java
@@ -42,6 +42,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* can be generated from it.
*/
public class SequenceDescriptor
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
extends PrivilegedSQLObject
implements Provider, Dependent
{
@@ -272,6 +273,7 @@ public String getClassType() {
* @see Dependable#getDependableFinder
*/
public DependableFinder getDependableFinder() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
return getDependableFinder(
StoredFormatIds.SEQUENCE_DESCRIPTOR_FINDER_V01_ID);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementColumnPermission.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementColumnPermission.java
index e465dd7f48..3cd6dc6dfd 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementColumnPermission.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementColumnPermission.java
@@ -93,9 +93,11 @@ public void check( LanguageConnectionContext lcc,
Activation activation)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
DataDictionary dd = lcc.getDataDictionary();
ExecPreparedStatement ps = activation.getPreparedStatement();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
if (hasPermissionOnTable(lcc, activation, forGrant, ps)) {
return;
}
@@ -111,6 +113,7 @@ public void check( LanguageConnectionContext lcc,
permittedColumns);
permittedColumns = addPermittedColumns( dd,
false /* non-grantable permissions */,
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
currentUserId,
permittedColumns);
}
@@ -120,6 +123,7 @@ public void check( LanguageConnectionContext lcc,
permittedColumns);
permittedColumns = addPermittedColumns( dd,
true /* grantable permissions */,
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
currentUserId,
permittedColumns);
@@ -135,7 +139,9 @@ public void check( LanguageConnectionContext lcc,
return;
FormatableBitSet unresolvedColumns = (FormatableBitSet)columns.clone();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
for (int i = unresolvedColumns.anySetBit();
i >= 0;
i = unresolvedColumns.anySetBit(i)) {
@@ -163,6 +169,7 @@ public void check( LanguageConnectionContext lcc,
// used.
String dbo = dd.getAuthorizationDatabaseOwner();
rd = dd.getRoleGrantDescriptor(role, currentUserId, dbo);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
if (rd == null) {
rd = dd.getRoleGrantDescriptor
@@ -255,6 +262,8 @@ public void check( LanguageConnectionContext lcc,
(forGrant
? SQLState.AUTH_NO_COLUMN_PERMISSION_FOR_GRANT
: SQLState.AUTH_NO_COLUMN_PERMISSION),
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
currentUserId,
getPrivName(),
cd.getColumnName(),
@@ -271,6 +280,7 @@ public void check( LanguageConnectionContext lcc,
// another role has been set), we are able to
// invalidate the ps or activation (the latter is used
// if the current role changes).
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
DependencyManager dm = dd.getDependencyManager();
RoleGrantDescriptor rgd =
dd.getRoleDefinitionDescriptor(role);
@@ -307,6 +317,7 @@ private FormatableBitSet addPermittedColumns( DataDictionary dd,
* @see StatementPermission#getPermissionDescriptor
*/
public PermissionsDescriptor getPermissionDescriptor(String authid, DataDictionary dd)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
throws StandardException
{
//If table permission found for authorizationid, then simply return that
@@ -379,6 +390,7 @@ public PermissionsDescriptor getPUBLIClevelColPermsDescriptor(String authid, Dat
* @return false if the current role is required
*/
public boolean allColumnsCoveredByUserOrPUBLIC(String authid,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
DataDictionary dd)
throws StandardException {
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementGenericPermission.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementGenericPermission.java
index d4cad0d8b1..c993374c3e 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementGenericPermission.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementGenericPermission.java
@@ -67,6 +67,7 @@ public void check( LanguageConnectionContext lcc,
boolean forGrant,
Activation activation) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
genericCheck( lcc, forGrant, activation, _privilege );
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementPermission.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementPermission.java
index bb72c148e5..0494442f48 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementPermission.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementPermission.java
@@ -56,6 +56,7 @@ public abstract class StatementPermission
public abstract void check( LanguageConnectionContext lcc,
boolean forGrant,
Activation activation) throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
/**
*
@@ -79,6 +80,7 @@ public abstract void check( LanguageConnectionContext lcc,
*/
public abstract PermissionsDescriptor getPermissionDescriptor(String authid, DataDictionary dd)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
/**
* Return true if the passed in permission matches the one required by this
@@ -115,6 +117,7 @@ public String getObjectType()
TransactionController tc = lcc.getTransactionExecute();
ExecPreparedStatement ps = activation.getPreparedStatement();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
PermissionsDescriptor perm =
getPermissionDescriptor( lcc.getCurrentUserId(activation), dd );
if( !isCorrectPermission( perm ) ) { perm = getPermissionDescriptor(Authorizer.PUBLIC_AUTHORIZATION_ID, dd ); }
@@ -137,6 +140,7 @@ public String getObjectType()
String dbo = dd.getAuthorizationDatabaseOwner();
RoleGrantDescriptor rd = dd.getRoleGrantDescriptor
(role, lcc.getCurrentUserId(activation), dbo);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
if (rd == null) {
rd = dd.getRoleGrantDescriptor(
@@ -209,6 +213,7 @@ public String getObjectType()
(forGrant
? SQLState.AUTH_NO_GENERIC_PERMISSION_FOR_GRANT
: SQLState.AUTH_NO_GENERIC_PERMISSION),
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
lcc.getCurrentUserId(activation),
privilegeType,
getObjectType(),
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementRolePermission.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementRolePermission.java
index 8c48622d13..1b2023726a 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementRolePermission.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementRolePermission.java
@@ -55,6 +55,7 @@ public StatementRolePermission(String roleName, int privType)
*/
public void check(LanguageConnectionContext lcc,
boolean forGrant,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
Activation activation
) throws StandardException
{
@@ -98,6 +99,7 @@ public PermissionsDescriptor getPermissionDescriptor(String authid,
private String getPrivName( )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
switch(privType) {
case Authorizer.CREATE_ROLE_PRIV:
return "CREATE_ROLE";
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementRoutinePermission.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementRoutinePermission.java
index 97b842b07b..d4436c7d60 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementRoutinePermission.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementRoutinePermission.java
@@ -54,6 +54,7 @@ public StatementRoutinePermission( UUID routineUUID)
*/
public UUID getRoutineUUID()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3743
return routineUUID;
}
@@ -62,8 +63,10 @@ public UUID getRoutineUUID()
*/
public void check( LanguageConnectionContext lcc,
boolean forGrant,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
Activation activation) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
genericCheck( lcc, forGrant, activation, "EXECUTE" );
}
@@ -89,6 +92,7 @@ public PrivilegedSQLObject getPrivilegedObject( DataDictionary dd ) throws Stand
* @see StatementPermission#getPermissionDescriptor
*/
public PermissionsDescriptor getPermissionDescriptor(String authid, DataDictionary dd)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
throws StandardException
{
return dd.getRoutinePermissions(routineUUID,authid);
@@ -101,6 +105,7 @@ public PermissionsDescriptor getPermissionDescriptor(String authid, DataDictiona
public String toString()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
return "StatementRoutinePermission: " + routineUUID;
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementSchemaPermission.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementSchemaPermission.java
index 05e5b9963e..1a37e38a76 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementSchemaPermission.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementSchemaPermission.java
@@ -62,15 +62,19 @@ public StatementSchemaPermission(String schemaName, String aid, int privType)
*/
public void check( LanguageConnectionContext lcc,
boolean forGrant,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
Activation activation) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
DataDictionary dd = lcc.getDataDictionary();
TransactionController tc = lcc.getTransactionExecute();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
String currentUserId = lcc.getCurrentUserId(activation);
switch ( privType )
{
case Authorizer.MODIFY_SCHEMA_PRIV:
case Authorizer.DROP_SCHEMA_PRIV:
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, false);
// If schema hasn't been created already, no need to check
// for drop schema, an exception will be thrown if the schema
@@ -78,6 +82,7 @@ public void check( LanguageConnectionContext lcc,
if (sd == null)
return;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
if (!currentUserId.equals(sd.getAuthorizationId()))
throw StandardException.newException(
SQLState.AUTH_NO_ACCESS_NOT_OWNER,
@@ -117,6 +122,7 @@ public void check( LanguageConnectionContext lcc,
* @see StatementPermission#check
*/
public PermissionsDescriptor getPermissionDescriptor(String authid, DataDictionary dd)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
throws StandardException
{
return null;
@@ -124,6 +130,7 @@ public PermissionsDescriptor getPermissionDescriptor(String authid, DataDictiona
private String getPrivName( )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
switch(privType) {
case Authorizer.CREATE_SCHEMA_PRIV:
return "CREATE_SCHEMA";
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementTablePermission.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementTablePermission.java
index 5ce4485ae2..5006792941 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementTablePermission.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/StatementTablePermission.java
@@ -116,7 +116,9 @@ public void check( LanguageConnectionContext lcc,
{
ExecPreparedStatement ps = activation.getPreparedStatement();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
if (!hasPermissionOnTable(lcc, activation, forGrant, ps)) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5017
DataDictionary dd = lcc.getDataDictionary();
TableDescriptor td = getTableDescriptor( dd);
throw StandardException.newException(
@@ -149,13 +151,17 @@ protected TableDescriptor getTableDescriptor(DataDictionary dd) throws Standard
* privileges
*/
protected boolean hasPermissionOnTable(LanguageConnectionContext lcc,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
Activation activation,
boolean forGrant,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
ExecPreparedStatement ps)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
DataDictionary dd = lcc.getDataDictionary();
String currentUserId = lcc.getCurrentUserId(activation);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
boolean result =
oneAuthHasPermissionOnTable(dd,
@@ -178,6 +184,7 @@ protected boolean hasPermissionOnTable(LanguageConnectionContext lcc,
String dbo = dd.getAuthorizationDatabaseOwner();
RoleGrantDescriptor rd = dd.getRoleGrantDescriptor
(role, currentUserId, dbo);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
if (rd == null) {
rd = dd.getRoleGrantDescriptor(
@@ -219,6 +226,7 @@ protected boolean hasPermissionOnTable(LanguageConnectionContext lcc,
// another role has been set), we are able to
// invalidate the ps or activation (the latter is used
// if the current role changes).
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
DependencyManager dm = dd.getDependencyManager();
RoleGrantDescriptor rgd =
dd.getRoleDefinitionDescriptor(role);
@@ -272,6 +280,7 @@ protected boolean oneAuthHasPermissionOnTable(DataDictionary dd, String authoriz
* @see StatementPermission#getPermissionDescriptor
*/
public PermissionsDescriptor getPermissionDescriptor(String authid, DataDictionary dd)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
throws StandardException
{
//if the required type of privilege exists for the given authorizer,
@@ -292,6 +301,7 @@ public String getPrivName( )
{
case Authorizer.SELECT_PRIV:
case Authorizer.MIN_SELECT_PRIV:
+//IC see: https://issues.apache.org/jira/browse/DERBY-1824
return "SELECT";
case Authorizer.UPDATE_PRIV:
return "UPDATE";
@@ -309,6 +319,7 @@ public String getPrivName( )
public String toString()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
return "StatementTablePermission: " + getPrivName() + " " + tableUUID;
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/TableDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/TableDescriptor.java
index 78d584bffa..efaa46957d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/TableDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/TableDescriptor.java
@@ -48,6 +48,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
This class represents a table descriptor. The external interface to this
class is:
@@ -90,6 +91,7 @@ public void getAllRelevantConstraints(...) throws StandardException
*/
public class TableDescriptor extends UniqueSQLObjectDescriptor
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
implements Provider, Dependent
{
public static final int BASE_TABLE_TYPE = 0;
@@ -108,6 +110,7 @@ public class TableDescriptor extends UniqueSQLObjectDescriptor
public static final int ISTATS_ABSDIFF_THRESHOLD;
public static final double ISTATS_LNDIFF_THRESHOLD;
static {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4938
ISTATS_CREATE_THRESHOLD = PropertyUtil.getSystemInt(
Property.STORAGE_AUTO_INDEX_STATS_DEBUG_CREATE_THRESHOLD,
Property.STORAGE_AUTO_INDEX_STATS_DEBUG_CREATE_THRESHOLD_DEFAULT
@@ -162,6 +165,7 @@ public class TableDescriptor extends UniqueSQLObjectDescriptor
*/
private volatile long heapConglomNumber = -1;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4895
ColumnDescriptorList columnDescriptorList;
ConglomerateDescriptorList conglomerateDescriptorList;
ConstraintDescriptorList constraintDescriptorList;
@@ -186,6 +190,8 @@ private FormatableBitSet referencedColumnMapGet() {
(FormatableBitSet newReferencedColumnMap) {
LanguageConnectionContext lcc =
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
(LanguageConnectionContext)getContextOrNull(
LanguageConnectionContext.CONTEXT_ID);
@@ -319,6 +325,7 @@ public void setTableName(String newTableName)
*/
public String getQualifiedName()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4476
return IdUtil.mkQualifiedName(getSchemaName(), getName());
}
@@ -413,6 +420,7 @@ public int getNumberOfColumns()
*/
public FormatableBitSet getReferencedColumnMap()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2861
return referencedColumnMapGet();
}
@@ -424,6 +432,7 @@ public FormatableBitSet getReferencedColumnMap()
*/
public void setReferencedColumnMap(FormatableBitSet referencedColumnMap)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2861
referencedColumnMapPut(referencedColumnMap);
}
@@ -462,6 +471,7 @@ public int getMaxColumnID()
{
int maxColumnID = 1;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
for (ColumnDescriptor cd : columnDescriptorList)
{
maxColumnID = Math.max( maxColumnID, cd.getPosition() );
@@ -548,11 +558,13 @@ public ExecRow getEmptyExecRow()
throws StandardException
{
int columnCount = getNumberOfColumns();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2661
ExecRow result =
getDataDictionary().getExecutionFactory().getValueRow(columnCount);
for (int index = 0; index < columnCount; index++)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
ColumnDescriptor cd = columnDescriptorList.elementAt(index);
//String name = column.getColumnName();
DataValueDescriptor dataValue = cd.getType().getNull();
@@ -574,6 +586,7 @@ public ExecRow getEmptyExecRow()
* @exception StandardException Standard exception policy.
**/
public int[] getColumnCollationIds()
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
throws StandardException
{
int[] collation_ids = new int[getNumberOfColumns()];
@@ -581,6 +594,7 @@ public int[] getColumnCollationIds()
for (int index = 0; index < collation_ids.length; index++)
{
ColumnDescriptor cd = columnDescriptorList.elementAt(index);
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
collation_ids[index] = cd.getType().getCollationType();
@@ -649,6 +663,7 @@ public boolean isPersistent()
*/
public boolean isSynonymDescriptor()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-335
if (tableType == TableDescriptor.SYNONYM_TYPE)
return true;
return false;
@@ -663,6 +678,7 @@ public boolean isSynonymDescriptor()
public int getTotalNumberOfIndexes()
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3790
return getQualifiedNumberOfIndexes(0, false);
}
@@ -680,6 +696,7 @@ public int getTotalNumberOfIndexes()
public int getQualifiedNumberOfIndexes(int minColCount,
boolean nonUniqeTrumpsColCount) {
int matches = 0;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
for (ConglomerateDescriptor cd : conglomerateDescriptorList) {
if (cd.isIndex()) {
IndexRowGenerator irg = cd.getIndexDescriptor();
@@ -706,6 +723,7 @@ public int getQualifiedNumberOfIndexes(int minColCount,
(
int statementType,
int[] changedColumnIds,
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
TriggerDescriptorList relevantTriggers
)
throws StandardException
@@ -721,6 +739,7 @@ public int getQualifiedNumberOfIndexes(int minColCount,
DataDictionary dd = getDataDictionary();
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
for (TriggerDescriptor tgr : dd.getTriggerDescriptors(this)) {
if (tgr.needsToFire(statementType, changedColumnIds)) {
relevantTriggers.add(tgr);
@@ -823,6 +842,7 @@ public int getQualifiedNumberOfIndexes(int minColCount,
*/
public DependableFinder getDependableFinder()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2861
if (referencedColumnMapGet() == null)
return getDependableFinder(StoredFormatIds.TABLE_DESCRIPTOR_FINDER_V01_ID);
else
@@ -838,10 +858,12 @@ public DependableFinder getDependableFinder()
*/
public String getObjectName()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2861
if (referencedColumnMapGet() == null)
return tableName;
else
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
StringBuilder name = new StringBuilder();
name.append(tableName);
boolean first = true;
@@ -852,6 +874,7 @@ public String getObjectName()
{
if (first)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5071
name.append("(").append(cd.getColumnName());
first = false;
}
@@ -899,6 +922,7 @@ public String toString()
{
if (SanityManager.DEBUG)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4087
String tempString =
"\n" + "schema: " + schema + "\n" +
"tableName: " + tableName + "\n" +
@@ -909,6 +933,7 @@ public String toString()
"heapConglomNumber: " + heapConglomNumber + "\n";
if (tableType == TableDescriptor.GLOBAL_TEMPORARY_TABLE_TYPE)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4087
tempString = tempString + "onCommitDeleteRows: " + "\n" +
onCommitDeleteRows + "\n";
tempString = tempString + "onRollbackDeleteRows: " + "\n" +
@@ -1050,6 +1075,8 @@ public void emptyTriggerDescriptorList()
throws StandardException
{
// Easier just to get a new CDL then to clean out the current one
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
this.triggerDescriptorList = new TriggerDescriptorList();
}
@@ -1244,6 +1271,7 @@ public IndexLister getIndexLister()
*/
public boolean tableHasAutoincrement()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
for (ColumnDescriptor cd : columnDescriptorList)
{
if (cd.isAutoincrement())
@@ -1319,7 +1347,9 @@ public synchronized List getStatistics() throws StandardEx
* @throws StandardException if obtaining index statistics fails
*/
public void markForIndexStatsUpdate(long tableRowCountEstimate)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4938
throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
List sdl = getStatistics();
if (sdl.isEmpty() && tableRowCountEstimate >= ISTATS_CREATE_THRESHOLD) {
// No statistics exists, create them.
@@ -1330,6 +1360,7 @@ public void markForIndexStatsUpdate(long tableRowCountEstimate)
}
// Check the state of the existing indexes (if any).
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
for (StatisticsDescriptor sd : sdl) {
long indexRowCountEstimate = sd.getStatistic().getRowEstimate();
long diff = Math.abs(tableRowCountEstimate - indexRowCountEstimate);
@@ -1387,6 +1418,7 @@ public boolean statisticsExist(ConglomerateDescriptor cd)
throws StandardException
{
List sdl = getStatistics();
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
if (cd == null)
return (sdl.size() > 0);
@@ -1423,6 +1455,7 @@ public double selectivityForConglomerate(ConglomerateDescriptor cd,
{
UUID referenceUUID = cd.getUUID();
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
for (StatisticsDescriptor statDesc : getStatistics())
{
if (!referenceUUID.equals(statDesc.getReferenceID()))
@@ -1447,6 +1480,7 @@ public double selectivityForConglomerate(ConglomerateDescriptor cd,
@Override
public String getDescriptorType()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-335
return (tableType == TableDescriptor.SYNONYM_TYPE) ? "Synonym" : "Table/View";
}
@@ -1536,6 +1570,7 @@ public static String makeSequenceName( UUID tableID )
*/
private static Context getContextOrNull( final String contextID )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getContextOrNull( contextID );
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/TablePermsDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/TablePermsDescriptor.java
index 07b83cb30f..e7931dc2e5 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/TablePermsDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/TablePermsDescriptor.java
@@ -52,6 +52,7 @@ public TablePermsDescriptor( DataDictionary dd,
String insertPriv,
String updatePriv,
String referencesPriv,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
String triggerPriv) throws StandardException
{
super (dd, grantee, grantor);
@@ -64,7 +65,9 @@ public TablePermsDescriptor( DataDictionary dd,
this.triggerPriv = triggerPriv;
//tableUUID can be null only if the constructor with tablePermsUUID
//has been invoked.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
if (tableUUID != null)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
tableName = dd.getTableDescriptor(tableUUID).getName();
}
@@ -74,6 +77,7 @@ public TablePermsDescriptor( DataDictionary dd,
public TablePermsDescriptor( DataDictionary dd,
String grantee,
String grantor,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
UUID tableUUID) throws StandardException
{
this( dd, grantee, grantor, tableUUID,
@@ -81,6 +85,7 @@ public TablePermsDescriptor( DataDictionary dd,
}
public TablePermsDescriptor( DataDictionary dd,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
UUID tablePermsUUID) throws StandardException
{
this( dd, null, null, null,
@@ -104,6 +109,7 @@ public int getCatalogNumber()
public String toString()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
return "tablePerms: grantee=" + getGrantee() +
",tablePermsUUID=" + getUUID() +
",grantor=" + getGrantor() +
@@ -133,6 +139,7 @@ public boolean equals( Object other)
*/
public int hashCode()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
return super.keyHashCode() + tableUUID.hashCode();
}
@@ -141,6 +148,7 @@ public int hashCode()
*/
public boolean checkOwner(String authorizationId) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
TableDescriptor td = getDataDictionary().getTableDescriptor(tableUUID);
if (td.getSchemaDescriptor().getAuthorizationId().equals(authorizationId))
return true;
@@ -181,6 +189,7 @@ public String getClassType()
*/
public DependableFinder getDependableFinder()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
return getDependableFinder(
StoredFormatIds.TABLE_PERMISSION_FINDER_V01_ID);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java
index 304ce8768d..6c633ceed4 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java
@@ -95,6 +95,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*
*/
public class TriggerDescriptor extends UniqueSQLObjectDescriptor
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
implements Provider, Dependent, Formatable
{
// field that we want users to be able to know about
@@ -162,6 +163,7 @@ public TriggerDescriptor() {}
* @param whenClauseText the SQL text of the WHEN clause, or {@code null}
* if there is no WHEN clause
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6186
TriggerDescriptor
(
DataDictionary dataDictionary,
@@ -198,6 +200,7 @@ public TriggerDescriptor() {}
this.whenSPSId = whenSPSId;
this.isEnabled = isEnabled;
this.referencedCols = referencedCols;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
setReferencedColsInTriggerAction( referencedColsInTriggerAction );
this.creationTimestamp = DataTypeUtilities.clone( creationTimestamp );
this.triggerDefinition = triggerDefinition;
@@ -285,6 +288,7 @@ public int getTriggerEventMask()
*/
public Timestamp getCreationTimestamp()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
return DataTypeUtilities.clone( creationTimestamp );
}
@@ -404,6 +408,7 @@ private SPSDescriptor getSPS(LanguageConnectionContext lcc,
: pa.parseStatement(originalSQL);
lcc.popCompilerContext(newCC);
int[] cols;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6783
cols = dd.examineTriggerNodeAndCols(stmtnode,
oldReferencingName,
newReferencingName,
@@ -411,6 +416,7 @@ private SPSDescriptor getSPS(LanguageConnectionContext lcc,
referencedCols,
referencedColsInTriggerAction,
0,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6726
getTableDescriptor(),
-1,
false,
@@ -423,9 +429,11 @@ private SPSDescriptor getSPS(LanguageConnectionContext lcc,
referencedCols,
referencedColsInTriggerAction,
0,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6726
getTableDescriptor(),
-1,
false,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6783
null,
cols);
@@ -525,12 +533,14 @@ public TableDescriptor getTableDescriptor()
*/
public int[] getReferencedCols()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
return ArrayUtil.copy( referencedCols );
}
/** Update the array of referenced columns */
public void setReferencedCols( int[] newCols )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
referencedCols = ArrayUtil.copy( newCols );
}
@@ -541,6 +551,7 @@ public void setReferencedCols( int[] newCols )
*/
public int[] getReferencedColsInTriggerAction()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
return ArrayUtil.copy( referencedColsInTriggerAction );
}
@@ -811,6 +822,7 @@ public synchronized boolean isValid()
case DependencyManager.DROP_SPS:
case DependencyManager.DROP_VIEW:
case DependencyManager.RENAME:
+//IC see: https://issues.apache.org/jira/browse/DERBY-1643
case DependencyManager.REVOKE_PRIVILEGE_RESTRICT:
case DependencyManager.DROP_METHOD_ALIAS:
DependencyManager dm = getDataDictionary().getDependencyManager();
@@ -861,6 +873,7 @@ public void makeInvalid(int action, LanguageConnectionContext lcc) throws Standa
// make the TriggerDescriptor drop itself.
// Ditto for revoking a role conferring a privilege.
case DependencyManager.REVOKE_PRIVILEGE:
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
case DependencyManager.REVOKE_ROLE:
drop(lcc);
@@ -972,6 +985,7 @@ protected DataDictionary getDataDictionary()
if (dd == null)
{
LanguageConnectionContext lcc = (LanguageConnectionContext)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
getContext(LanguageConnectionContext.CONTEXT_ID);
dd = lcc.getDataDictionary();
setDataDictionary(dd);
@@ -1063,6 +1077,7 @@ public String getDescriptorType()
*/
private static Context getContext( final String contextID )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getContext( contextID );
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/TupleDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/TupleDescriptor.java
index e623bf83b2..c1110b605f 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/TupleDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/TupleDescriptor.java
@@ -89,6 +89,7 @@ public boolean isPersistent()
//////////////////////////////////////////////////////////////////
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
DependableFinder getDependableFinder(int formatId)
{
return dataDictionary.getDependableFinder(formatId);
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/UserDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/UserDescriptor.java
index 068b136f8e..c0ff1eb56e 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/UserDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/UserDescriptor.java
@@ -45,6 +45,7 @@ public final class UserDescriptor extends TupleDescriptor
* @param password The user's password.
* @param lastModified Time that the password was last modified.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6186
UserDescriptor
(
DataDictionary dataDictionary,
@@ -67,6 +68,7 @@ public final class UserDescriptor extends TupleDescriptor
System.arraycopy( password, 0, _password, 0, password.length );
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
_lastModified = DataTypeUtilities.clone( lastModified );
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java
index 30916d8bb7..a5fe3fcbe6 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java
@@ -52,6 +52,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
public final class ViewDescriptor extends UniqueTupleDescriptor
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
implements Dependent, Provider
{
private final int checkOption;
@@ -242,6 +243,9 @@ public void prepareToInvalidate(Provider p, int action,
*/
case DependencyManager.CREATE_INDEX:
case DependencyManager.DROP_INDEX:
+//IC see: https://issues.apache.org/jira/browse/DERBY-1489
+//IC see: https://issues.apache.org/jira/browse/DERBY-1909
+//IC see: https://issues.apache.org/jira/browse/DERBY-1926
case DependencyManager.DROP_COLUMN:
case DependencyManager.CREATE_CONSTRAINT:
case DependencyManager.ALTER_TABLE:
@@ -274,9 +278,11 @@ public void prepareToInvalidate(Provider p, int action,
// anything here. Later in makeInvalid method, we make the
// ViewDescriptor drop itself.
case DependencyManager.REVOKE_ROLE:
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
// Only used by Activations
case DependencyManager.RECHECK_PRIVILEGES:
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
break;
// When REVOKE_PRIVILEGE gets sent to a
@@ -285,6 +291,7 @@ public void prepareToInvalidate(Provider p, int action,
// may be GPSs needing re-compilation. But Dependents
// could also be ViewDescriptors, which then also need
// to handle this event.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2594
case DependencyManager.INTERNAL_RECOMPILE_REQUEST:
break;
@@ -345,6 +352,7 @@ public void makeInvalid(int action, LanguageConnectionContext lcc)
// Only used by Activations
case DependencyManager.RECHECK_PRIVILEGES:
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
// When REVOKE_PRIVILEGE gets sent to a
// TablePermsDescriptor we must also send
@@ -352,6 +360,7 @@ public void makeInvalid(int action, LanguageConnectionContext lcc)
// may be GPSs needing re-compilation. But Dependents
// could also be ViewDescriptors, which then also need
// to handle this event.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2594
case DependencyManager.INTERNAL_RECOMPILE_REQUEST:
break;
@@ -359,8 +368,13 @@ public void makeInvalid(int action, LanguageConnectionContext lcc)
// types SELECT, UPDATE, DELETE, INSERT, REFERENCES, TRIGGER),
// we make the ViewDescriptor drop itself. REVOKE_ROLE also
// drops the dependent view.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1489
+//IC see: https://issues.apache.org/jira/browse/DERBY-1909
+//IC see: https://issues.apache.org/jira/browse/DERBY-1926
case DependencyManager.DROP_COLUMN:
case DependencyManager.REVOKE_PRIVILEGE:
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
case DependencyManager.REVOKE_ROLE:
TableDescriptor td =
@@ -472,6 +486,7 @@ private void drop(
/* Drop all table and column permission descriptors */
dd.dropAllTableAndColPermDescriptors(td.getUUID(), tc);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1543
/* Drop the table */
dd.dropTableDescriptor(td, sd, tc);
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/ExecAggregator.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/ExecAggregator.java
index f0f48cdd4b..bd7d0ee05a 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/ExecAggregator.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/ExecAggregator.java
@@ -28,6 +28,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import org.apache.derby.iapi.services.loader.ClassFactory;
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
An ExecAggregator is the interface that execution uses
to an aggregate. System defined aggregates will implement
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/ExecPreparedStatement.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/ExecPreparedStatement.java
index 4c55888d15..4c04466a07 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/ExecPreparedStatement.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/ExecPreparedStatement.java
@@ -71,6 +71,7 @@ public interface ExecPreparedStatement
* @return a list with all the saved objects
*/
List getSavedObjects();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
/**
* Get the saved cursor info. Used for stored prepared
@@ -175,6 +176,7 @@ public interface ExecPreparedStatement
* the database does not use SQL standard authorization
*/
List getRequiredPermissionsList();
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
// Methods for stale plan checking.
@@ -193,6 +195,7 @@ public interface ExecPreparedStatement
* @return the row count from the first execution of the result set
*/
long getInitialRowCount(int rsNum, long currentRowCount);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5947
/**
* Set the stale plan check interval.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/ExecutionFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/ExecutionFactory.java
index 7c45560db8..22be468363 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/ExecutionFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/ExecutionFactory.java
@@ -99,6 +99,7 @@ public ResultSetStatisticsFactory getResultSetStatisticsFactory()
* @exception StandardException Thrown on error
*/
XPLAINFactoryIF getXPLAINFactory()
+//IC see: https://issues.apache.org/jira/browse/DERBY-2661
throws StandardException;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/NoPutResultSet.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/NoPutResultSet.java
index 169d9e221d..ee216598a8 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/NoPutResultSet.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/NoPutResultSet.java
@@ -198,6 +198,7 @@ public interface NoPutResultSet extends ResultSet, RowLocationRetRowSource
* @exception StandardException thrown on failure.
*/
public void updateRow(ExecRow row, RowChanger rowChanger)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4198
throws StandardException;
/**
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java
index bfde9ef2c4..65642ce182 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java
@@ -121,6 +121,7 @@ ResultSet getSetTransactionResultSet(Activation activation)
@exception StandardException thrown when unable to perform the insert
*/
ResultSet getInsertResultSet(NoPutResultSet source, GeneratedMethod generationClauses,
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
GeneratedMethod checkGM, int fullTemplate,
String schemaNameName,
String tableName)
@@ -296,6 +297,7 @@ ResultSet getCallStatementResultSet(GeneratedMethod methodCall,
that is applied to the activation's "current row" field
to determine whether the restriction is satisfied or not.
The signature of this method is
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
"Boolean restriction() throws StandardException;"
@param projection a reference to a method in the activation
that is applied to the activation's "current row" field
@@ -331,6 +333,8 @@ NoPutResultSet getProjectRestrictResultSet(NoPutResultSet source,
boolean reuseResult,
boolean doesProjection,
boolean validatingCheckConstraint,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6670
+//IC see: https://issues.apache.org/jira/browse/DERBY-6665
String validatingBaseTableUUIDString,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost) throws StandardException;
@@ -352,6 +356,7 @@ NoPutResultSet getProjectRestrictResultSet(NoPutResultSet source,
that is applied to the activation's "current row" field
to project out the expected result row.
The signature of this method is
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
"ExecRow projection() throws StandardException;"
@param resultSetNumber The resultSetNumber for the ResultSet
@param mapRefItem Item # for mapping of source to target columns
@@ -588,6 +593,7 @@ NoPutResultSet getAnyResultSet(NoPutResultSet source,
/**
A once result set iterates over its source,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
raising an error if the source returns > 1 row and
returning a row with all columns set to nulls
if the source returns no rows.
@@ -628,6 +634,7 @@ NoPutResultSet getOnceResultSet(NoPutResultSet source,
create the result set.
@param row a reference to a method in the activation
that creates the expected row.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
"ExecRow row() throws StandardException;"
@param canCacheRow True if execution can cache the input row
after it has gotten it. If the input row is constructed soley
@@ -690,6 +697,7 @@ public NoPutResultSet getVTIResultSet(Activation activation, int row,
int returnTypeNumber,
int vtiProjectionNumber,
int vtiRestrictionNumber,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6117
String vtiSchema,
String vtiName
)
@@ -883,6 +891,7 @@ NoPutResultSet getDistinctScanResultSet(
@exception StandardException thrown when unable to create the
result set
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
NoPutResultSet getValidateCheckConstraintResultSet(
Activation activation,
long conglomId,
@@ -1072,6 +1081,7 @@ NoPutResultSet getMultiProbeTableScanResultSet(
and uses the RowLocation in its last column to get the row from the
base conglomerate.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2998
@param conglomId Conglomerate # for the heap.
@param scoci The saved item for the static conglomerate info.
@@ -1079,6 +1089,7 @@ NoPutResultSet getMultiProbeTableScanResultSet(
rows from an index conglomerate
@param resultRowAllocator a reference to a method in the activation
that creates a holder for the rows from the scan.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
"ExecRow rowAllocator() throws StandardException;"
@param resultSetNumber The resultSetNumber for the ResultSet
@param indexName The name of the index.
@@ -1086,6 +1097,7 @@ NoPutResultSet getMultiProbeTableScanResultSet(
are referenced in the underlying heap. -1 if
no item.
@param allColRefItem A saved item for a bitImpl of columns
+//IC see: https://issues.apache.org/jira/browse/DERBY-2226
that are referenced in the underlying
index and heap. -1 if no item.
@param heapOnlyColRefItem A saved item for a bitImpl of
@@ -1126,6 +1138,8 @@ public NoPutResultSet getIndexRowToBaseRowResultSet(
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-3634
+//IC see: https://issues.apache.org/jira/browse/DERBY-4069
A OLAP window on top of a regular result set. It is used to realize
window functions.
@@ -1303,6 +1317,10 @@ public NoPutResultSet getNestedLoopLeftOuterJoinResultSet(NoPutResultSet leftRes
that is applied to the activation's "current row" field
to determine whether the joinClause is satisfied or not.
The signature of this method is
+//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
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
"Boolean joinClause() throws StandardException;"
@param resultSetNumber The resultSetNumber for the ResultSet
@param emptyRowFun a reference to a method in the activation
@@ -1332,6 +1350,10 @@ public NoPutResultSet getHashLeftOuterJoinResultSet(NoPutResultSet leftResultSet
boolean notExistsRightSide,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1700
+//IC see: https://issues.apache.org/jira/browse/DERBY-1700
+//IC see: https://issues.apache.org/jira/browse/DERBY-1700
+//IC see: https://issues.apache.org/jira/browse/DERBY-1700
String userSuppliedOptimizerOverrides)
throws StandardException;
@@ -1522,6 +1544,7 @@ NoPutResultSet getSetOpResultSet( NoPutResultSet leftSource,
int resultRowTemplate,
long conglomId,
String tableName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
String userSuppliedOptimizerOverrides,
String indexName,
int colRefItem,
@@ -1535,6 +1558,7 @@ NoPutResultSet getSetOpResultSet( NoPutResultSet leftSource,
/**
A Dependent table scan result set forms a result set on a scan
+//IC see: https://issues.apache.org/jira/browse/DERBY-6003
of a dependent table for the rows that got materialized
on the scan of its parent table and if the row being deleted
on parent table has a reference in the dependent table.
@@ -1548,6 +1572,10 @@ NoPutResultSet getSetOpResultSet( NoPutResultSet leftSource,
@param startKeyGetter a reference to a method in the activation
that gets the start key indexable row for the scan. Null
means there is no start key.
+//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
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
"ExecIndexRow startKeyGetter() throws StandardException;"
@param startSearchOperator The start search operator for opening
the scan
@@ -1579,6 +1607,7 @@ NoPutResultSet getSetOpResultSet( NoPutResultSet leftSource,
optimizer
@param optimizerEstimatedCost Estimated total cost by optimizer
@param parentResultSetId Id to access the materialized temporary result
+//IC see: https://issues.apache.org/jira/browse/DERBY-6003
set from the reference stored in the activation.
@param fkIndexConglomId foreign key index conglomerate id.
@param fkColArrayItem saved column array object that matches the foreign key index
@@ -1602,6 +1631,15 @@ public NoPutResultSet getRaDependentTableScanResultSet(
boolean sameStartStopPosition,
Qualifier[][] qualifiers,
String tableName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
String userSuppliedOptimizerOverrides,
String indexName,
boolean isConstraint,
@@ -1642,9 +1680,11 @@ public NoPutResultSet getRaDependentTableScanResultSet(
*/
public NoPutResultSet getRowCountResultSet(
+//IC see: https://issues.apache.org/jira/browse/DERBY-4079
NoPutResultSet source,
Activation activation,
int resultSetNumber,
+//IC see: https://issues.apache.org/jira/browse/DERBY-4208
GeneratedMethod offsetMethod,
GeneratedMethod fetchFirstMethod,
boolean hasJDBClimitClause,
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/TargetResultSet.java b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/TargetResultSet.java
index 5ac16cbcf6..28369bf6ae 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/TargetResultSet.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/sql/execute/TargetResultSet.java
@@ -50,6 +50,7 @@ public interface TargetResultSet extends ResultSet
public void changedRow(ExecRow execRow, RowLocation rowLocation) throws StandardException;
public void offendingRowLocation(
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
RowLocation rl, long constainerId) throws StandardException;
/**
* Preprocess the source row prior to getting it back from the source.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/AccessFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/AccessFactory.java
index dd7602b961..f946db39f7 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/AccessFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/AccessFactory.java
@@ -36,6 +36,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Module interface for an access manager. An access manager provides
transactional access via access methods to data in a single storage
@@ -238,6 +239,7 @@ TransactionController getAndNameTransaction(
* thrown on error.
*/
public void startReplicationMaster(String dbmaster, String host, int port,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2977
String replicationMode)
throws StandardException;
@@ -337,6 +339,8 @@ public void backupAndEnableLogArchiveMode(
public void disableLogArchiveMode(boolean deleteOnlineArchivedLogFiles)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-239
+//IC see: https://issues.apache.org/jira/browse/DERBY-523
/**
* Checkpoints the database, that is, flushes all dirty data to disk.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/AccessFactoryGlobals.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/AccessFactoryGlobals.java
index b612ea713d..4ff7186c7f 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/AccessFactoryGlobals.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/AccessFactoryGlobals.java
@@ -73,6 +73,7 @@ public interface AccessFactoryGlobals
public static final String SORT_INTERNAL = "sort internal";
public static final String SORT_UNIQUEWITHDUPLICATENULLS_EXTERNAL
= "sort almost unique external";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
public static final String NESTED_READONLY_USER_TRANS = "nestedReadOnlyUserTransaction";
public static final String NESTED_UPDATE_USER_TRANS = "nestedUpdateUserTransaction";
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java
index 3d86c4b3e2..b4c2c33d3e 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java
@@ -58,6 +58,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
The hash table will be built logically as follows (actual implementation
may differ). The important points are that the hash value is the standard
java hash value on the row[key_column_numbers[0], if key_column_numbers.length is 1,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
or row[key_column_numbers[0, 1, ...]] if key_column_numbers.length > 1,
and that duplicate detection is done by the standard java duplicate detection provided by
java.util.Hashtable.
@@ -118,6 +119,7 @@ or a LocatedRow (i.e., a structure holding the columns plus a RowLocation).
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
DataValueDescriptor[] and ArrayList<DataValueDescriptor>
or LocatedRow and ArrayList<LocatedRow>
@@ -157,6 +159,7 @@ public class BackingStoreHashtable
* The estimated number of bytes used by ArrayList(0)
*/
private final static int ARRAY_LIST_SIZE =
+//IC see: https://issues.apache.org/jira/browse/DERBY-2493
ClassSize.estimateBaseFromCatalog(ArrayList.class);
private DiskHashtable diskHashtable;
@@ -236,6 +239,7 @@ public BackingStoreHashtable(
this.remove_duplicates = remove_duplicates;
this.row_source = row_source;
this.skipNullKeyColumns = skipNullKeyColumns;
+//IC see: https://issues.apache.org/jira/browse/DERBY-106
this.max_inmemory_rowcnt = max_inmemory_rowcnt;
if ( max_inmemory_rowcnt > 0)
{
@@ -265,6 +269,7 @@ public BackingStoreHashtable(
{
hash_table =
((loadFactor == -1) ?
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
new HashMap(initialCapacity) :
new HashMap(initialCapacity, loadFactor));
}
@@ -297,6 +302,7 @@ public BackingStoreHashtable(
*/
hash_table =
(((estimated_rowcnt <= 0) || (row_source == null)) ?
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
new HashMap() :
(estimated_rowcnt < max_inmemory_size) ?
new HashMap((int) estimated_rowcnt) :
@@ -318,6 +324,10 @@ public BackingStoreHashtable(
// it would still satisfy the max_inmemory condition. Note
// that this isn't a hard limit--the hash table can grow if
// needed.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1007
+//IC see: https://issues.apache.org/jira/browse/DERBY-1259
+//IC see: https://issues.apache.org/jira/browse/DERBY-1260
+//IC see: https://issues.apache.org/jira/browse/DERBY-1205
if (hash_table == null)
{
// Check to see how much memory we think the first row
@@ -325,6 +335,7 @@ public BackingStoreHashtable(
// capacity of the hash table.
double rowUsage = getEstimatedMemUsage(row);
hash_table =
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
new HashMap((int)(max_inmemory_size / rowUsage));
}
@@ -339,8 +350,10 @@ public BackingStoreHashtable(
// an empty result set) so that calls to other methods on this
// BackingStoreHashtable (ex. "size()") will have a working hash_table
// on which to operate.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1365
if (hash_table == null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
hash_table = new HashMap();
}
}
@@ -417,6 +430,7 @@ private static DataValueDescriptor[] cloneRow(DataValueDescriptor[] old_row)
{
if ( old_row[i] != null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4520
new_row[i] = old_row[i].cloneValue(false);
}
}
@@ -443,6 +457,7 @@ static DataValueDescriptor[] shallowCloneRow(DataValueDescriptor[] old_row)
{
if ( old_row[i] != null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4520
new_row[i] = old_row[i].cloneHolder();
}
}
@@ -529,6 +544,7 @@ private void doSpaceAccounting(Object hashValue,
max_inmemory_size -= getEstimatedMemUsage( hashValue );
if ( firstDuplicate)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2493
max_inmemory_size -= ARRAY_LIST_SIZE;
}
}
@@ -581,6 +597,7 @@ private void doSpaceAccounting(Object hashValue,
// Want to start spilling
diskRow = makeDiskRow( columnValues, rowLocation );
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
diskHashtable =
new DiskHashtable(
tc,
@@ -775,6 +792,7 @@ public void close()
hash_table = null;
if ( diskHashtable != null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-106
diskHashtable.close();
diskHashtable = null;
}
@@ -830,6 +848,7 @@ public Enumeration elements()
{
if ( diskHashtable == null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2493
return Collections.enumeration(hash_table.values());
}
return new BackingStoreHashtableEnumeration();
@@ -1091,6 +1110,7 @@ private class BackingStoreHashtableEnumeration implements Enumeration
public boolean hasMoreElements()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2493
if (memoryIterator != null) {
if (memoryIterator.hasNext()) {
return true;
@@ -1106,6 +1126,7 @@ public boolean hasMoreElements()
public Object nextElement() throws NoSuchElementException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2493
if (memoryIterator != null) {
if (memoryIterator.hasNext()) {
return memoryIterator.next();
@@ -1125,6 +1146,7 @@ public Object nextElement() throws NoSuchElementException
private static class RowList extends ArrayList {
private RowList(int initialCapacity) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
super(initialCapacity);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/BinaryOrderable.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/BinaryOrderable.java
index a7ae77350a..1e32a78f1c 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/BinaryOrderable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/BinaryOrderable.java
@@ -33,6 +33,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
The Orderable interface represents a value that can
be linearly ordered.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Currently only supports linear (<, =, <=) operations.
Eventually we may want to do other types of orderings,
in which case there would probably be a number of interfaces
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/DiskHashtable.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/DiskHashtable.java
index 458b4d3841..4dfd6a026d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/DiskHashtable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/DiskHashtable.java
@@ -94,8 +94,10 @@ public DiskHashtable(
this.tc = tc;
this.key_column_numbers = key_column_numbers;
this.remove_duplicates = remove_duplicates;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2462
this.keepAfterCommit = keepAfterCommit;
LanguageConnectionContext lcc = (LanguageConnectionContext)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
getContextOrNull(
LanguageConnectionContext.CONTEXT_ID);
@@ -129,6 +131,7 @@ public DiskHashtable(
"heap",
template,
(ColumnOrdering[]) null,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
collation_ids,
(Properties) null,
tempFlags);
@@ -166,6 +169,7 @@ public DiskHashtable(
// default collation is used for hash code and row location
int[] index_collation_ids =
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
{StringDataValue.COLLATION_TYPE_UCS_BASIC,
StringDataValue.COLLATION_TYPE_UCS_BASIC};
@@ -260,6 +264,7 @@ private Object getRemove(Object key, boolean remove, boolean existenceOnly)
{
int hashCode = key.hashCode();
int rowCount = 0;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
DataValueDescriptor[] firstRow = null;
List allRows = null;
@@ -290,6 +295,7 @@ && rowMatches( row, key))
if( existenceOnly)
return this;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
DataValueDescriptor[] clonedRow =
BackingStoreHashtable.shallowCloneRow(row);
@@ -322,6 +328,7 @@ && rowMatches( row, key))
}
if( remove_duplicates)
// This must be the only row with the key
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
return clonedRow;
}
}
@@ -331,6 +338,7 @@ && rowMatches( row, key))
scan.close();
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
if (allRows == null) {
// No duplicates. Return the single row, or null if no row was
// found for the given key.
@@ -403,6 +411,7 @@ public Enumeration elements()
*/
private static Context getContextOrNull( final String contextID )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getContextOrNull( contextID );
@@ -433,6 +442,7 @@ private class ElementEnum implements Enumeration
try
{
scan = tc.openScan( rowConglomerateId,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2462
keepAfterCommit,
0, // read only
TransactionController.MODE_TABLE,
@@ -448,6 +458,7 @@ private class ElementEnum implements Enumeration
{
scan.close();
scan = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2462
} else if (keepAfterCommit) {
rowloc = rowConglomerate.newRowLocationTemplate();
scan.fetchLocation(rowloc);
@@ -479,6 +490,7 @@ public Object nextElement()
throw new NoSuchElementException();
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2462
if (scan.isHeldAfterCommit()) {
// automatically reopens scan:
if (!scan.positionAtRowLocation(rowloc)) {
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/FileResource.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/FileResource.java
index 5634449c0e..37806d3702 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/FileResource.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/FileResource.java
@@ -57,6 +57,8 @@ Within a database a (name,generationId) pair uniquely identifies
public interface FileResource {
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-304
+//IC see: https://issues.apache.org/jira/browse/DERBY-239
The name of the jar directory
*/
public static final String JAR_DIRECTORY_NAME = "jar";
@@ -111,6 +113,8 @@ public long replace(String name, long currentGenerationId, InputStream source)
throws StandardException;
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-538
+//IC see: https://issues.apache.org/jira/browse/DERBY-2040
Get the StorageFile for a file resource.
@param name The name of the fileResource
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/GlobalXact.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/GlobalXact.java
index 39977c1252..b1cf08ae6a 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/GlobalXact.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/GlobalXact.java
@@ -33,6 +33,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
org.apache.derby.iapi.store.access.xa.XAXactId :
this class is a specific implementation of the JTA Xid interface
org.apache.derby.impl.store.access.GlobalXactId :
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
this class represents internal Derby transaction ids
@@ -83,6 +84,7 @@ public String toString()
for (int i = 0; i < global_id.length; i++)
{
mask = (global_id[i] & 0xFF);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2551
if (mask < 16) {
globalhex += "0" + Integer.toHexString(mask);
} else {
@@ -97,6 +99,7 @@ public String toString()
for (int i = 0; i < branch_id.length; i++)
{
mask = (branch_id[i] & 0xFF);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2551
if (mask < 16) {
branchhex += "0" + Integer.toHexString(mask);
} else {
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/GroupFetchScanController.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/GroupFetchScanController.java
index d22677c017..57264b67ab 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/GroupFetchScanController.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/GroupFetchScanController.java
@@ -139,6 +139,7 @@ public int fetchNextGroup(
throws StandardException;
public int fetchNextGroup(
+//IC see: https://issues.apache.org/jira/browse/DERBY-132
DataValueDescriptor[][] row_array,
RowLocation[] oldrowloc_array,
RowLocation[] newrowloc_array)
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/Qualifier.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/Qualifier.java
index 2f839e7666..15d4680a42 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/Qualifier.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/Qualifier.java
@@ -26,11 +26,13 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import org.apache.derby.shared.common.error.StandardException;
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-1665
A structure which is used to "qualify" a column. Specifies
that the column value in a given column identified by column
id is to be compared via a specific operator to a particular
DataValueDescriptor value.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
The implementation of this interface is provided by the client;
@@ -59,7 +61,9 @@ Licensed to the Apache Software Foundation (ASF) under one or more
compare_result = !(compare_result);
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
+//IC see: https://issues.apache.org/jira/browse/DERBY-1665
Qualifiers are often passed through interfaces as a set of Qualifiers,
rather than one at a time, for example see the qualifier argument in
@@ -85,7 +89,9 @@ Licensed to the Apache Software Foundation (ASF) under one or more
of OR's. Thus the 2 dimensional array qual[][] argument is to be treated as
the following, note if qual.length = 1 then only the first array is valid and
it is and an array of AND clauses:
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
+//IC see: https://issues.apache.org/jira/browse/DERBY-1665
(qual[0][0] AND qual[0][0] ... AND qual[0][qual[0].length - 1])
AND
@@ -94,6 +100,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
(qual[2][0] OR qual[2][1] ... OR qual[2][qual[2].length - 1])
...
AND (qual[qual.length - 1][0] OR qual[1][1] ... OR qual[1][2])
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
If any of the array's qual[0].length ... qual[qual.length -1] are 0 length
@@ -103,6 +110,7 @@ encoding of (a or b) that takes advantage of this.
Note that any of the arrays qual[0].length ... qual[qual.length -1] may also
be of length 1, thus no guarantee is made the presence of OR
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
predicates if qual.length < 1. See example 1a.
@@ -130,6 +138,7 @@ encoding of (a or b) that takes advantage of this.
qualifier[0][0] = a
qualifier[1][0] = b
qualifier[2][0] = c
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Example 2: "(f) AND (a OR b) AND (c OR d OR e)"
@@ -147,6 +156,7 @@ encoding of (a or b) that takes advantage of this.
qualifier[2][0] = c
qualifier[2][1] = d
qualifier[2][2] = e
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Example 3: "(a OR b) AND (c OR d) AND (e OR f)"
@@ -166,6 +176,7 @@ encoding of (a or b) that takes advantage of this.
qualifier[2][1] = d
qualifier[3][0] = e
qualifier[3][1] = f
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Example 4: "(a OR b)"
@@ -178,6 +189,7 @@ encoding of (a or b) that takes advantage of this.
qualifier[1][0] = a
qualifier[1][1] = b
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
@see ScanController
@see TransactionController#openScan
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/RowCountable.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/RowCountable.java
index eb9d7dff2d..a8224e8fc7 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/RowCountable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/RowCountable.java
@@ -54,6 +54,7 @@ public interface RowCountable
*/
public long getEstimatedRowCount()
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4938
/**
* Set the total estimated number of rows in the container.
@@ -81,5 +82,6 @@ public long getEstimatedRowCount()
*/
public void setEstimatedRowCount(long count)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4938
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/RowLocationRetRowSource.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/RowLocationRetRowSource.java
index fb52987468..b8d575efad 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/RowLocationRetRowSource.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/RowLocationRetRowSource.java
@@ -74,6 +74,7 @@ public interface RowLocationRetRowSource extends RowSource
NeedsRowLocation and rowLocation will ONLY be called by a drainer of
the row source which CAN return a row location. Drainer of row source
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
which cannot return rowLocation will guarantee to not call either
callbacks. Conversely, if NeedsRowLocation is called and it returns
true, then for every row return by getNextRowFromRowSource, a
@@ -90,6 +91,7 @@ row location, it needs to clone it (RowLocation is a ClonableObject).
*/
void rowLocation(RowLocation rl) throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
void offendingRowLocation(
RowLocation rl, long containdId) throws StandardException;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/RowSource.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/RowSource.java
index 10ef323aca..fadbe4df1d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/RowSource.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/RowSource.java
@@ -98,6 +98,7 @@ preceeding getNextRowFromRowSource() call. Column N maps to
not in the partial row if validColumns.get(N) returns false. Column N is
in the partial row if validColumns.get(N) returns true. If column N is
in the partial row then it maps to DataValueDescriptor[M] where M is the
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
count of calls to validColumns.get(i) that return true where i < N. If
DataValueDescriptor.length is greater than the number of columns
indicated by validColumns the extra entries are ignored.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/RowUtil.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/RowUtil.java
index 956d88b81d..0c1664b7fb 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/RowUtil.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/RowUtil.java
@@ -36,6 +36,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.util.Vector;
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
A set of static utility methods to work with rows.
@@ -56,6 +57,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
that the format for a partial row changed from a "packed" representation
in the 3.0 release to a "sparse" representation in later releases:
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
@@ -73,6 +75,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
FormatableBitSet.set(7);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
@@ -97,6 +100,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
returns false.
Column N is in the partial row if validColumns.isSet(N) returns true.
If column N is in the partial row then it maps to row[N].
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
If N >= row.length then the column is taken as non existent for an
insert or update, and not fetched on a fetch.
@@ -256,6 +260,7 @@ public static int getNumberOfColumns(
/**
See if a row actually contains no columns.
Returns true if row is null or row.length is zero.
+//IC see: https://issues.apache.org/jira/browse/DERBY-404
@return true if row is empty.
*/
@@ -371,6 +376,7 @@ public static final FetchDescriptor getFetchDescriptorConstant(
* @exception StandardException Standard exception policy.
**/
public static DataValueDescriptor[] newTemplate(
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
DataValueFactory dvf,
FormatableBitSet column_list,
int[] format_ids,
@@ -379,6 +385,7 @@ public static DataValueDescriptor[] newTemplate(
{
int num_cols = format_ids.length;
DataValueDescriptor[] ret_row = new DataValueDescriptor[num_cols];
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
int column_listSize =
(column_list == null) ? 0 : column_list.getLength();
@@ -398,6 +405,7 @@ public static DataValueDescriptor[] newTemplate(
// get empty instance of object identified by the format id.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
ret_row[i] = dvf.getNull(format_ids[i], collation_ids[i]);
}
}
@@ -422,6 +430,7 @@ public static DataValueDescriptor[] newTemplate(
* @exception StandardException Standard exception policy.
**/
public static DataValueDescriptor[] newRowFromTemplate(
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
DataValueDescriptor[] template)
throws StandardException
{
@@ -460,6 +469,7 @@ public static String toString(Object[] row)
{
String str = "";
+//IC see: https://issues.apache.org/jira/browse/DERBY-5491
if (row != null)
{
@@ -501,6 +511,7 @@ public static String toString(Hashtable hash_table)
if (SanityManager.DEBUG)
{
String str = "";
+//IC see: https://issues.apache.org/jira/browse/DERBY-5491
Object row_or_vector;
@@ -524,6 +535,7 @@ else if (row_or_vector instanceof Vector)
str +=
"vec[" + i + "]:" +
RowUtil.toString((Object[]) vec.get(i));
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
str += "\n";
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/ScanController.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/ScanController.java
index 28dd64f11b..ed219be6a9 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/ScanController.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/ScanController.java
@@ -189,6 +189,7 @@ Fetch the (partial) row at the current position of the Scan.
fetch must be compatible with the number of scan columns
requested at the openScan call time.
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
A fetch can return a sub-set of the scan columns requested
at scan open time by supplying a destRow will less elements
than the number of requested columns. In this case the N leftmost
@@ -218,6 +219,7 @@ void fetch(DataValueDescriptor[] destRow)
throws StandardException;
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-690
The same as fetch, except that the qualifiers passed to the openScan()
will not be applied. destRow will contain the current row even if it
has been changed and no longer qualifies.
@@ -331,6 +333,7 @@ boolean next()
boolean positionAtRowLocation(RowLocation rl)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1067
/**
Replace the (partial) row at the current position of the scan.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/SortController.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/SortController.java
index 18fbeaab40..c075b6ca64 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/SortController.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/SortController.java
@@ -44,6 +44,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
public interface SortController
{
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-2486
Inform SortController that all the rows have
been inserted into it.
**/
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/SpaceInfo.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/SpaceInfo.java
index 4d0aee451c..d5998728c9 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/SpaceInfo.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/SpaceInfo.java
@@ -23,6 +23,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Manage the result information from a single call to
ConglomerateController.getSpaceInfo().
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/StoreCostController.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/StoreCostController.java
index b9d40e87db..317ddb7292 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/StoreCostController.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/StoreCostController.java
@@ -30,6 +30,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
The StoreCostController interface provides methods that an access client
(most likely the system optimizer) can use to get store's estimated cost of
@@ -44,6 +45,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
once per unit of work and rather than close and reopen the controller. For
instance if the optimizer needs to cost 2 different scans against a single
conglomerate, it should use one instance of the StoreCostController.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
The locking behavior of the implementation of a StoreCostController is
@@ -53,6 +55,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
conglomerate, thus allowing concurrent access to the table by a executing
query while another query is optimizing.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
@see TransactionController#openStoreCost
@see RowCountable
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/StoreCostResult.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/StoreCostResult.java
index c6eed17a9d..69f2a598dd 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/StoreCostResult.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/StoreCostResult.java
@@ -23,6 +23,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Manage the result information from a single call to
StoreCostController.getScanCost().
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/TransactionController.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/TransactionController.java
index 9d892f44c9..9aea902dfa 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/TransactionController.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/TransactionController.java
@@ -305,11 +305,13 @@ boolean conglomerateExists(long conglomId)
long conglomId = tc.createConglomerate(
"heap", // we're requesting a heap conglomerate
template, // a populated template is required for heap and btree.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
null, // no column order
null, // default collation order for all columns
null, // default properties
0); // not temporary
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Each implementation of a conglomerate takes a possibly different set
of properties. The "heap" implementation currently takes no properties.
@@ -386,6 +388,7 @@ template is kept (and thus this template can be re-used in subsequent
Ascending order.
@param collationIds Specifies the collation id of each of the columns
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
in the new conglomerate. Collation id along with format id may be used
to create DataValueDescriptor's which may subsequently be used for
comparisons. For instance the correct collation specific order and
@@ -420,6 +423,7 @@ temporary conglomerates are truncated on abort (or rollback
All temporary conglomerate is removed by store when the
conglomerate controller is destroyed, or if it is dropped by an explicit
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
dropConglomerate. If Derby reboots, all temporary
conglomerates are removed.
@@ -454,6 +458,7 @@ with a database backup rather than an transaction log backup (when we have
For now, use "BTREE" or "heap" for a local access manager.
@param template A row which describes the prototypical
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
row that the conglomerate will be holding.
Typically this row gives the conglomerate
information about the number and type of
@@ -501,6 +506,7 @@ long createAndLoadConglomerate(
Properties properties,
int temporaryFlag,
RowLocationRetRowSource rowSource,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
long[] rowCount)
throws StandardException;
@@ -549,6 +555,7 @@ template is kept (and thus this template can be re-used in subsequent
Ascending order.
@param collationIds Specifies the collation id of each of the columns
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
in the new conglomerate. Collation id along with format id may be used
to create DataValueDescriptor's which may subsequently be used for
comparisons. For instance the correct collation specific order and
@@ -626,6 +633,7 @@ long recreateAndLoadConglomerate(
public void addColumnToConglomerate(
long conglomId,
int column_id,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
Storable template_column,
int collation_id)
throws StandardException;
@@ -990,6 +998,7 @@ BackingStoreHashtable createBackingStoreHashtableFromScan(
x: 1 3 4 4 4 5 5 5 6 7 9
y: 1 1 2 4 6 2 4 6 1 1 1
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
A {start key, search op} pair of {{5.2}, GE} would position on
@@ -1009,6 +1018,7 @@ open a scan on the conglomerate (or a useful index) of t
| | value | op | value |op | returned |serialization |
+-------------------+-------+----+-------+---+--------------+--------------+
| x = 5 | {5} | GE | {5} |GT |{5,2} .. {5,6}|{4,6} .. {5,6}|
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
| x > 5 | {5} | GT | null | |{6,1} .. {9,1}|{5,6} .. {9,1}|
| x >= 5 | {5} | GE | null | |{5,2} .. {9,1}|{4,6} .. {9,1}|
| x <= 5 | null | | {5} |GT |{1,1} .. {5,6}|first .. {5,6}|
@@ -1019,6 +1029,7 @@ open a scan on the conglomerate (or a useful index) of t
| x = 5 and y < 5 | {5} | GE | {5,5} |GE |{5,2} .. {5,4}|{4,6} .. {5,4}|
| x = 2 | {2} | GE | {2} |GT | none |{1,1} .. {1,1}|
+-------------------+-------+----+-------+---+--------------+--------------+
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
As the above table implies, the underlying scan may lock
@@ -1068,6 +1079,7 @@ For example ((x = 5) or (x = 6)) and ((y = 1) or (y = 2)) would be
if (qualifier != null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
for (int and_clause; and_clause < qualifier.length; and_clause++)
{
boolean or_qualifies = false;
@@ -1101,6 +1113,7 @@ For example ((x = 5) or (x = 6)) and ((y = 1) or (y = 2)) would be
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
@param conglomId The identifier of the conglomerate
to open the scan for.
@@ -1623,6 +1636,7 @@ Sorts also do aggregation. The input (unaggregated) rows
row.
So, for the query:
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
select a, sum(b)
from t
@@ -1748,6 +1762,7 @@ SortController openSort(long id)
*
* @see StoreCostController
**/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6075
SortCostController openSortCostController()
throws StandardException;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/conglomerate/Conglomerate.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/conglomerate/Conglomerate.java
index 6c7dadf8b5..a8217f8018 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/conglomerate/Conglomerate.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/conglomerate/Conglomerate.java
@@ -84,6 +84,7 @@ public interface Conglomerate extends Storable, DataValueDescriptor
public void addColumn(
TransactionManager xact_manager,
int column_id,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
Storable template_column,
int collation_id)
throws StandardException;
@@ -308,6 +309,7 @@ ScanManager openScan(
int lock_level,
LockingPolicy locking_policy,
int isolation_level,
+//IC see: https://issues.apache.org/jira/browse/DERBY-132
FormatableBitSet scanColumnList,
DataValueDescriptor[] startKeyValue,
int startSearchOperator,
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/conglomerate/ScanManager.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/conglomerate/ScanManager.java
index 27cfa70c55..af4e0398c9 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/conglomerate/ScanManager.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/conglomerate/ScanManager.java
@@ -29,6 +29,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import org.apache.derby.iapi.store.access.BackingStoreHashtable;
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
The ScanManager interface contains those methods private to access method
implementors necessary to implement Scans on Conglomerates. Client of scans
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/conglomerate/Sort.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/conglomerate/Sort.java
index bfab0a2070..99eb9a6b83 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/conglomerate/Sort.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/conglomerate/Sort.java
@@ -59,6 +59,7 @@ SortController open(TransactionManager tran)
@exception StandardException Standard exception policy.
**/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
ScanManager openSortScan(
TransactionManager tran,
boolean hold)
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/conglomerate/TransactionManager.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/conglomerate/TransactionManager.java
index 8e3664f889..6d09302a9b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/conglomerate/TransactionManager.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/conglomerate/TransactionManager.java
@@ -32,6 +32,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
The TransactionManager interface provides methods on the transaction needed
by an access method implementer, but should not be visible to clients of a
@@ -99,6 +100,7 @@ public interface TransactionManager extends TransactionController
public boolean checkVersion(
int requiredMajorVersion,
int requiredMinorVersion,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
String feature)
throws StandardException;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/xa/XAXactId.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/xa/XAXactId.java
index f4f2ff8116..df4f87e06a 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/xa/XAXactId.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/access/xa/XAXactId.java
@@ -64,6 +64,7 @@ private void copy_init_xid(
byte[] branch_id)
{
this.format_id = format_id;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6184
this.global_id = (byte[]) global_id.clone();
this.branch_id = (byte[]) branch_id.clone();
}
@@ -227,6 +228,7 @@ public int getFormatId()
**/
public byte[] getGlobalTransactionId()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6184
return (byte[]) global_id.clone();
}
@@ -238,6 +240,7 @@ public byte[] getGlobalTransactionId()
**/
public byte[] getBranchQualifier()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6184
return (byte[]) branch_id.clone();
}
@@ -274,6 +277,7 @@ public boolean equals(Object other)
// this class only knows how to compare with other Xids
if (SanityManager.DEBUG)
SanityManager.THROWASSERT("comparing XAXactId with " +
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
other.getClass().getName(), cce);
return false;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/ContainerHandle.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/ContainerHandle.java
index b31bf5992f..565dcd4642 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/ContainerHandle.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/ContainerHandle.java
@@ -27,6 +27,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.util.Properties;
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
A Container contains a contigious address space of pages, the pages
start at page number Container.FIRST_PAGE_NUMBER and are numbered sequentially.
@@ -56,6 +57,7 @@ If the caller calls getPage (or one of its variants) more than once on the
done. In the example, p1 could have been unlatched after p2 with no ill
effects.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Open container modes
ContainerHandle.MODE are used to open or create the container.
@@ -88,6 +90,7 @@ the container (other than the create) is ever logged. The difference
does not force the cache. It is up to the client of raw store to force the
cache at the appropriate time - this allows a statement to create and open
the container serveral times for bulk loading without logging or doing any
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
synchronous I/O.
MODE_LOCK_NOWAIT - if set, then don't wait for the container lock, else
wait for the container lock. This flag only dictates whether the lock
@@ -114,6 +117,7 @@ the container (other than the create) is ever logged. The difference
update since the last commit or abort. Temporary containers are private
to a transaction and must only be used a single thread within the
transaction at any time, these restrictions are not currently enforced.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
When opening a temporary container for update access these additional mode
@@ -216,6 +220,7 @@ public interface ContainerHandle
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-132
Release free space to the OS.
As is possible release any free space to the operating system. This
@@ -414,6 +419,7 @@ caller until its unlatch() method is called.
for (Page p = containerHandle.getFirstPage();
p != null;
p = containerHandle.getNextPage(p.getPageNumber()))
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
will guarentee to iterate thru and latched all the valid pages
in the container
@@ -457,6 +463,7 @@ public Page getPageForInsert(int flag)
public Page getPageForCompress(
int flag,
+//IC see: https://issues.apache.org/jira/browse/DERBY-132
long pageno)
throws StandardException;
@@ -618,6 +625,7 @@ public RecordHandle makeRecordHandle(long pageNumber, int recordId)
public SpaceInfo getSpaceInfo() throws StandardException;
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-239
Backup the container to the specified path.
@exception StandardException Standard Derby error policy
*/
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/ContainerKey.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/ContainerKey.java
index e7b745ae02..9697b41763 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/ContainerKey.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/ContainerKey.java
@@ -176,6 +176,7 @@ public boolean lockAttributes(int flag, Hashtable attributes)
if ((flag & VirtualLockTable.TABLE_AND_ROWLOCK) == 0)
return false;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
attributes.put(VirtualLockTable.CONTAINERID,getContainerId());
attributes.put(VirtualLockTable.LOCKNAME, "Tablelock");
attributes.put(VirtualLockTable.LOCKTYPE, "TABLE");
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/ContainerLock.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/ContainerLock.java
index f5785e1883..2882490da3 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/ContainerLock.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/ContainerLock.java
@@ -89,6 +89,7 @@ private ContainerLock(int type) {
/**
Get an integer representation of the type of the lock. This method is guaranteed
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
to return an integer >= 0 and < C_NUMBER. No correlation between the value
and one of the static variables (CIS etc.) is guaranteed, except that
the values returned do not change.
@@ -98,6 +99,7 @@ public int getType() {
}
public boolean isCompatible(ContainerLock granted) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2122
return (granted.typeBit & compat) != 0;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/Loggable.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/Loggable.java
index 3b91b8e302..7e790839a7 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/Loggable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/Loggable.java
@@ -93,6 +93,7 @@ which contains optional data that will be available in to doMe()
releaseResource method.
The sequence of events in recovery redo of a Loggable operation is:
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Get the loggable operation. If loggable.needsRedo is false, then
no need to redo this operation.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/Page.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/Page.java
index 727b18861f..a0f89684d8 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/Page.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/Page.java
@@ -283,6 +283,8 @@ boolean spaceForInsert(
* mode, or if the row cannot fit on the page, or if the row is null
**/
RecordHandle insert(
+//IC see: https://issues.apache.org/jira/browse/DERBY-132
+//IC see: https://issues.apache.org/jira/browse/DERBY-132
Object[] row,
FormatableBitSet validColumns,
byte insertFlag,
@@ -648,6 +650,7 @@ public RecordHandle fetchFromSlot(
is locked but not fetched.
The fieldId of the first field is 0.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
If the fieldId is >= the number of fields on the record,
column is restored to null
@@ -732,6 +735,7 @@ passed to the openContainer() call before the record is updated.
the slot is not on the page, or if the
record is deleted, or if the fieldId
is not on the record and (fieldId - 1)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6323
does not exist, or if the container was
not opened in update mode.
@@ -951,6 +955,7 @@ passed to the openContainer() call before the record is undeleted.
@exception StandardException the container was not opened in update
mode, or the slot is not on the page
+//IC see: https://issues.apache.org/jira/browse/DERBY-6323
*/
RecordHandle updateAtSlot(
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/PageKey.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/PageKey.java
index 8b0df52c01..05353db9d4 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/PageKey.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/PageKey.java
@@ -93,6 +93,7 @@ public boolean equals(Object other) {
public int hashCode() {
int hash = 7;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3280
hash = 79 * hash + container.hashCode();
hash = 79 * hash + (int) (pageNumber ^ (pageNumber >>> 32));
return hash;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java
index c549815ba5..6651467044 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java
@@ -152,6 +152,7 @@ Maximum page cache size we will accept (MAXINT).
/** Property name for the number of open files to maintain associated with
the page cache. Internally this is referred to as the "ContainerCache".
+//IC see: https://issues.apache.org/jira/browse/DERBY-3734
Each object in this cache maps to a java level "open" file on a file
in the database directory. Although actual implementation depends on
@@ -289,6 +290,7 @@ Maximum stream file buffer size we will accept (MAXINT).
if this property is set, it will attempt to allocate
CONTAINER_INITIAL_PAGES, but with no guarentee.
CONTAIENR_INITIAL_PAGES legally ranges from 1 to
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
MAX_CONTAINER_INITIAL_PAGES. Values < 1 will
be set to 1 and values > MAX_CONTAINER_INITIAL_PAGES will be set to
MAX_CONTAINER_INITIAL_PAGES
@@ -469,6 +471,7 @@ The cleanupOnError() method of this context behaves as follows:
If error is an instance of StandardException that
has a severity less than ExceptionSeverity.TRANSACTION_SEVERITY then
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
no action is taken.
If error is an instance of StandardException that
@@ -514,6 +517,7 @@ public Transaction startTransaction(
Starting a transaction always performs the following steps.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Create an raw store transaction context
Create a new idle transaction and then link it to the context.
@@ -527,6 +531,7 @@ The cleanupOnError() method of this context behaves as follows:
If error is an instance of StandardException that
has a severity less than ExceptionSeverity.TRANSACTION_SEVERITY then
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
no action is taken.
If error is an instance of StandardException that
@@ -591,6 +596,7 @@ public Transaction findUserTransaction(
Starting an internal transaction always performs the following steps.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Create an raw store internal transaction context
Create a new idle internal transaction and then link it to the
context.
@@ -618,6 +624,7 @@ The cleanupOnError() method of this context behaves as follows:
If error is an instance of StandardException that
has a severity less than ExceptionSeverity.TRANSACTION_SEVERITY then
the internal transaction is aborted, the internal transaction is closed, the context is popped off the stack, and an exception of severity
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Transaction exception is re-thrown.
If error is an instance of StandardException that has a severity
@@ -647,6 +654,7 @@ The cleanupOnError() method of this context behaves as follows:
the transaction.
Starting a transaction always performs the following steps.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Create an raw store transaction context
Create a new idle transaction and then link it to the context.
@@ -694,7 +702,9 @@ The cleanupOnError() method of this context behaves as follows:
*/
public Transaction startNestedReadOnlyUserTransaction(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6554
Transaction parentTransaction,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
CompatibilitySpace compatibilitySpace,
ContextManager contextMgr,
String transName)
@@ -709,8 +719,10 @@ public Transaction startNestedReadOnlyUserTransaction(
the transaction.
Starting a transaction always performs the following steps.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Create an raw store transaction context.
Create a new idle transaction and then link it to the context.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Only one user transaction and one nested user transaction can be active
in a context at any one time.
@@ -723,6 +735,8 @@ The cleanupOnError() method of this context behaves as follows:
If error is an instance of StandardException that
has a severity less than ExceptionSeverity.TRANSACTION_SEVERITY then
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
no action is taken.
If error is an instance of StandardException that
@@ -759,6 +773,7 @@ The cleanupOnError() method of this context behaves as follows:
*/
public Transaction startNestedUpdateUserTransaction(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6554
Transaction parentTransaction,
ContextManager contextMgr,
String transName,
@@ -783,6 +798,7 @@ public Transaction startNestedUpdateUserTransaction(
* thrown on error.
*/
public void startReplicationMaster(String dbmaster, String host, int port,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2977
String replicationMode)
throws StandardException;
@@ -836,6 +852,8 @@ public void startReplicationMaster(String dbmaster, String host, int port,
* @exception StandardException Thrown on error
*/
public void backup(
+//IC see: https://issues.apache.org/jira/browse/DERBY-239
+//IC see: https://issues.apache.org/jira/browse/DERBY-523
String backupDir,
boolean wait) throws StandardException;
@@ -885,6 +903,7 @@ public void disableLogArchiveMode(boolean deleteOnlineArchivedLogFiles)
/**
Checkpoint the database.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4239
The raw store will wait for any current checkpoints to complete. It
will start a new checkpoint and not return until that checkpoint
@@ -982,6 +1001,7 @@ public void getRawStoreProperties(PersistentSet tc)
@exception StandardException Standard Derby Error Policy
*/
public int encrypt(byte[] cleartext, int offset, int length,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1156
byte[] ciphertext, int outputOffset,
boolean newEngine)
throws StandardException ;
@@ -1034,6 +1054,7 @@ long getMaxContainerId()
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-239
Get the Transaction Factory to use with this store.
*/
public TransactionFactory getXactFactory();
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/RowLock.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/RowLock.java
index f8f33f230a..288c04125b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/RowLock.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/RowLock.java
@@ -97,6 +97,7 @@ public final class RowLock {
private RowLock(int type) {
this.type = type;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2122
typeBit = (1 << type);
int bitmask = 0;
for (int i = 0; i < R_NUMBER; i++) {
@@ -110,6 +111,7 @@ private RowLock(int type) {
/**
Get an integer representation of the type of the lock. This method is
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
guaranteed to return an integer >= 0 and < R_NUMBER. No correlation
between the value and one of the static variables (CIS etc.) is
guaranteed, except that the values returned do not change.
@@ -119,6 +121,7 @@ public int getType() {
}
public boolean isCompatible(RowLock granted) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2122
return (granted.typeBit & compat) != 0;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/Transaction.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/Transaction.java
index a4fe8fa9e6..0c2b0fa1bc 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/Transaction.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/Transaction.java
@@ -58,6 +58,7 @@ public interface Transaction {
* @return The compatibility space of the transaction.
**/
CompatibilitySpace getCompatibilitySpace();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
/**
* Tell this transaction whether it should time out immediately if a lock
@@ -185,6 +186,8 @@ Everything else is identical to commit(), use this at your own risk.
occur of lower severity than Transaction severity are caught, the
transaction is then aborted and then an exception of Transaction
severity is thrown nesting the original exception.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6323
+//IC see: https://issues.apache.org/jira/browse/DERBY-6323
Any exception more severe than a
Transaction exception is not caught and the transaction is not aborted.
The transaction will be aborted by the standard context mechanism.
@@ -629,5 +632,6 @@ public void xa_rollback()
* @exception StandardException Standard exception policy.
**/
public DataValueFactory getDataValueFactory()
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
throws StandardException;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/Undoable.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/Undoable.java
index 056f4b4181..c266c752b8 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/Undoable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/Undoable.java
@@ -46,6 +46,7 @@ public interface Undoable extends Loggable {
There are 3 ways to implement a redo-only log record:
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Make the log record a Loggable instead of an Undoable, this is the
cleanest method.
@@ -74,6 +75,7 @@ Any resource (e.g., latched page) that is needed for the
The sequence of events in a rollback of a undoable operation is
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
The logging system calls undoable.generateUndo. If this returns
null, then there is nothing to undo.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/data/DataFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/data/DataFactory.java
index fd75787e7f..428c455cdc 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/data/DataFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/data/DataFactory.java
@@ -269,6 +269,7 @@ public int reclaimSpace(Serviceable work, ContextManager contextMgr)
@exception StandardException Standard Derby Error Policy
*/
public int encrypt(byte[] cleartext, int offset, int length,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1156
byte[] ciphertext, int outputOffset,
boolean newEngine)
throws StandardException ;
@@ -289,6 +290,7 @@ public int decrypt(byte[] ciphertext, int offset, int length,
* @param t the transaction that is decrypting the container
* @exception StandardException Standard Derby Error Policy
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-5792
void decryptAllContainers(RawTransaction t)
throws StandardException;
@@ -397,6 +399,7 @@ long getMaxContainerId()
* @return the root directory of the data storage area
*/
String getRootDirectory();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6733
public void stop();
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/data/RawContainerHandle.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/data/RawContainerHandle.java
index 32ceed32ba..e794cba693 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/data/RawContainerHandle.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/data/RawContainerHandle.java
@@ -131,5 +131,6 @@ checkpoint is taken after any log record is sent to the log stream but
*/
public void encryptOrDecryptContainer(String newFilePath, boolean doEncrypt)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5792
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/log/LogFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/log/LogFactory.java
index ce4a841033..5bb3b11069 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/log/LogFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/log/LogFactory.java
@@ -94,6 +94,7 @@ public void recover(DataFactory dataFactory,
properties,
RawStore.LOG_SWITCH_INTERVAL and RawStore.CHECKPOINT_INTERVAL.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4239
By default, LOG_SWITCH_INTERVAL is every 1M bytes of log record
written. User can change this value by setting the property to some
other values during boot time. The legal range of LOG_SWITCH_INTERVAL
@@ -162,6 +163,7 @@ LogScan openForwardsFlushedScan(LogInstant startAt)
@return the LogScan.
@exception StandardException Standard Derby error policy
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-862
ScanHandle openFlushedScan(DatabaseInstant startAt, int groupsIWant)
throws StandardException;
@@ -404,6 +406,7 @@ public boolean checkVersion(int requiredMajorVersion,
*/
public void startReplicationMasterRole(MasterFactory masterFactory)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3051
/**
* Stop this LogFactory from passing log records to the
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/xact/RawTransaction.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/xact/RawTransaction.java
index 2d393063d0..4ca03c30c1 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/xact/RawTransaction.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/xact/RawTransaction.java
@@ -322,6 +322,7 @@ public void notifyObservers(Object arg) {
* @exception StandardException Exception encountered during checkpoint
*/
public abstract void checkpointInRollForwardRecovery(LogInstant cinstant,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3562
long redoLWM,
long undoLWM)
throws StandardException;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/xact/TransactionFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/xact/TransactionFactory.java
index 1958a60630..ecfdb9cea2 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/xact/TransactionFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/xact/TransactionFactory.java
@@ -109,7 +109,9 @@ public RawTransaction startTransaction(
*/
public RawTransaction startNestedReadOnlyUserTransaction(
RawStoreFactory rsf,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6554
RawTransaction parentTransaction,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
CompatibilitySpace compatibilitySpace,
ContextManager contextMgr,
String transName)
@@ -139,6 +141,7 @@ public RawTransaction startNestedReadOnlyUserTransaction(
*/
public RawTransaction startNestedUpdateUserTransaction(
RawStoreFactory rsf,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6554
RawTransaction parentTransaction,
ContextManager contextMgr,
String transName,
@@ -335,6 +338,7 @@ public void useTransactionTable(Formatable transactionTable)
*/
public boolean blockBackupBlockingOperations(boolean wait)
throws StandardException ;
+//IC see: https://issues.apache.org/jira/browse/DERBY-239
/**
* Backup completed. Allow backup blocking operations.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/replication/master/MasterFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/replication/master/MasterFactory.java
index 1a2664305c..ea5acbc0df 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/replication/master/MasterFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/replication/master/MasterFactory.java
@@ -71,6 +71,7 @@ public interface MasterFactory {
/** The name of the Master Factory, used to boot the service. */
public static final String MODULE =
"org.apache.derby.iapi.store.replication.master.MasterFactory";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3432
/* Property names that are used as key values in the Properties objects*/
@@ -141,6 +142,7 @@ public void startMaster(RawStoreFactory rawStore,
**/
public void appendLog(long greatestInstant,
byte[] log, int logOffset, int logLength);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2977
/**
* Used by the LogFactory to notify the replication master
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/store/replication/slave/SlaveFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/store/replication/slave/SlaveFactory.java
index f0ff9b7f21..9cdb77d676 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/store/replication/slave/SlaveFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/store/replication/slave/SlaveFactory.java
@@ -45,12 +45,14 @@ public interface SlaveFactory {
/** The name of the Slave Factory, used to boot the service. */
public static final String MODULE =
"org.apache.derby.iapi.store.replication.slave.SlaveFactory";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3432
/* Strings used as keys in the Properties objects*/
/** Property key to specify the name of the database */
public static final String SLAVE_DB =
"replication.slave.dbname";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3184
/** Property key to specify replication mode */
public static final String REPLICATION_MODE =
@@ -64,6 +66,7 @@ public interface SlaveFactory {
*/
public static final String SLAVE_MODE =
"slavemode";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3184
/**
* Property value used to indicate that the service should be
@@ -112,6 +115,8 @@ public void startSlave(RawStoreFactory rawStore, LogFactory logFac)
*/
public void stopSlave(boolean forcedStop)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3021
+//IC see: https://issues.apache.org/jira/browse/DERBY-3071
/**
*
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/transaction/TransactionControl.java b/java/org.apache.derby.engine/org/apache/derby/iapi/transaction/TransactionControl.java
index 8046aa8eed..614bdb9510 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/transaction/TransactionControl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/transaction/TransactionControl.java
@@ -49,6 +49,7 @@ public final class TransactionControl {
* JDBC constants.
*/
private static final int[] CS_TO_JDBC_ISOLATION_LEVEL_MAP = {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6206
java.sql.Connection.TRANSACTION_NONE, // UNSPECIFIED_ISOLATION_LEVEL
java.sql.Connection.TRANSACTION_READ_UNCOMMITTED, // READ_UNCOMMITTED_ISOLATION_LEVEL
java.sql.Connection.TRANSACTION_READ_COMMITTED, // READ_COMMITTED_ISOLATION_LEVEL
@@ -90,6 +91,7 @@ public static String[] isolationTextNames( int derbyIsolationLevel )
public TransactionControl()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
listeners = new ArrayList();
}
@@ -126,6 +128,7 @@ public void preCommitNotify() throws StandardException
if (listeners.isEmpty())
return;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
for (Iterator i = listeners.iterator(); i.hasNext(); )
{
TransactionListener listener =
@@ -167,6 +170,7 @@ public void preRollbackNotify() throws StandardException
if (listeners.isEmpty())
return;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
for (Iterator i = listeners.iterator(); i.hasNext(); )
{
TransactionListener listener =
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/BooleanDataValue.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/BooleanDataValue.java
index 7335e173e8..42bf0081b7 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/BooleanDataValue.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/BooleanDataValue.java
@@ -124,6 +124,7 @@ public BooleanDataValue throwExceptionIfFalse(
* is false.
*/
public BooleanDataValue throwExceptionIfImmediateAndFalse(
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
String SQLState,
String tableName,
String constraintName,
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/CharStreamHeaderGenerator.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/CharStreamHeaderGenerator.java
index 75fe71a2f7..27f8e0e3c6 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/CharStreamHeaderGenerator.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/CharStreamHeaderGenerator.java
@@ -36,6 +36,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*
* The length is encoded like this:
*
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
out.writeByte((byte)(byteLength >>> 8));
out.writeByte((byte)(byteLength >>> 0));
*
@@ -62,6 +63,7 @@ public boolean expectsCharCount() {
/** Write the EOF marker to a byte array and return the EOF marker's length */
public static int writeEOFMarker( byte[] buffer, int offset )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6200
System.arraycopy( DERBY_EOF_MARKER, 0, buffer, offset, DERBY_EOF_MARKER.length );
return DERBY_EOF_MARKER.length;
}
@@ -158,6 +160,7 @@ public int writeEOF(ObjectOutput out, long byteLength)
* @return Maximum header length in bytes.
*/
public int getMaxHeaderLength() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4661
return 2;
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/ClobStreamHeaderGenerator.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/ClobStreamHeaderGenerator.java
index f27c6615e7..c6bac5fb05 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/ClobStreamHeaderGenerator.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/ClobStreamHeaderGenerator.java
@@ -98,6 +98,7 @@ public ClobStreamHeaderGenerator(boolean isPreDerbyTenFive) {
// Do not try to determine the version through the cottext service, use
// the specified value instead.
this.callbackDVD = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4543
this.isPreDerbyTenFive = Boolean.valueOf(isPreDerbyTenFive);
}
@@ -129,6 +130,7 @@ public boolean expectsCharCount() {
* @return The number of bytes written into the buffer.
*/
public int generateInto(byte[] buf, int offset, long valueLength) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4543
if (callbackDVD != null && isPreDerbyTenFive == null) {
determineHeaderFormat();
}
@@ -165,6 +167,7 @@ public int generateInto(byte[] buf, int offset, long valueLength) {
*/
public int generateInto(ObjectOutput out, long valueLength)
throws IOException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4543
if (callbackDVD != null && isPreDerbyTenFive == null) {
determineHeaderFormat();
}
@@ -206,6 +209,7 @@ public int writeEOF(byte[] buffer, int offset, long valueLength) {
}
if (!isPreDerbyTenFive.booleanValue()) {
if (valueLength < 0) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6200
return CharStreamHeaderGenerator.writeEOFMarker( buffer, offset );
} else {
return 0;
@@ -225,11 +229,14 @@ public int writeEOF(byte[] buffer, int offset, long valueLength) {
*/
public int writeEOF(ObjectOutput out, long valueLength)
throws IOException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4543
+//IC see: https://issues.apache.org/jira/browse/DERBY-4543
if (callbackDVD != null && isPreDerbyTenFive == null) {
determineHeaderFormat();
}
if (!isPreDerbyTenFive.booleanValue()) {
if (valueLength < 0) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6200
return CharStreamHeaderGenerator.writeEOFMarker( out );
} else {
return 0;
@@ -245,6 +252,7 @@ public int writeEOF(ObjectOutput out, long valueLength)
* @return Maximum header length in bytes.
*/
public int getMaxHeaderLength() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4661
return 5;
}
@@ -259,6 +267,7 @@ public int getMaxHeaderLength() {
*/
private void determineHeaderFormat() {
DatabaseContext dbCtx = (DatabaseContext)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
getContext(DatabaseContext.CONTEXT_ID);
if (dbCtx == null) {
throw new IllegalStateException("No context, unable to determine " +
@@ -266,6 +275,7 @@ private void determineHeaderFormat() {
} else {
DataDictionary dd = dbCtx.getDatabase().getDataDictionary();
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4543
isPreDerbyTenFive = Boolean.valueOf(!dd.checkVersion(
DataDictionary.DD_VERSION_DERBY_10_5, null));
} catch (StandardException se) {
@@ -280,6 +290,7 @@ private void determineHeaderFormat() {
// being accessed in. It is assumed that a DVD is only shared
// within a single database, i.e. the mode doesn't change during
// the lifetime of the DVD.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4543
callbackDVD.setStreamHeaderFormat(isPreDerbyTenFive);
}
}
@@ -290,6 +301,7 @@ private void determineHeaderFormat() {
*/
private static Context getContext( final String contextID )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getContext( contextID );
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/CollatorSQLChar.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/CollatorSQLChar.java
index 0346a1bb14..7fbe33680d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/CollatorSQLChar.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/CollatorSQLChar.java
@@ -90,6 +90,7 @@ protected RuleBasedCollator getCollatorForCollation() throws StandardException
// Implementation of CollationElementsInterface interface
public boolean hasSingleCollationElement() throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2699
return holderForCollationSensitiveInfo.hasSingleCollationElement();
}
@@ -110,6 +111,7 @@ public DataValueDescriptor cloneValue(boolean forceMaterialization)
catch (StandardException se)
{
if (SanityManager.DEBUG)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
SanityManager.THROWASSERT("Unexpected exception", se);
return null;
}
@@ -135,6 +137,7 @@ public DataValueDescriptor getNewNull()
*/
public StringDataValue getValue(RuleBasedCollator collatorForComparison)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2534
if (collatorForComparison != null)
{
//non-null collatorForComparison means use this collator sensitive
@@ -154,6 +157,7 @@ public StringDataValue getValue(RuleBasedCollator collatorForComparison)
protected int stringCompare(SQLChar char1, SQLChar char2)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2335
return holderForCollationSensitiveInfo.stringCompare(char1, char2);
}
@@ -197,6 +201,7 @@ public BooleanDataValue like(DataValueDescriptor pattern)
* @exception StandardException Thrown on error
*/
public BooleanDataValue like(DataValueDescriptor pattern,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2334
DataValueDescriptor escape) throws StandardException
{
return(holderForCollationSensitiveInfo.like(pattern, escape));
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/CollatorSQLClob.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/CollatorSQLClob.java
index f4fe3fb7ca..86da938f42 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/CollatorSQLClob.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/CollatorSQLClob.java
@@ -72,6 +72,7 @@ class CollatorSQLClob extends SQLClob implements CollationElementsInterface
* Create SQL CLOB value initially set to value that
* performs collation according to collatorForCharacterDatatypes
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-5951
CollatorSQLClob(Clob val, RuleBasedCollator collatorForCharacterDatatypes)
{
super(val);
@@ -103,6 +104,7 @@ protected RuleBasedCollator getCollatorForCollation() throws StandardException
// Implementation of CollationElementsInterface interface
public boolean hasSingleCollationElement() throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2699
return holderForCollationSensitiveInfo.hasSingleCollationElement();
}
@@ -115,6 +117,7 @@ public boolean hasSingleCollationElement() throws StandardException {
*/
public DataValueDescriptor cloneValue(boolean forceMaterialization)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4542
if (forceMaterialization) {
try {
return new CollatorSQLClob(getString(),
@@ -123,6 +126,7 @@ public DataValueDescriptor cloneValue(boolean forceMaterialization)
catch (StandardException se)
{
if (SanityManager.DEBUG)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
SanityManager.THROWASSERT("Unexpected exception", se);
return null;
}
@@ -142,6 +146,7 @@ public DataValueDescriptor cloneValue(boolean forceMaterialization)
*/
public DataValueDescriptor getNewNull()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5951
CollatorSQLClob result = new CollatorSQLClob((String) null,
holderForCollationSensitiveInfo.getCollatorForCollation());
return result;
@@ -157,6 +162,7 @@ public DataValueDescriptor getNewNull()
*/
public StringDataValue getValue(RuleBasedCollator collatorForComparison)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2534
if (collatorForComparison != null)
{
//non-null collatorForComparison means use this collator sensitive
@@ -176,6 +182,7 @@ public StringDataValue getValue(RuleBasedCollator collatorForComparison)
protected int stringCompare(SQLChar char1, SQLChar char2)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2335
return holderForCollationSensitiveInfo.stringCompare(char1, char2);
}
@@ -219,6 +226,7 @@ public BooleanDataValue like(DataValueDescriptor pattern)
* @exception StandardException Thrown on error
*/
public BooleanDataValue like(DataValueDescriptor pattern,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2334
DataValueDescriptor escape) throws StandardException
{
return(holderForCollationSensitiveInfo.like(pattern, escape));
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/CollatorSQLLongvarchar.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/CollatorSQLLongvarchar.java
index f330375bcb..70adaf6b29 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/CollatorSQLLongvarchar.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/CollatorSQLLongvarchar.java
@@ -92,6 +92,7 @@ protected RuleBasedCollator getCollatorForCollation() throws StandardException
// Implementation of CollationElementsInterface interface
public boolean hasSingleCollationElement() throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2699
return holderForCollationSensitiveInfo.hasSingleCollationElement();
}
@@ -112,6 +113,7 @@ public DataValueDescriptor cloneValue(boolean forceMaterialization)
catch (StandardException se)
{
if (SanityManager.DEBUG)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
SanityManager.THROWASSERT("Unexpected exception", se);
return null;
}
@@ -137,6 +139,7 @@ public DataValueDescriptor getNewNull()
*/
public StringDataValue getValue(RuleBasedCollator collatorForComparison)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2534
if (collatorForComparison != null)
{
//non-null collatorForComparison means use this collator sensitive
@@ -156,6 +159,7 @@ public StringDataValue getValue(RuleBasedCollator collatorForComparison)
protected int stringCompare(SQLChar char1, SQLChar char2)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2335
return holderForCollationSensitiveInfo.stringCompare(char1, char2);
}
@@ -199,6 +203,7 @@ public BooleanDataValue like(DataValueDescriptor pattern)
* @exception StandardException Thrown on error
*/
public BooleanDataValue like(DataValueDescriptor pattern,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2334
DataValueDescriptor escape) throws StandardException
{
return(holderForCollationSensitiveInfo.like(pattern, escape));
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/CollatorSQLVarchar.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/CollatorSQLVarchar.java
index 0ad7b391f4..19aeb164d7 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/CollatorSQLVarchar.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/CollatorSQLVarchar.java
@@ -91,6 +91,7 @@ protected RuleBasedCollator getCollatorForCollation() throws StandardException
// Implementation of CollationElementsInterface interface
public boolean hasSingleCollationElement() throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2699
return holderForCollationSensitiveInfo.hasSingleCollationElement();
}
@@ -111,6 +112,7 @@ public DataValueDescriptor cloneValue(boolean forceMaterialization)
catch (StandardException se)
{
if (SanityManager.DEBUG)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
SanityManager.THROWASSERT("Unexpected exception", se);
return null;
}
@@ -143,6 +145,7 @@ protected StringDataValue getNewVarchar() throws StandardException
*/
public StringDataValue getValue(RuleBasedCollator collatorForComparison)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2534
if (collatorForComparison != null)
{
//non-null collatorForComparison means use this collator sensitive
@@ -162,6 +165,7 @@ public StringDataValue getValue(RuleBasedCollator collatorForComparison)
protected int stringCompare(SQLChar char1, SQLChar char2)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2335
return holderForCollationSensitiveInfo.stringCompare(char1, char2);
}
@@ -205,6 +209,7 @@ public BooleanDataValue like(DataValueDescriptor pattern)
* @exception StandardException Thrown on error
*/
public BooleanDataValue like(DataValueDescriptor pattern,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2334
DataValueDescriptor escape) throws StandardException
{
return(holderForCollationSensitiveInfo.like(pattern, escape));
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataType.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataType.java
index 9ff05479b1..b151c48009 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataType.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataType.java
@@ -60,6 +60,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*
*/
public abstract class DataType
+//IC see: https://issues.apache.org/jira/browse/DERBY-4520
implements DataValueDescriptor, Comparable
{
/*
@@ -223,6 +224,7 @@ public Timestamp getTimestamp( Calendar cal) throws StandardException
*/
public InputStream getStream() throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5879
throw dataTypeConversion( "InputStream" );
}
@@ -236,6 +238,7 @@ public InputStream getStream() throws StandardException
* @return {@code false}
*/
public boolean hasStream() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
return false;
}
@@ -249,6 +252,7 @@ public boolean hasStream() {
* @see DataValueDescriptor#getString
*/
public String getTraceString() throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1693
return getString();
}
@@ -272,6 +276,7 @@ public DataValueDescriptor recycle() {
* @see java.io.Externalizable#readExternal
*/
public void readExternalFromArray(ArrayInputStream in)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2920
throws IOException, ClassNotFoundException {
readExternal(in);
}
@@ -385,6 +390,7 @@ public void setValue(Date theValue, Calendar cal) throws StandardException
*/
public void setValue(Object theValue) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4499
throwLangSetMismatch("java.lang.Object");
}
@@ -407,6 +413,7 @@ public void setValue(String theValue) throws StandardException
*/
public void setValue(Blob theValue) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4066
throwLangSetMismatch("java.sql.Blob");
}
@@ -585,6 +592,7 @@ public void setToNull()
*
*/
public void setObjectForCast(Object theValue, boolean instanceOfResultType,
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
String resultTypeClassName) throws StandardException {
if (theValue == null)
@@ -643,6 +651,7 @@ public Object getObject() throws StandardException
void genericSetObject(Object theValue) throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
throwLangSetMismatch(theValue);
}
@@ -659,6 +668,7 @@ void genericSetObject(Object theValue) throws StandardException {
* @return A shallow clone.
*/
public DataValueDescriptor cloneHolder() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4520
return cloneValue(false);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataTypeDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataTypeDescriptor.java
index c264ed6e33..aa059941a1 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataTypeDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataTypeDescriptor.java
@@ -96,6 +96,7 @@ public final class DataTypeDescriptor implements Formatable
* Runtime INTEGER type that is nullable.
*/
public static final DataTypeDescriptor DOUBLE =
+//IC see: https://issues.apache.org/jira/browse/DERBY-5466
new DataTypeDescriptor(TypeId.DOUBLE_ID, true);
public static final int MIN_VALUE_IDX = 0;
@@ -328,6 +329,7 @@ public static TypeDescriptor getCatalogType(TypeDescriptor catalogType,
(
String javaTypeName
)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return DataTypeDescriptor.getSQLDataTypeDescriptor(javaTypeName, true);
@@ -383,6 +385,8 @@ public static TypeDescriptor getCatalogType(TypeDescriptor catalogType,
boolean isNullable,
int maximumWidth
)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
TypeId typeId = TypeId.getSQLTypeForJavaType(javaTypeName);
@@ -507,6 +511,7 @@ public DataTypeDescriptor(TypeId typeId, boolean isNullable,
public DataTypeDescriptor(TypeId typeId, boolean isNullable) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2599
this.typeId = typeId;
typeDescriptor = new TypeDescriptorImpl(typeId.getBaseTypeId(),
typeId.getMaximumPrecision(),
@@ -736,6 +741,7 @@ public DataTypeDescriptor getDominantType(DataTypeDescriptor otherDTS, ClassFact
* types are system built-in types and the other if at least 1 is
* a user type. (typePrecedence is meaningless for user types.)
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
if (!thisType.userType() && !otherType.userType())
{
TypeId higherTypeId;
@@ -908,6 +914,7 @@ else if (thisType.typePrecedence() != otherType.typePrecedence())
higherType = new DataTypeDescriptor(higherType,
precision, scale, nullable, maximumWidth);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2599
//Set collation info on the DTD for dominant type if it is string type
//The algorithm used is explained in this method's javadoc
@@ -1009,6 +1016,7 @@ public TypeId getTypeId()
Get a Null for this type.
*/
public DataValueDescriptor getNull() throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2335
DataValueDescriptor returnDVD = typeId.getNull();
//If we are dealing with default collation, then we have got the
//right DVD already. Just return it.
@@ -1100,6 +1108,7 @@ public int getCollationType()
*/
public static int getCollationType(String collationName)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1748
if (collationName.equalsIgnoreCase(Property.UCS_BASIC_COLLATION))
return StringDataValue.COLLATION_TYPE_UCS_BASIC;
else if (collationName.equalsIgnoreCase(Property.TERRITORY_BASED_COLLATION))
@@ -1129,6 +1138,7 @@ else if (collationName.equalsIgnoreCase(Property.TERRITORY_BASED_IDENTICAL_COLLA
*/
public String getCollationName()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1748
if (getCollationDerivation() == StringDataValue.COLLATION_DERIVATION_NONE)
return Property.COLLATION_NONE;
else
@@ -1367,6 +1377,7 @@ public boolean comparable(DataTypeDescriptor compareWithDTD,
//If both the types are string types, then we need to make sure
//they have the same collation set on them
if (compareWithTypeID.isStringTypeId() && typeId.isStringTypeId()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2793
return compareCollationInfo(compareWithDTD);
} else
return false;//can't be compared
@@ -1455,6 +1466,7 @@ public boolean compareCollationInfo(DataTypeDescriptor compareWithDTD){
//both the operands can not have the collation derivation of
//NONE. This is because in that case, we do not know what kind
//of collation to use for comparison.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2793
if (getCollationDerivation() == compareWithDTD.getCollationDerivation() &&
getCollationDerivation() == StringDataValue.COLLATION_DERIVATION_NONE)
return false;
@@ -1533,6 +1545,8 @@ public double estimatedMemoryUsage() {
case StoredFormatIds.INT_TYPE_ID:
return 4.0;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
case StoredFormatIds.BIGINT_TYPE_ID:
return 8.0;
@@ -1648,6 +1662,7 @@ public static boolean isJDBCTypeEquivalent(int existingType, int jdbcTypeId)
}
// To CLOB
+//IC see: https://issues.apache.org/jira/browse/DERBY-628
if (existingType == Types.CLOB && DataTypeDescriptor.isCharacterType(jdbcTypeId))
return true;
@@ -1658,6 +1673,7 @@ public static boolean isNumericType(int jdbcType) {
switch (jdbcType) {
case Types.BIT:
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
case Types.BOOLEAN:
case Types.TINYINT:
case Types.SMALLINT:
@@ -1723,6 +1739,7 @@ private static boolean isBinaryType(int jdbcType) {
case Types.LONGVARBINARY:
return true;
default:
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
return false;
}
}
@@ -1736,6 +1753,7 @@ private static boolean isBinaryType(int jdbcType) {
* false otherwise
*/
public static boolean isAsciiStreamAssignable(int jdbcType) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1527
return jdbcType == Types.CLOB || isCharacterType(jdbcType);
}
@@ -1787,6 +1805,7 @@ public void readExternal( ObjectInput in )
// Restore typeId from the type descriptor. User-defined types and
// built-in types have different methods for getting the type id.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6003
if (typeDescriptor.isUserDefinedType()) {
try {
typeId = TypeId.getUserDefinedTypeId(
@@ -1855,6 +1874,7 @@ public boolean isUserCreatableType() throws StandardException
case Types.DECIMAL:
return
(getPrecision() <= typeId.getMaximumPrecision()) &&
+//IC see: https://issues.apache.org/jira/browse/DERBY-6956
(getScale() <= typeId.getMaximumScale());
default: break;
}
@@ -1891,6 +1911,7 @@ else if (typeId.variableLength())
* String types.
*/
public String getSQLTypeNameWithCollation() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2668
String name = typeId.getSQLTypeName();
if (typeId.isStringTypeId()) {
name = name + " (" + getCollationName() + ")";
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataTypeUtilities.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataTypeUtilities.java
index e2f4ae97c7..f616e88cc8 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataTypeUtilities.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataTypeUtilities.java
@@ -35,6 +35,7 @@ public abstract class DataTypeUtilities {
/** Clone a Timestamp because they are mutable */
public static Timestamp clone( Timestamp original )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6202
return original == null ? null : (Timestamp) original.clone();
}
@@ -55,10 +56,12 @@ public static int getPrecision(DataTypeDescriptor dtd) {
case Types.VARBINARY:
case Types.LONGVARBINARY:
case Types.BLOB:
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
case Types.SQLXML:
return dtd.getMaximumWidth();
case Types.SMALLINT:
return 5;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
case Types.BOOLEAN:
return 1;
}
@@ -98,6 +101,7 @@ public static boolean isCaseSensitive(DataTypeDescriptor dtd) {
typeId == Types.VARCHAR ||
typeId == Types.CLOB ||
typeId == Types.LONGVARCHAR ||
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
typeId == Types.SQLXML);
}
/**
@@ -148,6 +152,7 @@ public static int getColumnDisplaySize(int typeId, int storageLength)
switch (typeId)
{
case Types.TIMESTAMP:
+//IC see: https://issues.apache.org/jira/browse/DERBY-4614
size = 29;
break;
case Types.DATE:
@@ -164,6 +169,7 @@ public static int getColumnDisplaySize(int typeId, int storageLength)
break;
case Types.REAL :
case Types.FLOAT :
+//IC see: https://issues.apache.org/jira/browse/DERBY-3398
size = 15;
break;
case Types.DOUBLE:
@@ -186,6 +192,7 @@ public static int getColumnDisplaySize(int typeId, int storageLength)
size = 20;
break;
case Types.BIT:
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
case Types.BOOLEAN:
// Types.BIT == SQL BOOLEAN, so 5 chars for 'false'
// In JDBC 3.0, Types.BIT or Types.BOOLEAN = SQL BOOLEAN
@@ -194,6 +201,7 @@ public static int getColumnDisplaySize(int typeId, int storageLength)
default:
// MaximumWidth is -1 when it is unknown.
int w = storageLength;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
size = (w > 0 ? w : JDBC40Translation.DEFAULT_COLUMN_DISPLAY_SIZE);
break;
}
@@ -216,6 +224,7 @@ public static int computeMaxWidth( int precision, int scale)
// 1. If scale = 0, only sign should be added to precision.
// 2. scale=precision, 3 should be added to precision for sign, decimal and an additional char '0'.
// 3. precision > scale > 0, 2 should be added to precision for sign and decimal.
+//IC see: https://issues.apache.org/jira/browse/DERBY-836
return (scale ==0) ? (precision +1) : ((scale == precision) ? (precision + 3) : (precision + 2));
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataValueDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataValueDescriptor.java
index 53dd1e743d..d2ec36f6e6 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataValueDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataValueDescriptor.java
@@ -136,6 +136,7 @@ public interface DataValueDescriptor extends Storable, Orderable
* the associated stream is given.
*/
String getTraceString() throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1693
/**
* Gets the value in the data value descriptor as a boolean.
@@ -290,6 +291,7 @@ public interface DataValueDescriptor extends Storable, Orderable
* @see StringDataValue#getStreamWithDescriptor()
*/
InputStream getStream() throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
/**
* Tells if this data value is, or will be, represented by a stream.
@@ -827,6 +829,7 @@ public BooleanDataValue in(DataValueDescriptor left,
* or higher than all non-NULL values.
*
* @param other The Orderable to compare this one to.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2887
% @param nullsOrderedLow True if null should be lower than non-NULL
*
* @return <0 - this Orderable is less than other.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataValueFactory.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataValueFactory.java
index c368a0c523..764be7b3ac 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataValueFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataValueFactory.java
@@ -251,6 +251,7 @@ StringDataValue getClobDataValue(String value, StringDataValue previous,
* If collationType is equal to StringDataValue.COLLATION_TYPE_UCS_BASIC
* then the call is the equivalent of the overload without collationType.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-5951
StringDataValue getClobDataValue(Clob value, StringDataValue previous,
int collationType) throws StandardException;
@@ -595,6 +596,7 @@ BitDataValue getNullBlob(BitDataValue dataValue)
StringDataValue getNullChar(StringDataValue dataValue,
int collationType)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3320
/**
* Get a SQL VARCHAR (UCS_BASIC) with a SQL null value. If the supplied value
@@ -612,6 +614,7 @@ StringDataValue getNullChar(StringDataValue dataValue,
StringDataValue getNullVarchar(StringDataValue dataValue,
int collationType)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3320
/**
* Get a SQL LONG VARCHAR (UCS_BASIC) with a SQL null value. If the supplied value
@@ -629,6 +632,7 @@ StringDataValue getNullVarchar(StringDataValue dataValue,
StringDataValue getNullLongvarchar(StringDataValue dataValue,
int collationType)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3320
/**
* Get a SQL CLOB (UCS_BASIC) with a SQL null value. If the supplied value
@@ -646,6 +650,7 @@ StringDataValue getNullLongvarchar(StringDataValue dataValue,
StringDataValue getNullClob(StringDataValue dataValue,
int collationType)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3320
/**
* Get a User-defined data value with a SQL null value. If the supplied value
@@ -721,6 +726,7 @@ StringDataValue getNullClob(StringDataValue dataValue,
* @return Collator null if the collation type is UCS_BASIC.
* Collator based on territory if the collation type is TERRITORY_BASED
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-3320
RuleBasedCollator getCharacterCollator(int collationType)
throws StandardException;
@@ -741,6 +747,7 @@ RuleBasedCollator getCharacterCollator(int collationType)
* @return DataValueDescriptor which will be constructed using the
* passed parameters
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2557
DataValueDescriptor getNull(int formatId, int collationType)
throws StandardException;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java
index af2c1d052c..d4e400745a 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java
@@ -76,6 +76,7 @@ public final class DataValueFactoryImpl implements DataValueFactory, ModuleContr
*/
public void boot(boolean create, Properties properties) throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
ModuleFactory monitor = getMonitor();
//The Locale on monitor has already been set by the boot code in
//BasicDatabase so we can simply do a get here.
@@ -86,6 +87,7 @@ public void boot(boolean create, Properties properties) throws StandardException
//Locale object will be used to construct the Collator object which
//will be used if user has requested territory based collation.
databaseLocale = monitor.getLocale(this);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3320
//If we are here for database create time, verify that there is
//Collator support for the database's locale. If not, then we
@@ -116,6 +118,7 @@ public void boot(boolean create, Properties properties) throws StandardException
//If the user has requested for territory based database, then
//verify that JVM has Collator support for the database locale.
String userDefinedCollation =
+//IC see: https://issues.apache.org/jira/browse/DERBY-1748
properties.getProperty(Attribute.COLLATION);
if (userDefinedCollation != null) {//Invalid value handling
int collationType = DataTypeDescriptor.getCollationType(userDefinedCollation);
@@ -184,6 +187,7 @@ public NumberDataValue getDataValue(Short value, NumberDataValue previous)
throws StandardException
{
if (previous == null)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
return new SQLSmallint(value);
previous.setValue(value);
return previous;
@@ -202,6 +206,7 @@ public NumberDataValue getDataValue(Byte value, NumberDataValue previous)
throws StandardException
{
if (previous == null)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
return new SQLTinyint(value);
previous.setValue(value);
return previous;
@@ -221,6 +226,7 @@ public NumberDataValue getDataValue(Long value, NumberDataValue previous)
throws StandardException
{
if (previous == null)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
return new SQLLongint(value);
previous.setValue(value);
return previous;
@@ -239,6 +245,7 @@ public NumberDataValue getDataValue(Float value, NumberDataValue previous)
throws StandardException
{
if (previous == null)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
return new SQLReal(value);
previous.setValue(value);
return previous;
@@ -257,6 +264,7 @@ public NumberDataValue getDataValue(Double value, NumberDataValue previous)
throws StandardException
{
if (previous == null)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
return new SQLDouble(value);
previous.setValue(value);
return previous;
@@ -265,6 +273,7 @@ public NumberDataValue getDataValue(Double value, NumberDataValue previous)
public final NumberDataValue getDecimalDataValue(Number value, NumberDataValue previous)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
NumberDataValue retValue =
(previous == null) ? getNullDecimal(null) : previous;
retValue.setValue(value);
@@ -287,6 +296,7 @@ public BooleanDataValue getDataValue(Boolean value,
throws StandardException
{
if (previous == null)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
return new SQLBoolean(value);
previous.setValue(value);
return previous;
@@ -467,6 +477,7 @@ public StringDataValue getClobDataValue(Clob value, StringDataValue previous) th
}
public StringDataValue getClobDataValue(Clob value,
+//IC see: https://issues.apache.org/jira/browse/DERBY-5951
StringDataValue previous, int collationType)
throws StandardException
{
@@ -658,6 +669,7 @@ public NumberDataValue getNullDouble(NumberDataValue dataValue)
public final NumberDataValue getNullDecimal(NumberDataValue dataValue)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
if (dataValue == null) {
return new SQLDecimal();
}
@@ -850,6 +862,10 @@ public StringDataValue getNullClob(StringDataValue dataValue)
*/
public StringDataValue getNullClob(StringDataValue previous,
int collationType)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3320
+//IC see: https://issues.apache.org/jira/browse/DERBY-3320
+//IC see: https://issues.apache.org/jira/browse/DERBY-3320
+//IC see: https://issues.apache.org/jira/browse/DERBY-3320
throws StandardException
{
if (collationType == StringDataValue.COLLATION_TYPE_UCS_BASIC)
@@ -866,6 +882,7 @@ public UserDataValue getNullObject(UserDataValue dataValue)
{
if (dataValue == null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
return new UserType((Object) null);
}
else
@@ -894,6 +911,7 @@ public DateTimeDataValue getNullDate(DateTimeDataValue dataValue)
{
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
return new SQLDate((Date) null);
}
catch( StandardException se)
@@ -918,6 +936,7 @@ public DateTimeDataValue getNullTime(DateTimeDataValue dataValue)
{
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
return new SQLTime((Time) null);
}
catch( StandardException se)
@@ -942,6 +961,7 @@ public DateTimeDataValue getNullTimestamp(DateTimeDataValue dataValue)
{
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
return new SQLTimestamp((Timestamp) null);
}
catch( StandardException se)
@@ -1017,6 +1037,7 @@ public XMLDataValue getNullXML(XMLDataValue dataValue)
/** @see DataValueFactory#getCharacterCollator(int) */
public RuleBasedCollator getCharacterCollator(int collationType)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3320
throws StandardException {
if (collationType == StringDataValue.COLLATION_TYPE_UCS_BASIC)
return (RuleBasedCollator)null;
@@ -1026,6 +1047,7 @@ else if (collatorForCharacterTypes == null) {
//the Collator for the database locale.
// Calculate the collator strength. COLLATION_TYPE_TERRITORY_BASED use strength -1, i e unspecified.
int strength = collationType - StringDataValue.COLLATION_TYPE_TERRITORY_BASED_PRIMARY;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1748
collatorForCharacterTypes = verifyCollatorSupport(strength);
return collatorForCharacterTypes;
} else
@@ -1057,6 +1079,7 @@ private RuleBasedCollator verifyCollatorSupport(int strength)
databaseLocale.toString());
RuleBasedCollator collator = (RuleBasedCollator)Collator.getInstance(databaseLocale);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1748
if (strength != -1)
collator.setStrength(strength);
@@ -1069,6 +1092,7 @@ private RuleBasedCollator verifyCollatorSupport(int strength)
public DataValueDescriptor getNull(int formatId, int collationType)
throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
DataValueDescriptor returnDVD =
DataValueFactoryImpl.getNullDVDWithUCS_BASICcollation(formatId);
@@ -1112,6 +1136,7 @@ public static DataValueDescriptor getNullDVDWithUCS_BASICcollation(
case StoredFormatIds.SQL_BOOLEAN_ID: return new SQLBoolean();
case StoredFormatIds.SQL_CHAR_ID: return new SQLChar();
case StoredFormatIds.SQL_DATE_ID: return new SQLDate();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
case StoredFormatIds.SQL_DECIMAL_ID: return new SQLDecimal();
case StoredFormatIds.SQL_DOUBLE_ID: return new SQLDouble();
case StoredFormatIds.SQL_INTEGER_ID: return new SQLInteger();
@@ -1130,6 +1155,7 @@ public static DataValueDescriptor getNullDVDWithUCS_BASICcollation(
case StoredFormatIds.SQL_BLOB_ID: return new SQLBlob();
case StoredFormatIds.SQL_CLOB_ID: return new SQLClob();
case StoredFormatIds.XML_ID: return new XML();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
case StoredFormatIds.ACCESS_HEAP_ROW_LOCATION_V1_ID:
// This is an specific implementation of RowLocation, known to be
// a DTD.
@@ -1161,6 +1187,7 @@ private LocaleFinder getLocaleFinder()
*/
static Context getContext( final String contextID )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/DateTimeDataValue.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/DateTimeDataValue.java
index dfb1e72199..fb61e06132 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/DateTimeDataValue.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/DateTimeDataValue.java
@@ -135,6 +135,7 @@ NumberDataValue getSeconds(NumberDataValue result)
*
* @exception StandardException
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-81
DateTimeDataValue timestampAdd( int intervalType,
NumberDataValue intervalCount,
java.sql.Date currentDate,
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/DateTimeParser.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/DateTimeParser.java
index 6945e6fcd4..2d79e1a1d0 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/DateTimeParser.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/DateTimeParser.java
@@ -187,6 +187,7 @@ private void updateCurrentSeparator()
*
* @exception StandardException if there are more non-blank characters.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-3173
void checkEnd() throws StandardException
{
for( ; fieldStart < len; fieldStart++)
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/HarmonySerialBlob.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/HarmonySerialBlob.java
index 28ac9fe3a5..d7d2898840 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/HarmonySerialBlob.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/HarmonySerialBlob.java
@@ -110,6 +110,7 @@ public byte[] getBytes(long pos, int length) throws SQLException {
if (pos < 1 || pos > len)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throw makeSQLException( SQLState.BLOB_BAD_POSITION, new Object[] {pos} );
}
if (length < 0)
@@ -215,6 +216,7 @@ public int setBytes(long pos, byte[] theBytes, int offset, int length)
throws SQLException {
if (pos < 1 || length < 0 || pos > (len - length + 1))
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throw makeSQLException( SQLState.BLOB_BAD_POSITION, new Object[] {pos} );
}
if (offset < 0 || length < 0 || offset > (theBytes.length - length))
@@ -228,6 +230,7 @@ public int setBytes(long pos, byte[] theBytes, int offset, int length)
public void truncate(long length) throws SQLException {
if (length > this.len)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throw makeSQLException( SQLState.BLOB_LENGTH_TOO_LONG, new Object[] {len} );
}
buf = getBytes(1, (int) length);
@@ -242,6 +245,7 @@ public InputStream getBinaryStream(long pos, long length)
throws SQLException {
if (len < 0)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throw makeSQLException( SQLState.BLOB_NONPOSITIVE_LENGTH, new Object[] {len} );
}
if (length < 0)
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/HarmonySerialClob.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/HarmonySerialClob.java
index ad1d2bbfa5..db2acd2b32 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/HarmonySerialClob.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/HarmonySerialClob.java
@@ -104,6 +104,7 @@ public String getSubString(long pos, int length) throws SQLException {
checkValidation();
if (length < 0)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throw HarmonySerialBlob.makeSQLException( SQLState.BLOB_NONPOSITIVE_LENGTH, new Object[] {length} );
}
if (pos < 1 || pos > len || pos + length > len + 1)
@@ -179,6 +180,7 @@ public int setString(long pos, String str, int offset, int length)
checkValidation();
if (pos < 1)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throw HarmonySerialBlob.makeSQLException( SQLState.BLOB_BAD_POSITION, new Object[] {pos} );
}
if (length < 0)
@@ -205,6 +207,7 @@ public void truncate(long length) throws SQLException {
checkValidation();
if (length < 0)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throw HarmonySerialBlob.makeSQLException( SQLState.BLOB_NONPOSITIVE_LENGTH, new Object[] {length} );
}
if (length > len)
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/JSQLType.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/JSQLType.java
index b65c5032fe..4a7bd99461 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/JSQLType.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/JSQLType.java
@@ -176,6 +176,7 @@ public final class JSQLType implements Formatable
public DataTypeDescriptor getSQLType
(
)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
// might not be filled in if this is a JAVA_CLASS or JAVA_PRIMITIVE
@@ -200,6 +201,7 @@ public final class JSQLType implements Formatable
// Give read-only access to array of strings
public static String getPrimitiveName(byte index){
+//IC see: https://issues.apache.org/jira/browse/DERBY-4293
return primitiveNames[index];
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/Like.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/Like.java
index 818c4f8af8..ec8b467ca9 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/Like.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/Like.java
@@ -260,6 +260,7 @@ else if (pat[pLoc] == anyString) {
private static boolean checkEquality(char[] val, int vLoc,
char[] pat, int pLoc, RuleBasedCollator collator) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3136
if (val[vLoc] == pat[pLoc]) {
// same character, so two strings consisting of this
// single character must be equal regardless of territory
@@ -278,6 +279,8 @@ private static boolean checkEquality(char[] val, int vLoc,
}
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-2720
+//IC see: https://issues.apache.org/jira/browse/DERBY-3315
Calculate the shortest length string that could match this pattern
*/
static int getMinLen(char[] pattern, int pStart, int pEnd, boolean haveEsc, char escChar)
@@ -344,6 +347,8 @@ else if (pLoc == pEnd)
/*
Most typical interface for character string types with UCS_BASIC and
+//IC see: https://issues.apache.org/jira/browse/DERBY-2720
+//IC see: https://issues.apache.org/jira/browse/DERBY-3315
territory based collation.
*/
public static Boolean like(char[] value, int valueLength, char[] pattern,
@@ -368,6 +373,7 @@ public static Boolean like(char[] value, int valueLength, char[] pattern,
public static boolean isOptimizable(String pattern)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1231
if (pattern == null)
{
return false;
@@ -423,6 +429,7 @@ public static String greaterEqualString(String pattern, String escape, int maxWi
// what is there, while stripping escapes
//
+//IC see: https://issues.apache.org/jira/browse/DERBY-44
if ((escape != null) && (escape.length() != 0))
{
char escChar = escape.charAt(0);
@@ -581,6 +588,7 @@ public static String lessThanString(String pattern, String escape, int maxWidth)
char newLastChar;
final int escChar;
+//IC see: https://issues.apache.org/jira/browse/DERBY-44
if ((escape != null) && (escape.length() !=0))
{
escChar = escape.charAt(0);
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/NumberDataType.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/NumberDataType.java
index f60539a125..1992946c65 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/NumberDataType.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/NumberDataType.java
@@ -46,6 +46,7 @@ public abstract class NumberDataType extends DataType
implements NumberDataValue
{
static final BigDecimal MAXLONG_PLUS_ONE =
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
BigDecimal.valueOf(Long.MAX_VALUE).add(BigDecimal.ONE);
static final BigDecimal MINLONG_MINUS_ONE =
BigDecimal.valueOf(Long.MIN_VALUE).subtract(BigDecimal.ONE);
@@ -63,6 +64,7 @@ public final NumberDataValue absolute(NumberDataValue result)
return minus(result);
if(result == null)
+//IC see: https://issues.apache.org/jira/browse/DERBY-5224
result = (NumberDataValue)getNewNull();
result.setValue(this);
@@ -96,6 +98,7 @@ public NumberDataValue sqrt(NumberDataValue result)
if( this.isNegative() )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
if( doubleValue == -0.0d )
{
doubleValue = 0.0d;
@@ -405,6 +408,7 @@ public void setValue(Number theValue) throws StandardException
* Used for TINYINT, SMALLINT, INTEGER.
* @throws StandardException
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
void setObject(Object theValue) throws StandardException
{
setValue(((Integer) theValue).intValue());
@@ -421,6 +425,7 @@ public void setBigDecimal(BigDecimal bigDecimal) throws StandardException
// See comment in SQLDecimal.getLong()
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
if ( (bigDecimal.compareTo(NumberDataType.MINLONG_MINUS_ONE) == 1)
&& (bigDecimal.compareTo(NumberDataType.MAXLONG_PLUS_ONE) == -1)) {
@@ -459,6 +464,7 @@ public static float normalizeREAL(float v) throws StandardException
{
boolean invalid = Float.isNaN(v) || Float.isInfinite(v);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3398
if (v < Limits.DB2_SMALLEST_REAL ||
v > Limits.DB2_LARGEST_REAL ||
(v > 0 && v < Limits.DB2_SMALLEST_POSITIVE_REAL) ||
@@ -502,6 +508,7 @@ public static float normalizeREAL(final double v) throws StandardException
float fv = (float)v;
boolean invalid =
+//IC see: https://issues.apache.org/jira/browse/DERBY-3398
Double.isNaN(v) ||
Double.isInfinite(v) ||
(fv == 0.0f && v != 0.0d); // too small to represent as REAL
@@ -570,7 +577,9 @@ public static double normalizeDOUBLE(double v) throws StandardException
* @return false if dictionary is new enough, see DD_Version.
*/
private static boolean useDB2Limits() throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3398
LanguageConnectionContext lcc =
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
(LanguageConnectionContext)getContextOrNull(
LanguageConnectionContext.CONTEXT_ID);
if (lcc != null) {
@@ -591,6 +600,7 @@ private static boolean useDB2Limits() throws StandardException {
*/
private static Context getContextOrNull( final String contextID )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getContextOrNull( contextID );
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/Orderable.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/Orderable.java
index 648fa596fe..224b2b87f5 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/Orderable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/Orderable.java
@@ -28,6 +28,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
The Orderable interface represents a value that can
be linearly ordered.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Currently only supports linear (<, =, <=) operations.
Eventually we may want to do other types of orderings,
in which case there would probably be a number of interfaces
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/RawToBinaryFormatStream.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/RawToBinaryFormatStream.java
index 4b566b6783..e9f5f52635 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/RawToBinaryFormatStream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/RawToBinaryFormatStream.java
@@ -203,6 +203,7 @@ private void checkSufficientData() throws IOException
int remainingBytes = clearLimit();
+//IC see: https://issues.apache.org/jira/browse/DERBY-1473
if (length > -1 && remainingBytes > 0) {
throw new DerbyIOException(
MessageService.getTextMessage(
@@ -221,6 +222,7 @@ private void checkSufficientData() throws IOException
catch (IOException ioe) {
c = -1;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-1473
if (c != -1) {
if (length > -1) {
// Stream is not capped, and should have matched the
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/ReaderToUTF8Stream.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/ReaderToUTF8Stream.java
index f4b4f3b3d5..f4d6e3228d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/ReaderToUTF8Stream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/ReaderToUTF8Stream.java
@@ -125,6 +125,7 @@ public ReaderToUTF8Stream(Reader appReader,
int valueLength,
int numCharsToTruncate,
String typeName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
StreamHeaderGenerator headerGenerator) {
this.reader = new LimitReader(appReader);
this.charsToTruncate = numCharsToTruncate;
@@ -133,7 +134,9 @@ public ReaderToUTF8Stream(Reader appReader,
this.hdrGen = headerGenerator;
int absValueLength = Math.abs(valueLength);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4661
reader.setLimit(absValueLength);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
if (SanityManager.DEBUG) {
// Check the type name
// The national types (i.e. NVARCHAR) are not used/supported.
@@ -147,6 +150,7 @@ public ReaderToUTF8Stream(Reader appReader,
// requirement during encoding/insertion.
// Be conservative, assume three bytes per char.
int bz = 32*1024; // 32 KB default
+//IC see: https://issues.apache.org/jira/browse/DERBY-4661
if (absValueLength < bz / 3) {
// Enforce a minimum size of the buffer, otherwise read may loop
// indefinitely (must enter for loop in fillBuffer to detect EOF).
@@ -177,6 +181,7 @@ public ReaderToUTF8Stream(Reader appReader,
public ReaderToUTF8Stream(Reader appReader,
int maximumLength,
String typeName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
StreamHeaderGenerator headerGenerator) {
this(appReader, -1 * maximumLength, 0, typeName, headerGenerator);
if (maximumLength < 0) {
@@ -210,6 +215,7 @@ public int read() throws IOException {
// first read
if (blen < 0)
fillBuffer(FIRST_READ);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
while (boff == blen)
{
@@ -257,6 +263,7 @@ public int read(byte b[], int off, int len) throws IOException {
// first read
if (blen < 0)
fillBuffer(FIRST_READ);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
int readCount = 0;
@@ -313,6 +320,7 @@ public int read(byte b[], int off, int len) throws IOException {
*/
private void fillBuffer(int startingOffset) throws IOException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
if (startingOffset == FIRST_READ) {
// Generate the header. Provide the char length only if the header
// encodes a char count and we actually know the char count.
@@ -330,6 +338,7 @@ private void fillBuffer(int startingOffset) throws IOException
// starts, it shall point at the next byte the stream will deliver on
// the next iteration of read or skip.
boff = 0;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4122
if (off == 0)
multipleBuffer = true;
@@ -362,6 +371,7 @@ private void fillBuffer(int startingOffset) throws IOException
// 6! need to leave room for a three byte UTF8 encoding
// and 3 bytes for our special end of file marker.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4661
for (; off <= buffer.length - READ_BUFFER_RESERVATION; )
{
int c = reader.read();
@@ -370,6 +380,7 @@ private void fillBuffer(int startingOffset) throws IOException
break;
}
charCount++; // Increment the character count.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
if ((c >= 0x0001) && (c <= 0x007F))
{
@@ -413,6 +424,7 @@ private void checkSufficientData() throws IOException
if (charsToTruncate > 0)
{
reader.setLimit(charsToTruncate);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1473
truncate();
}
@@ -456,6 +468,7 @@ private void checkSufficientData() throws IOException
// can put the correct length into the stream.
if (!multipleBuffer) {
int newValueLen = -1;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
if (hdrGen.expectsCharCount()) {
if (SanityManager.DEBUG && charCount == 0) {
SanityManager.ASSERT(eof);
@@ -484,10 +497,12 @@ private void checkSufficientData() throws IOException
*/
private boolean canTruncate() {
// Only a few types can be truncated, default is to not allow.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1473
if (typeName.equals(TypeId.CLOB_NAME)) {
return true;
} else if (typeName.equals(TypeId.VARCHAR_NAME)) {
return true;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
} else if (typeName.equals(TypeId.CHAR_NAME)) {
return true;
}
@@ -508,8 +523,10 @@ private void truncate()
} else if (c != SPACE) {
throw new DerbyIOException(
MessageService.getTextMessage(
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
SQLState.LANG_STRING_TRUNCATION,
typeName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
"", // Don't show the whole value.
String.valueOf(Math.abs(valueLength))),
SQLState.LANG_STRING_TRUNCATION);
@@ -542,6 +559,7 @@ public final int available()
// from the reader object
// reader.getLimit() returns the remaining bytes available
// on this stream
+//IC see: https://issues.apache.org/jira/browse/DERBY-4122
return (buffer.length > remainingBytes ? remainingBytes : buffer.length);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLBinary.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLBinary.java
index d27e88b73f..a75c2a9176 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLBinary.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLBinary.java
@@ -61,6 +61,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
Format : <encoded length><raw data>
Length is encoded to support Cloudscape 5.x databases where the length was stored as the number of bits.
@@ -88,6 +89,7 @@ When the value was written from a stream (e.g. PreparedStatement.setBinaryStream
The Cloudscape '5.x format bits' format I think was never used by Derby.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
abstract class SQLBinary
extends DataType implements BitDataValue
{
@@ -208,6 +210,7 @@ else if (dataValue.length * 2 < 0) //if converted to hex, length exceeds max in
*/
public final InputStream getStream() throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
if (!hasStream()) {
throw StandardException.newException(
SQLState.LANG_STREAM_INVALID_ACCESS, getTypeName());
@@ -252,6 +255,7 @@ else if ((dataValue == null) && (stream != null) )
}
catch (IOException ioe)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3732
throwStreamingIOException(ioe);
}
catch (SQLException se) { throw StandardException.plainWrapException( se ); }
@@ -275,6 +279,7 @@ else if (stream instanceof Resetable){
// If we have the stream length encoded.
// just read that.
streamValueLength = readBinaryLength((ObjectInput) stream);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3770
if (streamValueLength == 0) {
// Otherwise we will have to read the whole stream.
streamValueLength =
@@ -355,8 +360,10 @@ private void writeBlob(ObjectOutput out) throws IOException
int bytesRead = 0;
int numOfBytes = 0;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4686
byte[] buffer = new byte[Math.min(len, LEN_OF_BUFFER_TO_WRITE_BLOB)];
+//IC see: https://issues.apache.org/jira/browse/DERBY-4686
while(bytesRead < len) {
numOfBytes = is.read(buffer);
@@ -595,7 +602,9 @@ public final int compare(DataValueDescriptor other) throws StandardException
* Beetle 4896
*/
public final DataValueDescriptor cloneHolder() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4520
if (stream == null && _blobValue == null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4520
return cloneValue(false);
} else {
// Cast to SQLBinary to avoid having to catch StandardException.
@@ -629,6 +638,7 @@ public DataValueDescriptor cloneValue(boolean forceMaterialization)
catch (StandardException se)
{
if (SanityManager.DEBUG)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
SanityManager.THROWASSERT("Unexpected exception", se);
return null;
}
@@ -956,6 +966,7 @@ public final BitDataValue concatenate(
BitDataValue result)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5246
if (result == null)
{
result = (BitDataValue) getNewNull();
@@ -1168,6 +1179,7 @@ public final int hashCode()
catch (StandardException se)
{
if (SanityManager.DEBUG)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
SanityManager.THROWASSERT("Unexpected exception", se);
return 0;
}
@@ -1175,6 +1187,7 @@ public final int hashCode()
// Hash code should ignore trailing PAD bytes.
byte[] bytes = dataValue;
int lastNonPadByte = bytes.length - 1;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3981
while (lastNonPadByte >= 0 && bytes[lastNonPadByte] == PAD) {
lastNonPadByte--;
}
@@ -1232,6 +1245,7 @@ private static int compare(byte[] left, byte[] right) {
*/
public void setInto(PreparedStatement ps, int position) throws SQLException, StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-203
ps.setBytes(position, getBytes());
}
@@ -1247,6 +1261,7 @@ public final String getTraceString() throws StandardException {
}
// Check if we have a stream.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
if (hasStream()) {
return (getTypeName() + "(" + getStream().toString() + ")");
}
@@ -1291,6 +1306,7 @@ void truncate(int sourceWidth, int desiredWidth, boolean warn)
getLength(), desiredWidth);
StatementContext statementContext = (StatementContext)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
DataValueFactoryImpl.getContext(ContextId.LANG_STATEMENT);
statementContext.getActivation().
getResultSet().addWarning(warning);
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLBit.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLBit.java
index 7b6f78dc2c..9d5eef6e0d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLBit.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLBit.java
@@ -97,6 +97,7 @@ public final void setValueFromResultSet(ResultSet resultSet, int colNumber,
boolean isNullable)
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
setValue(resultSet.getBytes(colNumber));
}
@@ -113,6 +114,7 @@ public int typePrecedence()
/**
* Set the value from an non-null object.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
final void setObject(Object theValue)
throws StandardException
{
@@ -182,6 +184,7 @@ public void setWidth(int desiredWidth,
*/
if (getValue() == null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
return;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLBlob.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLBlob.java
index c4d6fadf62..08c05d2e9f 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLBlob.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLBlob.java
@@ -85,6 +85,7 @@ int getMaxMemoryUsage()
* {@code false} otherwise.
*/
public boolean hasStream() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
return stream != null;
}
@@ -105,6 +106,7 @@ public DataValueDescriptor cloneValue(boolean forceMaterialization) {
// may be more effective because the data doesn't have to be
// decoded multiple times.
final SQLBlob clone = new SQLBlob();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4520
// Shortcut cases where value is NULL.
if (isNull()) {
@@ -155,6 +157,7 @@ public DataValueDescriptor getNewNull()
* Return a JDBC Blob. Originally implemented to support DERBY-2201.
*/
public Object getObject()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4754
throws StandardException
{
// the generated code for the DERBY-2201 codepath expects to get a Blob
@@ -167,6 +170,7 @@ public Object getObject()
if ( bytes == null ) { return null; }
else
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
return new HarmonySerialBlob( bytes );
}
}
@@ -216,6 +220,7 @@ public void setWidth(int desiredWidth, // ignored!
// Input is a stream with unknown length. The length will be checked
// while reading the stream.
if (isLengthLess()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
return;
}
@@ -276,6 +281,8 @@ public int typePrecedence()
}
public void setInto(PreparedStatement ps, int position)
+//IC see: https://issues.apache.org/jira/browse/DERBY-217
+//IC see: https://issues.apache.org/jira/browse/DERBY-175
throws SQLException, StandardException
{
if (isNull()) {
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLBoolean.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLBoolean.java
index 89845f3fe0..2903da8690 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLBoolean.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLBoolean.java
@@ -162,6 +162,7 @@ public Object getObject()
if (isNull())
return null;
else
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
return value;
}
@@ -274,6 +275,7 @@ public int compare(DataValueDescriptor other) throws StandardException
{
if (!thisNull) // otherNull must be true
return -1;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4716
if (!otherNull) // thisNull must be true
return 1;
return 0;
@@ -501,6 +503,7 @@ public void setBigDecimal(BigDecimal bigDecimal) throws StandardException
}
else
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
value = BigDecimal.ZERO.compareTo(bigDecimal) != 0;
isnull = false;
}
@@ -537,6 +540,7 @@ public void setValue(String theValue)
if (cleanedValue.equals("TRUE"))
{
value = true;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4658
isnull = false;
}
else if (cleanedValue.equals("FALSE"))
@@ -560,12 +564,14 @@ else if (cleanedValue.equals("UNKNOWN"))
/**
* @see DataValueDescriptor#setValue
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
void setObject(Object theValue)
{
setValue((Boolean) theValue);
}
protected void setFrom(DataValueDescriptor theValue) throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4684
if ( theValue instanceof SQLChar ) { setValue( theValue.getString() ); }
else if ( theValue instanceof SQLBoolean ){ setValue(theValue.getBoolean()); }
else
@@ -873,6 +879,7 @@ public BooleanDataValue throwExceptionIfFalse(
}
public BooleanDataValue throwExceptionIfImmediateAndFalse(
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
String sqlState,
String tableName,
String constraintName,
@@ -885,6 +892,7 @@ public BooleanDataValue throwExceptionIfImmediateAndFalse(
final UUID constrId = (UUID)ps.getSavedObject(savedUUIDIdx);
final LanguageConnectionContext lcc =
a.getLanguageConnectionContext();
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
final boolean isDeferred = lcc.isEffectivelyDeferred(
lcc.getCurrentSQLSessionContext(a), constrId);
@@ -1045,6 +1053,7 @@ public boolean equals(boolean val)
*/
public BooleanDataValue getImmutable()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-742
if (isNull())
return SQLBoolean.UNKNOWN;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLChar.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLChar.java
index 46e3103cc9..702a54bcda 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLChar.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLChar.java
@@ -147,6 +147,7 @@ public class SQLChar
*/
protected static final StreamHeaderGenerator CHAR_HEADER_GENERATOR =
new CharStreamHeaderGenerator();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
/**************************************************************************
* Fields of the class
@@ -466,6 +467,7 @@ public float getFloat() throws StandardException
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
return Float.parseFloat(getString().trim());
}
catch (NumberFormatException nfe)
@@ -492,6 +494,7 @@ public double getDouble() throws StandardException
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
return Double.parseDouble(getString().trim());
}
catch (NumberFormatException nfe)
@@ -638,6 +641,7 @@ public Object getObject() throws StandardException
* @exception StandardException Thrown on error
*/
public InputStream getStream() throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
if (!hasStream()) {
throw StandardException.newException(
SQLState.LANG_STREAM_INVALID_ACCESS, getTypeName());
@@ -678,6 +682,7 @@ public int getLength() throws StandardException {
if (stream instanceof Resetable && stream instanceof ObjectInput) {
try {
// Skip the encoded byte length.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4040
InputStreamUtil.skipFully(stream, 2);
// Decode the whole stream to find the character length.
return (int)UTF8Util.skipUntilEOF(stream);
@@ -709,6 +714,7 @@ public int getLength() throws StandardException {
* @throws StandardException the wrapping exception
*/
protected void throwStreamingIOException(IOException ioe)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
throws StandardException {
throw StandardException.
newException(SQLState.LANG_STREAMING_COLUMN_I_O_EXCEPTION,
@@ -740,6 +746,7 @@ public String getString() throws StandardException
// data is stored in the char[] array
value = new String(rawData, 0, len);
+//IC see: https://issues.apache.org/jira/browse/DERBY-302
if (len > RETURN_SPACE_THRESHOLD) {
// free up this char[] array to reduce memory usage
rawData = null;
@@ -776,6 +783,7 @@ public String getString() throws StandardException
throw StandardException.newException(
SQLState.LANG_STREAMING_COLUMN_I_O_EXCEPTION,
ioe,
+//IC see: https://issues.apache.org/jira/browse/DERBY-4465
String.class.getName());
}
}
@@ -845,6 +853,7 @@ public boolean isNull()
/**
Writes a non-Clob data value to the modified UTF-8 format used by Derby.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
The maximum stored size is based upon the UTF format
used to stored the String. The format consists of
@@ -941,6 +950,7 @@ else if (c > 0x07FF)
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
StreamHeaderGenerator header = getStreamHeaderGenerator();
if (SanityManager.DEBUG) {
SanityManager.ASSERT(!header.expectsCharCount());
@@ -1012,6 +1022,7 @@ else if (c > 0x07FF)
* @throws IOException if writing to the destination stream fails
*/
protected final void writeClobUTF(ObjectOutput out)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
throws IOException {
if (SanityManager.DEBUG) {
SanityManager.ASSERT(!isNull());
@@ -1078,6 +1089,7 @@ protected final void writeClobUTF(ObjectOutput out)
public void readExternalFromArray(ArrayInputStream in)
throws IOException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
resetForMaterialization();
int utfLen = (((in.read() & 0xFF) << 8) | (in.read() & 0xFF));
if (rawData == null || rawData.length < utfLen) {
@@ -1104,6 +1116,7 @@ public void readExternalFromArray(ArrayInputStream in)
* @throws IOException if reading from the source fails
*/
protected void readExternalClobFromArray(ArrayInputStream in, int charLen)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
throws IOException {
resetForMaterialization();
if (rawData == null || rawData.length < charLen) {
@@ -1162,6 +1175,7 @@ protected void readExternal(ObjectInput in, int utflen,
// OR
// The original string was a 0 length string.
requiredLength = in.available();
+//IC see: https://issues.apache.org/jira/browse/DERBY-302
if (requiredLength < minGrowBy)
requiredLength = minGrowBy;
}
@@ -1177,6 +1191,7 @@ protected void readExternal(ObjectInput in, int utflen,
// Set these to null to allow GC of the array if required.
rawData = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
resetForMaterialization();
int count = 0;
int strlen = 0;
@@ -1233,6 +1248,7 @@ protected void readExternal(ObjectInput in, int utflen,
// for char, growby 64 seems reasonable, but for varchar
// clob 4k or 32k is performant and hence
// growBy() is override correctly to ensure this
+//IC see: https://issues.apache.org/jira/browse/DERBY-302
if (growby < minGrowBy)
growby = minGrowBy;
@@ -1309,6 +1325,7 @@ else if ((c & 0x70) == 0x60) // we know the top bit is set here
((char3 & 0x3F) << 0));
}
else {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
throw new UTFDataFormatException(
"Invalid code point: " + Integer.toHexString(c));
}
@@ -1331,6 +1348,7 @@ else if ((c & 0x70) == 0x60) // we know the top bit is set here
*/
protected int growBy()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-302
return GROWBY_FOR_CHAR; //seems reasonable for a char
}
/**
@@ -1340,6 +1358,7 @@ protected int growBy()
public void restoreToNull()
{
value = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5162
_clobValue = null;
stream = null;
rawLength = -1;
@@ -1401,6 +1420,7 @@ public int compare(DataValueDescriptor other) throws StandardException
* objectify a stream.
*/
public DataValueDescriptor cloneHolder() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4520
if ((stream == null) && (_clobValue == null)) {
return cloneValue(false);
}
@@ -1442,6 +1462,7 @@ public DataValueDescriptor getNewNull()
/** @see StringDataValue#getValue(RuleBasedCollator) */
public StringDataValue getValue(RuleBasedCollator collatorForComparison)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2534
if (collatorForComparison == null)
{//null collatorForComparison means use UCS_BASIC for collation
return this;
@@ -1581,6 +1602,7 @@ public void setValue(byte[] theValue) throws StandardException
*/
public void setBigDecimal(BigDecimal bigDecimal) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
if (bigDecimal == null)
setToNull();
else
@@ -1884,6 +1906,7 @@ public void setWidth(int desiredWidth,
*/
if ( (_clobValue == null ) && (getString() == null) )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
return;
}
@@ -1944,6 +1967,7 @@ else if (sourceWidth > desiredWidth && desiredWidth > 0)
warning.initCause(se);
StatementContext statementContext = (StatementContext)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
DataValueFactoryImpl.getContext(ContextId.LANG_STATEMENT);
statementContext.getActivation().
getResultSet().addWarning(warning);
@@ -1954,6 +1978,7 @@ else if (sourceWidth > desiredWidth && desiredWidth > 0)
*/
setValue(getString().substring(0, desiredWidth));
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
return;
}
@@ -2235,6 +2260,7 @@ public StringDataValue concatenate(
StringDataValue result)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5246
if (result == null)
{
result = (StringDataValue) getNewNull();
@@ -2324,6 +2350,10 @@ public BooleanDataValue like(
// of the char array may be different than the
// length we should be using (i.e. getLength()).
// see getCharArray() for more info
+//IC see: https://issues.apache.org/jira/browse/DERBY-2720
+//IC see: https://issues.apache.org/jira/browse/DERBY-3315
+//IC see: https://issues.apache.org/jira/browse/DERBY-2720
+//IC see: https://issues.apache.org/jira/browse/DERBY-3315
char[] evalCharArray = getCharArray();
char[] patternCharArray = ((SQLChar)pattern).getCharArray();
char[] escapeCharArray = (((SQLChar) escape).getCharArray());
@@ -2395,7 +2425,9 @@ public NumberDataValue locate( StringDataValue searchFrom,
{
throw StandardException.newException(
SQLState.LANG_INVALID_PARAMETER_FOR_SEARCH_POSITION,
+//IC see: https://issues.apache.org/jira/browse/DERBY-5491
getString(), mySearchFrom,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
startVal);
}
@@ -2972,6 +3004,7 @@ public String toString()
if (stream != null) {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4754
return getString();
} catch (Exception e) {
return e.toString();
@@ -3000,6 +3033,7 @@ public int hashCode()
catch (StandardException se)
{
if (SanityManager.DEBUG)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
SanityManager.THROWASSERT("Unexpected exception", se);
return 0;
}
@@ -3021,6 +3055,7 @@ public int hashCode()
// Find 1st non-blank from the right
int lastNonPadChar = lvalue.length() - 1;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3981
while (lastNonPadChar >= 0 && lvalue.charAt(lastNonPadChar) == PAD) {
lastNonPadChar--;
}
@@ -3047,6 +3082,8 @@ int hashCodeForCollation() {
} catch (StandardException se) {
// ignore exceptions, like we do in hashCode()
if (SanityManager.DEBUG) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
SanityManager.THROWASSERT("Unexpected exception", se);
}
}
@@ -3080,6 +3117,7 @@ private Locale getLocale() throws StandardException
protected RuleBasedCollator getCollatorForCollation()
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1748
if (SanityManager.DEBUG) {
// Sub-classes that support collation will override this method,
// do don't expect it to be called here in the base class.
@@ -3096,6 +3134,7 @@ protected LocaleFinder getLocaleFinder()
if (localeFinder == null)
{
DatabaseContext dc = (DatabaseContext)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
DataValueFactoryImpl.getContext(DatabaseContext.CONTEXT_ID);
if( dc != null)
localeFinder = dc.getDatabase();
@@ -3168,6 +3207,7 @@ public String getTraceString() throws StandardException {
* @return A stream header generator.
*/
public StreamHeaderGenerator getStreamHeaderGenerator() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
return CHAR_HEADER_GENERATOR;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLClob.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLClob.java
index 70f828cbd6..dffc56fccf 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLClob.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLClob.java
@@ -65,6 +65,7 @@ public class SQLClob
/** The header generator used for 10.5 databases. */
private static final StreamHeaderGenerator TEN_FIVE_CLOB_HEADER_GENERATOR =
new ClobStreamHeaderGenerator(false);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
/**
* The maximum number of bytes used by the stream header.
@@ -73,6 +74,7 @@ public class SQLClob
*/
private static final int MAX_STREAM_HEADER_LENGTH =
TEN_FIVE_CLOB_HEADER_GENERATOR.getMaxHeaderLength();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4661
/**
* The descriptor for the stream. If there is no stream this should be
@@ -120,6 +122,7 @@ public DataValueDescriptor cloneValue(boolean forceMaterialization) {
// TODO: Add optimization for materializing "smallish" streams. This
// may be more effective because the data doesn't have to be
// decoded multiple times.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4520
final SQLClob clone = new SQLClob();
// Copy the soft upgrade mode state.
clone.inSoftUpgradeMode = inSoftUpgradeMode;
@@ -153,6 +156,7 @@ public DataValueDescriptor cloneValue(boolean forceMaterialization) {
clone.setValue(getString());
} catch (StandardException se) {
if (SanityManager.DEBUG) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
SanityManager.THROWASSERT("Unexpected exception", se);
}
return null;
@@ -167,6 +171,7 @@ public DataValueDescriptor cloneValue(boolean forceMaterialization) {
*/
public DataValueDescriptor getNewNull()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4278
SQLClob newClob = new SQLClob();
// Copy the soft upgrade mode state.
newClob.inSoftUpgradeMode = inSoftUpgradeMode;
@@ -176,6 +181,7 @@ public DataValueDescriptor getNewNull()
/** @see StringDataValue#getValue(RuleBasedCollator) */
public StringDataValue getValue(RuleBasedCollator collatorForComparison)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2534
if (collatorForComparison == null)
{//null collatorForComparison means use UCS_BASIC for collation
return this;
@@ -266,6 +272,7 @@ public int getInt() throws StandardException
* @throws StandardException if obtaining the length fails
*/
public int getLength() throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
if (stream == null) {
return super.getLength();
}
@@ -294,6 +301,7 @@ public int getLength() throws StandardException {
long charLength = 0;
try {
if (repositionStream) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4245
rewindStream(stream, csd.getDataOffset());
}
charLength = UTF8Util.skipUntilEOF(stream);
@@ -344,6 +352,7 @@ public Date getDate(java.util.Calendar cal) throws StandardException
*/
public Object getObject() throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4754
if ( _clobValue != null ) { return _clobValue; }
else
{
@@ -376,6 +385,7 @@ public CharacterStreamDescriptor getStreamWithDescriptor()
// Lazily reset the descriptor here, to avoid further changes in
// {@code SQLChar}.
csd = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
throw StandardException.newException(
SQLState.LANG_STREAM_INVALID_ACCESS, getTypeName());
}
@@ -389,6 +399,7 @@ public CharacterStreamDescriptor getStreamWithDescriptor()
try {
((Resetable)stream).resetStream();
// Make sure the stream is in sync with the descriptor.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
InputStreamUtil.skipFully(stream, csd.getCurBytePos());
} catch (IOException ioe) {
throwStreamingIOException(ioe);
@@ -405,9 +416,11 @@ public CharacterStreamDescriptor getStreamWithDescriptor()
// First time, read the header format of the stream.
try {
// Assume new header format, adjust later if necessary.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
byte[] header = new byte[MAX_STREAM_HEADER_LENGTH];
int read = stream.read(header);
// Expect at least two header bytes.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4122
if (SanityManager.DEBUG) {
SanityManager.ASSERT(read > 1,
"Too few header bytes: " + read);
@@ -416,6 +429,7 @@ public CharacterStreamDescriptor getStreamWithDescriptor()
if (read > hdrInfo.headerLength()) {
// We have read too much. Reset the stream.
read = hdrInfo.headerLength();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4245
rewindStream(stream, read);
}
csd = new CharacterStreamDescriptor.Builder().stream(stream).
@@ -430,6 +444,7 @@ public CharacterStreamDescriptor getStreamWithDescriptor()
// Check here to see if the root cause is a container closed
// exception. If so, this most likely means that the Clob was
// accessed after a commit or rollback on the connection.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4122
Throwable rootCause = ioe;
while (rootCause.getCause() != null) {
rootCause = rootCause.getCause();
@@ -455,6 +470,7 @@ public CharacterStreamDescriptor getStreamWithDescriptor()
* {@code false} otherwise.
*/
public boolean hasStream() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
return stream != null;
}
@@ -475,11 +491,13 @@ public Timestamp getTimestamp(java.util.Calendar cal) throws StandardException
*/
public final String getTraceString() throws StandardException {
// Check if the value is SQL NULL.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1693
if (isNull()) {
return "NULL";
}
// Check if we have a stream.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
if (hasStream()) {
return (getTypeName() + "(" + getStream().toString() + ")");
}
@@ -555,12 +573,14 @@ public void setBigDecimal(BigDecimal bigDecimal) throws StandardException
* @param stream the new stream
*/
public final void setStream(InputStream stream) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
super.setStream(stream);
// Discard the old stream descriptor.
this.csd = null;
}
public final void restoreToNull() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
this.csd = null;
super.restoreToNull();
}
@@ -623,11 +643,13 @@ final void setObject(Object theValue)
// down this code path when in soft upgrade mode, because the code
// reading the header bytes ends up reading zero bytes (i.e., it
// doesn't get the header / EOF marker).
+//IC see: https://issues.apache.org/jira/browse/DERBY-4122
if (vcl < 32*1024) {
setValue(vc.getSubString(1, (int)vcl));
} else {
ReaderToUTF8Stream utfIn = new ReaderToUTF8Stream(
vc.getCharacterStream(), (int) vcl, 0, TypeId.CLOB_NAME,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
getStreamHeaderGenerator());
setValue(utfIn, (int) vcl);
}
@@ -644,6 +666,7 @@ final void setObject(Object theValue)
* @throws IOException if writing to the destination stream fails
*/
public void writeExternal(ObjectOutput out)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
throws IOException {
super.writeClobUTF(out);
}
@@ -770,6 +793,7 @@ public void readExternal(ObjectInput in)
: (int)csd.getByteLength();
hdrInfo = new HeaderInfo(hdrLen, valueLength);
// Make sure the stream is correctly positioned.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4245
rewindStream((InputStream)in, hdrLen);
} else {
final InputStream srcIn = (InputStream)in;
@@ -797,6 +821,7 @@ public void readExternal(ObjectInput in)
// 1) Reset the stream to the previously set mark.
srcIn.reset();
InputStreamUtil.skipFully(srcIn, hdrInfo.headerLength());
+//IC see: https://issues.apache.org/jira/browse/DERBY-4245
} else if (in instanceof FormatIdInputStream) {
// 2) Add a push back stream on top of the underlying
// source, and unread the surplus bytes we read. Set the
@@ -840,6 +865,7 @@ public void readExternalFromArray(ArrayInputStream in)
byte[] header = new byte[MAX_STREAM_HEADER_LENGTH];
int read = in.read(header);
// Expect at least two header bytes.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4122
if (SanityManager.DEBUG) {
SanityManager.ASSERT(read > 1, "Too few header bytes: " + read);
}
@@ -868,6 +894,7 @@ public void readExternalFromArray(ArrayInputStream in)
private void rewindStream(InputStream in, long offset)
throws IOException {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4245
((Resetable)in).resetStream();
InputStreamUtil.skipFully(in, offset);
} catch (StandardException se) {
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLDate.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLDate.java
index 6eac0a8538..e9a0608e3d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLDate.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLDate.java
@@ -77,6 +77,7 @@ public final class SQLDate extends DataType
public int estimateMemoryUsage()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3173
return BASE_MEMORY_USAGE;
} // end of estimateMemoryUsage
@@ -95,6 +96,7 @@ public String getString()
//format is [yyy]y-mm-dd e.g. 1-01-01, 9999-99-99
if (!isNull())
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3173
return encodedDateToString(encodedDate);
}
else
@@ -114,6 +116,7 @@ public Timestamp getTimestamp( Calendar cal)
return null;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-1985
return new Timestamp(getTimeInMillis(cal));
}
@@ -507,6 +510,7 @@ else if( cal == null)
* Set the value from a correctly typed Date object.
* @throws StandardException
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
void setObject(Object theValue) throws StandardException
{
setValue((Date) theValue);
@@ -554,6 +558,7 @@ public void setValue(String theValue)
if (theValue != null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
DatabaseContext databaseContext = (DatabaseContext) DataValueFactoryImpl.getContext(DatabaseContext.CONTEXT_ID);
parseDate( theValue,
false,
@@ -566,6 +571,7 @@ public void setValue(String theValue)
** SQL Operators
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-729
NumberDataValue nullValueInt() {
return new SQLInteger();
}
@@ -594,6 +600,7 @@ public NumberDataValue getYear(NumberDataValue result)
public NumberDataValue getMonth(NumberDataValue result)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-729
if (isNull()) {
return nullValueInt();
} else {
@@ -609,6 +616,7 @@ public NumberDataValue getMonth(NumberDataValue result)
public NumberDataValue getDate(NumberDataValue result)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-729
if (isNull()) {
return nullValueInt();
} else {
@@ -701,6 +709,7 @@ public final boolean isNull()
*/
public Date getDate( Calendar cal)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1985
if (isNull())
return null;
@@ -882,6 +891,7 @@ public static DateTimeDataValue computeDateFunction( DataValueDescriptor operand
return new SQLDate();
if( operand instanceof SQLDate)
return (SQLDate) operand.cloneValue(false);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4520
if( operand instanceof SQLTimestamp)
{
@@ -937,6 +947,7 @@ public static DateTimeDataValue computeDateFunction( DataValueDescriptor operand
*/
public void setInto(PreparedStatement ps, int position) throws SQLException, StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-203
ps.setDate(position, getDate((Calendar) null));
}
@@ -956,6 +967,7 @@ public void setInto(PreparedStatement ps, int position) throws SQLException, Sta
* @exception StandardException
*/
public DateTimeDataValue timestampAdd( int intervalType,
+//IC see: https://issues.apache.org/jira/browse/DERBY-81
NumberDataValue intervalCount,
java.sql.Date currentDate,
DateTimeDataValue resultHolder)
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLDecimal.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLDecimal.java
index 632d84f30f..1935d2073c 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLDecimal.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLDecimal.java
@@ -128,6 +128,7 @@ public SQLDecimal(BigDecimal val, int nprecision, int scale)
value = val;
if ((value != null) && (scale >= 0))
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
value = value.setScale(scale, RoundingMode.DOWN);
}
}
@@ -296,12 +297,14 @@ public boolean getBoolean()
if (localValue == null)
return false;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return localValue.compareTo(BigDecimal.ZERO) != 0;
}
public String getString()
{
BigDecimal localValue = getBigDecimal();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return (localValue == null) ? null : localValue.toPlainString();
}
@@ -317,6 +320,7 @@ public Object getObject()
* Set the value from a correctly typed BigDecimal object.
* @throws StandardException
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
void setObject(Object theValue) throws StandardException
{
setValue((BigDecimal) theValue);
@@ -399,6 +403,7 @@ public void writeExternal(ObjectOutput out) throws IOException
// a BigDecimal with scale -3 (unscaled value of 1)
// or a BigDecimal with scale 0 (unscaled value of 1000)
+//IC see: https://issues.apache.org/jira/browse/DERBY-225
if (scale < 0) {
scale = 0;
value = value.setScale(0);
@@ -598,6 +603,7 @@ public void setValue(int theValue)
*/
public void setBigDecimal(BigDecimal theValue) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
setCoreValue(theValue);
}
@@ -629,6 +635,7 @@ public void setValue(Number theValue) throws StandardException
*/
public void setValue(boolean theValue)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
setCoreValue(theValue ? BigDecimal.ONE : BigDecimal.ZERO);
}
@@ -650,6 +657,7 @@ private void setCoreValue(BigDecimal theValue)
}
private void setCoreValue(double theValue) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-123
value = new BigDecimal(Double.toString(theValue));
rawData = null;
}
@@ -841,6 +849,7 @@ public NumberDataValue divide(NumberDataValue dividend,
BigDecimal divisorBigDecimal = SQLDecimal.getBigDecimal(divisor);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
if (divisorBigDecimal.compareTo(BigDecimal.ZERO) == 0)
{
throw StandardException.newException(SQLState.LANG_DIVIDE_BY_ZERO);
@@ -854,6 +863,7 @@ public NumberDataValue divide(NumberDataValue dividend,
** (for the whole result set column, eg.); otherwise dynamically
** calculates the scale according to actual values. Beetle 3901
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
result.setBigDecimal
(
dividendBigDecimal.divide
@@ -910,6 +920,7 @@ public NumberDataValue minus(NumberDataValue result)
protected boolean isNegative()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return !isNull() && (getBigDecimal().compareTo(BigDecimal.ZERO) == -1);
}
@@ -983,14 +994,17 @@ public void setWidth(int desiredPrecision,
throws StandardException
{
if (isNull())
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
return;
if (desiredPrecision != IGNORE_PRECISION &&
+//IC see: https://issues.apache.org/jira/browse/DERBY-225
((desiredPrecision - desiredScale) < SQLDecimal.getWholeDigits(getBigDecimal())))
{
throw StandardException.newException(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE,
("DECIMAL/NUMERIC("+desiredPrecision+","+desiredScale+")"));
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
value = value.setScale(desiredScale, RoundingMode.DOWN);
rawData = null;
}
@@ -1003,6 +1017,7 @@ public void setWidth(int desiredPrecision,
*/
public int getDecimalValuePrecision()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-225
if (isNull())
return 0;
@@ -1079,6 +1094,7 @@ private static int getWholeDigits(BigDecimal decimalValue)
* if ONE > abs(value) then the number of whole digits is 0
*/
decimalValue = decimalValue.abs();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
if (BigDecimal.ONE.compareTo(decimalValue) == 1)
{
return 0;
@@ -1087,6 +1103,7 @@ private static int getWholeDigits(BigDecimal decimalValue)
// precision is the number of digits in the unscaled value,
// subtracting the scale (positive or negative) will give the
// number of whole digits.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return decimalValue.precision() - decimalValue.scale();
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLDouble.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLDouble.java
index 4a371b52c7..0731aeb462 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLDouble.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLDouble.java
@@ -125,6 +125,7 @@ public long getLong() throws StandardException
*/
public float getFloat() throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1136
if (Float.isInfinite((float)value))
throw StandardException.newException(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE, TypeId.REAL_NAME);
return (float) value;
@@ -164,6 +165,7 @@ public Object getObject()
if (isNull())
return null;
else
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
return value;
}
@@ -172,6 +174,7 @@ public Object getObject()
* Set the value from a correctly typed Double object.
* @throws StandardException
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
void setObject(Object theValue) throws StandardException
{
setValue(((Double) theValue).doubleValue());
@@ -274,6 +277,7 @@ public DataValueDescriptor cloneValue(boolean forceMaterialization)
{
if (SanityManager.DEBUG)
SanityManager.THROWASSERT(
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
"error on clone, " +
" value = " + value +
" isnull = " + isnull, se);
@@ -446,6 +450,9 @@ public void setBigDecimal(BigDecimal bigDecimal) throws StandardException
double v = bigDecimal.doubleValue();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5546
+//IC see: https://issues.apache.org/jira/browse/DERBY-3398
+//IC see: https://issues.apache.org/jira/browse/DERBY-5534
if (v == 0) {
// We need to catch underflow here, since BigDecimal#doubleValue it
// just returns 0 (i.e. no exception).
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLInteger.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLInteger.java
index aa25862625..c2e601b3e7 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLInteger.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLInteger.java
@@ -115,6 +115,7 @@ public Object getObject()
if (isNull())
return null;
else
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
return value;
}
@@ -305,6 +306,7 @@ public void setValue(String theValue)
else
{
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5053
value = Integer.parseInt(theValue.trim());
} catch (NumberFormatException nfe) {
throw invalidFormat();
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLLongVarbit.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLLongVarbit.java
index 9640509d34..bb13089efe 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLLongVarbit.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLLongVarbit.java
@@ -123,6 +123,7 @@ public void normalize(
this.dataValue = other.dataValue;
}
else
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
setValue(source.getBytes());
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLLongint.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLLongint.java
index 69da6fd03c..d1ecff97f7 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLLongint.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLLongint.java
@@ -132,6 +132,7 @@ public Object getObject()
if (isNull())
return null;
else
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
return value;
}
@@ -143,6 +144,8 @@ public int getLength()
// this is for DataType's error generator
public String getTypeName()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
return TypeId.BIGINT_NAME;
}
@@ -409,6 +412,7 @@ public void setValue(boolean theValue)
* Set the value from a correctly typed Long object.
* @throws StandardException
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
void setObject(Object theValue)
{
setValue(((Long) theValue).longValue());
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLLongvarchar.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLLongvarchar.java
index 66df3af056..ce099c6861 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLLongvarchar.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLLongvarchar.java
@@ -69,6 +69,7 @@ public DataValueDescriptor cloneValue(boolean forceMaterialization)
catch (StandardException se)
{
if (SanityManager.DEBUG)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
SanityManager.THROWASSERT("Unexpected exception", se);
return null;
}
@@ -86,6 +87,7 @@ public DataValueDescriptor getNewNull()
/** @see StringDataValue#getValue(RuleBasedCollator) */
public StringDataValue getValue(RuleBasedCollator collatorForComparison)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2534
if (collatorForComparison == null)
{//null collatorForComparison means use UCS_BASIC for collation
return this;
@@ -146,6 +148,7 @@ public StringDataValue concatenate(
throws StandardException
{
result = super.concatenate(leftOperand, rightOperand, result);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5246
//bug 5600 - according to db2 concatenation documentation, for compatibility with previous versions, there is no automatic
//escalation of results involving LONG data types to LOB data types. For eg, concatenation of a CHAR(200) value and a
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLReal.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLReal.java
index 5ecc1242a6..398fb73698 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLReal.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLReal.java
@@ -185,6 +185,7 @@ public Object getObject()
if (isNull())
return null;
else
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
return value;
}
@@ -369,6 +370,7 @@ public void setValue(String theValue)
// what if String is rouned to zero?
//System.out.println("SQLReal.setValue(String) - rounding issue?"+theValue);
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5053
setValue(Double.parseDouble(theValue.trim()));
} catch (NumberFormatException nfe) {
throw invalidFormat();
@@ -403,6 +405,9 @@ public void setBigDecimal(BigDecimal bigDecimal) throws StandardException
float v = bigDecimal.floatValue();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5546
+//IC see: https://issues.apache.org/jira/browse/DERBY-3398
+//IC see: https://issues.apache.org/jira/browse/DERBY-5534
if (v == 0) {
// We need to catch underflow here, since BigDecimal#floatValue it
// just returns 0 (i.e. no exception).
@@ -469,6 +474,7 @@ public void setValue(boolean theValue)
* Set the value from a correctly typed Float object.
* @throws StandardException
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
void setObject(Object theValue) throws StandardException
{
setValue(((Float) theValue).floatValue());
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLRef.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLRef.java
index 4c65f4ced3..2a9150c07e 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLRef.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLRef.java
@@ -76,6 +76,7 @@ public Object getObject()
protected void setFrom(DataValueDescriptor theValue) throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
if (theValue.isNull())
setToNull();
else
@@ -182,6 +183,7 @@ public DataValueDescriptor cloneValue(boolean forceMaterialization)
if (value == null)
return new SQLRef();
else
+//IC see: https://issues.apache.org/jira/browse/DERBY-4520
return new SQLRef((RowLocation) value.cloneValue(false));
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLSmallint.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLSmallint.java
index 0d252e267e..a4ec7bee93 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLSmallint.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLSmallint.java
@@ -158,6 +158,7 @@ public Object getObject()
if (isNull())
return null;
else
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
return (int) value;
}
@@ -326,6 +327,7 @@ private SQLSmallint(short val, boolean isnull) {
}
public SQLSmallint(Short obj) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
if (isnull = (obj == null))
;
else
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLTime.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLTime.java
index 6e9a4fdbfb..1aa2956603 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLTime.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLTime.java
@@ -91,6 +91,7 @@ public final class SQLTime extends DataType
public int estimateMemoryUsage()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3173
return BASE_MEMORY_USAGE;
} // end of estimateMemoryUsage
@@ -140,6 +141,7 @@ public Timestamp getTimestamp( Calendar cal)
// Set Calendar to current date and time
// to pick up the current date. Time portion
// will be overridden by this value's time.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1985
cal.setTimeInMillis(System.currentTimeMillis());
}
@@ -513,6 +515,7 @@ else if( amPm == 1) // PM
else if( hour > 12)
throw StandardException.newException( SQLState.LANG_DATE_RANGE_EXCEPTION);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3173
parser.checkEnd();
encodedTime = computeEncodedTime( hour, minute, second);
}
@@ -554,6 +557,7 @@ else if( cal == null)
* Set the value from a correctly typed Time object.
* @throws StandardException
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
void setObject(Object theValue) throws StandardException
{
setValue((Time) theValue);
@@ -605,6 +609,7 @@ public void setValue(String theValue)
restoreToNull();
if (theValue != null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
DatabaseContext databaseContext = (DatabaseContext) DataValueFactoryImpl.getContext(DatabaseContext.CONTEXT_ID);
parseTime( theValue,
false,
@@ -617,6 +622,7 @@ public void setValue(String theValue)
** SQL Operators
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-729
NumberDataValue nullValueInt() {
return new SQLInteger();
}
@@ -665,6 +671,7 @@ public NumberDataValue getDate(NumberDataValue result)
public NumberDataValue getHours(NumberDataValue result)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-729
if (isNull()) {
return nullValueInt();
} else {
@@ -680,6 +687,7 @@ public NumberDataValue getHours(NumberDataValue result)
public NumberDataValue getMinutes(NumberDataValue result)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-729
if (isNull()) {
return nullValueInt();
} else {
@@ -695,6 +703,7 @@ public NumberDataValue getMinutes(NumberDataValue result)
public NumberDataValue getSeconds(NumberDataValue result)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-729
if (isNull()) {
return nullValueInt();
} else {
@@ -764,6 +773,7 @@ public Time getTime(java.util.Calendar cal)
// Derby's SQL TIME type only has second resolution
// so pass in 0 for nano-seconds
+//IC see: https://issues.apache.org/jira/browse/DERBY-1985
return getTime(cal, encodedTime, 0);
}
@@ -931,6 +941,7 @@ static int computeEncodedTime(java.util.Date value, Calendar currentCal) throws
*/
public void setInto(PreparedStatement ps, int position) throws SQLException, StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-203
ps.setTime(position, getTime((Calendar) null));
}
@@ -950,6 +961,7 @@ public void setInto(PreparedStatement ps, int position) throws SQLException, Sta
* @exception StandardException
*/
public DateTimeDataValue timestampAdd( int intervalType,
+//IC see: https://issues.apache.org/jira/browse/DERBY-81
NumberDataValue intervalCount,
java.sql.Date currentDate,
DateTimeDataValue resultHolder)
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLTimestamp.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLTimestamp.java
index 6abb69a474..210248b6ec 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLTimestamp.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLTimestamp.java
@@ -95,6 +95,7 @@ public String getString()
{
if (!isNull())
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3173
String valueString = getTimestamp((Calendar) null).toString();
/* The java.sql.Timestamp.toString() method is supposed to return a string in
* the JDBC escape format. However the JDK 1.3 libraries truncate leading zeros from
@@ -141,6 +142,7 @@ public Date getDate( Calendar cal) throws StandardException
cal.clear();
SQLDate.setDateInCalendar(cal, encodedDate);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1985
return new Date(cal.getTimeInMillis());
}
@@ -161,6 +163,7 @@ public Time getTime( Calendar cal) throws StandardException
// to nano-seconds so ensure the Time object
// maintains that since it has milli-second
// resolutiuon.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1985
return SQLTime.getTime(cal, encodedTime, nanos);
}
@@ -405,6 +408,7 @@ public SQLTimestamp(Timestamp value) throws StandardException
}
SQLTimestamp(int encodedDate, int encodedTime, int nanos) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-81
this.encodedDate = encodedDate;
this.encodedTime = encodedTime;
@@ -595,6 +599,7 @@ static int[] parseDateOrTimestamp( DateTimeParser parser, boolean timeRequired)
* Set the value from a correctly typed Timestamp object.
* @throws StandardException
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
void setObject(Object theValue) throws StandardException
{
setValue((Timestamp) theValue);
@@ -653,6 +658,7 @@ public void setValue(String theValue)
if (theValue != null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
DatabaseContext databaseContext = (DatabaseContext) DataValueFactoryImpl.getContext(DatabaseContext.CONTEXT_ID);
parseTimestamp( theValue,
false,
@@ -666,6 +672,7 @@ public void setValue(String theValue)
** SQL Operators
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-729
NumberDataValue nullValueInt() {
return new SQLInteger();
}
@@ -682,6 +689,7 @@ NumberDataValue nullValueDouble() {
public NumberDataValue getYear(NumberDataValue result)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-729
if (isNull()) {
return nullValueInt();
} else {
@@ -697,6 +705,7 @@ public NumberDataValue getYear(NumberDataValue result)
public NumberDataValue getMonth(NumberDataValue result)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-729
if (isNull()) {
return nullValueInt();
} else {
@@ -712,6 +721,7 @@ public NumberDataValue getMonth(NumberDataValue result)
public NumberDataValue getDate(NumberDataValue result)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-729
if (isNull()) {
return nullValueInt();
} else {
@@ -727,6 +737,7 @@ public NumberDataValue getDate(NumberDataValue result)
public NumberDataValue getHours(NumberDataValue result)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-729
if (isNull()) {
return nullValueInt();
} else {
@@ -742,6 +753,7 @@ public NumberDataValue getHours(NumberDataValue result)
public NumberDataValue getMinutes(NumberDataValue result)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-729
if (isNull()) {
return nullValueInt();
} else {
@@ -764,6 +776,7 @@ public NumberDataValue getSeconds(NumberDataValue source)
}
NumberDataValue result;
+//IC see: https://issues.apache.org/jira/browse/DERBY-729
if (isNull()) {
return nullValueDouble();
}
@@ -836,6 +849,7 @@ public Timestamp getTimestamp(java.util.Calendar cal)
if (isNull())
return null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1985
if (cal == null)
cal = new GregorianCalendar();
setCalendar(cal);
@@ -880,6 +894,7 @@ private void setNumericTimestamp(Timestamp value, Calendar cal) throws StandardE
computeEncodedDate sets the date in a Calendar object
and then uses the SQLDate function to compute an encoded date
The encoded date is
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
year << 16 + month << 8 + date
@param value the value to convert
@return the encodedDate
@@ -896,6 +911,7 @@ private static int computeEncodedDate(java.util.Date value, Calendar currentCal)
/**
computeEncodedTime extracts the hour, minute and seconds from
a java.util.Date value and encodes them as
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
hour << 16 + minute << 8 + second
using the SQLTime function for encoding the data
@param value the value to convert
@@ -911,6 +927,8 @@ private static int computeEncodedTime(java.util.Date value, Calendar currentCal)
public void setInto(PreparedStatement ps, int position) throws SQLException, StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-174
+//IC see: https://issues.apache.org/jira/browse/DERBY-175
ps.setTimestamp(position, getTimestamp((Calendar) null));
}
@@ -928,6 +946,7 @@ public static DateTimeDataValue computeTimestampFunction( DataValueDescriptor op
return new SQLTimestamp();
if( operand instanceof SQLTimestamp)
return (SQLTimestamp) operand.cloneValue(false);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4520
String str = operand.getString();
if( str.length() == 14)
@@ -983,6 +1002,7 @@ static int parseDateTimeInteger( String str, int start, int ndigits) throws Stan
* @exception StandardException
*/
public DateTimeDataValue timestampAdd( int intervalType,
+//IC see: https://issues.apache.org/jira/browse/DERBY-81
NumberDataValue count,
java.sql.Date currentDate,
DateTimeDataValue resultHolder)
@@ -1054,6 +1074,7 @@ public DateTimeDataValue timestampAdd( int intervalType,
break;
default:
+//IC see: https://issues.apache.org/jira/browse/DERBY-6885
throw StandardException.newException(SQLState.LANG_INVALID_FUNCTION_ARGUMENT, intervalType,
"TIMESTAMPADD");
}
@@ -1103,6 +1124,7 @@ public NumberDataValue timestampDiff( int intervalType,
throws StandardException
{
if( resultHolder == null)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2386
resultHolder = new SQLLongint();
if( isNull() || time1.isNull())
@@ -1235,9 +1257,11 @@ else if( nanosDiff > 0 && secondsDiff < 0)
break;
default:
+//IC see: https://issues.apache.org/jira/browse/DERBY-6885
throw StandardException.newException(SQLState.LANG_INVALID_FUNCTION_ARGUMENT, intervalType,
"TIMESTAMPDIFF");
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2386
resultHolder.setValue(ldiff);
return resultHolder;
} // end of timestampDiff
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLTinyint.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLTinyint.java
index 2163f7cbd2..36a032faf3 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLTinyint.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLTinyint.java
@@ -106,6 +106,7 @@ private SQLTinyint(byte val, boolean isnull) {
}
public SQLTinyint(Byte obj) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
if (isnull = (obj == null))
;
else
@@ -200,6 +201,7 @@ public Object getObject()
{
return (isNull()) ?
null:
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
value;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLVarbit.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLVarbit.java
index 2d26971835..359284babe 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLVarbit.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLVarbit.java
@@ -92,6 +92,7 @@ public void normalize(
int desiredWidth = desiredType.getMaximumWidth();
byte[] sourceData = source.getBytes();
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
setValue(sourceData);
if (sourceData.length > desiredWidth)
setWidth(desiredWidth, 0, true);
@@ -120,6 +121,7 @@ public void setWidth(int desiredWidth,
*/
if (getValue() == null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
return;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLVarchar.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLVarchar.java
index 4ae976970b..e87c78a5d2 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLVarchar.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SQLVarchar.java
@@ -65,6 +65,7 @@ public DataValueDescriptor cloneValue(boolean forceMaterialization)
catch (StandardException se)
{
if (SanityManager.DEBUG)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
SanityManager.THROWASSERT("Unexpected exception", se);
return null;
}
@@ -82,6 +83,7 @@ public DataValueDescriptor getNewNull()
/** @see StringDataValue#getValue(RuleBasedCollator) */
public StringDataValue getValue(RuleBasedCollator collatorForComparison)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2534
if (collatorForComparison == null)
{//null collatorForComparison means use UCS_BASIC for collation
return this;
@@ -211,6 +213,7 @@ public int typePrecedence()
*/
protected final int growBy()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-302
return RETURN_SPACE_THRESHOLD; //seems reasonable for a varchar or clob
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SqlXmlUtil.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SqlXmlUtil.java
index 598399b331..bfe23d1c9c 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/SqlXmlUtil.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/SqlXmlUtil.java
@@ -235,6 +235,7 @@ public SqlXmlUtil() throws StandardException
*/
throw StandardException.newException(
SQLState.LANG_UNEXPECTED_XML_EXCEPTION, t, t.getMessage());
+//IC see: https://issues.apache.org/jira/browse/DERBY-1775
}
@@ -263,6 +264,7 @@ public void compileXQExpr(String queryExpr, String opName)
* is used). In the future we may want to revisit this
* to make it easier for users to query based on namespaces.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6624
XPath xpath = XPathFactory.newInstance().newXPath();
xpath.setNamespaceContext(NullNamespaceContext.SINGLETON);
@@ -287,6 +289,7 @@ public void compileXQExpr(String queryExpr, String opName)
*/
throw StandardException.newException(
SQLState.LANG_XML_QUERY_ERROR, te, opName, te.getMessage());
+//IC see: https://issues.apache.org/jira/browse/DERBY-1775
}
}
@@ -307,6 +310,7 @@ protected String serializeToString(String xmlAsText)
throws Exception
{
Document doc;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6634
/* The call to dBuilder.parse() is a call to an external
* (w.r.t. to Derby) JAXP parser. If the received XML
@@ -317,9 +321,12 @@ protected String serializeToString(String xmlAsText)
* reading the DTD file.
*/
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2131
final InputSource is = new InputSource(new StringReader(xmlAsText));
+//IC see: https://issues.apache.org/jira/browse/DERBY-6634
doc = java.security.AccessController.doPrivileged(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
new java.security.PrivilegedExceptionAction()
{
public Document run() throws IOException, SAXException
@@ -350,6 +357,7 @@ public Document run() throws IOException, SAXException
* don't have a top-level attribute node in the list,
* so we don't have to worry. Hence the "null" here.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6634
return serializeToString(Collections.singletonList(doc), null);
}
@@ -384,6 +392,7 @@ protected String serializeToString(List items,
XMLDataValue xmlVal) throws TransformerException
{
// If we have an empty sequence, return an empty value immediately.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6634
if (items.isEmpty()) {
return "";
}
@@ -405,8 +414,10 @@ protected String serializeToString(List items,
}
// Iterate through the list and serialize each item.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
for (Object obj : items)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6634
if (obj instanceof Attr)
{
/* Step 7a: Attribute nodes. If there is an Attribute node
@@ -436,7 +447,9 @@ protected String serializeToString(List items,
* explicit call to serialize the sequence, we'll throw the
* appropriate error (see XML.XMLSerialize()).
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6634
xmlVal.markAsHavingTopLevelAttr();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2739
serializer.transform(
new DOMSource((Node) obj), new StreamResult(sWriter));
}
@@ -471,6 +484,7 @@ protected String serializeToString(List items,
* "serialized" as an atomic value, attribute, or
* text node.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2739
serializer.transform(
new DOMSource(n), new StreamResult(sWriter));
}
@@ -524,6 +538,7 @@ protected List evalXQExpression(XMLDataValue xmlContext,
// Make sure we have a compiled query.
if (SanityManager.DEBUG) {
SanityManager.ASSERT(
+//IC see: https://issues.apache.org/jira/browse/DERBY-2739
(query != null),
"Failed to locate compiled XML query expression.");
}
@@ -543,6 +558,7 @@ protected List evalXQExpression(XMLDataValue xmlContext,
(returnResults ? "XMLQUERY" : "XMLEXISTS"));
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6624
Document docNode = dBuilder.parse(
new InputSource(
new StringReader(xmlContext.getString())));
@@ -607,6 +623,7 @@ private Object evaluate(Document doc) throws XPathExpressionException {
// If we know the return type, just evaluate the expression with
// that type.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6624
if (returnType != null) {
return query.evaluate(doc, returnType);
}
@@ -640,6 +657,7 @@ private void loadSerializer() throws TransformerConfigurationException
{
// Set serialization properties.
Properties props = new Properties();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2739
// SQL/XML[2006] 10.15:General Rules:6 says method is "xml".
props.setProperty(OutputKeys.METHOD, "xml");
@@ -713,6 +731,7 @@ private static class NullNamespaceContext implements NamespaceContext {
private final static NullNamespaceContext
SINGLETON = new NullNamespaceContext();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6624
@Override
public String getNamespaceURI(String prefix) {
@@ -726,6 +745,7 @@ public String getPrefix(String namespaceURI) {
@Override
public Iterator getPrefixes(String namespaceURI) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6998
List emptylist = Collections.emptyList();
return emptylist.iterator();
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/StringDataValue.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/StringDataValue.java
index 2d1677bf7b..b03b50f7e8 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/StringDataValue.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/StringDataValue.java
@@ -38,6 +38,7 @@ public interface StringDataValue extends ConcatableDataValue
/**
For a character string type, the collation derivation should always be
"explicit"(not possible in Derby 10.3), "implicit" or "none". We will
+//IC see: https://issues.apache.org/jira/browse/DERBY-2599
start by setting it to "implicit" in TypeDescriptorImpl. At runtime, only
character string types which are results of aggregate methods dealing
with operands with different collation types should have a collation
@@ -248,5 +249,6 @@ public CharacterStreamDescriptor getStreamWithDescriptor()
* Stuff a StringDataValue with a Clob.
*/
public void setValue( Clob value )
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
throws StandardException;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/TypeId.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/TypeId.java
index eadf134154..8416bc9b04 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/TypeId.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/TypeId.java
@@ -1086,6 +1086,8 @@ public boolean isDoubleTypeId()
*/
public boolean isFixedStringTypeId()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2720
+//IC see: https://issues.apache.org/jira/browse/DERBY-3315
return (formatId == StoredFormatIds.CHAR_TYPE_ID);
}
@@ -1114,6 +1116,8 @@ public boolean isBlobTypeId()
*/
public boolean isLongVarcharTypeId()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2720
+//IC see: https://issues.apache.org/jira/browse/DERBY-3315
return (formatId == StoredFormatIds.LONGVARCHAR_TYPE_ID);
}
@@ -1176,6 +1180,7 @@ public boolean orderable(ClassFactory cf)
case StoredFormatIds.CLOB_TYPE_ID:
case StoredFormatIds.LONGVARCHAR_TYPE_ID:
case StoredFormatIds.XML_TYPE_ID:
+//IC see: https://issues.apache.org/jira/browse/DERBY-392
case StoredFormatIds.LONGVARBIT_TYPE_ID:
return false;
@@ -1431,6 +1436,7 @@ public DataValueDescriptor getNull()
// Implementation of DECIMAL can change.
case StoredFormatIds.DECIMAL_TYPE_ID:
return new SQLDecimal();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
case StoredFormatIds.DOUBLE_TYPE_ID:
return new SQLDouble();
@@ -1438,6 +1444,8 @@ public DataValueDescriptor getNull()
case StoredFormatIds.INT_TYPE_ID:
return new SQLInteger();
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
case StoredFormatIds.BIGINT_TYPE_ID:
return new SQLLongint();
@@ -1685,6 +1693,7 @@ public boolean variableLength()
case StoredFormatIds.CHAR_TYPE_ID:
case StoredFormatIds.VARCHAR_TYPE_ID:
case StoredFormatIds.BLOB_TYPE_ID:
+//IC see: https://issues.apache.org/jira/browse/DERBY-786
case StoredFormatIds.CLOB_TYPE_ID:
return true;
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/UserType.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/UserType.java
index 3b1442a43b..03e957a3c0 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/UserType.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/UserType.java
@@ -255,6 +255,7 @@ public String getTypeName()
* Get the type name of this value, overriding
* with the passed in class name (for user/java types).
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
String getTypeName(String className)
{
return className;
@@ -391,6 +392,7 @@ public int compare(DataValueDescriptor other)
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
comparison = ((java.lang.Comparable) value).compareTo(other.getObject());
}
catch (ClassCastException cce)
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/WorkHorseForCollatorDatatypes.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/WorkHorseForCollatorDatatypes.java
index 7b14d09a5c..dfd20332a5 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/WorkHorseForCollatorDatatypes.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/WorkHorseForCollatorDatatypes.java
@@ -65,6 +65,7 @@ final class WorkHorseForCollatorDatatypes
/** @see SQLChar#stringCompare(SQLChar, SQLChar) */
int stringCompare(SQLChar str1, SQLChar str2)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2334
throws StandardException
{
CollationKey ckey1 = str1.getCollationKey();
@@ -157,6 +158,7 @@ BooleanDataValue like(DataValueDescriptor pattern,
!escapeCharacter.hasSingleCollationElement())
{
throw StandardException.newException(SQLState.LANG_INVALID_ESCAPE_CHARACTER,
+//IC see: https://issues.apache.org/jira/browse/DERBY-5491
escapeCharacter.toString());
}
likeResult = Like.like(stringData.getCharArray(),
@@ -187,6 +189,7 @@ RuleBasedCollator getCollatorForCollation()
* @see CollationElementsInterface#hasSingleCollationElement()
*/
boolean hasSingleCollationElement() throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2699
if (stringData.isNull()) {
return false;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/XML.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/XML.java
index 2c1942090d..745604034b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/XML.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/XML.java
@@ -162,6 +162,7 @@ public XML()
*/
private XML(SQLChar val, int xmlType, boolean seqWithAttr,
boolean materialize) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4520
xmlStringValue = (val == null ? null
: (SQLChar)val.cloneValue(materialize));
setXType(xmlType);
@@ -177,6 +178,7 @@ private XML(SQLChar val, int xmlType, boolean seqWithAttr,
* @see DataValueDescriptor#cloneValue
*/
public DataValueDescriptor cloneValue(boolean forceMaterialization) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4520
return new XML(xmlStringValue, getXType(), hasTopLevelAttr(),
forceMaterialization);
}
@@ -627,6 +629,8 @@ public XMLDataValue XMLParse(
// So do a serialization now and just store the result,
// so that we don't have to re-serialize every time a
// call is made to XMLSERIALIZE.
+//IC see: https://issues.apache.org/jira/browse/DERBY-688
+//IC see: https://issues.apache.org/jira/browse/DERBY-567
text = sqlxUtil.serializeToString(text);
}
else {
@@ -653,6 +657,7 @@ public XMLDataValue XMLParse(
*/
throw StandardException.newException(
SQLState.LANG_INVALID_XML_DOCUMENT, t, t.getMessage());
+//IC see: https://issues.apache.org/jira/browse/DERBY-1775
}
@@ -662,6 +667,8 @@ public XMLDataValue XMLParse(
if (xmlStringValue == null)
xmlStringValue = new SQLChar();
xmlStringValue.setValue(text);
+//IC see: https://issues.apache.org/jira/browse/DERBY-688
+//IC see: https://issues.apache.org/jira/browse/DERBY-567
return this;
}
@@ -699,6 +706,8 @@ public StringDataValue XMLSerialize(StringDataValue result,
if (SanityManager.DEBUG) {
SanityManager.THROWASSERT(
"Should NOT have made it to XMLSerialize " +
+//IC see: https://issues.apache.org/jira/browse/DERBY-688
+//IC see: https://issues.apache.org/jira/browse/DERBY-567
"with a non-string target type: " + targetType);
}
return null;
@@ -716,6 +725,7 @@ public StringDataValue XMLSerialize(StringDataValue result,
// passed collation type in determining whether we should
// generate SQLChar vs CollatorSQLChar for instance. Keep in mind
// that collation applies only to character string types.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5077
try {
RuleBasedCollator rbs = ConnectionUtil.getCurrentLCC().getDataValueFactory().
getCharacterCollator(targetCollationType);
@@ -761,6 +771,8 @@ public StringDataValue XMLSerialize(StringDataValue result,
// we already have it as a UTF-8 string, so just use
// that.
result.setValue(getString());
+//IC see: https://issues.apache.org/jira/browse/DERBY-688
+//IC see: https://issues.apache.org/jira/browse/DERBY-567
// Seems wrong to trunc an XML document, as it then becomes non-
// well-formed and thus useless. So we throw an error (that's
@@ -786,6 +798,8 @@ public StringDataValue XMLSerialize(StringDataValue result,
* @exception StandardException Thrown on error
*/
public BooleanDataValue XMLExists(SqlXmlUtil sqlxUtil)
+//IC see: https://issues.apache.org/jira/browse/DERBY-688
+//IC see: https://issues.apache.org/jira/browse/DERBY-567
throws StandardException
{
if (this.isNull()) {
@@ -828,6 +842,8 @@ public BooleanDataValue XMLExists(SqlXmlUtil sqlxUtil)
* fail but Derby will continue to run as normal.
*/
throw StandardException.newException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-1775
+//IC see: https://issues.apache.org/jira/browse/DERBY-6624
SQLState.LANG_XML_QUERY_ERROR, xe,
"XMLEXISTS", xe.getMessage());
}
@@ -867,6 +883,7 @@ public XMLDataValue XMLQuery(SqlXmlUtil sqlxUtil, XMLDataValue result)
// Return an XML data value whose contents are the
// serialized version of the query results.
int [] xType = new int[1];
+//IC see: https://issues.apache.org/jira/browse/DERBY-2739
List itemRefs = sqlxUtil.evalXQExpression(
this, true, xType);
@@ -901,6 +918,8 @@ public XMLDataValue XMLQuery(SqlXmlUtil sqlxUtil, XMLDataValue result)
* fail but Derby will continue to run as normal.
*/
throw StandardException.newException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-1775
+//IC see: https://issues.apache.org/jira/browse/DERBY-6624
SQLState.LANG_XML_QUERY_ERROR, xe,
"XMLQUERY", xe.getMessage());
}
@@ -995,6 +1014,7 @@ public static void checkXMLRequirements()
* provided as part the JVM if it is jdk 1.4 or
* greater.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6624
if (!checkJAXPRequirement()) {
xmlReqCheck = "JAXP";
}
@@ -1021,6 +1041,7 @@ else if (!checkXPathRequirement()) {
*/
private static boolean checkJAXPRequirement() {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6624
Class.forName("javax.xml.parsers.DocumentBuilderFactory");
return true;
} catch (Throwable t) {
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/types/XMLDataValue.java b/java/org.apache.derby.engine/org/apache/derby/iapi/types/XMLDataValue.java
index 33e533a6eb..5bc84430b7 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/types/XMLDataValue.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/types/XMLDataValue.java
@@ -105,6 +105,8 @@ public BooleanDataValue XMLExists(SqlXmlUtil sqlxUtil)
*/
public XMLDataValue XMLQuery(SqlXmlUtil sqlxUtil, XMLDataValue result)
throws StandardException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-688
+//IC see: https://issues.apache.org/jira/browse/DERBY-567
/* ****
* Helper classes and methods.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/util/DoubleProperties.java b/java/org.apache.derby.engine/org/apache/derby/iapi/util/DoubleProperties.java
index 8c6bd697a2..e007023d94 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/util/DoubleProperties.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/util/DoubleProperties.java
@@ -33,6 +33,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
second. But any put() calls are always made directly to
the write object.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5830
+//IC see: https://issues.apache.org/jira/browse/DERBY-4269
Only the put(), propertyNames() and getProperty() methods are supported
by this class.
*/
@@ -62,7 +64,10 @@ public String getProperty(String key, String defaultValue) {
}
public Enumeration propertyNames() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
HashSet names = new HashSet();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5830
+//IC see: https://issues.apache.org/jira/browse/DERBY-4269
addAllNames(write, names);
addAllNames(read, names);
return Collections.enumeration(names);
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/util/IdUtil.java b/java/org.apache.derby.engine/org/apache/derby/iapi/util/IdUtil.java
index ad776bbd21..e4f32f1e46 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/util/IdUtil.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/util/IdUtil.java
@@ -77,6 +77,8 @@ public static String mkQualifiedName(String id1,
String id2)
{
if( null == id1)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3158
+//IC see: https://issues.apache.org/jira/browse/DERBY-3159
return normalToDelimited(id2);
return
normalToDelimited(id1) +
@@ -93,6 +95,8 @@ public static String mkQualifiedName(String[] ids)
for (int ix=0; ix < ids.length; ix++)
{
if (ix!=0) sb.append(".");
+//IC see: https://issues.apache.org/jira/browse/DERBY-3158
+//IC see: https://issues.apache.org/jira/browse/DERBY-3159
sb.append(normalToDelimited(ids[ix]));
}
return sb.toString();
@@ -126,10 +130,12 @@ public static String[] parseMultiPartSQLIdentifier(String s)
private static String[] parseMultiPartSQLIdentifier(StringReader r)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Vector v = new Vector();
while (true)
{
String thisId = parseId(r,true);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
v.add(thisId);
int dot;
@@ -153,6 +159,7 @@ private static String[] parseMultiPartSQLIdentifier(StringReader r)
}
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
Parse a SQL identifier from the String provided. Raise an excepion
if the string does not contain a valid SQL indentifier.
The returned String contains the normalized form of the
@@ -164,6 +171,7 @@ public static String parseSQLIdentifier(String s)
throws StandardException
{
StringReader r = new StringReader(s);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
String id = parseId(r,true);
verifyEmpty(r);
return id;
@@ -194,6 +202,7 @@ private static String parseId(StringReader r, boolean normalize)
if (c == '"')
return parseQId(r,normalize);
else
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
return parseUnQId(r,normalize);
}
@@ -264,6 +273,7 @@ public static String SQLIdentifier2CanonicalPropertyUsername(String authid){
if (!needsQuote) {
result = authid.toLowerCase();
} else {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3673
result = normalToDelimited(authid);
}
@@ -300,6 +310,7 @@ private static String parseUnQId(StringReader r, boolean normalize)
if (c != -1) r.reset();
String id = b.toString();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
if (normalize)
return StringUtil.SQLToUpperCase(id);
@@ -360,6 +371,8 @@ else if (c == -1)
if (normalize)
return b.toString();
else
+//IC see: https://issues.apache.org/jira/browse/DERBY-3158
+//IC see: https://issues.apache.org/jira/browse/DERBY-3159
return normalToDelimited(b.toString()); //Put the quotes back.
}
@@ -412,16 +425,19 @@ public static String[][] parseDbClassPath(String input)
if (input.length() == 0)
return new String[0][];
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Vector v = new Vector();
java.io.StringReader r = new java.io.StringReader(input);
//
while (true)
{
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
String[] thisQName = IdUtil.parseMultiPartSQLIdentifier(r);
if (thisQName.length != 2)
throw StandardException.newException(SQLState.DB_CLASS_PATH_PARSE_ERROR,input);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
v.add(thisQName);
int delim = r.read();
if (delim != ':')
@@ -456,6 +472,7 @@ public static String[][] parseDbClassPath(String input)
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
Scan a list of comma separated SQL identifiers from the string provided.
This returns an array with containing the normalized forms of the identifiers.
@@ -470,12 +487,14 @@ public static String[] parseIdList(String p)
if (p==null) return null;
StringReader r = new StringReader(p);
String[] result = parseIdList(r, true);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
verifyEmpty(r);
return result;
}
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
Parse a list of comma separated SQL identifiers returning
them a as elements in an array.
@@ -487,12 +506,15 @@ public static String[] parseIdList(String p)
private static String[] parseIdList(StringReader r, boolean normalize)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Vector v = new Vector();
while (true)
{
int delim;
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
String thisId = IdUtil.parseId(r,normalize);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
v.add(thisId);
r.mark(0);
delim = r.read();
@@ -530,9 +552,11 @@ private static String[] parseIdList(StringReader r, boolean normalize)
public static String intersect(String[] l1, String[] l2)
{
if (l1 == null || l2 == null) return null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
HashSet h = new HashSet();
for(int ix=0;ix v = new Vector();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
for(int ix=0;ix v,boolean normal)
*/
public static String getUserAuthorizationId(String userName) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
try {
if (userName != null)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
return parseSQLIdentifier(userName);
}
catch (StandardException se) {
@@ -597,6 +623,7 @@ public static String getUserNameFromURLProps(Properties params)
public static String dups(String[] l)
{
if (l == null) return null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
HashSet h = new HashSet();
Vector v = new Vector();
for(int ix=0;ix h = new HashSet();
Vector v = new Vector();
for(int ix=0;ix v = new Vector();
StringReader r = new StringReader(list);
String[] enteredList_a = parseIdList(r,false);
@@ -709,7 +744,9 @@ public static String deleteId(String id, String list)
//compare we parse each SQL indentifier in list to convert
//to normal form.
for (int ix=0; ix < enteredList_a.length; ix++)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
if (!id.equals(IdUtil.parseSQLIdentifier(enteredList_a[ix])))
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
v.add(enteredList_a[ix]);
if (v.size() == 0)
return null;
@@ -730,6 +767,8 @@ public static String deleteId(String id, String list)
public static String appendNormalToList(String id, String list)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3158
+//IC see: https://issues.apache.org/jira/browse/DERBY-3159
String delimitedId = normalToDelimited(id);
if (list==null)
return delimitedId;
@@ -747,6 +786,7 @@ public static String appendNormalToList(String id, String list)
*/
public static String parseRoleId(String roleName) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4475
roleName = roleName.trim();
// NONE is a special case and is not allowed with its special
// meaning in SET ROLE . Even if there is
@@ -754,6 +794,7 @@ public static String parseRoleId(String roleName) throws StandardException
// delimited here, since it would have had to be delimited to
// get created, too. We could have chosen to be lenient here,
// but it seems safer to be restrictive.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
if (StringUtil.SQLToUpperCase(roleName).equals("NONE")) {
throw StandardException.newException(SQLState.ID_PARSE_ERROR);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/util/InterruptDetectedException.java b/java/org.apache.derby.engine/org/apache/derby/iapi/util/InterruptDetectedException.java
index eaf0020b35..870baae3f2 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/util/InterruptDetectedException.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/util/InterruptDetectedException.java
@@ -35,6 +35,7 @@ public class InterruptDetectedException extends StandardException {
*/
public InterruptDetectedException() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
super("intrp.U");
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/util/InterruptStatus.java b/java/org.apache.derby.engine/org/apache/derby/iapi/util/InterruptStatus.java
index 645edb055e..dd375afe34 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/util/InterruptStatus.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/util/InterruptStatus.java
@@ -79,8 +79,10 @@ public class InterruptStatus {
* also. Use lcc if available, else thread local variable.
*/
public static void setInterrupted() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4920
LanguageConnectionContext lcc = null;
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
lcc = (LanguageConnectionContext)getContextOrNull(
LanguageConnectionContext.CONTEXT_ID);
@@ -112,6 +114,7 @@ public static void setInterrupted() {
public static void saveInfoFromLcc(LanguageConnectionContext lcc) {
StandardException e = lcc.getInterruptedException();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5152
if (e != null) {
exception.set(e);
@@ -197,9 +200,11 @@ public static boolean noteAndClearInterrupt(String s,
*/
public static void restoreIntrFlagIfSeen() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4911
LanguageConnectionContext lcc = null;
try {
lcc =
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
(LanguageConnectionContext)getContextOrNull(
LanguageConnectionContext.CONTEXT_ID);
} catch (ShutdownException e) {
@@ -248,8 +253,10 @@ public static void restoreIntrFlagIfSeen() {
public static void restoreIntrFlagIfSeen(LanguageConnectionContext lcc) {
if (SanityManager.DEBUG) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4920
LanguageConnectionContext ctxLcc = null;
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
ctxLcc = (LanguageConnectionContext)
getContextOrNull(LanguageConnectionContext.CONTEXT_ID);
@@ -290,6 +297,7 @@ public static void restoreIntrFlagIfSeen(LanguageConnectionContext lcc) {
public static void throwIf(LanguageConnectionContext lcc)
throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
if (Thread.currentThread().isInterrupted()) {
setInterrupted();
}
@@ -312,6 +320,7 @@ public static void throwIf(LanguageConnectionContext lcc)
*/
private static Context getContextOrNull( final String contextID )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getContextOrNull( contextID );
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/util/PropertyUtil.java b/java/org.apache.derby.engine/org/apache/derby/iapi/util/PropertyUtil.java
index d0eafa7d4b..ac4d7ded37 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/util/PropertyUtil.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/util/PropertyUtil.java
@@ -71,6 +71,7 @@ public static String sortProperties( Properties list )
public static String sortProperties( Properties list, String indent )
{
// Get all property names, including any defaults.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6296
Set names = (list == null)
? Collections.emptySet()
: list.stringPropertyNames();
@@ -119,6 +120,7 @@ public static String sortProperties( Properties list, String indent )
**/
public static void copyProperties(Properties src_prop, Properties dest_prop)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6296
for (String key : src_prop.stringPropertyNames())
{
dest_prop.put(key, src_prop.get(key));
@@ -166,6 +168,7 @@ public static void loadWithTrimmedValues(InputStream iStr,
// Now, trim off any excess whitespace, if any, and then
// add the properties from file to the received Properties
// set.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6296
for (String tmpKey : p.stringPropertyNames()) {
// get the value, trim off the whitespace, then store it
// in the received properties object.
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/util/StringUtil.java b/java/org.apache.derby.engine/org/apache/derby/iapi/util/StringUtil.java
index b9cc5c344c..a3ecd5ca6e 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/util/StringUtil.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/util/StringUtil.java
@@ -70,6 +70,7 @@ public final static String formatForPrint(String input)
| 08 BS | 09 HT | 0A NL | 0B VT | 0C NP | 0D CR | 0E SO | 0F SI |
| 10 DLE| 11 DC1| 12 DC2| 13 DC3| 14 DC4| 15 NAK| 16 SYN| 17 ETB|
| 18 CAN| 19 EM | 1A SUB| 1B ESC| 1C FS | 1D GS | 1E RS | 1F US |
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
| 20 SP | 21 ! | 22 " | 23 # | 24 $ | 25 % | 26 & | 27 ' |
| 28 ( | 29 ) | 2A * | 2B + | 2C , | 2D - | 2E . | 2F / |
| 30 0 | 31 1 | 32 2 | 33 3 | 34 4 | 35 5 | 36 6 | 37 7 |
@@ -146,6 +147,7 @@ public static String slice(String value,
int beginOffset, int endOffset,
boolean trim)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-731
String retval = value.substring(beginOffset, endOffset + 1);
if (trim)
@@ -156,6 +158,7 @@ public static String slice(String value,
private static char[] hex_table = {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3531
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f'
};
@@ -167,6 +170,7 @@ public static String slice(String value,
For each byte (b) two characaters are generated, the first character
represents the high nibble (4 bits) in hexidecimal (b & 0xf0), the second character
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
represents the low nibble (b & 0x0f).
The byte at data[offset] is represented by the first two characters in the returned String.
@@ -328,6 +332,7 @@ public static boolean SQLEqualsIgnoreCase(String s1, String s2)
return false;
else
return SQLToUpperCase(s1).equals(SQLToUpperCase(s2));
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
}
@@ -340,6 +345,7 @@ public static boolean SQLEqualsIgnoreCase(String s1, String s2)
* @param id syntacically correct SQL identifier
*/
public static String normalizeSQLIdentifier(String id) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3673
if (id.length() == 0) {
return id;
}
@@ -442,6 +448,7 @@ public static String quoteStringLiteral(String string) {
*/
public static String ensureIndent(String formatted, int depth) {
StringBuffer indent = new StringBuffer();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4087
while (depth-- > 0) {
indent.append("\t");
@@ -557,6 +564,7 @@ private static String doRegExpC(String src, String indent) {
*/
public static String shortDBName
(
+//IC see: https://issues.apache.org/jira/browse/DERBY-590
String canonicalDBName,
char separatorChar
)
diff --git a/java/org.apache.derby.engine/org/apache/derby/iapi/util/UTF8Util.java b/java/org.apache.derby.engine/org/apache/derby/iapi/util/UTF8Util.java
index 3eeb0fc03a..0676417d2d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/iapi/util/UTF8Util.java
+++ b/java/org.apache.derby.engine/org/apache/derby/iapi/util/UTF8Util.java
@@ -58,6 +58,7 @@ public static final long skipUntilEOF(InputStream in)
// No need to do the skip in a loop, as Reader.read() returning -1
// means EOF has been reached.
// Note that a loop should be used if skip is used instead of read.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2760
return internalSkip(in, Long.MAX_VALUE).charsSkipped();
}
@@ -74,6 +75,7 @@ public static final long skipUntilEOF(InputStream in)
*/
public static final long skipFully(InputStream in, long charsToSkip)
throws EOFException, IOException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2760
SkipCount skipped = internalSkip(in, charsToSkip);
if (skipped.charsSkipped() != charsToSkip) {
throw new EOFException("Reached end-of-stream prematurely at " +
@@ -103,6 +105,7 @@ public static final long skipFully(InputStream in, long charsToSkip)
* @throws UTFDataFormatException if an invalid UTF-8 encoding is detected
*/
private static final SkipCount internalSkip(final InputStream in,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2760
final long charsToSkip)
throws IOException {
long charsSkipped = 0;
@@ -120,6 +123,7 @@ private static final SkipCount internalSkip(final InputStream in,
bytesSkipped++;
} else if ((c & 0x60) == 0x40) { // 7th bit set, 6th bit unset
// Found char of two byte width.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3770
if (InputStreamUtil.skipPersistent(in, 1L) != 1L) {
// No second byte present.
throw new UTFDataFormatException(
@@ -146,6 +150,7 @@ private static final SkipCount internalSkip(final InputStream in,
skipped = 2;
}
} else {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3770
skipped = (int)InputStreamUtil.skipPersistent(in, 2L);
}
if (skipped != 2) {
@@ -163,6 +168,7 @@ private static final SkipCount internalSkip(final InputStream in,
}
// We don't close the stream, since it might be reused. One example of
// this is use of Resetable streams.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2760
return new SkipCount(charsSkipped, bytesSkipped);
}
@@ -182,6 +188,7 @@ private static final class SkipCount {
* @param byteCount number of bytes
* @param charCount number of characters
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2760
SkipCount(long charCount, long byteCount) {
if (byteCount < 0 || charCount < 0) {
// Don't allow negative counts.
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/db/BasicDatabase.java b/java/org.apache.derby.engine/org/apache/derby/impl/db/BasicDatabase.java
index 6abb33d5b9..d183045f57 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/db/BasicDatabase.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/db/BasicDatabase.java
@@ -132,6 +132,7 @@ public class BasicDatabase implements ModuleControl, ModuleSupportable, Property
public boolean canSupport(Properties startParams) {
boolean supported =
Monitor.isDesiredCreateType(startParams, getEngineType());
+//IC see: https://issues.apache.org/jira/browse/DERBY-3184
if (supported) {
String repliMode =
@@ -149,6 +150,7 @@ public void boot(boolean create, Properties startParams)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
ModuleFactory monitor = getMonitor();
if (create)
{
@@ -158,6 +160,7 @@ public void boot(boolean create, Properties startParams)
String localeID =
startParams.getProperty(
org.apache.derby.shared.common.reference.Attribute.TERRITORY);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
if (localeID == null) {
localeID = Locale.getDefault().toString();
@@ -168,6 +171,7 @@ public void boot(boolean create, Properties startParams)
databaseLocale = monitor.getLocale(this);
}
setLocale(databaseLocale);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
// boot the validation needed to do property validation, now property
// validation is separated from AccessFactory, therefore from store
@@ -177,9 +181,11 @@ public void boot(boolean create, Properties startParams)
// registered types (DECIMAL) are there before logical undo recovery
// might need them.
DataValueFactory dvf = (DataValueFactory)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
bootServiceModule(
create,
this,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
org.apache.derby.shared.common.reference.ClassName.DataValueFactory,
startParams);
@@ -191,6 +197,7 @@ public void boot(boolean create, Properties startParams)
// Add the database properties read from disk (not stored
// in service.properties) into the set seen by booting modules.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2341
Properties allParams =
new DoubleProperties(getAllDatabaseProperties(), startParams);
@@ -202,8 +209,10 @@ public void boot(boolean create, Properties startParams)
bootClassFactory(create, allParams);
dd = (DataDictionary)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
bootServiceModule(create, this,
DataDictionary.MODULE, allParams);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2341
lcf = (LanguageConnectionFactory)
bootServiceModule(
@@ -227,6 +236,7 @@ public void boot(boolean create, Properties startParams)
//
authenticationService = bootAuthenticationService(create, allParams);
if (SanityManager.DEBUG) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2537
SanityManager.ASSERT(
authenticationService != null,
"Failed to set the Authentication service for the database");
@@ -243,6 +253,7 @@ public void boot(boolean create, Properties startParams)
active = true;
// Create an index statistics update daemon.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4936
if (dd.doCreateIndexStatsRefresher()) {
dd.createIndexStatsRefresher(this, allParams.getProperty(
Property.PROPERTY_RUNTIME_PREFIX + "serviceDirectory"));
@@ -252,6 +263,7 @@ public void boot(boolean create, Properties startParams)
public void stop() {
// The data dictionary is not available if this database has the
// role as an active replication slave database.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5390
if (dd != null) {
try {
// on orderly shutdown, try not to leak unused numbers from
@@ -278,6 +290,7 @@ public void stop() {
* This implementation supports the standard database.
*/
public int getEngineType() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2164
return EngineType.STANDALONE_DB;
}
@@ -313,6 +326,7 @@ public LanguageConnectionContext setupConnection(ContextManager cm, String user,
//a bit of a hack. Unfortunately, we can't initialize this
//when we push it. We first must push a few more contexts.
lctx.initialize();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
// Need to commit this to release locks gotten in initialize.
// Commit it but make sure transaction not have any updates.
@@ -329,6 +343,7 @@ public LanguageConnectionContext setupConnection(ContextManager cm, String user,
*/
public final DataDictionary getDataDictionary()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2138
return dd;
}
@@ -342,6 +357,7 @@ public void pushDbContext(ContextManager cm)
public AuthenticationService getAuthenticationService()
throws StandardException{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3184
// Expected to find one - Sanity check being done at
// DB boot-up.
@@ -367,9 +383,11 @@ public AuthenticationService getAuthenticationService()
* @exception SQLException Thrown on error
*/
public void startReplicationMaster(String dbmaster, String host, int port,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2977
String replicationMode)
throws SQLException {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3189
af.startReplicationMaster(dbmaster, host, port, replicationMode);
} catch (StandardException se) {
throw PublicAPI.wrapStandardException(se);
@@ -382,6 +400,7 @@ public void startReplicationMaster(String dbmaster, String host, int port,
* @exception SQLException Thrown on error
*/
public void stopReplicationMaster() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3189
try {
af.stopReplicationMaster();
} catch (StandardException se) {
@@ -410,6 +429,7 @@ public boolean isInSlaveMode() {
* @see org.apache.derby.iapi.db.Database#failover(String)
*/
public void failover(String dbname) throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3428
af.failover(dbname);
}
@@ -433,6 +453,8 @@ public void unfreeze() throws SQLException
public void backup(String backupDir, boolean wait)
+//IC see: https://issues.apache.org/jira/browse/DERBY-239
+//IC see: https://issues.apache.org/jira/browse/DERBY-523
throws SQLException
{
try {
@@ -456,6 +478,8 @@ public void backupAndEnableLogArchiveMode(String backupDir,
af.backupAndEnableLogArchiveMode(backupDir,
deleteOnlineArchivedLogFiles,
wait);
+//IC see: https://issues.apache.org/jira/browse/DERBY-590
+//IC see: https://issues.apache.org/jira/browse/DERBY-590
if ( luceneLoaded() )
{
backupLucene( backupDir );
@@ -586,6 +610,7 @@ protected UUID makeDatabaseID(boolean create, Properties startParams)
TransactionController tc = af.getTransaction(
getContextService().getCurrentContextManager());
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
String upgradeID = null;
UUID databaseID;
@@ -596,6 +621,7 @@ protected UUID makeDatabaseID(boolean create, Properties startParams)
// this could be an upgrade, see if it's stored in the service set
UUIDFactory uuidFactory = getMonitor().getUUIDFactory();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
upgradeID = startParams.getProperty(DataDictionary.DATABASE_ID);
@@ -662,6 +688,7 @@ public boolean validate(String key,
if (newClasspath != null) {
// parse it when it is set to ensure only valid values
// are written to the actual conglomerate.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
dbcp = IdUtil.parseDbClassPath(newClasspath);
}
@@ -701,6 +728,7 @@ public Serviceable apply(String key, Serializable value, Dictionary p)
//
// Invalidate stored plans.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2138
getDataDictionary().invalidateAllSPSPlans();
String newClasspath = (String) value;
@@ -743,9 +771,12 @@ protected void bootClassFactory(boolean create,
// parse the class path and allow 2 part names.
IdUtil.parseDbClassPath(classpath);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
startParams.put(Property.BOOT_DB_CLASSPATH, classpath);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
cfDB = (ClassFactory) bootServiceModule(create, this,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
org.apache.derby.shared.common.reference.Module.ClassFactory, startParams);
}
@@ -763,12 +794,14 @@ protected TransactionController getConnectionTransaction(ContextManager cm)
protected AuthenticationService bootAuthenticationService(boolean create, Properties props) throws StandardException {
return (AuthenticationService)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
bootServiceModule(create, this, AuthenticationService.MODULE, props);
}
protected void bootValidation(boolean create, Properties startParams)
throws StandardException {
pf = (PropertyFactory) bootServiceModule(create, this,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
org.apache.derby.shared.common.reference.Module.PropertyFactory, startParams);
}
@@ -785,6 +818,7 @@ protected Properties getAllDatabaseProperties()
throws StandardException {
TransactionController tc = af.getTransaction(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
getContextService().getCurrentContextManager());
Properties dbProps = tc.getProperties();
tc.commit();
@@ -808,7 +842,9 @@ protected void bootResourceAdapter(boolean create, Properties allParams) {
try
{
resourceAdapter =
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
bootServiceModule(create, this,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
org.apache.derby.shared.common.reference.Module.ResourceAdapter,
allParams);
}
@@ -835,9 +871,11 @@ public StorageFile getJarFile(String schemaName, String sqlName)
long generationId = fid.getGenerationId();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
ContextManager cm = getContextService().getCurrentContextManager();
FileResource fr = af.getTransaction(cm).getFileHandler();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5357
String externalName = JarUtil.mkExternalName(
fid.getUUID(), schemaName, sqlName, fr.getSeparatorChar());
@@ -856,6 +894,7 @@ public StorageFile getJarFile(String schemaName, String sqlName)
*
*/
private boolean luceneLoaded()
+//IC see: https://issues.apache.org/jira/browse/DERBY-590
throws StandardException
{
try {
@@ -892,6 +931,7 @@ private StorageFactory getStorageFactory()
throws StandardException
{
DataFactory dataFactory = (DataFactory) findServiceModule( this, DataFactory.MODULE );
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return dataFactory.getStorageFactory();
}
@@ -948,12 +988,14 @@ public Boolean run()
*/
private static ContextService getContextService()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
{
public ContextService run()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return ContextService.getFactory();
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/db/DatabaseContextImpl.java b/java/org.apache.derby.engine/org/apache/derby/impl/db/DatabaseContextImpl.java
index 28b14b3c80..c1b76633b3 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/db/DatabaseContextImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/db/DatabaseContextImpl.java
@@ -38,6 +38,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
/**
A context that shutdowns down the database on a databsae exception.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1095
final class DatabaseContextImpl extends ContextImpl implements DatabaseContext
{
@@ -54,11 +55,13 @@ public void cleanupOnError(Throwable t) {
// Ensure the context is popped if the session is
// going away.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1095
if (se.getSeverity() < ExceptionSeverity.SESSION_SEVERITY)
return;
popMe();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5108
if (se.getSeverity() >= ExceptionSeverity.DATABASE_SEVERITY) {
// DERBY-5108: Shut down the istat daemon thread before shutting
// down the various modules belonging to the database. An active
@@ -74,9 +77,11 @@ public void cleanupOnError(Throwable t) {
}
if (se.getSeverity() == ExceptionSeverity.DATABASE_SEVERITY) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
getContextService().notifyAllActiveThreads(this);
// This may be called multiple times, but is short-circuited
// in the monitor.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
getMonitor().shutdown(db);
}
}
@@ -100,6 +105,7 @@ public int hashCode() {
*/
private static ContextService getContextService()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/db/SlaveDatabase.java b/java/org.apache.derby.engine/org/apache/derby/impl/db/SlaveDatabase.java
index d1b4842d7e..d80da4cf08 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/db/SlaveDatabase.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/db/SlaveDatabase.java
@@ -126,14 +126,18 @@ public void boot(boolean create, Properties startParams)
throws StandardException {
inReplicationSlaveMode = true;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3361
+//IC see: https://issues.apache.org/jira/browse/DERBY-3356
inBoot = true;
shutdownInitiated = false;
dbname = startParams.getProperty(SlaveFactory.SLAVE_DB);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3184
// SlaveDatabaseBootThread is an internal class
SlaveDatabaseBootThread dbBootThread =
new SlaveDatabaseBootThread(create, startParams);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3447
Thread sdbThread =
new Thread(dbBootThread, "derby.slave.boot-" + dbname);
sdbThread.setDaemon(true);
@@ -142,6 +146,8 @@ public void boot(boolean create, Properties startParams)
// Check that the database was booted successfully, or throw
// the exception that caused the boot to fail.
verifySuccessfulBoot();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3361
+//IC see: https://issues.apache.org/jira/browse/DERBY-3356
inBoot = false;
@@ -202,6 +208,7 @@ public LanguageConnectionContext setupConnection(ContextManager cm,
}
public AuthenticationService getAuthenticationService()
+//IC see: https://issues.apache.org/jira/browse/DERBY-3184
throws StandardException{
if (inReplicationSlaveMode) {
// Cannot get authentication service for a database that
@@ -227,6 +234,7 @@ public void verifyShutdownSlave() throws StandardException {
throw StandardException.
newException(SQLState.REPLICATION_STOPSLAVE_NOT_INITIATED);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
pushDbContext(getContextService().
getCurrentContextManager());
}
@@ -266,6 +274,7 @@ public void stopReplicationSlave() throws SQLException {
}
public void failover(String dbname) throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3428
if (inReplicationSlaveMode) {
slaveFac.failover();
// SlaveFactory#failover will make the
@@ -278,6 +287,7 @@ public void failover(String dbname) throws StandardException {
try {
Thread.sleep(500);
} catch (InterruptedException ie) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
InterruptStatus.setInterrupted();
}
}
@@ -310,9 +320,11 @@ public void run() {
// The thread needs a ContextManager since two threads
// cannot share a context
+//IC see: https://issues.apache.org/jira/browse/DERBY-3184
ContextManager bootThreadCm = null;
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
bootThreadCm = getContextService().newContextManager();
getContextService().
setCurrentContextManager(bootThreadCm);
@@ -324,10 +336,12 @@ public void run() {
inReplicationSlaveMode = false;
if (bootThreadCm != null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
getContextService().
resetCurrentContextManager(bootThreadCm);
bootThreadCm = null;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-4269
} catch (Exception e) {
// We get here when SlaveController#stopSlave has been called,
// a fatal Derby exception has been thrown, or if a run-time
@@ -358,6 +372,8 @@ public void run() {
* to fail.
*/
private void verifySuccessfulBoot() throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3361
+//IC see: https://issues.apache.org/jira/browse/DERBY-3356
while (!(isSlaveFactorySet() && slaveFac.isStarted())) {
if (bootException != null) {
throw bootException;
@@ -365,12 +381,14 @@ private void verifySuccessfulBoot() throws StandardException {
try {
Thread.sleep(500);
} catch (InterruptedException ie) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
InterruptStatus.setInterrupted();
}
}
}
if (bootException != null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4186
// DERBY-4186: This is a corner case. Master made us shut down
// before the initial connect which establishes the slave has
@@ -398,6 +416,7 @@ private boolean isSlaveFactorySet() {
}
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
slaveFac = (SlaveFactory)
findServiceModule(this, SlaveFactory.MODULE);
return true;
@@ -437,6 +456,7 @@ private void handleShutdown(StandardException shutdownCause) {
InternalDriver driver = InternalDriver.activeDriver();
if (driver != null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6094
driver.connect( conStr, (Properties) null, 0 );
}
} catch (Exception e) {
@@ -458,12 +478,14 @@ private void bootBasicDatabase(boolean create, Properties params)
*/
private static ContextService getContextService()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
{
public ContextService run()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return ContextService.getFactory();
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/db/StoreClassFactoryContext.java b/java/org.apache.derby.engine/org/apache/derby/impl/db/StoreClassFactoryContext.java
index 5cb4d85db2..257bcc2126 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/db/StoreClassFactoryContext.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/db/StoreClassFactoryContext.java
@@ -46,6 +46,7 @@ final class StoreClassFactoryContext extends ClassFactoryContext {
public CompatibilitySpace getLockSpace() throws StandardException {
if (store == null)
return null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
return store.getTransaction(getContextManager()).getLockSpace();
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/io/BaseStorageFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/io/BaseStorageFactory.java
index d8e3fc4d5e..9c3da786c8 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/io/BaseStorageFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/io/BaseStorageFactory.java
@@ -266,6 +266,7 @@ else if( isReadOnlyDatabase())
tempDir.deleteAll();
tempDir.mkdirs();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5363
tempDir.limitAccessToOwner();
tempDirPath = tempDir.getPath();
} // end of createTempDir
@@ -293,6 +294,7 @@ public int getStorageFactoryVersion()
*/
public StorageFile createTemporaryFile (String prefix, String suffix)
throws IOException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2247
File tmpFile = File.createTempFile (prefix, suffix,
new File (getTempDir().getPath()));
return newStorageFile (getTempDir(), tmpFile.getName());
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/io/CPFile.java b/java/org.apache.derby.engine/org/apache/derby/impl/io/CPFile.java
index de6b43c471..54d8543405 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/io/CPFile.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/io/CPFile.java
@@ -34,6 +34,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* This class provides a class path based implementation of the StorageFile interface. It is used by the
* database engine to access persistent data and transaction logs under the classpath subsubprotocol.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6535
class CPFile extends InputStreamFile
{
@@ -64,6 +65,7 @@ private CPFile( CPStorageFactory storageFactory, String child, int pathLen)
*/
public boolean exists()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-538
return getURL() != null;
} // end of exists
@@ -86,6 +88,7 @@ StorageFile getParentDir( int pathLen)
*/
public InputStream getInputStream( ) throws FileNotFoundException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5615
InputStream is = null;
ClassLoader cl = getContextClassLoader(Thread.currentThread());
if (cl != null) {
@@ -121,6 +124,7 @@ private URL getURL() {
ClassLoader cl = getContextClassLoader(Thread.currentThread());
if (cl != null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6534
URL myURL = getResource(cl, path);
if (myURL != null)
return myURL;
@@ -133,6 +137,7 @@ private URL getURL() {
// null as a return from Class.getClassLoader()
// to indicate the system/bootstrap classloader.
if (cl != null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5615
return getResource(cl, path);
} else {
return getSystemResource(path);
@@ -171,6 +176,7 @@ public URL run() {
* Privileged wrapper for {@code ClassLoader.getResourceAsStream(String)}.
*/
private static InputStream getResourceAsStream(
+//IC see: https://issues.apache.org/jira/browse/DERBY-5615
final ClassLoader cl, final String name) {
return AccessController.doPrivileged(
new PrivilegedAction() {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/io/DirFile.java b/java/org.apache.derby.engine/org/apache/derby/impl/io/DirFile.java
index 06c0fd464e..0f3a424324 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/io/DirFile.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/io/DirFile.java
@@ -109,6 +109,7 @@ public StorageFile getParentDir()
*/
public OutputStream getOutputStream( ) throws FileNotFoundException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6503
return getOutputStream(false);
}
@@ -129,9 +130,12 @@ public OutputStream getOutputStream( final boolean append) throws FileNotFoundEx
{
boolean exists = exists();
OutputStream result = new FileOutputStream(this, append);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
if (!exists) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6503
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5363
limitAccessToOwner();
} catch (FileNotFoundException fnfe) {
// Throw FileNotFoundException unchanged.
@@ -190,6 +194,7 @@ public synchronized int getExclusiveFileLock() throws StandardException
** of a warning.
**/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
try
{
//create the file that us used to acquire exclusive lock if it does not exists.
@@ -375,6 +380,7 @@ public boolean renameTo( StorageFile newName)
boolean rename_status = super.renameTo( (File) newName);
int retry_count = 1;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5574
while (!rename_status && (retry_count <= 5))
{
// retry operation, hoping a temporary I/O resource issue is
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/io/DirRandomAccessFile.java b/java/org.apache.derby.engine/org/apache/derby/impl/io/DirRandomAccessFile.java
index 572f35ad4a..e48c5e53ab 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/io/DirRandomAccessFile.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/io/DirRandomAccessFile.java
@@ -58,6 +58,7 @@ class DirRandomAccessFile extends RandomAccessFile implements StorageRandomAcces
DirRandomAccessFile( File name, String mode) throws FileNotFoundException
{
super( name, mode);
+//IC see: https://issues.apache.org/jira/browse/DERBY-590
_name = name;
_mode = mode;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/io/DirStorageFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/io/DirStorageFactory.java
index dfed1facea..72838fa495 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/io/DirStorageFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/io/DirStorageFactory.java
@@ -152,6 +152,7 @@ public void sync( OutputStream stream, boolean metaData) throws IOException, Syn
*/
public boolean supportsWriteSync()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return true;
}
@@ -184,6 +185,7 @@ else if( home != null && dataDirectory.startsWith( home))
else
{
databaseRoot = new File( home, dataDirectory);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1618
if (home != null)
dataDirectory = home + getSeparator() + dataDirectory;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/io/InputStreamFile.java b/java/org.apache.derby.engine/org/apache/derby/impl/io/InputStreamFile.java
index a6c2d67f13..a537f86852 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/io/InputStreamFile.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/io/InputStreamFile.java
@@ -39,6 +39,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* classpath, jar, http, and https subsubprotocols
* @param the storage factory class used by the subsubprotocol
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6535
abstract class InputStreamFile
implements StorageFile
{
@@ -57,6 +58,7 @@ abstract class InputStreamFile
}
else
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6535
StringBuilder sb =
new StringBuilder(storageFactory.separatedDataDirectory);
if( File.separatorChar != '/')
@@ -68,6 +70,7 @@ abstract class InputStreamFile
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6535
InputStreamFile(F storageFactory, String parent, String name)
{
this.storageFactory = storageFactory;
@@ -89,6 +92,7 @@ abstract class InputStreamFile
nameStart = this.path.lastIndexOf( '/') + 1;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6535
InputStreamFile(InputStreamFile dir, String name)
{
this.storageFactory = dir.storageFactory;
@@ -102,6 +106,7 @@ abstract class InputStreamFile
nameStart = this.path.lastIndexOf( '/') + 1;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6535
InputStreamFile(F storageFactory, String child, int pathLen)
{
this.storageFactory = storageFactory;
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/io/JarDBFile.java b/java/org.apache.derby.engine/org/apache/derby/impl/io/JarDBFile.java
index eefdb93a29..7d478806e0 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/io/JarDBFile.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/io/JarDBFile.java
@@ -31,6 +31,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* This class provides a jar file based implementation of the StorageFile interface. It is used by the
* database engine to access persistent data and transaction logs under the jar subsubprotocol.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6535
class JarDBFile extends InputStreamFile
{
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/io/JarStorageFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/io/JarStorageFactory.java
index 451542add9..44d583a71a 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/io/JarStorageFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/io/JarStorageFactory.java
@@ -84,6 +84,7 @@ void doInit() throws IOException
return;
// Parse the dataDirectory name. It should be of the form "(jar-file)directory" or "jar-file"
int offset = 0;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4472
while( offset < dataDirectory.length() && Character.isSpaceChar( dataDirectory.charAt( offset)))
offset ++;
int leftParen = -1;
@@ -99,6 +100,7 @@ void doInit() throws IOException
{
jarFile = getJarFile( dataDirectory.substring( leftParen + 1, rightParen));
offset = rightParen + 1;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4472
while( offset < dataDirectory.length() && Character.isSpaceChar( dataDirectory.charAt( offset)))
offset ++;
dataDirectory = dataDirectory.substring( offset, dataDirectory.length());
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/io/URLFile.java b/java/org.apache.derby.engine/org/apache/derby/impl/io/URLFile.java
index ac91cf21b8..f0cff7145f 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/io/URLFile.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/io/URLFile.java
@@ -33,6 +33,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* This class provides a http based implementation of the StorageFile interface. It is used by the
* database engine to access persistent data and transaction logs under the http and https subsubprotocols.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6535
class URLFile extends InputStreamFile
{
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java
index 2f93068eb0..86bc2c17c5 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java
@@ -98,17 +98,20 @@ public VFMemoryStorageFactory() {
* @exception IOException on an error (unexpected).
*/
public void init(String home, String databaseName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-4093
String tempDirNameIgnored, String uniqueName)
throws IOException {
// Handle cases where a database name is specified.
if (databaseName != null) {
if (home != null &&
+//IC see: https://issues.apache.org/jira/browse/DERBY-4125
!new File(databaseName).isAbsolute()) {
canonicalName = new File(home, databaseName).getCanonicalPath();
} else {
canonicalName = new File(databaseName).getCanonicalPath();
}
synchronized (DATABASES) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4428
this.dbData = (DataStore)DATABASES.get(canonicalName);
// If the store has been scheduled for deletion, purge it.
if (dbData != null && dbData.scheduledForDeletion()) {
@@ -122,6 +125,7 @@ public void init(String home, String databaseName,
// Create a new data store.
this.dbData = new DataStore(canonicalName);
DATABASES.put(canonicalName, dbData);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4432
} else {
// We have a database name, but no unique name.
// Assume that the client only wants to do some
@@ -133,6 +137,7 @@ public void init(String home, String databaseName,
}
// Specify the data directory and the temp directory.
dataDirectory = new VirtualFile(canonicalName, dbData);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4094
tempDir = new VirtualFile(normalizePath(canonicalName, "tmp"),
dbData);
@@ -145,6 +150,7 @@ public void init(String home, String databaseName,
// directory names of the database locations, but the
// databases themselves will be stored in separate stores.
final String absHome = new File(home).getCanonicalPath();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4432
dbData = DUMMY_STORE;
dataDirectory = new VirtualFile(absHome, dbData);
tempDir = new VirtualFile(getSeparator() + "tmp", dbData);
@@ -154,8 +160,10 @@ public void init(String home, String databaseName,
// Creating the temporary directory too early casues the
// BaseDataFileFactory to fail, hence the check for uniqueName.
// This check is also used by BaseStorageFactory.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4093
if (uniqueName != null && tempDir != null && !tempDir.exists()) {
tempDir.mkdirs();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5363
tempDir.limitAccessToOwner(); // nop, but follow pattern
}
}
@@ -168,6 +176,7 @@ public void shutdown() {
// If the data store has been scheduled for deletion, which happens
// when the store detects that the service root has been deleted, then
// delete the whole store to release the memory.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4428
if (dbData.scheduledForDeletion()) {
DataStore store;
synchronized (DATABASES) {
@@ -212,6 +221,7 @@ public StorageFile newStorageFile(String path) {
// Return the database directory as described by StorageFactory.
return dataDirectory;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-4094
return new VirtualFile(normalizePath(path), dbData);
}
@@ -223,6 +233,7 @@ public StorageFile newStorageFile(String path) {
* @return A path handle.
*/
public StorageFile newStorageFile(String directoryName, String fileName) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4094
return new VirtualFile(
normalizePath(directoryName, fileName), dbData);
}
@@ -236,6 +247,7 @@ public StorageFile newStorageFile(String directoryName, String fileName) {
*/
public StorageFile newStorageFile(StorageFile directoryName,
String fileName) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4094
return newStorageFile(directoryName == null ? null
: directoryName.getPath(),
fileName);
@@ -336,8 +348,11 @@ public boolean supportsWriteSync() {
* @throws NullPointerException if {@code file} is {@code null}
*/
private String normalizePath(String dir, String file) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5393
if (dir == null || dir.length() == 0) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4094
dir = dataDirectory.getPath();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4125
} else if (!new File(dir).isAbsolute()) {
dir = new File(dataDirectory.getPath(), dir).getPath();
}
@@ -353,8 +368,10 @@ private String normalizePath(String dir, String file) {
* @return A path.
*/
private String normalizePath(String path) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5393
if (path == null || path.length() == 0) {
return dataDirectory.getPath();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4125
} else if (new File(path).isAbsolute()) {
return path;
} else {
@@ -369,6 +386,7 @@ private String normalizePath(String path) {
* @param dbPath absolute path of the dropped database
*/
private void dbDropCleanupInDummy(String dbPath) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4428
while (dbPath != null && DUMMY_STORE.deleteEntry(dbPath)) {
dbPath = new File(dbPath).getParent();
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/io/vfmem/BlockedByteArray.java b/java/org.apache.derby.engine/org/apache/derby/impl/io/vfmem/BlockedByteArray.java
index 8ed241dd74..b9efe0f057 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/io/vfmem/BlockedByteArray.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/io/vfmem/BlockedByteArray.java
@@ -140,9 +140,11 @@ public synchronized long length() {
*/
public synchronized void setLength(final long newLength) {
// If capacity is requested before any writes has taken place.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4103
if (blockSize == 0) {
checkBlockSize((int)Math.min(Integer.MAX_VALUE, newLength));
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-5098
final long currentCapacity = (long)allocatedBlocks * blockSize;
if (newLength > currentCapacity) {
// Allocate more blocks.
@@ -187,6 +189,7 @@ public synchronized int writeBytes(final long pos, final byte[] buf,
throw new ArrayIndexOutOfBoundsException(len);
}
// Increase the capacity if required.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5098
increaseCapacity(pos + len);
// Calculate the block number and the index within this block.
int block = (int)(pos / blockSize);
@@ -224,6 +227,7 @@ public synchronized int writeByte(long pos, byte b) {
checkBlockSize(0);
}
// Increase the capacity if required.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5098
increaseCapacity(pos);
// Calculate the block number and the index within this block.
int block = (int)(pos / blockSize);
@@ -292,10 +296,12 @@ private void checkBlockSize(int len) {
*/
//@GuardedBy("this")
private void increaseCapacity(long lastIndex) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4103
if (SanityManager.DEBUG) {
SanityManager.ASSERT(blockSize > 0, "Invalid/unset block size");
}
// Safe-guard to avoid overwriting existing data.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5098
if (lastIndex < (long)allocatedBlocks * blockSize) {
return;
}
@@ -308,6 +314,7 @@ private void increaseCapacity(long lastIndex) {
// holder array, we don't fill it with data blocks before needed.
int growTo = Math.max(
// Grow at least ~33%.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4103
blocks.length + (blocks.length / 3),
// For cases where we need to grow more than 33%.
blocksRequired + MIN_HOLDER_GROWTH);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/io/vfmem/DataStore.java b/java/org.apache.derby.engine/org/apache/derby/impl/io/vfmem/DataStore.java
index 20e969703c..01d2aea5e9 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/io/vfmem/DataStore.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/io/vfmem/DataStore.java
@@ -94,6 +94,7 @@ public String getDatabaseName() {
* {@code false} otherwise.
*/
public boolean scheduledForDeletion() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4428
return this.deleteMe;
}
@@ -111,6 +112,7 @@ public boolean scheduledForDeletion() {
*/
public DataStoreEntry createEntry(String iPath, boolean isDir) {
// Normalize the path.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4125
final String nPath = new File(iPath).getPath();
synchronized (LOCK) {
if (files.containsKey(nPath)) {
@@ -119,6 +121,7 @@ public DataStoreEntry createEntry(String iPath, boolean isDir) {
// Make sure the the parent directories exists.
String[] parents = getParentList(nPath);
for (int i=parents.length -1; i >= 0; i--) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
DataStoreEntry entry = files.get(parents[i]);
if (entry == null) {
return null;
@@ -139,12 +142,14 @@ public DataStoreEntry createEntry(String iPath, boolean isDir) {
* or were created, {@code false} otherwise
*/
public boolean createAllParents(String path) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4125
final String nPath = new File(path).getPath();
// Iterate through the list and create the missing parents.
String[] parents = getParentList(nPath);
synchronized (LOCK) {
for (int i=parents.length -1; i >= 0; i--) {
String subPath = parents[i];
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
DataStoreEntry entry = files.get(subPath);
if (entry == null) {
createEntry(subPath, true);
@@ -167,9 +172,11 @@ public boolean createAllParents(String path) {
* @return {@code true} if the entry was deleted, {@code false} otherwise.
*/
public boolean deleteEntry(String iPath) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4125
final String nPath = new File(iPath).getPath();
DataStoreEntry entry;
synchronized (LOCK) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
entry = files.remove(nPath);
if (entry != null) {
if (entry.isDirectory()) {
@@ -181,6 +188,7 @@ public boolean deleteEntry(String iPath) {
}
// Check if we just deleted the service root. Normally the
// service would be deleted using deleteAll.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4428
if (nPath.equals(databaseName) &&
files.get(databaseName) == null) {
// Service root deleted, mark this store for removal.
@@ -203,6 +211,7 @@ public boolean deleteEntry(String iPath) {
public DataStoreEntry getEntry(String iPath) {
synchronized (LOCK) {
// Use java.io.File to normalize the path.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return files.get(new File(iPath).getPath());
}
}
@@ -217,6 +226,7 @@ public DataStoreEntry getEntry(String iPath) {
public boolean deleteAll(String iPath) {
final String nPath = new File(iPath).getPath();
synchronized (LOCK) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
DataStoreEntry entry = files.remove(nPath);
if (entry == null) {
// Delete root doesn't exist.
@@ -224,6 +234,7 @@ public boolean deleteAll(String iPath) {
} else if (entry.isDirectory()) {
// Delete root is a directory.
boolean deleted = _deleteAll(nPath);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4428
if (files.get(databaseName) == null) {
// The service root has been deleted, which means that all
// the data has been deleted. Mark this store for removal.
@@ -250,11 +261,13 @@ public String[] listChildren(String iPath) {
throw new IllegalArgumentException(
"The empty string is not a valid path");
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-4125
String nPath = new File(iPath).getPath();
// Make sure the search path ends with the separator.
if (nPath.charAt(nPath.length() -1) != SEP) {
nPath += SEP;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
ArrayList children = new ArrayList();
synchronized (LOCK) {
Iterator paths = files.keySet().iterator();
@@ -262,6 +275,7 @@ public String[] listChildren(String iPath) {
while (paths.hasNext()) {
candidate = paths.next();
if (candidate.startsWith(nPath)) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-590
candidate = candidate.substring(nPath.length());
// don't include grandchildren
if ( candidate.indexOf( PathUtil.SEP_STR ) < 0 )
@@ -283,12 +297,14 @@ public String[] listChildren(String iPath) {
* file already existed or the existing file doesn't exist.
*/
public boolean move(StorageFile currentFile, StorageFile newFile) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4125
final String currentPath = new File(currentFile.getPath()).getPath();
final String newPath = new File(newFile.getPath()).getPath();
synchronized (LOCK) {
if (files.containsKey(newPath)) {
return false;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
DataStoreEntry current = files.remove(currentPath);
if (current == null) {
return false;
@@ -303,6 +319,7 @@ public boolean move(StorageFile currentFile, StorageFile newFile) {
*/
public void purge() {
synchronized (LOCK) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Iterator fileIter = files.values().iterator();
while (fileIter.hasNext()) {
(fileIter.next()).release();
@@ -327,6 +344,7 @@ private boolean _deleteAll(String prefixPath) {
if (prefixPath.charAt(prefixPath.length() -1) != SEP) {
prefixPath += SEP;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
ArrayList toDelete = new ArrayList();
Iterator paths = files.keySet().iterator();
// Find all the entries to delete.
@@ -341,7 +359,9 @@ private boolean _deleteAll(String prefixPath) {
// Iterate through all entries found and release them.
Iterator keys = toDelete.iterator();
while (keys.hasNext()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
DataStoreEntry entry = files.remove((String)keys.next());
+//IC see: https://issues.apache.org/jira/browse/DERBY-4125
entry.release();
}
return true;
@@ -368,7 +388,9 @@ public long getTempFileCounter() {
* @return A list of parents.
*/
private String[] getParentList(String path) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
ArrayList parents = new ArrayList();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4125
String parent = path;
// Build the list of parents.
while ((parent = new File(parent).getParent()) != null) {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/io/vfmem/DataStoreEntry.java b/java/org.apache.derby.engine/org/apache/derby/impl/io/vfmem/DataStoreEntry.java
index 401b291e7d..c1d7174d9d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/io/vfmem/DataStoreEntry.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/io/vfmem/DataStoreEntry.java
@@ -147,6 +147,7 @@ public boolean isReadOnly() {
*/
void release() {
released = true;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4125
if (src != null) {
src.release();
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/io/vfmem/VirtualRandomAccessFile.java b/java/org.apache.derby.engine/org/apache/derby/impl/io/vfmem/VirtualRandomAccessFile.java
index 7e849f9321..243c04f367 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/io/vfmem/VirtualRandomAccessFile.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/io/vfmem/VirtualRandomAccessFile.java
@@ -70,6 +70,7 @@ public class VirtualRandomAccessFile
public VirtualRandomAccessFile(DataStoreEntry entry, boolean readOnly)
throws FileNotFoundException {
this.entry = entry;
+//IC see: https://issues.apache.org/jira/browse/DERBY-590
_readOnly = readOnly;
bIn = entry.getInputStream();
bIn.setPosition(0L);
@@ -87,6 +88,7 @@ public VirtualRandomAccessFile(DataStoreEntry entry, boolean readOnly)
public VirtualRandomAccessFile clone()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-590
try {
return new VirtualRandomAccessFile( entry, _readOnly );
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/AutoPositioningStream.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/AutoPositioningStream.java
index 8bde5b91fc..a7f4ca9def 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/AutoPositioningStream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/AutoPositioningStream.java
@@ -156,6 +156,7 @@ private void setPosition () throws IOException {
}
}
catch (StandardException se) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
throw Util.newIOException(se);
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/BinaryToRawStream.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/BinaryToRawStream.java
index 6b3bbbb2f3..64b8666429 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/BinaryToRawStream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/BinaryToRawStream.java
@@ -28,10 +28,12 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.io.EOFException;
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
Converts a stream containing the Derby stored binary form
to one that just contains the application's data.
Simply read and save the length information.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2812
class BinaryToRawStream
extends java.io.FilterInputStream
{
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/ClobAsciiStream.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/ClobAsciiStream.java
index 3eaaab81f6..e311e56288 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/ClobAsciiStream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/ClobAsciiStream.java
@@ -56,6 +56,7 @@ final class ClobAsciiStream extends OutputStream {
* output stream has been closed.
*/
public void write(int b) throws IOException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2618
writer.write(b & 0xff);
}
@@ -90,10 +91,12 @@ public void write(int b) throws IOException {
*/
public void write(byte[] b, int off, int len) throws IOException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2618
while (len > 0)
{
int clen = Math.min(len, buffer.length);
for (int i = 0; i < clen; i++) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2618
buffer[i] = (char)(b[off + i] & 0xff);
}
writer.write(buffer, 0, clen);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/ClobUtf8Writer.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/ClobUtf8Writer.java
index e79ba7264c..fee5a74f3e 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/ClobUtf8Writer.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/ClobUtf8Writer.java
@@ -42,6 +42,7 @@ final class ClobUtf8Writer extends Writer {
* @param control worker object for the CLOB value
* @param pos initial byte position in the CLOB value
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2827
ClobUtf8Writer(TemporaryClob control, long pos) {
this.control = control;
this.pos = pos;
@@ -64,6 +65,7 @@ final class ClobUtf8Writer extends Writer {
public void flush() throws IOException {
if (closed)
throw new IOException (
+//IC see: https://issues.apache.org/jira/browse/DERBY-5090
MessageService.getTextMessage(MessageId.OBJECT_CLOSED));
// A no-op.
// Flushing is currently the responsibility of the underlying stream(s).
@@ -92,6 +94,7 @@ public void close() {
public void write(char[] cbuf, int off, int len) throws IOException {
if (closed)
throw new IOException (
+//IC see: https://issues.apache.org/jira/browse/DERBY-5090
MessageService.getTextMessage(MessageId.OBJECT_CLOSED));
try {
long ret = control.insertString (String.copyValueOf (
@@ -101,6 +104,7 @@ public void write(char[] cbuf, int off, int len) throws IOException {
pos += ret;
}
catch (SQLException e) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
throw Util.newIOException(e);
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/ConnectionChild.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/ConnectionChild.java
index b8014b7443..40faaad1d8 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/ConnectionChild.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/ConnectionChild.java
@@ -152,13 +152,16 @@ java.util.Calendar getCal() {
}
static SQLException newSQLException(String messageId, Object... args) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6262
return EmbedConnection.newSQLException(messageId, args);
}
protected static void restoreIntrFlagIfSeen(
boolean pushStack, EmbedConnection ec) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
if (pushStack) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
InterruptStatus.restoreIntrFlagIfSeen( getLCC( ec ) );
} else {
// no lcc if connection is closed:
@@ -169,6 +172,7 @@ protected static void restoreIntrFlagIfSeen(
/**
* Get and cache the LanguageConnectionContext for this connection.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
LanguageConnectionContext getLanguageConnectionContext( final EmbedConnection conn )
{
if ( lcc == null ) { lcc = getLCC( conn ); }
@@ -180,6 +184,7 @@ LanguageConnectionContext getLanguageConnectionContext( final EmbedConnection co
*/
static LanguageConnectionContext getLCC( final EmbedConnection conn )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedBlob.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedBlob.java
index e0abbeb6e9..6de7848228 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedBlob.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedBlob.java
@@ -68,6 +68,7 @@ multiple threads and sucks data from the stream (returned from
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-3576
final class EmbedBlob extends ConnectionChild implements Blob, EngineLOB
{
/**
@@ -132,6 +133,7 @@ final class EmbedBlob extends ConnectionChild implements Blob, EngineLOB
*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2247
EmbedBlob(byte [] blobBytes,EmbedConnection con) throws SQLException {
super(con);
try {
@@ -154,6 +156,7 @@ final class EmbedBlob extends ConnectionChild implements Blob, EngineLOB
This constructor should only be called by EmbedResultSet.getBlob
*/
protected EmbedBlob(DataValueDescriptor dvd, EmbedConnection con)
+//IC see: https://issues.apache.org/jira/browse/DERBY-5760
throws StandardException, SQLException
{
super(con);
@@ -163,6 +166,7 @@ protected EmbedBlob(DataValueDescriptor dvd, EmbedConnection con)
SanityManager.ASSERT(!dvd.isNull(), "blob is created on top of a null column");
/*
+//IC see: https://issues.apache.org/jira/browse/DERBY-4102
We support three scenarios at this point:
a) The Blob value is already represented as bytes in memory.
This is the case for small Blobs (less than 32 KB).
@@ -174,10 +178,13 @@ This is the case for small Blobs (less than 32 KB).
stream and store it temporarily until it is either discarded or
inserted into the database.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
if (dvd.hasStream()) { // Cases b) and c)
streamPositionOffset = handleStreamValue(dvd.getStream(), con);
} else { // a) Blob already materialized in memory
materialized = true;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3766
+//IC see: https://issues.apache.org/jira/browse/DERBY-3766
streamPositionOffset = Integer.MIN_VALUE;
// copy bytes into memory so that blob can live after result set
// is closed
@@ -189,11 +196,17 @@ This is the case for small Blobs (less than 32 KB).
control = new LOBStreamControl (
getEmbedConnection(), dvdBytes);
} catch (IOException e) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5760
throw Util.setStreamFailure(e);
}
}
//add entry in connection so it can be cleared
//when transaction is not valid
+//IC see: https://issues.apache.org/jira/browse/DERBY-3354
+//IC see: https://issues.apache.org/jira/browse/DERBY-3354
+//IC see: https://issues.apache.org/jira/browse/DERBY-3354
+//IC see: https://issues.apache.org/jira/browse/DERBY-3354
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
con.addLOBReference (this);
}
@@ -209,6 +222,7 @@ This is the case for small Blobs (less than 32 KB).
* data to temporary storage fails
*/
private int handleStreamValue(InputStream dvdStream, EmbedConnection con)
+//IC see: https://issues.apache.org/jira/browse/DERBY-5760
throws StandardException, SQLException {
int offset = 0;
// b) Resetable stream
@@ -224,24 +238,30 @@ private int handleStreamValue(InputStream dvdStream, EmbedConnection con)
implementing the getStream() method for dvd.getStream(), does not
guarantee this for us
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-3766
if (SanityManager.DEBUG) {
SanityManager.ASSERT(dvdStream instanceof Resetable);
}
// Create a position aware stream on top of dvdStream so we can
// more easily move back and forth in the Blob.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3766
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3970
myStream = new PositionedStoreStream(dvdStream);
// The BinaryToRawStream will read the encoded length bytes.
BinaryToRawStream tmpStream =
new BinaryToRawStream(myStream, con);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
offset = (int)myStream.getPosition();
// Check up front if the stream length is specified.
streamLength = tmpStream.getLength();
tmpStream.close();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3970
} catch (StandardException se) {
if (se.getMessageId().equals(SQLState.DATA_CONTAINER_CLOSED)) {
throw StandardException
.newException(SQLState.BLOB_ACCESSED_AFTER_COMMIT);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3768
} else {
throw se;
}
@@ -252,8 +272,10 @@ implementing the getStream() method for dvd.getStream(), does not
// c) Non-resetable stream
// This is most likely a stream coming in from the user, and we
// don't have any guarantees on how it behaves.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
} else {
// The code below will only work for RawToBinaryFormatStream.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4102
if (SanityManager.DEBUG) {
SanityManager.ASSERT(
dvdStream instanceof RawToBinaryFormatStream,
@@ -262,6 +284,7 @@ implementing the getStream() method for dvd.getStream(), does not
// The source stream isn't resetable, so we have to write it to a
// temporary location to be able to support the Blob operations.
materialized = true;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
offset = Integer.MIN_VALUE;
try {
control = new LOBStreamControl(getEmbedConnection());
@@ -282,9 +305,11 @@ implementing the getStream() method for dvd.getStream(), does not
}
tmpStream.close();
} catch (IOException ioe) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5760
throw Util.setStreamFailure(ioe);
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
return offset;
}
@@ -318,16 +343,19 @@ private long setBlobPosition(long logicalPos)
// Nothing to do here, except checking if the position is valid.
if (logicalPos >= control.getLength()) {
throw StandardException.newException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
SQLState.BLOB_POSITION_TOO_LARGE, logicalPos);
}
} else {
// Reposition the store stream, account for the length field offset.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2379
try {
this.myStream.reposition(
logicalPos + this.streamPositionOffset);
} catch (EOFException eofe) {
throw StandardException.newException(
SQLState.BLOB_POSITION_TOO_LARGE, eofe,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
logicalPos);
}
}
@@ -347,6 +375,7 @@ private long setBlobPosition(long logicalPos)
* fails
*/
private int read(long pos)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3766
throws IOException, StandardException {
int c;
if (materialized) {
@@ -377,6 +406,7 @@ public long length()
//call checkValidity to exit by throwing a SQLException if
//the Blob object has been freed by calling free() on it
checkValidity();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2247
try {
if (materialized)
return control.getLength ();
@@ -384,6 +414,7 @@ public long length()
catch (IOException e) {
throw Util.setStreamFailure (e);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3768
if (streamLength != -1)
return streamLength;
@@ -407,11 +438,13 @@ public long length()
}
streamLength = InputStreamUtil.skipUntilEOF(tmpStream);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3770
tmpStream.close();
// Save for future uses.
restoreIntrFlagIfSeen(pushStack, ec);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
return streamLength;
}
@@ -463,16 +496,20 @@ public byte[] getBytes(long startPos, int length)
{
if (startPos < 1)
throw StandardException.newException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
SQLState.BLOB_BAD_POSITION, startPos);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1516
if (length < 0)
throw StandardException.newException(
SQLState.BLOB_NONPOSITIVE_LENGTH, length);
byte[] result;
// if the blob is materialized
+//IC see: https://issues.apache.org/jira/browse/DERBY-2247
if (materialized) {
result = new byte [length];
int sz = control.read (result, 0, result.length, startPos - 1);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
if (sz == -1) {
InterruptStatus.restoreIntrFlagIfSeen();
return new byte [0];
@@ -493,6 +530,7 @@ public byte[] getBytes(long startPos, int length)
if (pushStack)
setupContextStack();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3766
setBlobPosition(startPos-1);
// read length bytes into a string
result = new byte[length];
@@ -511,6 +549,7 @@ public byte[] getBytes(long startPos, int length)
System.arraycopy(result,0,result2,0,n);
restoreIntrFlagIfSeen(pushStack, ec);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
return result2;
}
@@ -524,8 +563,12 @@ public byte[] getBytes(long startPos, int length)
}
catch (StandardException e)
{ // if this is a setPosition exception then we ran out of Blob
+//IC see: https://issues.apache.org/jira/browse/DERBY-839
+//IC see: https://issues.apache.org/jira/browse/DERBY-839
+//IC see: https://issues.apache.org/jira/browse/DERBY-839
if (e.getMessageId().equals(SQLState.BLOB_LENGTH_TOO_LONG))
e = StandardException.newException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
SQLState.BLOB_POSITION_TOO_LARGE, startPos);
throw handleMyExceptions(e);
}
@@ -560,8 +603,10 @@ public java.io.InputStream getBinaryStream()
try
{
// if we have byte array, not a stream
+//IC see: https://issues.apache.org/jira/browse/DERBY-2247
if (materialized)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
java.io.InputStream result = control.getInputStream(0);
return result;
}
@@ -571,6 +616,7 @@ public java.io.InputStream getBinaryStream()
synchronized (getConnectionSynchronization())
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
EmbedConnection ec = getEmbedConnection();
pushStack = !ec.isClosed();
if (pushStack)
@@ -578,6 +624,7 @@ public java.io.InputStream getBinaryStream()
// Reset stream, because AutoPositionigStream wants to read
// the encoded length bytes.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3766
myStream.resetStream();
UpdatableBlobStream result = new UpdatableBlobStream(
this,
@@ -627,8 +674,10 @@ public long position(byte[] pattern, long start)
{
if (start < 1)
throw StandardException.newException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
SQLState.BLOB_BAD_POSITION, start);
if (pattern == null)
+//IC see: https://issues.apache.org/jira/browse/DERBY-839
throw StandardException.newException(SQLState.BLOB_NULL_PATTERN_OR_SEARCH_STR);
if (pattern.length == 0)
return start; // match DB2's SQL LOCATE function
@@ -641,6 +690,7 @@ public long position(byte[] pattern, long start)
if (pushStack)
setupContextStack();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3766
long pos = setBlobPosition(start -1);
// look for first character
int lookFor = pattern[0];
@@ -649,6 +699,7 @@ public long position(byte[] pattern, long start)
while (true)
{
c = read(pos++); // Note the position increment.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
if (c == -1) { // run out of stream
restoreIntrFlagIfSeen(pushStack, ec);
return -1;
@@ -692,6 +743,7 @@ public long position(byte[] pattern, long start)
* @return {@code true} if a match is found, {@code false} if not.
*/
private boolean checkMatch(byte[] pattern, long pos)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3766
throws IOException, StandardException {
// check whether rest matches
// might improve performance by reading more
@@ -722,6 +774,10 @@ public long position(Blob pattern, long start)
{
//call checkValidity to exit by throwing a SQLException if
//the Blob object has been freed by calling free() on it
+//IC see: https://issues.apache.org/jira/browse/DERBY-1328
+//IC see: https://issues.apache.org/jira/browse/DERBY-1328
+//IC see: https://issues.apache.org/jira/browse/DERBY-1328
+//IC see: https://issues.apache.org/jira/browse/DERBY-1328
checkValidity();
boolean pushStack = false;
@@ -729,22 +785,29 @@ public long position(Blob pattern, long start)
{
if (start < 1)
throw StandardException.newException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
SQLState.BLOB_BAD_POSITION, start);
if (pattern == null)
throw StandardException.newException(SQLState.BLOB_NULL_PATTERN_OR_SEARCH_STR);
+//IC see: https://issues.apache.org/jira/browse/DERBY-839
synchronized (getConnectionSynchronization())
{
EmbedConnection ec = getEmbedConnection();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
pushStack = !ec.isClosed();
if (pushStack)
setupContextStack();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3766
long pos = setBlobPosition(start-1);
// look for first character
byte[] b;
try
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
{ // pattern is not necessarily a Derby Blob
b = pattern.getBytes(1,1);
}
@@ -752,6 +815,7 @@ public long position(Blob pattern, long start)
{
throw StandardException.newException(SQLState.BLOB_UNABLE_TO_READ_PATTERN);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
if (b == null || b.length < 1) { // the 'empty' blob
restoreIntrFlagIfSeen(pushStack, ec);
return start; // match DB2's SQL LOCATE function
@@ -761,6 +825,7 @@ public long position(Blob pattern, long start)
long curPos;
while (true)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3766
c = read(pos++); // Note the position increment.
if (c == -1) { // run out of stream
restoreIntrFlagIfSeen(pushStack, ec);
@@ -803,6 +868,7 @@ public long position(Blob pattern, long start)
* @return {@code true} if a match is found, {@code false} if not.
*/
private boolean checkMatch(Blob pattern, long pos)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3766
throws IOException, StandardException {
// check whether rest matches
// might improve performance by reading buffer at a time
@@ -862,6 +928,7 @@ private SQLException handleMyExceptions(Throwable t)
@SuppressWarnings("deprecation")
protected void finalize()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2247
if (!materialized)
myStream.closeStream();
}
@@ -893,6 +960,7 @@ protected void finalize()
* @since 1.4
*/
public int setBytes(long pos, byte[] bytes) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2247
return setBytes(pos, bytes, 0, bytes.length);
}
@@ -923,6 +991,7 @@ public int setBytes(long pos,
if (pos - 1 > length())
throw Util.generateCsSQLException(SQLState.BLOB_POSITION_TOO_LARGE,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
pos);
if (pos < 1)
throw Util.generateCsSQLException(SQLState.BLOB_BAD_POSITION,
@@ -952,10 +1021,12 @@ public int setBytes(long pos,
control.copyData(myStream, length());
control.write(bytes, offset, len, pos - 1);
myStream.close();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3768
streamLength = -1;
materialized = true;
}
return len;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
} catch (IOException e) {
throw Util.setStreamFailure(e);
} catch (StandardException se) {
@@ -978,6 +1049,7 @@ public java.io.OutputStream setBinaryStream (long pos)
checkValidity ();
if (pos - 1 > length())
throw Util.generateCsSQLException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
SQLState.BLOB_POSITION_TOO_LARGE, pos);
if (pos < 1)
throw Util.generateCsSQLException(
@@ -991,6 +1063,7 @@ public java.io.OutputStream setBinaryStream (long pos)
getEmbedConnection());
control.copyData (myStream, pos - 1);
myStream.close ();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3768
streamLength = -1;
materialized = true;
return control.getOutputStream(pos - 1);
@@ -1016,10 +1089,13 @@ public java.io.OutputStream setBinaryStream (long pos)
* @exception SQLException Feature not implemented for now.
*/
public void truncate(long len)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2379
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2247
if (len > length())
throw Util.generateCsSQLException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
SQLState.BLOB_LENGTH_TOO_LONG, len);
try {
if (materialized) {
@@ -1030,6 +1106,7 @@ public void truncate(long len)
control = new LOBStreamControl (getEmbedConnection());
control.copyData (myStream, len);
myStream.close();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3768
streamLength = -1;
materialized = true;
}
@@ -1037,6 +1114,10 @@ public void truncate(long len)
catch (IOException e) {
throw Util.setStreamFailure (e);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2379
+//IC see: https://issues.apache.org/jira/browse/DERBY-2379
+//IC see: https://issues.apache.org/jira/browse/DERBY-2379
+//IC see: https://issues.apache.org/jira/browse/DERBY-2379
catch (StandardException se) {
throw Util.generateCsSQLException (se);
}
@@ -1057,8 +1138,10 @@ public void truncate(long len)
* the Blob's resources
*/
public void free()
+//IC see: https://issues.apache.org/jira/browse/DERBY-1180
throws SQLException {
//calling free() on a already freed object is treated as a no-op
+//IC see: https://issues.apache.org/jira/browse/DERBY-1328
if (!isValid) return;
//now that free has been called the Blob object is no longer
@@ -1066,6 +1149,7 @@ public void free()
isValid = false;
// Remove entry from connection if a locator has been created.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3768
if (this.locator != 0) {
localConn.removeLOBMapping(locator);
}
@@ -1075,10 +1159,13 @@ public void free()
//if it is a stream then close it.
//if a array of bytes then initialize it to null
//to free up space
+//IC see: https://issues.apache.org/jira/browse/DERBY-3766
if (!materialized) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3766
myStream.closeStream();
myStream = null;
} else {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2247
try {
control.free ();
control = null;
@@ -1107,11 +1194,13 @@ public InputStream getBinaryStream(long pos, long length)
throws SQLException {
//call checkValidity to exit by throwing a SQLException if
//the Blob object has been freed by calling free() on it
+//IC see: https://issues.apache.org/jira/browse/DERBY-1328
checkValidity();
if (pos <= 0) {
throw Util.generateCsSQLException(
SQLState.BLOB_BAD_POSITION,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
pos);
}
if (length < 0) {
@@ -1119,13 +1208,16 @@ public InputStream getBinaryStream(long pos, long length)
SQLState.BLOB_NONPOSITIVE_LENGTH,
length);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-4060
if (length > (this.length() - (pos -1))) {
throw Util.generateCsSQLException(
SQLState.POS_AND_LENGTH_GREATER_THAN_LOB,
pos, length);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2730
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2830
return new UpdatableBlobStream(this,
getBinaryStream(),
pos-1,
@@ -1145,7 +1237,9 @@ public InputStream getBinaryStream(long pos, long length)
private void checkValidity() throws SQLException{
//check for connection to maintain sqlcode for closed
//connection
+//IC see: https://issues.apache.org/jira/browse/DERBY-2729
getEmbedConnection().checkIfClosed();
+//IC see: https://issues.apache.org/jira/browse/DERBY-1328
if(!isValid)
throw newSQLException(SQLState.LOB_OBJECT_INVALID);
}
@@ -1155,6 +1249,7 @@ private void checkValidity() throws SQLException{
* @return true if materialized else false
*/
boolean isMaterialized () {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2711
return materialized;
}
@@ -1164,9 +1259,12 @@ boolean isMaterialized () {
* @return The locator identifying this lob.
*/
public int getLocator() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3354
+//IC see: https://issues.apache.org/jira/browse/DERBY-3354
if (locator == 0) {
locator = localConn.addLOBMapping(this);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3365
return locator;
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java
index 663e3b214b..227330cad1 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java
@@ -64,6 +64,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*
*/
public class EmbedCallableStatement extends EmbedPreparedStatement
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
implements EngineCallableStatement
{
/*
@@ -87,6 +88,7 @@ public EmbedCallableStatement (EmbedConnection conn, String sql,
resultSetType,
resultSetConcurrency,
resultSetHoldability,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
Statement.NO_GENERATED_KEYS,
null,
null);
@@ -160,6 +162,7 @@ protected final boolean executeStatement(Activation a,
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
DataValueDescriptor returnValue = pvs.getReturnValueForSet();
returnValue.setValueFromResultSet(results, 1, true);
} catch (StandardException e)
@@ -167,6 +170,7 @@ protected final boolean executeStatement(Activation a,
throw EmbedResultSet.noStateChangeException(e);
}
finally {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3496
results.close();
results = null;
}
@@ -212,6 +216,7 @@ public final void registerOutParameter(int parameterIndex, int sqlType, int scal
checkStatus();
if (scale < 0)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throw newSQLException(SQLState.BAD_SCALE_VALUE, scale);
try {
getParms().registerOutParameter(parameterIndex-1, sqlType, scale);
@@ -234,6 +239,7 @@ public void registerOutParameter(int parameterIndex, int sqlType,
String typeName)
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
registerOutParameter( parameterIndex, sqlType );
}
@@ -564,6 +570,7 @@ public final Object getObject(int parameterIndex) throws SQLException
{
checkStatus();
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
Object v = getParms().getParameterForGet(parameterIndex-1).getObject();
wasNull = (v == null);
return v;
@@ -668,6 +675,7 @@ public void addBatch() throws SQLException {
for (int j=1; j<=numberOfParameters; j++) {
switch (pvs.getParameterMode(j)) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
case (ParameterMetaData.parameterModeIn):
case (ParameterMetaData.parameterModeUnknown):
break;
@@ -693,6 +701,7 @@ public void addBatch() throws SQLException {
* @exception SQLException if a database-access error occurs.
*/
public final Object getObject(int i, Map> map) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
checkStatus();
if (map == null) {
throw Util.generateCsSQLException(SQLState.INVALID_API_PARAMETER, map, "map",
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedCallableStatement42.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedCallableStatement42.java
index e92c16b479..1d2b769bb7 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedCallableStatement42.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedCallableStatement42.java
@@ -39,6 +39,7 @@ public void registerOutParameter( int parameterIndex, SQLType sqlType )
throws SQLException
{
checkStatus();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6089
registerOutParameter( parameterIndex, Util42.getTypeAsInt( sqlType ) );
}
@@ -59,6 +60,7 @@ public void registerOutParameter( int parameterIndex, SQLType sqlType, String t
public void registerOutParameter( String parameterName, SQLType sqlType )
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
checkStatus();
registerOutParameter( parameterName, Util42.getTypeAsInt( sqlType ) );
}
@@ -82,6 +84,7 @@ public void registerOutParameter( String parameterName, SQLType sqlType, Strin
throws SQLException
{
checkStatus();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6089
setObject( parameterIndex, x, Util42.getTypeAsInt( targetSqlType ) );
}
@@ -92,6 +95,7 @@ public void registerOutParameter( String parameterName, SQLType sqlType, Strin
) throws SQLException
{
checkStatus();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6089
setObject( parameterIndex, x, Util42.getTypeAsInt( targetSqlType ), scaleOrLength );
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedClob.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedClob.java
index e9fa07ce85..e926aed573 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedClob.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedClob.java
@@ -42,6 +42,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
If its data is small (less than 1 page) it is a byte array taken from
the SQLChar class. If it is large (more than 1 page) it is a long column
in the database. The long column is accessed as a stream, and is implemented
+//IC see: https://issues.apache.org/jira/browse/DERBY-2346
in store as an OverflowInputStream. The Resetable interface allows sending
messages to that stream to initialize itself (reopen its container and
lock the corresponding row) and to reset itself to the beginning.
@@ -63,6 +64,7 @@ multiple threads and sucks data from the stream (returned from
new update methods can safely be added into implementation.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-3576
final class EmbedClob extends ConnectionChild implements Clob, EngineLOB
{
@@ -84,6 +86,7 @@ final class EmbedClob extends ConnectionChild implements Clob, EngineLOB
* @throws SQLException
*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2646
EmbedClob(EmbedConnection con) throws SQLException {
super(con);
this.clob = new TemporaryClob (this);
@@ -102,6 +105,7 @@ final class EmbedClob extends ConnectionChild implements Clob, EngineLOB
* @throws StandardException
*/
protected EmbedClob(EmbedConnection con, StringDataValue dvd)
+//IC see: https://issues.apache.org/jira/browse/DERBY-5760
throws StandardException, SQLException
{
super(con);
@@ -112,6 +116,7 @@ protected EmbedClob(EmbedConnection con, StringDataValue dvd)
"clob is created on top of a null column");
// See if a String or a stream will be the source of the Clob.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
if (dvd.hasStream()) {
CharacterStreamDescriptor csd = dvd.getStreamWithDescriptor();
/*
@@ -129,7 +134,9 @@ the class implementing the getStream() method for dvd.getStream(),
*/
if (SanityManager.DEBUG)
SanityManager.ASSERT(csd.getStream() instanceof Resetable);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
+//IC see: https://issues.apache.org/jira/browse/DERBY-265
try {
this.clob = new StoreStreamClob(csd, this);
} catch (StandardException se) {
@@ -145,9 +152,12 @@ the class implementing the getStream() method for dvd.getStream(),
this);
}
catch (IOException e) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5760
throw Util.setStreamFailure(e);
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3354
+//IC see: https://issues.apache.org/jira/browse/DERBY-3354
con.addLOBReference (this);
}
@@ -199,22 +209,28 @@ public String getSubString(long pos, int length) throws SQLException
//call checkValidity to exit by throwing a SQLException if
//the Clob object has been freed by calling free() on it
checkValidity();
+//IC see: https://issues.apache.org/jira/browse/DERBY-1328
if (pos < 1)
throw Util.generateCsSQLException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
SQLState.BLOB_BAD_POSITION, pos);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1516
if (length < 0)
throw Util.generateCsSQLException(
SQLState.BLOB_NONPOSITIVE_LENGTH, length);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2646
String result;
// An exception will be thrown if the position is larger than the Clob.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3825
Reader reader;
try {
try {
reader = this.clob.getInternalReader(pos);
} catch (EOFException eofe) {
throw Util.generateCsSQLException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6262
SQLState.BLOB_POSITION_TOO_LARGE, eofe, pos);
}
char[] chars = new char[length];
@@ -252,6 +268,7 @@ public java.io.Reader getCharacterStream() throws SQLException
//the Clob object has been freed by calling free() on it
checkValidity();
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2823
return new ClobUpdatableReader (this);
} catch (IOException ioe) {
throw Util.setStreamFailure(ioe);
@@ -317,6 +334,7 @@ public long position(String searchStr, long start)
checkValidity();
if (start < 1)
throw Util.generateCsSQLException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
SQLState.BLOB_BAD_POSITION, start);
if (searchStr == null)
throw Util.generateCsSQLException(
@@ -325,6 +343,7 @@ public long position(String searchStr, long start)
return start; // match DB2's SQL LOCATE function
boolean pushStack = false;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
EmbedConnection ec = getEmbedConnection();
try
{
@@ -338,18 +357,21 @@ public long position(String searchStr, long start)
int matchCount = 0;
long pos = start;
long newStart = -1;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3825
Reader reader = this.clob.getInternalReader(start);
char [] tmpClob = new char [4096];
boolean reset;
for (;;) {
reset = false;
int readCount = reader.read (tmpClob);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
if (readCount == -1) {
restoreIntrFlagIfSeen(pushStack, ec);
return -1;
}
for (int clobOffset = 0;
clobOffset < readCount; clobOffset++) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2646
if (tmpClob[clobOffset]
== searchStr.charAt(matchCount)) {
//find the new starting position in
@@ -361,6 +383,7 @@ public long position(String searchStr, long start)
}
matchCount ++;
if (matchCount == searchStr.length()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
restoreIntrFlagIfSeen(pushStack, ec);
return pos + clobOffset
- searchStr.length() + 1;
@@ -380,6 +403,7 @@ public long position(String searchStr, long start)
if (newStart < pos) {
pos = newStart;
reader.close();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3825
reader = this.clob.getInternalReader(
newStart);
newStart = -1;
@@ -401,8 +425,11 @@ public long position(String searchStr, long start)
} catch (EOFException eofe) {
restoreIntrFlagIfSeen(pushStack, ec);
throw Util.generateCsSQLException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6262
SQLState.BLOB_POSITION_TOO_LARGE, eofe, start);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2646
} catch (IOException ioe) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
restoreIntrFlagIfSeen(pushStack, ec);
throw Util.setStreamFailure(ioe);
} finally {
@@ -430,21 +457,27 @@ public long position(Clob searchClob, long start)
{
//call checkValidity to exit by throwing a SQLException if
//the Clob object has been freed by calling free() on it
+//IC see: https://issues.apache.org/jira/browse/DERBY-1328
+//IC see: https://issues.apache.org/jira/browse/DERBY-1328
checkValidity();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2646
if (start < 1)
throw Util.generateCsSQLException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
SQLState.BLOB_BAD_POSITION, start);
if (searchClob == null)
throw Util.generateCsSQLException(
SQLState.BLOB_NULL_PATTERN_OR_SEARCH_STR);
boolean pushStack = false;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
EmbedConnection ec = getEmbedConnection();
try
{
synchronized (getConnectionSynchronization())
{
char[] subPatternChar = new char[1024];
+//IC see: https://issues.apache.org/jira/browse/DERBY-2346
boolean seenOneCharacter = false;
@@ -458,6 +491,7 @@ public long position(Clob searchClob, long start)
subPatternChar.length);
if (read == -1) {
//empty pattern
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
if (!seenOneCharacter) {
// matches DB2 SQL LOCATE function
restoreIntrFlagIfSeen(pushStack, ec);
@@ -477,6 +511,7 @@ public long position(Clob searchClob, long start)
long position = position(subPattern, start);
if (position == -1) {
// never seen any match
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
if (firstPosition == -1) {
restoreIntrFlagIfSeen(pushStack, ec);
return -1;
@@ -496,7 +531,9 @@ else if (position != start) {
// read is the length of the subPattern string
start = position + read;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2646
} // End inner for loop
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
} // End outer for loop
} // End synchronized block
} catch (IOException ioe) {
@@ -535,6 +572,7 @@ else if (position != start) {
* @throws SQLException if writing the string fails
*/
public int setString(long pos, String str) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2346
return setString (pos, str, 0, str.length());
}
@@ -554,10 +592,13 @@ public int setString(long pos, String str) throws SQLException {
* @exception SQLException if writing the string fails
*/
public int setString(long pos, String str, int offset, int len)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2646
throws SQLException {
checkValidity();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2769
if (pos < 1) {
throw Util.generateCsSQLException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
SQLState.BLOB_BAD_POSITION, pos);
}
@@ -587,6 +628,7 @@ public int setString(long pos, String str, int offset, int len)
if (len + offset > str.length()) {
throw Util.generateCsSQLException(
SQLState.LANG_SUBSTR_START_ADDING_LEN_OUT_OF_RANGE,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
offset, len, str);
}
@@ -602,6 +644,7 @@ public int setString(long pos, String str, int offset, int len)
} catch (EOFException eofe) {
throw Util.generateCsSQLException(
SQLState.BLOB_POSITION_TOO_LARGE,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
pos);
} catch (IOException e) {
throw Util.setStreamFailure(e);
@@ -620,7 +663,9 @@ public int setString(long pos, String str, int offset, int len)
* @exception SQLException if obtaining the stream fails
*/
public java.io.OutputStream setAsciiStream(long pos) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2646
checkValidity();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2346
try {
return new ClobAsciiStream (this.clob.getWriter(pos));
} catch (IOException e) {
@@ -639,6 +684,7 @@ public java.io.OutputStream setAsciiStream(long pos) throws SQLException {
* @exception SQLException if obtaining the stream fails
*/
public java.io.Writer setCharacterStream(long pos) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2646
checkValidity();
try {
if (!this.clob.isWritable()) {
@@ -665,6 +711,7 @@ public void truncate(long len) throws SQLException
checkValidity();
if (len < 0)
throw Util.generateCsSQLException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
SQLState.BLOB_NONPOSITIVE_LENGTH, len);
try {
if (!clob.isWritable()) {
@@ -677,6 +724,7 @@ public void truncate(long len) throws SQLException
catch (EOFException eofe) {
throw Util.generateCsSQLException(
SQLState.BLOB_LENGTH_TOO_LONG,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6262
eofe, len);
} catch (IOException e) {
throw Util.setStreamFailure(e);
@@ -698,7 +746,9 @@ public void truncate(long len) throws SQLException
* @throws SQLException if an error occurs releasing the Clobs resources
*/
public void free()
+//IC see: https://issues.apache.org/jira/browse/DERBY-1180
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2646
if (this.isValid) {
this.isValid = false;
// Release and nullify the internal Clob.
@@ -707,6 +757,7 @@ public void free()
} catch (IOException e) {
throw Util.setStreamFailure(e);
} finally {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3354
localConn.removeLOBMapping(locator);
this.clob = null;
}
@@ -733,11 +784,15 @@ public java.io.Reader getCharacterStream(long pos, long length)
throws SQLException {
//call checkValidity to exit by throwing a SQLException if
//the Clob object has been freed by calling free() on it
+//IC see: https://issues.apache.org/jira/browse/DERBY-1328
+//IC see: https://issues.apache.org/jira/browse/DERBY-1328
+//IC see: https://issues.apache.org/jira/browse/DERBY-1328
checkValidity();
if (pos <= 0) {
throw Util.generateCsSQLException(
SQLState.BLOB_BAD_POSITION,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
pos);
}
if (length < 0) {
@@ -745,6 +800,7 @@ public java.io.Reader getCharacterStream(long pos, long length)
SQLState.BLOB_NONPOSITIVE_LENGTH,
length);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-4060
if (length > (this.length() - (pos -1))) {
throw Util.generateCsSQLException(
SQLState.POS_AND_LENGTH_GREATER_THAN_LOB,
@@ -752,6 +808,7 @@ public java.io.Reader getCharacterStream(long pos, long length)
}
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
return new ClobUpdatableReader(this, pos, length);
} catch (IOException ioe) {
throw Util.setStreamFailure(ioe);
@@ -767,6 +824,7 @@ public java.io.Reader getCharacterStream(long pos, long length)
* @throws SQLException if the Clob is not valid
*/
private void checkValidity() throws SQLException{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2787
localConn.checkIfClosed();
if(!isValid)
throw newSQLException(SQLState.LOB_OBJECT_INVALID);
@@ -783,8 +841,10 @@ private void checkValidity() throws SQLException{
* @throws SQLException if accessing underlying resources fail
*/
private void makeWritableClobClone()
+//IC see: https://issues.apache.org/jira/browse/DERBY-2646
throws IOException, SQLException {
InternalClob toBeAbandoned = this.clob;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2827
this.clob = TemporaryClob.cloneClobContent(
getEmbedConnection().getDBName(),
this, toBeAbandoned);
@@ -804,8 +864,10 @@ private void makeWritableClobClone()
* @throws SQLException if accessing underlying resources fail
*/
private void makeWritableClobClone(long len)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2800
throws IOException, SQLException {
InternalClob toBeAbandoned = this.clob;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2827
this.clob = TemporaryClob.cloneClobContent(
getEmbedConnection().getDBName(),
this, toBeAbandoned, len);
@@ -823,6 +885,8 @@ private void makeWritableClobClone(long len)
*
* @return The current internal Clob representation.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2818
+//IC see: https://issues.apache.org/jira/browse/DERBY-2806
InternalClob getInternalClob() {
return this.clob;
}
@@ -831,9 +895,11 @@ InternalClob getInternalClob() {
* @return locator value for this Clob.
*/
public int getLocator() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3354
if (locator == 0) {
locator = localConn.addLOBMapping(this);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3365
return locator;
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedConnection.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedConnection.java
index 179ec321c1..b1413eaa01 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedConnection.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedConnection.java
@@ -3994,6 +3994,7 @@ public void setNetworkTimeout( Executor executor, int milliseconds ) throws SQLE
*/
static ModuleFactory getMonitor()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
@@ -4105,6 +4106,7 @@ public Object run()
*/
private LanguageConnectionContext privilegedGetLCC()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedConnectionContext.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedConnectionContext.java
index fc93ee64b2..b074f8cfb2 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedConnectionContext.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedConnectionContext.java
@@ -39,6 +39,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.util.Enumeration;
/**
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
class EmbedConnectionContext extends ContextImpl
implements ConnectionContext
{
@@ -57,6 +58,7 @@ class EmbedConnectionContext extends ContextImpl
EmbedConnectionContext(ContextManager cm, EmbedConnection conn) {
super(cm, ConnectionContext.CONTEXT_ID);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
connRef = new java.lang.ref.SoftReference(conn);
}
@@ -66,6 +68,7 @@ public void cleanupOnError(Throwable error) {
return;
EmbedConnection conn = connRef.get();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
if (error instanceof StandardException) {
@@ -106,11 +109,13 @@ public void cleanupOnError(Throwable error) {
public java.sql.Connection getNestedConnection(boolean internal) throws SQLException {
EmbedConnection conn = connRef.get();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
if ((conn == null) || conn.isClosed())
throw Util.noCurrentConnection();
if (!internal) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
StatementContext sc = privilegedGetLCC( conn ).getStatementContext();
if ((sc == null) || (sc.getSQLAllowed() < org.apache.derby.catalog.types.RoutineAliasInfo.MODIFIES_SQL_DATA))
throw Util.noCurrentConnection();
@@ -128,9 +133,11 @@ public java.sql.Connection getNestedConnection(boolean internal) throws SQLExcep
public java.sql.ResultSet getResultSet
(
ResultSet executionResultSet
+//IC see: https://issues.apache.org/jira/browse/DERBY-98
) throws SQLException
{
EmbedConnection conn = connRef.get();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
EmbedResultSet rs = conn.getLocalDriver().newEmbedResultSet(conn, executionResultSet,
false, (EmbedStatement) null, true);
@@ -149,7 +156,9 @@ public java.sql.Connection getNestedConnection(boolean internal) throws SQLExcep
* @see EmbedStatement#processDynamicResult(EmbedConnection, java.sql.ResultSet, EmbedStatement)
*/
public boolean processInaccessibleDynamicResult(java.sql.ResultSet resultSet) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
EmbedConnection conn = connRef.get();
+//IC see: https://issues.apache.org/jira/browse/DERBY-1585
if (conn == null)
return false;
@@ -163,6 +172,7 @@ public boolean processInaccessibleDynamicResult(java.sql.ResultSet resultSet) {
*/
private LanguageConnectionContext privilegedGetLCC( final EmbedConnection conn )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
index bfcf712c06..719b07f53b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
@@ -91,6 +91,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
public class EmbedDatabaseMetaData extends ConnectionChild
implements DatabaseMetaData, java.security.PrivilegedAction {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
private static final int ILLEGAL_UDT_TYPE = 0;
@@ -136,6 +137,7 @@ public EmbedDatabaseMetaData (EmbedConnection connection, String url)
* @return a Properties value with the queries
*/
private Properties getQueryDescriptions(boolean net) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1176
Properties p = net ? queryDescriptions_net : queryDescriptions;
if (p != null) {
return p;
@@ -277,6 +279,7 @@ public boolean nullsAreSortedAtEnd() {
* @return database product name
*/
public String getDatabaseProductName() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return EmbedConnection.getMonitor().getEngineVersion().getProductName();
}
@@ -287,7 +290,10 @@ public String getDatabaseProductName() {
*/
public String getDatabaseProductVersion() {
ProductVersionHolder myPVH = EmbedConnection.getMonitor().getEngineVersion();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
+//IC see: https://issues.apache.org/jira/browse/DERBY-1146
+//IC see: https://issues.apache.org/jira/browse/DERBY-1547
return myPVH.getVersionBuildString(true);
}
@@ -345,6 +351,8 @@ public boolean usesLocalFiles() {
* @return true if the database uses a local file for each table
*/
public boolean usesLocalFilePerTable() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6662
+//IC see: https://issues.apache.org/jira/browse/DERBY-6662
if (url.contains("memory"))
return false;
else
@@ -456,6 +464,10 @@ public String getIdentifierQuoteString() {
*/
public String getSQLKeywords() {
return "ALIAS,BIGINT,BOOLEAN,CALL,CLASS,COPY,DB2J_DEBUG,EXECUTE,EXPLAIN,FILE,FILTER,"
+//IC see: https://issues.apache.org/jira/browse/DERBY-2258
+//IC see: https://issues.apache.org/jira/browse/DERBY-2259
+//IC see: https://issues.apache.org/jira/browse/DERBY-2260
+//IC see: https://issues.apache.org/jira/browse/DERBY-2245
+ "GETCURRENTCONNECTION,INDEX,INSTANCEOF,METHOD,NEW,OFF,PROPERTIES,RECOMPILE,"
+ "RENAME,RUNTIMESTATISTICS,STATEMENT,STATISTICS,TIMING,WAIT";
}
@@ -467,6 +479,7 @@ public String getSQLKeywords() {
* @return the list
*/
public String getNumericFunctions() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3063
return "ABS,ACOS,ASIN,ATAN,ATAN2,CEILING,COS,COT,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,RAND,SIGN,SIN,SQRT,TAN";
}
@@ -497,6 +510,7 @@ public String getSystemFunctions() {
* @return the list
*/
public String getTimeDateFunctions() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-471
return "CURDATE,CURTIME,HOUR,MINUTE,MONTH,SECOND,TIMESTAMPADD,TIMESTAMPDIFF,YEAR";
}
@@ -989,6 +1003,7 @@ public boolean supportsPositionedUpdate() {
*/
public boolean supportsRefCursors()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
return false;
}
@@ -1332,6 +1347,12 @@ public int getMaxTablesInSelect() {
* @return max name length in bytes
*/
public int getMaxUserNameLength() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-104
+//IC see: https://issues.apache.org/jira/browse/DERBY-104
+//IC see: https://issues.apache.org/jira/browse/DERBY-104
+//IC see: https://issues.apache.org/jira/browse/DERBY-104
+//IC see: https://issues.apache.org/jira/browse/DERBY-104
+//IC see: https://issues.apache.org/jira/browse/DERBY-3146
return Limits.MAX_IDENTIFIER_LENGTH;
}
@@ -1481,7 +1502,9 @@ public ResultSet getProcedures(String catalog, String schemaPattern,
// Using the new JDBC 4.0 version of the query here. The query
// was given a new name to allow the old query to
// be used by ODBCMetaDataGenerator.
+//IC see: https://issues.apache.org/jira/browse/DERBY-107
return doGetProcs(catalog, schemaPattern,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1093
procedureNamePattern, "getProcedures40");
}
@@ -1520,6 +1543,7 @@ public ResultSet getProceduresForODBC(String catalog, String schemaPattern,
* @throws SQLException if any of the underlying jdbc methods fail
*/
public ResultSet getFunctions(java.lang.String catalog,
+//IC see: https://issues.apache.org/jira/browse/DERBY-924
java.lang.String schemaPattern,
java.lang.String functionNamePattern)
throws SQLException
@@ -1618,8 +1642,10 @@ public ResultSet getProcedureColumns(String catalog,
// Using the new JDBC 4.0 version of the query here. The query
// was given a new name to allow the old query to
// be used by ODBCMetaDataGenerator.
+//IC see: https://issues.apache.org/jira/browse/DERBY-107
return doGetProcCols(catalog, schemaPattern,
procedureNamePattern, columnNamePattern,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1094
"getProcedureColumns40");
}
@@ -1667,6 +1693,7 @@ public ResultSet getFunctionColumns(String catalog,
String parameterNamePattern)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2145
return doGetProcCols(catalog,
schemaPattern,
functionNamePattern,
@@ -1774,6 +1801,8 @@ public ResultSet getTables(String catalog, String schemaPattern,
// parameter to the metadata statement and handle it here.
// Array for type parameters
+//IC see: https://issues.apache.org/jira/browse/DERBY-3000
+//IC see: https://issues.apache.org/jira/browse/DERBY-1790
final int numberOfTableTypesInDerby = 4;
if (types == null) {// null means all types
types = new String[] {"TABLE","VIEW","SYNONYM","SYSTEM TABLE"};
@@ -1821,6 +1850,7 @@ else if ("SYSTEM TABLE".equals(types[i]) ||
* @exception SQLException thrown on failure.
*/
public ResultSet getSchemas() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-876
return getSchemas(null, null);
}
@@ -1938,6 +1968,7 @@ public ResultSet getColumns(String catalog, String schemaPattern,
String tableNamePattern, String columnNamePattern)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-107
return doGetCols(catalog, schemaPattern, tableNamePattern,
columnNamePattern, "getColumns");
}
@@ -2107,6 +2138,7 @@ public ResultSet getTablePrivileges(String catalog, String schemaPattern,
) throws SQLException
{
return doGetBestRowId(catalogPattern, schemaPattern, table,
+//IC see: https://issues.apache.org/jira/browse/DERBY-107
scope, nullable, "");
}
@@ -2185,6 +2217,7 @@ private ResultSet doGetBestRowId(String catalogPattern,
// this one's it, do the real thing and return it.
// we don't need to check catalog, schema, table name
// or scope again.
+//IC see: https://issues.apache.org/jira/browse/DERBY-107
ps = getPreparedQuery(queryPrefix + "getBestRowIdentifierPrimaryKeyColumns");
ps.setString(1,constraintId);
ps.setString(2,constraintId);
@@ -2218,6 +2251,7 @@ private ResultSet doGetBestRowId(String catalogPattern,
if (done)
{
// this one's it, do the real thing and return it.
+//IC see: https://issues.apache.org/jira/browse/DERBY-107
ps = getPreparedQuery(queryPrefix + "getBestRowIdentifierUniqueKeyColumns");
ps.setString(1,constraintId);
ps.setString(2,constraintId);
@@ -2248,6 +2282,7 @@ private ResultSet doGetBestRowId(String catalogPattern,
ps.close();
if (done) {
// this one's it, do the real thing and return it.
+//IC see: https://issues.apache.org/jira/browse/DERBY-107
ps = getPreparedQuery(queryPrefix + "getBestRowIdentifierUniqueIndexColumns");
ps.setLong(1,indexNum);
ps.setInt(2,nullableInIntForm);
@@ -2256,6 +2291,7 @@ private ResultSet doGetBestRowId(String catalogPattern,
// last try -- just return all columns of the table
// the not null ones if that restriction is upon us.
+//IC see: https://issues.apache.org/jira/browse/DERBY-107
ps = getPreparedQuery(queryPrefix + "getBestRowIdentifierAllColumns");
ps.setString(1,catalogPattern);
ps.setString(2,schemaPattern);
@@ -2297,6 +2333,7 @@ private ResultSet doGetBestRowId(String catalogPattern,
*/
public ResultSet getVersionColumns(String catalog, String schema,
String table) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-107
return doGetVersionCols(catalog, schema, table, "getVersionColumns");
}
@@ -2348,11 +2385,13 @@ private ResultSet doGetVersionCols(String catalog, String schema,
* @throws SQLException
*/
private boolean notInSoftUpgradeMode()
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
throws SQLException {
if ( getEmbedConnection().isClosed())
throw Util.noCurrentConnection();
boolean notInSoftUpgradeMode;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
LanguageConnectionContext lcc = getLanguageConnectionContext();
try {
notInSoftUpgradeMode =
@@ -2391,6 +2430,7 @@ private boolean notInSoftUpgradeMode()
public ResultSet getPrimaryKeys(String catalog, String schema,
String table) throws SQLException {
PreparedStatement s = getPreparedQuery("getPrimaryKeys");
+//IC see: https://issues.apache.org/jira/browse/DERBY-137
if (table == null) {
throw Util.generateCsSQLException(
@@ -2556,6 +2596,7 @@ public ResultSet getImportedKeys(String catalog, String schema,
*/
public ResultSet getExportedKeys(String catalog, String schema,
String table) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
if (table == null) {
throw Util.generateCsSQLException(
@@ -2825,6 +2866,7 @@ private ResultSet getTypeInfoMinion(String queryName) throws SQLException {
public ResultSet getIndexInfo(String catalog, String schema, String table,
boolean unique, boolean approximate)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-107
return doGetIndexInfo(catalog, schema, table, unique, approximate, "getIndexInfo");
}
@@ -2884,6 +2926,7 @@ private ResultSet doGetIndexInfo(String catalog, String schema, String table,
* @see Connection
*/
public boolean supportsResultSetType(int type) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
if ((type == ResultSet.TYPE_FORWARD_ONLY) ||
(type == ResultSet.TYPE_SCROLL_INSENSITIVE)) {
return true;
@@ -2904,8 +2947,10 @@ public boolean supportsResultSetType(int type) {
* @see Connection
*/
public boolean supportsResultSetConcurrency(int type, int concurrency) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
if (type == ResultSet.TYPE_SCROLL_SENSITIVE) {
// (TYPE_SCROLL_SENSITIVE, *)
+//IC see: https://issues.apache.org/jira/browse/DERBY-690
return false;
} else {
// (FORWARD_ONLY, CONCUR_UPDATABLE)
@@ -3001,6 +3046,9 @@ public boolean othersDeletesAreVisible(int type) {
* @return true if inserts are visible for the result set type
*/
public boolean othersInsertsAreVisible(int type) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
if (type == ResultSet.TYPE_FORWARD_ONLY)
return true;
return false;
@@ -3017,6 +3065,7 @@ public boolean othersInsertsAreVisible(int type) {
*/
public boolean updatesAreDetected(int type) {
if (type == ResultSet.TYPE_SCROLL_INSENSITIVE) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-690
return true;
} else {
// For forward only resultsets, we move to before the next
@@ -3037,7 +3086,12 @@ public boolean updatesAreDetected(int type) {
* @return true if deletes are detected by the resultset type
*/
public boolean deletesAreDetected(int type) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
if (type == ResultSet.TYPE_SCROLL_INSENSITIVE) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-690
return true;
} else {
// For forward only resultsets, we move to before the next
@@ -3234,6 +3288,9 @@ public boolean supportsGetGeneratedKeys()
* (such as support for specifying the returned columns for
* the autogenerated key)
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-66
+//IC see: https://issues.apache.org/jira/browse/DERBY-242
+//IC see: https://issues.apache.org/jira/browse/DERBY-462
return false;
}
@@ -3261,6 +3318,7 @@ public boolean supportsResultSetHoldability(int holdability)
*/
public int getResultSetHoldability()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
return ResultSet.HOLD_CURSORS_OVER_COMMIT;
}
@@ -3290,6 +3348,8 @@ public int getDatabaseMajorVersion()
*/
public int getDatabaseMinorVersion()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
ProductVersionHolder pvh = EmbedConnection.getMonitor().getEngineVersion();
if (pvh == null)
{
@@ -3307,6 +3367,7 @@ public int getDatabaseMinorVersion()
*/
public int getJDBCMajorVersion()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
return 4;
}
@@ -3319,6 +3380,7 @@ public int getJDBCMajorVersion()
*/
public int getJDBCMinorVersion()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6324
return JVMInfo.jdbcMinorVersion();
}
@@ -3332,6 +3394,7 @@ public int getJDBCMinorVersion()
*/
public int getSQLStateType()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
return sqlStateSQL99;
}
@@ -3371,6 +3434,9 @@ public boolean locatorsUpdateCopy()
public ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern)
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-968
+//IC see: https://issues.apache.org/jira/browse/DERBY-924
+//IC see: https://issues.apache.org/jira/browse/DERBY-925
return getSimpleQuery("getSuperTypes");
}
@@ -3390,6 +3456,9 @@ public ResultSet getSuperTypes(String catalog, String schemaPattern, String type
public ResultSet getSuperTables(String catalog, String schemaPattern, String typeNamePattern)
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-968
+//IC see: https://issues.apache.org/jira/browse/DERBY-924
+//IC see: https://issues.apache.org/jira/browse/DERBY-925
return getSimpleQuery("getSuperTables");
}
@@ -3415,6 +3484,9 @@ public ResultSet getAttributes(String catalog, String schemaPattern,
String typeNamePattern, String attributeNamePattern)
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-968
+//IC see: https://issues.apache.org/jira/browse/DERBY-924
+//IC see: https://issues.apache.org/jira/browse/DERBY-925
return getSimpleQuery("getAttributes");
}
@@ -3474,6 +3546,7 @@ public ResultSet getClientInfoProperties() throws SQLException {
public ResultSet getSchemas(String catalog, String schemaPattern)
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-876
PreparedStatement s = getPreparedQuery("getSchemas");
s.setString(1, swapNull(catalog));
s.setString(2, swapNull(schemaPattern));
@@ -3481,6 +3554,7 @@ public ResultSet getSchemas(String catalog, String schemaPattern)
}
public RowIdLifetime getRowIdLifetime() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
return RowIdLifetime.ROWID_UNSUPPORTED;
}
@@ -3496,6 +3570,7 @@ public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException {
* {@code ResultSet}s
*/
public boolean autoCommitFailureClosesAllResultSets() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2789
return true;
}
@@ -3544,6 +3619,7 @@ public final T unwrap(Class iface) throws SQLException {
* not support pseudo columns.
*/
public ResultSet getPseudoColumns
+//IC see: https://issues.apache.org/jira/browse/DERBY-4869
( String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern )
throws SQLException
{
@@ -3564,6 +3640,7 @@ public final T unwrap(Class iface) throws SQLException {
* @exception SQLException if a database error occurs
*/
public ResultSet getClientCachedMetaData() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1176
return getSimpleQuery("METADATA", true);
}
@@ -3625,14 +3702,19 @@ private PreparedStatement getPreparedQueryUsingSystemTables(String nameKey,
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1176
String queryText =
getQueryDescriptions(net).getProperty(nameKey);
if (queryText == null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-968
+//IC see: https://issues.apache.org/jira/browse/DERBY-924
+//IC see: https://issues.apache.org/jira/browse/DERBY-925
throw Util.notImplemented(nameKey);
}
ps = prepareSPS(nameKey, queryText, net);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
InterruptStatus.
restoreIntrFlagIfSeen(getLanguageConnectionContext());
}
@@ -3683,6 +3765,7 @@ private PreparedStatement getPreparedQuery(String queryName,
//with this Derby release. We also need to be writable so
// that we can update SPS statements (DERBY-3546)
if (notInSoftUpgradeMode() && !isReadOnly())
+//IC see: https://issues.apache.org/jira/browse/DERBY-1176
s = getPreparedQueryUsingSystemTables(queryName, net);
else {
try {
@@ -3690,6 +3773,7 @@ private PreparedStatement getPreparedQuery(String queryName,
//mode or are read only, and hence need to get metadata sql from
//metadata.properties file or metadata_net.properties
String queryText = getQueryFromDescription(queryName, net);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
s = getEmbedConnection().prepareMetaDataStatement(queryText);
// InterruptStatus.restoreIntrFlagIfSeen: called inside
// prepareMetaDataStatement while we still have context pushed.
@@ -3708,6 +3792,7 @@ private PreparedStatement getPreparedQuery(String queryName,
* @exception SQLException if a database error occurs
*/
protected PreparedStatement getPreparedQuery(String queryName)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1176
throws SQLException
{
return getPreparedQuery(queryName, false);
@@ -3736,6 +3821,7 @@ protected PreparedStatement getPreparedQuery(String queryName)
* @exception StandardException if an error occurs
*/
private String getQueryFromDescription(String queryName, boolean net)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1124
throws StandardException
{
DataDictionary dd = getLanguageConnectionContext().getDataDictionary();
@@ -3752,6 +3838,7 @@ private String getQueryFromDescription(String queryName, boolean net)
queryName = "getTablePrivileges_10_1";
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-1176
return getQueryDescriptions(net).getProperty(queryName);
}
@@ -3762,6 +3849,7 @@ private String getQueryFromDescription(String queryName, boolean net)
**
*/
private PreparedStatement prepareSPS(String spsName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1176
String spsText,
boolean net)
throws StandardException, SQLException
@@ -3778,6 +3866,7 @@ private PreparedStatement prepareSPS(String spsName,
DataDictionary dd = getLanguageConnectionContext().getDataDictionary();
SPSDescriptor spsd = dd.getSPSDescriptor(
spsName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1176
net ? dd.getSysIBMSchemaDescriptor() :
dd.getSystemSchemaDescriptor());
lcc.commitNestedTransaction();
@@ -3797,6 +3886,7 @@ private PreparedStatement prepareSPS(String spsName,
** statement, but we have no (easy) way of turning
** the statement into a java.sql.PreparedStatement.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1176
String queryText =
"EXECUTE STATEMENT " + (net ? "SYSIBM" : "SYS") +
".\"" + spsName + "\"";
@@ -3816,6 +3906,7 @@ static final protected String swapNull(String s) {
*/
private LanguageConnectionContext getLanguageConnectionContext()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
return AccessController.doPrivileged
(
new PrivilegedAction()
@@ -3838,6 +3929,7 @@ public LanguageConnectionContext run()
* queryDescriptions_net.
*/
private void loadQueryDescriptions() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1176
java.security.AccessController.doPrivileged(this);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedParameterSetMetaData.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedParameterSetMetaData.java
index e6da675221..8ce5b0a4bc 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedParameterSetMetaData.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedParameterSetMetaData.java
@@ -75,6 +75,7 @@ public int isNullable(int param) throws SQLException {
checkPosition(param);
if (types[param - 1].isNullable())
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
return (ParameterMetaData.parameterNullable);
else
return (ParameterMetaData.parameterNoNulls);
@@ -112,6 +113,7 @@ public int getPrecision(int param) throws SQLException {
outparamPrecision = pvs.getPrecision(param);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-5062
if (outparamPrecision == -1)
{
return DataTypeUtilities.getPrecision(types[param - 1]);
@@ -200,6 +202,7 @@ public int getParameterMode(int param) throws SQLException {
//bug 4857 - only the return parameter is of type OUT. All the other output
//parameter are IN_OUT (it doesn't matter if their value is set or not).
if ((param == 1) && pvs.hasReturnOutputParameter())//only the first parameter can be of return type
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
return (ParameterMetaData.parameterModeOut);
return pvs.getParameterMode(param);
}
@@ -215,6 +218,7 @@ private void checkPosition(int parameterIndex) throws SQLException {
/* This message matches the one used by the DBMS */
throw Util.generateCsSQLException(
SQLState.LANG_INVALID_PARAM_POSITION,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
parameterIndex, paramCount);
}
}
@@ -231,6 +235,7 @@ private void checkPosition(int parameterIndex) throws SQLException {
* a wrapper for an object with the given interface.
*/
public boolean isWrapperFor(Class> iface) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
return iface.isInstance(this);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedPooledConnection.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedPooledConnection.java
index 0a7569bb0a..e6fb5293c4 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedPooledConnection.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedPooledConnection.java
@@ -84,6 +84,7 @@ public class EmbedPooledConnection implements javax.sql.PooledConnection, Broker
* the listeners fired in the same thread add or remove listeners.
*/
private final CopyOnWriteArrayList
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
statementEventListeners =
new CopyOnWriteArrayList();
@@ -102,6 +103,7 @@ public class EmbedPooledConnection implements javax.sql.PooledConnection, Broker
BrokeredConnection currentConnectionHandle;
// set up once by the data source
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
final EmbeddedDataSourceInterface dataSource;
private final String username;
private final String password;
@@ -198,8 +200,10 @@ final void openRealConnection() throws SQLException {
realConnection.setApplicationConnection(currentConnectionHandle);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
final Connection getNewCurrentConnectionHandle() throws SQLException {
Connection applicationConnection = currentConnectionHandle =
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
realConnection.getLocalDriver().newBrokeredConnection(this);
realConnection.setApplicationConnection(applicationConnection);
return applicationConnection;
@@ -212,6 +216,7 @@ final Connection getNewCurrentConnectionHandle() throws SQLException {
private void closeCurrentConnectionHandle() throws SQLException {
if (currentConnectionHandle != null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
ArrayList tmpEventListener = eventListener;
eventListener = null;
@@ -246,10 +251,12 @@ void resetRealConnection() throws SQLException {
if (realConnection.isReadOnly() != defaultReadOnly)
realConnection.setReadOnly(defaultReadOnly);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
if (realConnection.getHoldability() != ResultSet.HOLD_CURSORS_OVER_COMMIT)
realConnection.setHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT);
// reset any remaining state of the connection
+//IC see: https://issues.apache.org/jira/browse/DERBY-130
realConnection.resetFromPool();
if (SanityManager.DEBUG)
{
@@ -293,6 +300,7 @@ public final synchronized void addConnectionEventListener(ConnectionEventListene
if (listener == null)
return;
if (eventListener == null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
eventListener = new ArrayList();
} else if (eventIterators > 0) {
// DERBY-3401: Someone is iterating over the ArrayList, and since
@@ -318,6 +326,7 @@ public final synchronized void removeConnectionEventListener(ConnectionEventList
// we were able to synchronize on this, that someone is us. Clone
// the list of listeners in order to prevent invalidation of the
// iterator.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
eventListener =
new ArrayList(eventListener);
}
@@ -342,6 +351,7 @@ public synchronized EngineConnection getRealConnection()
* @return The underlying language connection.
*/
public synchronized LanguageConnectionContext getLanguageConnection()
+//IC see: https://issues.apache.org/jira/browse/DERBY-2432
throws SQLException
{
checkActive();
@@ -376,6 +386,7 @@ private void fireConnectionEventListeners(SQLException exception) {
ConnectionEvent event = new ConnectionEvent(this, exception);
eventIterators++;
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
for (ConnectionEventListener l : eventListener) {
if (exception == null) {
l.connectionClosed(event);
@@ -404,6 +415,7 @@ final void checkActive() throws SQLException {
*/
public boolean isIsolationLevelSetUsingSQLorJDBC() throws SQLException {
if (realConnection != null)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
return getLanguageConnectionContext( realConnection ).isIsolationLevelSetUsingSQLorJDBC();
else
return false;
@@ -416,6 +428,7 @@ public boolean isIsolationLevelSetUsingSQLorJDBC() throws SQLException {
and the end of a global transaction.
*/
public void resetIsolationLevelFlag() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
getLanguageConnectionContext( realConnection ).resetIsolationLevelFlagUsedForSQLandJDBC();
}
@@ -523,6 +536,7 @@ public PreparedStatement wrapStatement(PreparedStatement ps, String sql, Object
/*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-941
EmbedPreparedStatement ps_ = (EmbedPreparedStatement)ps;
ps_.setBrokeredConnectionControl(this);
return (PreparedStatement)ps_;
@@ -562,6 +576,7 @@ public CallableStatement wrapStatement(CallableStatement cs, String sql) throws
*/
public String toString()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-412
if ( connString == null )
{
String physicalConnString = isActive ?
@@ -589,6 +604,7 @@ public String toString()
* @param statement the {@code PreparedStatement} that was closed
*/
public void onStatementClose(PreparedStatement statement) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
if (!statementEventListeners.isEmpty()) {
StatementEvent event = new StatementEvent(this, statement);
for (StatementEventListener l : statementEventListeners) {
@@ -654,6 +670,7 @@ public void addStatementEventListener(StatementEventListener listener) {
*/
private static LanguageConnectionContext getLanguageConnectionContext( final EmbedConnection conn )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java
index da0323ea6f..ca359448a7 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java
@@ -121,6 +121,7 @@ public EmbedPreparedStatement (EmbedConnection conn, String sql, boolean forMeta
super(conn, forMetaData, resultSetType, resultSetConcurrency, resultSetHoldability);
// PreparedStatement is poolable by default
isPoolable = true;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1235
// if the sql string is null, raise an error
if (sql == null)
@@ -131,6 +132,7 @@ public EmbedPreparedStatement (EmbedConnection conn, String sql, boolean forMeta
try {
preparedStatement = lcc.prepareInternalStatement
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
(lcc.getDefaultSchema(), sql,
resultSetConcurrency == java.sql.ResultSet.CONCUR_READ_ONLY,
forMetaData);
@@ -144,6 +146,7 @@ public EmbedPreparedStatement (EmbedConnection conn, String sql, boolean forMeta
//bug 4838 - save the auto-generated key information in activation. keeping this
//information in lcc will not work as it can be tampered by a nested transaction
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
if (autoGeneratedKeys == Statement.RETURN_GENERATED_KEYS)
activation.setAutoGeneratedKeysResultsetInfo(columnIndexes, columnNames);
@@ -236,7 +239,9 @@ public final void addBatch(String sql) throws SQLException {
*
*/
void closeActions() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1095
+//IC see: https://issues.apache.org/jira/browse/DERBY-941
if (bcc!=null) {
java.sql.PreparedStatement ps_app =
(java.sql.PreparedStatement)applicationStatement;
@@ -257,6 +262,7 @@ void closeActions() throws SQLException {
activation.close();
activation = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
InterruptStatus.restoreIntrFlagIfSeen();
} catch (Throwable t)
{
@@ -282,6 +288,7 @@ void closeActions() throws SQLException {
* @exception SQLException thrown on failure.
*/
public final java.sql.ResultSet executeQuery() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-941
try {
executeStatement(activation, true, false);
} catch(SQLException sqle) {
@@ -306,6 +313,7 @@ public final java.sql.ResultSet executeQuery() throws SQLException {
* @exception SQLException thrown on failure.
*/
public final int executeUpdate() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
return (int) executeLargeUpdate();
}
@@ -316,6 +324,7 @@ public final int executeUpdate() throws SQLException {
* statements which may touch more than Integer.MAX_VALUE rows.
*/
public final long executeLargeUpdate() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-941
try {
executeStatement(activation, false, true);
} catch(SQLException sqle) {
@@ -335,6 +344,7 @@ public final long executeLargeUpdate() throws SQLException {
*/
public void setNull(int parameterIndex, int sqlType) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6089
Util.checkForSupportedDataType(sqlType);
checkStatus();
@@ -609,6 +619,7 @@ public void setTimestamp(int parameterIndex, Timestamp x)
*/
public final void setAsciiStream(int parameterIndex, InputStream x, long length)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1527
checkAsciiStreamConditions(parameterIndex);
java.io.Reader r = null;
@@ -637,6 +648,7 @@ public final void setAsciiStream(int parameterIndex, InputStream x, long length)
*/
public final void setAsciiStream(int parameterIndex, InputStream x, int length)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1445
throws SQLException {
setAsciiStream(parameterIndex,x,(long)length);
}
@@ -676,6 +688,7 @@ public void setUnicodeStream(int parameterIndex, InputStream x, int length)
*/
public final void setCharacterStream(int parameterIndex,
java.io.Reader reader,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1445
long length) throws SQLException {
checkCharacterStreamConditions(parameterIndex);
setCharacterStreamInternal(parameterIndex, reader, false, length);
@@ -698,6 +711,7 @@ public final void setCharacterStream(int parameterIndex,
* @exception SQLException if a database-access error occurs.
*/
public final void setCharacterStream(int parameterIndex,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1445
java.io.Reader reader,
int length) throws SQLException {
setCharacterStream(parameterIndex,reader,(long)length);
@@ -712,6 +726,7 @@ private final void checkCharacterStreamConditions(int parameterIndex)
throws SQLException {
checkStatus();
int jdbcTypeId = getParameterJDBCType(parameterIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1527
if (!DataTypeDescriptor.isCharacterStreamAssignable(jdbcTypeId)) {
throw dataTypeConversion(parameterIndex, "java.io.Reader");
}
@@ -724,6 +739,7 @@ private final void checkCharacterStreamConditions(int parameterIndex)
*/
private final void checkAsciiStreamConditions(int parameterIndex)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkStatus();
int jdbcTypeId = getParameterJDBCType(parameterIndex);
if (!DataTypeDescriptor.isAsciiStreamAssignable(jdbcTypeId)) {
@@ -776,11 +792,14 @@ private void setCharacterStreamInternal(int parameterIndex,
if (!lengthLess && length > Integer.MAX_VALUE)
throw newSQLException(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE,
getParameterSQLType(parameterIndex));
+//IC see: https://issues.apache.org/jira/browse/DERBY-1473
try {
ReaderToUTF8Stream utfIn;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
final StringDataValue dvd = (StringDataValue)
getParms().getParameter(parameterIndex -1);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4543
dvd.setStreamHeaderFormat(usePreTenFiveHdrFormat());
// Need column width to figure out if truncation is needed
DataTypeDescriptor dtd[] = preparedStatement
@@ -793,6 +812,7 @@ private void setCharacterStreamInternal(int parameterIndex,
// We cast the length from long to int. This wouldn't be
// appropriate if the limit of 2G-1 is decided to be increased
// at a later stage.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4515
usableLength = (int)length;
int truncationLength = 0;
@@ -816,6 +836,7 @@ private void setCharacterStreamInternal(int parameterIndex,
// usableLength is the length of the data from stream that
// can be inserted which is min(colWidth,length) provided
// length - colWidth has trailing blanks only
+//IC see: https://issues.apache.org/jira/browse/DERBY-4515
if (usableLength > colWidth) {
truncationLength = usableLength - colWidth;
usableLength = colWidth;
@@ -824,6 +845,7 @@ private void setCharacterStreamInternal(int parameterIndex,
// Create a stream with truncation.
utfIn = new ReaderToUTF8Stream(reader, usableLength,
truncationLength, getParameterSQLType(parameterIndex),
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
dvd.getStreamHeaderGenerator());
} else {
// Create a stream without exactness checks,
@@ -838,6 +860,7 @@ truncationLength, getParameterSQLType(parameterIndex),
// the maximum length for the column.
// This is okay, based on the observation that
// setValue does not use the value for anything at all.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
getParms().getParameterForSet(parameterIndex - 1).
setValue(utfIn, usableLength);
@@ -858,6 +881,7 @@ private Boolean usePreTenFiveHdrFormat()
throws StandardException {
// Determine the version of the database we are accessing.
// This is required to write the correct stream header format for Clobs.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4543
if (usePreTenFiveHdrFormat == null) {
usePreTenFiveHdrFormat = Boolean.valueOf(
!lcc.getDataDictionary().checkVersion(
@@ -910,6 +934,7 @@ public final void setBinaryStream(int parameterIndex, InputStream x, long length
* @exception SQLException thrown on failure.
*/
public final void setBinaryStream(int parameterIndex, InputStream x, int length)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1445
throws SQLException {
setBinaryStream(parameterIndex,x,(long)length);
}
@@ -953,14 +978,17 @@ private void setBinaryStreamInternal(int parameterIndex, InputStream x,
// in that case the cast to int would not be appropriate.
if ( !lengthLess && length > Integer.MAX_VALUE ) {
throw newSQLException(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
getParameterMetaData().getParameterTypeName(
parameterIndex));
}
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1473
RawToBinaryFormatStream rawStream;
if (lengthLess) {
// Indicate that we don't know the logical length of the stream.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4515
length = DataValueDescriptor.UNKNOWN_LOGICAL_LENGTH;
DataTypeDescriptor dtd[] =
preparedStatement.getParameterTypes();
@@ -985,8 +1013,10 @@ private void setBinaryStreamInternal(int parameterIndex, InputStream x,
*/
private final void checkBinaryStreamConditions(int parameterIndex)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkStatus();
int jdbcTypeId = getParameterJDBCType(parameterIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1527
if (!DataTypeDescriptor.isBinaryStreamAssignable(jdbcTypeId)) {
throw dataTypeConversion(parameterIndex, "java.io.InputStream");
}
@@ -1041,12 +1071,14 @@ public void addBatch() throws SQLException {
synchronized (getConnectionSynchronization()) {
if (batchStatements == null)
batchStatements = new Vector();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
//get a clone of the parameterValueSet and save it in the vector
//which will be used later on at the time of batch execution.
//This way we will get a copy of the current statement's parameter
//values rather than a pointer to the statement's parameter value
//set which will change with every new statement in the batch.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
batchStatements.add(getParms().getClone());
clearParameters();
}
@@ -1145,6 +1177,8 @@ public java.sql.ResultSetMetaData getMetaData() throws SQLException
rMetaData = newEmbedResultSetMetaData(resd);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
InterruptStatus.restoreIntrFlagIfSeen(lcc);
} catch (Throwable t) {
throw handleException(t);
@@ -1165,6 +1199,7 @@ public java.sql.ResultSetMetaData getMetaData() throws SQLException
* @exception SQLException Feature not implemented for now.
*/
public final void setRef(int i, Ref x) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
throw Util.notImplemented();
}
@@ -1212,6 +1247,7 @@ public final void setObject(int parameterIndex, Object x, int targetSqlType, int
}
Util.checkForSupportedDataType(targetSqlType);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6089
int paramJDBCType = getParameterJDBCType(parameterIndex);
@@ -1281,10 +1317,12 @@ public final void setObject(int parameterIndex, Object x) throws SQLException {
// See DERBY-1938 for details.
if (x == null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1938
setNull(parameterIndex, colType);
return;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
if (colType == Types.JAVA_OBJECT) {
try {
/* JDBC is one-based, DBMS is zero-based */
@@ -1390,6 +1428,7 @@ public final void setObject(int parameterIndex, Object x) throws SQLException {
*/
public final boolean execute() throws SQLException {
boolean ret=false;
+//IC see: https://issues.apache.org/jira/browse/DERBY-941
try{
ret = executeStatement(activation, false, false);
} catch(SQLException sqle) {
@@ -1529,6 +1568,7 @@ public void setClob (int i, Clob x)
// will read from the stream and drain the stream.
// Hence the need to declare this local variable - streamLength
long streamLength = x.length();
+//IC see: https://issues.apache.org/jira/browse/DERBY-856
setCharacterStreamInternal(i, x.getCharacterStream(),
false, streamLength);
@@ -1569,6 +1609,7 @@ public final ParameterValueSet getParms() {
/**
Get the target JDBC type for a parameter. Will throw exceptions
if the parameter index is out of range. The parameterIndex is 1-based.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6206
@exception SQLException parameter is out of range
*/
@@ -1591,6 +1632,7 @@ protected int getParameterJDBCType(int parameterIndex)
* @throws SQLException if parameter is out of range
*/
protected final String getParameterSQLType(int parameterIndex)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6206
throws SQLException
{
try {
@@ -1612,8 +1654,11 @@ private void setScale(int parameterIndex, int scale)
throws SQLException
{
checkStatus();
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
if (scale < 0)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throw newSQLException(SQLState.BAD_SCALE_VALUE, scale);
try {
@@ -1668,8 +1713,10 @@ public final void setURL(int parameterIndex, java.net.URL x)
* @exception SQLException if a database access error occurs
*/
public final ParameterMetaData getParameterMetaData()
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
throws SQLException {
checkStatus();
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
return new EmbedParameterSetMetaData(
getParms(), preparedStatement.getParameterTypes());
}
@@ -1680,6 +1727,7 @@ public final ParameterMetaData getParameterMetaData()
//
protected EmbedResultSetMetaData newEmbedResultSetMetaData(ResultDescription resultDesc) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-940
return factory.newEmbedResultSetMetaData(resultDesc.getColumnInfo());
}
@@ -1711,6 +1759,7 @@ boolean executeStatement(Activation a,
final SQLException dataTypeConversion(int column, String sourceType)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
return newSQLException(SQLState.LANG_DATA_TYPE_GET_MISMATCH,
getParameterMetaData().getParameterTypeName(column),
sourceType);
@@ -1757,6 +1806,7 @@ private void checkStatementValidity(SQLException sqle) throws SQLException {
* Check if the exception has occurred because the connection
* associated with the PreparedStatement has been closed
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-941
if(bcc != null && isClosed()) {
//call the BrokeredConnectionControl interface method
//onStatementErrorOccurred
@@ -1786,6 +1836,7 @@ private void checkStatementValidity(SQLException sqle) throws SQLException {
*/
public void setAsciiStream(int parameterIndex, InputStream x)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1527
checkAsciiStreamConditions(parameterIndex);
java.io.Reader asciiStream = null;
@@ -1825,6 +1876,8 @@ public void setAsciiStream(int parameterIndex, InputStream x)
*/
public void setCharacterStream(int parameterIndex, Reader reader)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1527
+//IC see: https://issues.apache.org/jira/browse/DERBY-1527
checkCharacterStreamConditions(parameterIndex);
setCharacterStreamInternal(parameterIndex, reader,
true, -1);
@@ -1890,6 +1943,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-1445
throws SQLException {
checkBlobConditions(parameterIndex);
setBinaryStreamInternal(parameterIndex, inputStream, true, -1);
@@ -1923,6 +1977,8 @@ public void setBlob(int parameterIndex, InputStream inputStream, long length)
*/
private final void checkBlobConditions(int parameterIndex)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkStatus();
if (getParameterJDBCType(parameterIndex) != Types.BLOB) {
throw dataTypeConversion(parameterIndex, "java.sql.Blob");
@@ -1930,6 +1986,7 @@ private final void checkBlobConditions(int parameterIndex)
}
public final void setRowId(int parameterIndex, RowId x) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
throw Util.notImplemented();
}
@@ -1965,6 +2022,8 @@ public final void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLExce
}
public final long getVersionCounter() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5459
+//IC see: https://issues.apache.org/jira/browse/DERBY-2402
return preparedStatement.getVersionCounter();
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement42.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement42.java
index 01bd9982a8..2919c47a24 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement42.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement42.java
@@ -50,6 +50,7 @@ public class EmbedPreparedStatement42 extends EmbedPreparedStatement
setObject
(
parameterIndex, x,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6089
Util42.getTypeAsInt( targetSqlType )
);
}
@@ -64,6 +65,7 @@ public class EmbedPreparedStatement42 extends EmbedPreparedStatement
setObject
(
parameterIndex, x,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6089
Util42.getTypeAsInt( targetSqlType ),
scaleOrLength
);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedResultSet.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
index d350cd788d..aaeae6a1f3 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
@@ -143,9 +143,11 @@ public class EmbedResultSet extends ConnectionChild
/**
This activation is set by EmbedStatement
for a single execution Activation. Ie.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3247
a ResultSet from a Statement.executeQuery() or
a ResultSet that is now a dynamic result set.
In this case the closing of this ResultSet will close
+//IC see: https://issues.apache.org/jira/browse/DERBY-3004
the activation or the finalization of the parent EmbedStatement
without it being closed will mark the Activation as unused.
@see EmbedStatement#finalize()
@@ -229,6 +231,7 @@ public class EmbedResultSet extends ConnectionChild
public EmbedResultSet(EmbedConnection conn, ResultSet resultsToWrap,
boolean forMetaData, EmbedStatement stmt, boolean isAtomic)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-98
super(conn);
@@ -239,13 +242,16 @@ public EmbedResultSet(EmbedConnection conn, ResultSet resultsToWrap,
// ResultSet's for metadata are single use, they are created
// with a PreparedStatement internally, but that statement is
// never returned to the application.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1142
if (this.forMetaData = forMetaData)
singleUseActivation = resultsToWrap.getActivation();
this.applicationStmt = this.stmt = owningStmt = stmt;
+//IC see: https://issues.apache.org/jira/browse/DERBY-31
this.timeoutMillis = stmt == null
? 0L
: stmt.timeoutMillis;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1876
this.isAtomic = isAtomic;
@@ -256,6 +262,7 @@ public EmbedResultSet(EmbedConnection conn, ResultSet resultsToWrap,
//If the underlying language resultset is not updateable, then the concurrency of the ResultSet object will be CONCUR_READ_ONLY
//and a warning will be issued on the ResultSet object.
if (stmt == null)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
concurrencyOfThisResultSet = java.sql.ResultSet.CONCUR_READ_ONLY;
else if (stmt.resultSetConcurrency == java.sql.ResultSet.CONCUR_READ_ONLY)
concurrencyOfThisResultSet = java.sql.ResultSet.CONCUR_READ_ONLY;
@@ -269,16 +276,22 @@ else if (stmt.resultSetConcurrency == java.sql.ResultSet.CONCUR_READ_ONLY)
}
// Fill in the column types
+//IC see: https://issues.apache.org/jira/browse/DERBY-4610
+//IC see: https://issues.apache.org/jira/browse/DERBY-3049
resultDescription = theResults.getResultDescription();
// Only incur the cost of allocating and maintaining
// updated column information if the columns can be updated.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
if (concurrencyOfThisResultSet == java.sql.ResultSet.CONCUR_UPDATABLE)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1876
final int columnCount = resultDescription.getColumnCount();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
final ExecutionFactory factory = getLanguageConnectionContext( conn ).
getLanguageConnectionFactory().getExecutionFactory();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2335
try{
//initialize arrays related to updateRow implementation
columnGotUpdated = new boolean[columnCount];
@@ -292,6 +305,7 @@ else if (stmt.resultSetConcurrency == java.sql.ResultSet.CONCUR_READ_ONLY)
throw noStateChangeException(t);
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-1876
else
{
updateRow = null;
@@ -301,6 +315,7 @@ else if (stmt.resultSetConcurrency == java.sql.ResultSet.CONCUR_READ_ONLY)
if (stmt != null)
{
// At connectivity level we handle only for forward only cursor
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
if (stmt.resultSetType == java.sql.ResultSet.TYPE_FORWARD_ONLY)
maxRows = stmt.maxRows;
@@ -318,10 +333,12 @@ else if (stmt.resultSetConcurrency == java.sql.ResultSet.CONCUR_READ_ONLY)
*/
public static void setFetchedRowBase( long newBase )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6206
if (SanityManager.DEBUG) { fetchedRowBase = newBase; }
}
private void checkNotOnInsertRow() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-100
if (isOnInsertRow) {
throw newSQLException(SQLState.NO_CURRENT_ROW);
}
@@ -332,6 +349,7 @@ private void checkNotOnInsertRow() throws SQLException {
// or milder problems due to not having a row.
protected final void checkOnRow() throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1876
if (currentRow == null) {
throw newSQLException(SQLState.NO_CURRENT_ROW);
}
@@ -341,6 +359,7 @@ protected final void checkOnRow() throws SQLException
* Initializes the currentRowHasBeenUpdated and columnGotUpdated fields
*/
private void initializeUpdateRowModifiers() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1251
currentRowHasBeenUpdated = false;
Arrays.fill(columnGotUpdated, false);
}
@@ -351,11 +370,13 @@ private void initializeUpdateRowModifiers() {
@exception SQLException ResultSet is not on a row or columnIndex is out of range.
*/
final int getColumnType(int columnIndex) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1251
if (!isOnInsertRow) checkOnRow(); // first make sure there's a row
if (columnIndex < 1 ||
columnIndex > resultDescription.getColumnCount())
throw newSQLException(SQLState.COLUMN_NOT_FOUND, columnIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
return resultDescription.getColumnDescriptor(columnIndex).getType().getJDBCTypeId();
}
@@ -411,6 +432,7 @@ protected boolean movePosition(int position, int row, String positionText)
// on the underlying connection. Do this
// outside of the connection synchronization.
+//IC see: https://issues.apache.org/jira/browse/DERBY-100
if (isOnInsertRow) {
moveToCurrentRow();
}
@@ -420,7 +442,9 @@ protected boolean movePosition(int position, int row, String positionText)
setupContextStack();
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
LanguageConnectionContext lcc = getLanguageConnectionContext( getEmbedConnection() );
+//IC see: https://issues.apache.org/jira/browse/DERBY-1251
final ExecRow newRow;
try {
@@ -431,6 +455,7 @@ protected boolean movePosition(int position, int row, String positionText)
*/
StatementContext statementContext =
lcc.pushStatementContext(isAtomic,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
concurrencyOfThisResultSet==java.sql.ResultSet.CONCUR_READ_ONLY,
getSQLText(),
getParameterValueSet(),
@@ -439,6 +464,7 @@ protected boolean movePosition(int position, int row, String positionText)
switch (position)
{
case BEFOREFIRST:
+//IC see: https://issues.apache.org/jira/browse/DERBY-1251
newRow = theResults.setBeforeFirstRow();
break;
@@ -492,6 +518,7 @@ protected boolean movePosition(int position, int row, String positionText)
SQLWarning w = theResults.getWarnings();
if (w != null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5436
addWarning(w);
}
@@ -528,8 +555,10 @@ protected boolean movePosition(int position, int row, String positionText)
}
// Clear the indication of which columns were fetched as streams.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3844
if (columnUsedFlags != null)
Arrays.fill(columnUsedFlags, false);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1251
if (columnGotUpdated != null && currentRowHasBeenUpdated) {
initializeUpdateRowModifiers();
}
@@ -591,10 +620,13 @@ public void close() throws SQLException {
try {
LanguageConnectionContext lcc =
getLanguageConnectionContext( getEmbedConnection() );
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3037
theResults.close();
+//IC see: https://issues.apache.org/jira/browse/DERBY-1142
if (this.singleUseActivation != null)
{
this.singleUseActivation.close();
@@ -632,12 +664,14 @@ public void close() throws SQLException {
}
} finally {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4869
markClosed();
restoreContextStack();
}
// the idea is to release resources, so:
currentRow = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1876
// we hang on to theResults and messenger
// in case more calls come in on this resultSet
@@ -651,6 +685,7 @@ public void close() throws SQLException {
*/
private void markClosed()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4869
if ( isClosed ) { return; }
isClosed = true;
@@ -658,6 +693,7 @@ private void markClosed()
// to prevent infinite looping, tell our parent Statement
// that we have closed AFTER
// we have marked ourself as closed
+//IC see: https://issues.apache.org/jira/browse/DERBY-4869
if ( stmt != null) { stmt.closeMeOnCompletion(); }
if ( (owningStmt != null) && (owningStmt != stmt) ) { owningStmt.closeMeOnCompletion(); }
}
@@ -695,6 +731,7 @@ public final boolean wasNull() throws SQLException {
public final String getString(int columnIndex) throws SQLException {
checkIfClosed("getString");
int columnType = getColumnType(columnIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5489
if (columnType == Types.BLOB || columnType == Types.CLOB) {
checkLOBMultiCall(columnIndex);
// If the above didn't fail, this is the first getter invocation,
@@ -712,6 +749,7 @@ public final String getString(int columnIndex) throws SQLException {
String value = dvd.getString();
// check for the max field size limit
+//IC see: https://issues.apache.org/jira/browse/DERBY-5489
if (maxFieldSize > 0 && isMaxFieldSizeType(columnType))
{
if (value.length() > maxFieldSize )
@@ -901,6 +939,7 @@ public final double getDouble(int columnIndex) throws SQLException {
public final byte[] getBytes(int columnIndex) throws SQLException {
checkIfClosed("getBytes");
int columnType = getColumnType(columnIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5489
if (columnType == Types.BLOB) {
checkLOBMultiCall(columnIndex);
// If the above didn't fail, this is the first getter invocation,
@@ -917,6 +956,7 @@ public final byte[] getBytes(int columnIndex) throws SQLException {
byte[] value = dvd.getBytes();
// check for the max field size limit
+//IC see: https://issues.apache.org/jira/browse/DERBY-5489
if (maxFieldSize > 0 && isMaxFieldSizeType(columnType))
{
if (value.length > maxFieldSize)
@@ -1018,6 +1058,7 @@ public java.sql.Date getDate(int columnIndex, Calendar cal)
public java.sql.Date getDate(String columnName, Calendar cal)
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getDate");
return getDate( findColumnName(columnName), cal);
}
@@ -1071,6 +1112,7 @@ public java.sql.Time getTime(int columnIndex, Calendar cal)
public java.sql.Time getTime(String columnName, Calendar cal)
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getTime");
return getTime( findColumnName( columnName), cal);
}
@@ -1091,6 +1133,7 @@ public java.sql.Time getTime(String columnName, Calendar cal)
public java.sql.Timestamp getTimestamp(String columnName, Calendar cal)
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getTimestamp");
return getTimestamp(findColumnName(columnName), cal);
}
@@ -1138,6 +1181,7 @@ public java.sql.Timestamp getTimestamp(int columnIndex, Calendar cal)
public final java.io.Reader getCharacterStream(int columnIndex)
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getCharacterStream");
int lmfs;
int colType = getColumnType(columnIndex);
@@ -1187,10 +1231,12 @@ public final java.io.Reader getCharacterStream(int columnIndex)
pushStack = true;
setupContextStack();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
java.io.Reader ret; // The reader we will return to the user
if (dvd.hasStream()) {
CharacterStreamDescriptor csd = dvd.getStreamWithDescriptor();
// See if we have to enforce a max field size.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
if (lmfs > 0) {
csd = new CharacterStreamDescriptor.Builder().copyState(csd).
maxCharLength(lmfs).build();
@@ -1265,6 +1311,7 @@ public final InputStream getAsciiStream(int columnIndex) throws SQLException {
* @exception SQLException thrown on failure.
*/
public final InputStream getBinaryStream(int columnIndex) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getBinaryStream");
int lmfs;
int colType = getColumnType(columnIndex);
@@ -1298,10 +1345,12 @@ public final InputStream getBinaryStream(int columnIndex) throws SQLException {
pushStack = true;
setupContextStack();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
InputStream stream; // The stream we will return to the user
if (dvd.hasStream()) {
stream = new BinaryToRawStream(dvd.getStream(), dvd);
} else {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5090
stream = new ByteArrayInputStream(dvd.getBytes());
}
@@ -1313,6 +1362,7 @@ public final InputStream getBinaryStream(int columnIndex) throws SQLException {
stream = limitResultIn;
}
// Wrap in a stream throwing exception on invocations when closed.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5090
stream = new CloseFilterInputStream(stream);
currentStream = stream;
return stream;
@@ -1338,6 +1388,8 @@ public final InputStream getBinaryStream(int columnIndex) throws SQLException {
* @exception SQLException thrown on failure.
*/
public final String getString(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getString");
return (getString(findColumnName(columnName)));
}
@@ -1350,6 +1402,8 @@ public final String getString(String columnName) throws SQLException {
* @exception SQLException thrown on failure.
*/
public final boolean getBoolean(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getBoolean");
return (getBoolean(findColumnName(columnName)));
}
@@ -1362,6 +1416,8 @@ public final boolean getBoolean(String columnName) throws SQLException {
* @exception SQLException thrown on failure.
*/
public final byte getByte(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getByte");
return (getByte(findColumnName(columnName)));
}
@@ -1374,6 +1430,8 @@ public final byte getByte(String columnName) throws SQLException {
* @exception SQLException thrown on failure.
*/
public final short getShort(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getShort");
return (getShort(findColumnName(columnName)));
}
@@ -1386,6 +1444,8 @@ public final short getShort(String columnName) throws SQLException {
* @exception SQLException thrown on failure.
*/
public final int getInt(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getInt");
return (getInt(findColumnName(columnName)));
}
@@ -1398,6 +1458,8 @@ public final int getInt(String columnName) throws SQLException {
* @exception SQLException thrown on failure.
*/
public final long getLong(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getLong");
return (getLong(findColumnName(columnName)));
}
@@ -1410,6 +1472,8 @@ public final long getLong(String columnName) throws SQLException {
* @exception SQLException thrown on failure.
*/
public final float getFloat(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getFloat");
return (getFloat(findColumnName(columnName)));
}
@@ -1422,6 +1486,8 @@ public final float getFloat(String columnName) throws SQLException {
* @exception SQLException thrown on failure.
*/
public final double getDouble(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getDouble");
return (getDouble(findColumnName(columnName)));
}
@@ -1438,6 +1504,7 @@ public final double getDouble(String columnName) throws SQLException {
@Deprecated
public final BigDecimal getBigDecimal(int columnIndex, int scale)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
BigDecimal ret = getBigDecimal(columnIndex);
if (ret != null) {
@@ -1452,6 +1519,8 @@ public final BigDecimal getBigDecimal(int columnIndex)
try {
DataValueDescriptor dvd = getColumn(columnIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1251
+//IC see: https://issues.apache.org/jira/browse/DERBY-1251
if (wasNull = dvd.isNull()) {
return null;
@@ -1500,6 +1569,8 @@ public final BigDecimal getBigDecimal(String columnName) throws SQLException {
* @exception SQLException thrown on failure.
*/
public final byte[] getBytes(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getBytes");
return (getBytes(findColumnName(columnName)));
}
@@ -1512,6 +1583,8 @@ public final byte[] getBytes(String columnName) throws SQLException {
* @exception SQLException thrown on failure.
*/
public final Date getDate(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getDate");
return (getDate(findColumnName(columnName)));
}
@@ -1524,6 +1597,8 @@ public final Date getDate(String columnName) throws SQLException {
* @exception SQLException thrown on failure.
*/
public final Time getTime(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getTime");
return (getTime(findColumnName(columnName)));
}
@@ -1536,6 +1611,8 @@ public final Time getTime(String columnName) throws SQLException {
* @exception SQLException thrown on failure.
*/
public final Timestamp getTimestamp(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getTimestamp");
return (getTimestamp(findColumnName(columnName)));
}
@@ -1549,6 +1626,7 @@ public final Timestamp getTimestamp(String columnName) throws SQLException {
*/
public final java.io.Reader getCharacterStream(String columnName)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getCharacterStream");
return (getCharacterStream(findColumnName(columnName)));
}
@@ -1570,6 +1648,8 @@ public final java.io.Reader getCharacterStream(String columnName)
* @exception SQLException thrown on failure.
*/
public final InputStream getAsciiStream(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getAsciiStream");
return (getAsciiStream(findColumnName(columnName)));
}
@@ -1590,6 +1670,7 @@ public final InputStream getAsciiStream(String columnName) throws SQLException {
* @exception SQLException thrown on failure.
*/
public final InputStream getBinaryStream(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getBinaryStream");
return (getBinaryStream(findColumnName(columnName)));
}
@@ -1603,6 +1684,7 @@ public final InputStream getBinaryStream(String columnName) throws SQLException
*/
@Deprecated
public final java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
throw Util.notImplemented("getUnicodeStream");
}
@@ -1728,6 +1810,8 @@ public final ResultSetMetaData getMetaData() throws SQLException {
checkIfClosed("getMetaData"); // checking result set closure does not depend
// on the underlying connection.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1879
+//IC see: https://issues.apache.org/jira/browse/DERBY-1876
ResultSetMetaData rMetaData =
resultDescription.getMetaData();
@@ -1755,6 +1839,7 @@ public final ResultSetMetaData getMetaData() throws SQLException {
public final int getHoldability() throws SQLException {
checkIfClosed("getHoldability");
if (theResults.getActivation().getResultSetHoldability()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
return java.sql.ResultSet.HOLD_CURSORS_OVER_COMMIT;
}
return java.sql.ResultSet.CLOSE_CURSORS_AT_COMMIT;
@@ -1786,6 +1871,7 @@ public final int getHoldability() throws SQLException {
*/
public final Object getObject(int columnIndex) throws SQLException {
checkIfClosed("getObject");
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
// need special handling for some types.
int colType = getColumnType(columnIndex);
@@ -1850,6 +1936,7 @@ public final Object getObject(int columnIndex) throws SQLException {
* @exception SQLException thrown on failure.
*/
public final Object getObject(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getObject");
return (getObject(findColumnName(columnName)));
}
@@ -1867,6 +1954,7 @@ public final Object getObject(String columnName) throws SQLException {
* @exception SQLException Feature not implemented for now.
*/
public Object getObject(int columnIndex, Map> map) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
checkIfClosed("getObject");
if (map == null) {
throw Util.generateCsSQLException(SQLState.INVALID_API_PARAMETER, map, "map",
@@ -1958,6 +2046,7 @@ public final void setApplicationStatement(Statement applicationStmt)
* @exception SQLException Feature not implemented for now.
*/
public final Ref getRef(int i) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
throw Util.notImplemented();
}
@@ -2298,7 +2387,9 @@ public int getFetchDirection() throws SQLException {
*/
public void setFetchSize(int rows) throws SQLException {
checkIfClosed("setFetchSize");
+//IC see: https://issues.apache.org/jira/browse/DERBY-3573
if (rows < 0) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throw Util.generateCsSQLException(SQLState.INVALID_FETCH_SIZE, rows);
} else if (rows > 0) // if it is zero ignore the call
{
@@ -2386,6 +2477,7 @@ public boolean rowUpdated() throws SQLException {
boolean rvalue = false;
+//IC see: https://issues.apache.org/jira/browse/DERBY-690
try {
if (isForUpdate() &&
getType() == java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE) {
@@ -2433,11 +2525,15 @@ public boolean rowInserted() throws SQLException {
*/
public boolean rowDeleted() throws SQLException {
checkIfClosed("rowDeleted");
+//IC see: https://issues.apache.org/jira/browse/DERBY-1323
+//IC see: https://issues.apache.org/jira/browse/DERBY-1323
+//IC see: https://issues.apache.org/jira/browse/DERBY-1323
checkNotOnInsertRow();
checkOnRow();
boolean rvalue = false;
+//IC see: https://issues.apache.org/jira/browse/DERBY-690
try {
if (isForUpdate() &&
getType() == java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE) {
@@ -2454,10 +2550,14 @@ protected void checksBeforeUpdateXXX(String methodName, int columnIndex) throws
checksBeforeUpdateOrDelete(methodName, columnIndex);
//1)Make sure for updateXXX methods, the column position is not out of range
+//IC see: https://issues.apache.org/jira/browse/DERBY-4610
+//IC see: https://issues.apache.org/jira/browse/DERBY-3049
ResultDescription rd = theResults.getResultDescription();
if (columnIndex < 1 || columnIndex > rd.getColumnCount())
+//IC see: https://issues.apache.org/jira/browse/DERBY-189
throw Util.generateCsSQLException(SQLState.LANG_INVALID_COLUMN_POSITION,
columnIndex, String.valueOf(rd.getColumnCount()));
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
//2)Make sure the column corresponds to a column in the base table and it is not a derived column
if (rd.getColumnDescriptor(columnIndex).getSourceTableName() == null)
@@ -2482,8 +2582,10 @@ protected void checksBeforeUpdateOrDelete(String methodName, int columnIndex) th
//2)Make sure this is an updatable ResultSet
checkUpdatableCursor(methodName);
+//IC see: https://issues.apache.org/jira/browse/DERBY-100
//3)Make sure JDBC ResultSet is positioned on a row
+//IC see: https://issues.apache.org/jira/browse/DERBY-1251
if (!isOnInsertRow) checkOnRow(); // make sure there's a current row
}
@@ -2491,6 +2593,7 @@ protected void checksBeforeUpdateOrDelete(String methodName, int columnIndex) th
protected DataValueDescriptor getDVDforColumnToBeUpdated(int columnIndex, String updateMethodName) throws StandardException, SQLException {
checksBeforeUpdateXXX(updateMethodName, columnIndex);
columnGotUpdated[columnIndex-1] = true;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1251
currentRowHasBeenUpdated = true;
return updateRow.getColumn(columnIndex);
@@ -2511,6 +2614,7 @@ protected void checksBeforeInsert() throws SQLException {
// 3)Make sure JDBC ResultSet is positioned on insertRow
if (!isOnInsertRow) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-842
throw newSQLException(SQLState.CURSOR_NOT_POSITIONED_ON_INSERT_ROW);
}
}
@@ -2524,6 +2628,7 @@ protected void checksBeforeInsert() throws SQLException {
* updateAsciiStream()
*/
private void checksBeforeUpdateAsciiStream(int columnIndex)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1527
throws SQLException
{
checksBeforeUpdateXXX("updateAsciiStream", columnIndex);
@@ -2768,6 +2873,7 @@ public void updateDouble(int columnIndex, double x) throws SQLException {
}
public void updateBigDecimal(int columnIndex, BigDecimal x)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
throws SQLException {
try {
getDVDforColumnToBeUpdated(columnIndex, "updateBigDecimal").setBigDecimal(x);
@@ -2945,6 +3051,7 @@ public void updateTimestamp(int columnIndex, java.sql.Timestamp x)
public void updateAsciiStream(int columnIndex, java.io.InputStream x,
long length) throws SQLException {
checksBeforeUpdateAsciiStream(columnIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1527
java.io.Reader r = null;
if (x != null)
@@ -2979,6 +3086,7 @@ public void updateAsciiStream(int columnIndex, java.io.InputStream x,
public void updateAsciiStream(int columnIndex, InputStream x)
throws SQLException {
checksBeforeUpdateAsciiStream(columnIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1527
java.io.Reader r = null;
if (x != null) {
@@ -3043,6 +3151,8 @@ public void updateBinaryStream(int columnIndex, java.io.InputStream x,
*/
public void updateBinaryStream(int columnIndex, InputStream x)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1527
+//IC see: https://issues.apache.org/jira/browse/DERBY-1527
checksBeforeUpdateBinaryStream(columnIndex);
updateBinaryStreamInternal(columnIndex, x, true, -1,
"updateBinaryStream");
@@ -3072,6 +3182,7 @@ public void updateBinaryStream(int columnIndex, InputStream x)
private void updateBinaryStreamInternal(int columnIndex, InputStream x,
final boolean lengthLess, long length, String updateMethodName)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1473
RawToBinaryFormatStream rawStream;
if (!lengthLess) {
if (length < 0)
@@ -3084,9 +3195,11 @@ private void updateBinaryStreamInternal(int columnIndex, InputStream x,
throw newSQLException(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE,
getColumnSQLType(columnIndex));
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-1473
rawStream = new RawToBinaryFormatStream(x, (int)length);
} else {
// Force length to UNKNOWN_LOGICAL_LENGTH if stream is length less.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4515
length = DataValueDescriptor.UNKNOWN_LOGICAL_LENGTH;
rawStream = new RawToBinaryFormatStream(x,
getMaxColumnWidth(columnIndex),
@@ -3122,6 +3235,7 @@ private void updateBinaryStreamInternal(int columnIndex, InputStream x,
*/
public void updateCharacterStream(int columnIndex, java.io.Reader x,
long length) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1527
checksBeforeUpdateCharacterStream(columnIndex);
updateCharacterStreamInternal(columnIndex, x, false, length,
"updateCharacterStream");
@@ -3146,6 +3260,7 @@ public void updateCharacterStream(int columnIndex, java.io.Reader x,
*/
public void updateCharacterStream(int columnIndex, Reader x)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1527
checksBeforeUpdateCharacterStream(columnIndex);
updateCharacterStreamInternal(columnIndex, x, true, -1,
"updateCharacterStream");
@@ -3184,11 +3299,13 @@ private void updateCharacterStreamInternal(int columnIndex, Reader reader,
return;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
final StringDataValue dvd = (StringDataValue)
getDVDforColumnToBeUpdated(columnIndex, updateMethodName);
// In the case of updatable result sets, we cannot guarantee that a
// context is pushed when the header needs to be generated. To fix
// this, tell the DVD/generator which header format to use.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4543
dvd.setStreamHeaderFormat(Boolean.valueOf(
!getEmbedConnection().getDatabase().getDataDictionary().
checkVersion(DataDictionary.DD_VERSION_DERBY_10_5, null)));
@@ -3242,6 +3359,7 @@ private void updateCharacterStreamInternal(int columnIndex, Reader reader,
utfIn = new ReaderToUTF8Stream(reader, usableLength,
truncationLength, getColumnSQLType(columnIndex),
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
dvd.getStreamHeaderGenerator());
} else {
int colWidth = getMaxColumnWidth(columnIndex);
@@ -3280,6 +3398,7 @@ truncationLength, getColumnSQLType(columnIndex),
public void updateObject(int columnIndex, Object x, int scale)
throws SQLException {
updateObject(columnIndex, x);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
adjustScale( columnIndex, scale );
}
@@ -3299,9 +3418,11 @@ protected void adjustScale( int columnIndex, int scale )
if ((colType == Types.DECIMAL) || (colType == Types.NUMERIC)) {
if (scale < 0)
throw newSQLException(SQLState.BAD_SCALE_VALUE, scale);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
try {
DataValueDescriptor value = updateRow.getColumn(columnIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1251
int origvaluelen = value.getLength();
((VariableSizeDataValue)
@@ -3335,8 +3456,10 @@ protected void adjustScale( int columnIndex, int scale )
public void updateObject(int columnIndex, Object x) throws SQLException {
checksBeforeUpdateXXX("updateObject", columnIndex);
int colType = getColumnType(columnIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
if (colType == Types.JAVA_OBJECT) {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
((UserDataValue) getDVDforColumnToBeUpdated(columnIndex, "updateObject")).setValue(x);
return;
} catch (StandardException t) {
@@ -3384,6 +3507,7 @@ public void updateObject(int columnIndex, Object x) throws SQLException {
return;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
if (x instanceof BigDecimal) {
updateBigDecimal(columnIndex, (BigDecimal) x);
return;
@@ -3438,6 +3562,7 @@ public void updateObject(int columnIndex, Object x) throws SQLException {
* if a database-access error occurs
*/
public void updateNull(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateNull");
updateNull(findColumnName(columnName));
}
@@ -3460,6 +3585,7 @@ public void updateNull(String columnName) throws SQLException {
* if a database-access error occurs
*/
public void updateBoolean(String columnName, boolean x) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateBoolean");
updateBoolean(findColumnName(columnName), x);
}
@@ -3482,6 +3608,7 @@ public void updateBoolean(String columnName, boolean x) throws SQLException {
* if a database-access error occurs
*/
public void updateByte(String columnName, byte x) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateByte");
updateByte(findColumnName(columnName), x);
}
@@ -3504,6 +3631,7 @@ public void updateByte(String columnName, byte x) throws SQLException {
* if a database-access error occurs
*/
public void updateShort(String columnName, short x) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateShort");
updateShort(findColumnName(columnName), x);
}
@@ -3526,6 +3654,7 @@ public void updateShort(String columnName, short x) throws SQLException {
* if a database-access error occurs
*/
public void updateInt(String columnName, int x) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateInt");
updateInt(findColumnName(columnName), x);
}
@@ -3548,6 +3677,7 @@ public void updateInt(String columnName, int x) throws SQLException {
* if a database-access error occurs
*/
public void updateLong(String columnName, long x) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateLong");
updateLong(findColumnName(columnName), x);
}
@@ -3570,6 +3700,7 @@ public void updateLong(String columnName, long x) throws SQLException {
* if a database-access error occurs
*/
public void updateFloat(String columnName, float x) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateFloat");
updateFloat(findColumnName(columnName), x);
}
@@ -3592,6 +3723,7 @@ public void updateFloat(String columnName, float x) throws SQLException {
* if a database-access error occurs
*/
public void updateDouble(String columnName, double x) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateDouble");
updateDouble(findColumnName(columnName), x);
}
@@ -3614,6 +3746,7 @@ public void updateDouble(String columnName, double x) throws SQLException {
* if a database-access error occurs
*/
public void updateString(String columnName, String x) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateString");
updateString(findColumnName(columnName), x);
}
@@ -3636,6 +3769,7 @@ public void updateString(String columnName, String x) throws SQLException {
* if a database-access error occurs
*/
public void updateBytes(String columnName, byte x[]) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateBytes");
updateBytes(findColumnName(columnName), x);
}
@@ -3659,6 +3793,7 @@ public void updateBytes(String columnName, byte x[]) throws SQLException {
*/
public void updateDate(String columnName, java.sql.Date x)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateDate");
updateDate(findColumnName(columnName), x);
}
@@ -3682,6 +3817,7 @@ public void updateDate(String columnName, java.sql.Date x)
*/
public void updateTime(String columnName, java.sql.Time x)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateTime");
updateTime(findColumnName(columnName), x);
}
@@ -3705,6 +3841,7 @@ public void updateTime(String columnName, java.sql.Time x)
*/
public void updateTimestamp(String columnName, java.sql.Timestamp x)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateTimestamp");
updateTimestamp(findColumnName(columnName), x);
}
@@ -3730,6 +3867,7 @@ public void updateTimestamp(String columnName, java.sql.Timestamp x)
*/
public void updateAsciiStream(String columnName, java.io.InputStream x,
int length) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateAsciiStream");
updateAsciiStream(findColumnName(columnName), x, length);
}
@@ -3755,6 +3893,7 @@ public void updateAsciiStream(String columnName, java.io.InputStream x,
*/
public void updateBinaryStream(String columnName, java.io.InputStream x,
int length) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateBinaryStream");
updateBinaryStream(findColumnName(columnName), x, length);
}
@@ -3780,6 +3919,7 @@ public void updateBinaryStream(String columnName, java.io.InputStream x,
*/
public void updateCharacterStream(String columnName, java.io.Reader reader,
int length) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateCharacterStream");
updateCharacterStream(findColumnName(columnName), reader, length);
}
@@ -3803,6 +3943,7 @@ public void updateCharacterStream(String columnName, java.io.Reader reader,
*/
public void updateObject(String columnName, Object x, int scale)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateObject");
updateObject(findColumnName(columnName), x, scale);
}
@@ -3825,6 +3966,7 @@ public void updateObject(String columnName, Object x, int scale)
* if a database-access error occurs
*/
public void updateObject(String columnName, Object x) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateObject");
updateObject(findColumnName(columnName), x);
}
@@ -3841,6 +3983,7 @@ public void updateObject(String columnName, Object x) throws SQLException {
* insert row have not been given a value
*/
public void insertRow() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-100
synchronized (getConnectionSynchronization()) {
checksBeforeInsert();
setupContextStack();
@@ -3866,6 +4009,8 @@ public void insertRow() throws SQLException {
// got the underlying (schema.)table name
insertSQL.append(getFullBaseTableName(targetTable));
ResultDescription rd = theResults.getResultDescription();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4610
+//IC see: https://issues.apache.org/jira/browse/DERBY-3049
insertSQL.append(" (");
// in this for loop we are constructing list of column-names
@@ -3877,7 +4022,10 @@ public void insertRow() throws SQLException {
}
// using quotes around the column name
// to preserve case sensitivity
+//IC see: https://issues.apache.org/jira/browse/DERBY-4044
insertSQL.append(IdUtil.normalToDelimited(
+//IC see: https://issues.apache.org/jira/browse/DERBY-4610
+//IC see: https://issues.apache.org/jira/browse/DERBY-3049
rd.getColumnDescriptor(i).getName()));
if (columnGotUpdated[i-1]) {
valuesSQL.append("?");
@@ -3890,6 +4038,7 @@ public void insertRow() throws SQLException {
valuesSQL.append(") ");
insertSQL.append(valuesSQL);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
StatementContext currSC = lcc.getStatementContext();
Activation parentAct = null;
@@ -3912,20 +4061,26 @@ public void insertRow() throws SQLException {
// which will be the activation of the pushed statement
// context.
statementContext.setActivation(parentAct);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
org.apache.derby.iapi.sql.PreparedStatement ps =
lcc.prepareInternalStatement(insertSQL.toString());
Activation act = ps.getActivation(lcc, false);
statementContext.setActivation(act);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3327
+//IC see: https://issues.apache.org/jira/browse/DERBY-1331
// in this for loop we are assigning values for parameters
//in sql constructed earlier VALUES (?, ..)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4610
+//IC see: https://issues.apache.org/jira/browse/DERBY-3049
for (int i=1, paramPosition=0; i<=rd.getColumnCount(); i++) {
// if the column got updated, do following
if (columnGotUpdated[i-1]) {
act.getParameterValueSet().
getParameterForSet(paramPosition++).
+//IC see: https://issues.apache.org/jira/browse/DERBY-1251
setValue(updateRow.getColumn(i));
}
}
@@ -3964,6 +4119,7 @@ public void updateRow() throws SQLException {
checkNotOnInsertRow();
setupContextStack();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
LanguageConnectionContext lcc = getLanguageConnectionContext( getEmbedConnection() );
StatementContext statementContext = null;
try {
@@ -3980,12 +4136,15 @@ public void updateRow() throws SQLException {
updateWhereCurrentOfSQL.append(getFullBaseTableName(targetTable));//got the underlying (schema.)table name
updateWhereCurrentOfSQL.append(" SET ");
ResultDescription rd = theResults.getResultDescription();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4610
+//IC see: https://issues.apache.org/jira/browse/DERBY-3049
for (int i=1; i<=rd.getColumnCount(); i++) { //in this for loop we are constructing columnname=?,... part of the update sql
if (columnGotUpdated[i-1]) { //if the column got updated, do following
if (foundOneColumnAlready)
updateWhereCurrentOfSQL.append(",");
//using quotes around the column name to preserve case sensitivity
+//IC see: https://issues.apache.org/jira/browse/DERBY-4044
updateWhereCurrentOfSQL.append(IdUtil.normalToDelimited(
rd.getColumnDescriptor(i).getName()) + "=?");
foundOneColumnAlready = true;
@@ -3995,6 +4154,7 @@ public void updateRow() throws SQLException {
updateWhereCurrentOfSQL.append(" WHERE CURRENT OF " +
IdUtil.normalToDelimited(getCursorName()));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
StatementContext currSC = lcc.getStatementContext();
Activation parentAct = null;
@@ -4004,6 +4164,7 @@ public void updateRow() throws SQLException {
// Context used for preparing, don't set any timeout (use 0)
statementContext = lcc.pushStatementContext(isAtomic, false, updateWhereCurrentOfSQL.toString(), null, false, 0L);
+//IC see: https://issues.apache.org/jira/browse/DERBY-231
// A priori, the new statement context inherits the activation of
// the existing statementContext, so that that activation ends up
@@ -4015,23 +4176,31 @@ public void updateRow() throws SQLException {
Activation act = ps.getActivation(lcc, false);
statementContext.setActivation(act);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3327
+//IC see: https://issues.apache.org/jira/browse/DERBY-1331
//in this for loop we are assigning values for parameters in sql constructed earlier with columnname=?,...
+//IC see: https://issues.apache.org/jira/browse/DERBY-4610
+//IC see: https://issues.apache.org/jira/browse/DERBY-3049
for (int i=1, paramPosition=0; i<=rd.getColumnCount(); i++) {
if (columnGotUpdated[i-1]) //if the column got updated, do following
+//IC see: https://issues.apache.org/jira/browse/DERBY-1251
act.getParameterValueSet().getParameterForSet(paramPosition++).setValue(updateRow.getColumn(i));
}
// Don't set any timeout when updating rows (use 0)
// Execute the update where current of sql.
org.apache.derby.iapi.sql.ResultSet rs =
ps.executeSubStatement(activation, act, true, 0L);
+//IC see: https://issues.apache.org/jira/browse/DERBY-690
SQLWarning w = act.getWarnings();
if (w != null) {
addWarning(w);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2566
act.close();
//For forward only resultsets, after a update, the ResultSet will be positioned right before the next row.
if (getType() == TYPE_FORWARD_ONLY) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1876
currentRow = null;
} else {
movePosition(RELATIVE, 0, "relative");
@@ -4064,9 +4233,13 @@ public void deleteRow() throws SQLException {
// Check that the cursor is not positioned on insertRow
checkNotOnInsertRow();
+//IC see: https://issues.apache.org/jira/browse/DERBY-100
+//IC see: https://issues.apache.org/jira/browse/DERBY-100
setupContextStack();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
LanguageConnectionContext lcc = getLanguageConnectionContext( getEmbedConnection() );
StatementContext statementContext = null;
@@ -4078,7 +4251,9 @@ public void deleteRow() throws SQLException {
//using quotes around the cursor name to preserve case sensitivity
deleteWhereCurrentOfSQL.append(" WHERE CURRENT OF " +
IdUtil.normalToDelimited(getCursorName()));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4044
+//IC see: https://issues.apache.org/jira/browse/DERBY-4551
StatementContext currSC = lcc.getStatementContext();
Activation parentAct = null;
@@ -4099,23 +4274,36 @@ public void deleteRow() throws SQLException {
org.apache.derby.iapi.sql.PreparedStatement ps = lcc.prepareInternalStatement(deleteWhereCurrentOfSQL.toString());
// Get activation, so that we can get the warning from it
Activation act = ps.getActivation(lcc, false);
+//IC see: https://issues.apache.org/jira/browse/DERBY-690
statementContext.setActivation(act);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3327
+//IC see: https://issues.apache.org/jira/browse/DERBY-1331
// Don't set any timeout when deleting rows (use 0)
//execute delete where current of sql
+//IC see: https://issues.apache.org/jira/browse/DERBY-3897
org.apache.derby.iapi.sql.ResultSet rs =
+//IC see: https://issues.apache.org/jira/browse/DERBY-3897
+//IC see: https://issues.apache.org/jira/browse/DERBY-3897
ps.executeSubStatement(activation, act, true, 0L);
SQLWarning w = act.getWarnings();
if (w != null) {
addWarning(w);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2566
+//IC see: https://issues.apache.org/jira/browse/DERBY-2566
act.close();
//After a delete, the ResultSet will be positioned right before
//the next row.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1876
currentRow = null;
lcc.popStatementContext(statementContext, null);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
InterruptStatus.restoreIntrFlagIfSeen(lcc);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4198
+//IC see: https://issues.apache.org/jira/browse/DERBY-4198
+//IC see: https://issues.apache.org/jira/browse/DERBY-4198
} catch (Throwable t) {
throw closeOnTransactionError(t);
} finally {
@@ -4129,6 +4317,7 @@ public void deleteRow() throws SQLException {
private String getFullBaseTableName(ExecCursorTableReference targetTable) {
//using quotes to preserve case sensitivity
+//IC see: https://issues.apache.org/jira/browse/DERBY-4044
return IdUtil.mkQualifiedName(targetTable.getSchemaName(),
targetTable.getBaseName());
}
@@ -4176,6 +4365,7 @@ public void cancelRowUpdates () throws SQLException {
checksBeforeUpdateOrDelete("cancelRowUpdates", -1);
checkNotOnInsertRow();
+//IC see: https://issues.apache.org/jira/browse/DERBY-100
initializeUpdateRowModifiers();
}
@@ -4215,6 +4405,7 @@ public void moveToInsertRow() throws SQLException {
//when dealing with character string datatypes.
setupContextStack();
// initialize state corresponding to insertRow/updateRow impl.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1251
initializeUpdateRowModifiers();
isOnInsertRow = true;
@@ -4222,6 +4413,7 @@ public void moveToInsertRow() throws SQLException {
updateRow.setColumn(i,
resultDescription.getColumnDescriptor(i).getType().getNull());
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
InterruptStatus.restoreIntrFlagIfSeen
( getLanguageConnectionContext( getEmbedConnection() ) );
} catch (Throwable ex) {
@@ -4254,11 +4446,15 @@ public void moveToCurrentRow() throws SQLException {
if (isOnInsertRow) {
// initialize state corresponding to insertRow/updateRow impl.
initializeUpdateRowModifiers();
+//IC see: https://issues.apache.org/jira/browse/DERBY-1251
+//IC see: https://issues.apache.org/jira/browse/DERBY-1251
+//IC see: https://issues.apache.org/jira/browse/DERBY-1251
isOnInsertRow = false;
}
InterruptStatus.restoreIntrFlagIfSeen();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
} catch (Throwable ex) {
handleException(ex);
@@ -4297,6 +4493,7 @@ public Blob getBlob(int columnIndex) throws SQLException {
try {
DataValueDescriptor dvd = getColumn(columnIndex);
EmbedConnection ec = getEmbedConnection();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
if (wasNull = dvd.isNull()) {
InterruptStatus.restoreIntrFlagIfSeen();
@@ -4306,12 +4503,14 @@ public Blob getBlob(int columnIndex) throws SQLException {
// should set up a context stack if we have a long column,
// since a blob may keep a pointer to a long column in the
// database
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
if (dvd.hasStream())
pushStack = true;
if (pushStack)
setupContextStack();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
EmbedBlob result = new EmbedBlob(dvd, ec);
restoreIntrFlagIfSeen(pushStack, ec);
return result;
@@ -4343,6 +4542,10 @@ public final Clob getClob(int columnIndex) throws SQLException {
// outside of the connection synchronization.
useStreamOrLOB(columnIndex);
+//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
synchronized (getConnectionSynchronization()) {
int colType = getColumnType(columnIndex);
@@ -4352,11 +4555,13 @@ public final Clob getClob(int columnIndex) throws SQLException {
throw dataTypeConversion("java.sql.Clob", columnIndex);
boolean pushStack = false;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
EmbedConnection ec = getEmbedConnection();
try {
StringDataValue dvd = (StringDataValue)getColumn(columnIndex);
LanguageConnectionContext lcc = getLanguageConnectionContext( ec );
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
if (wasNull = dvd.isNull()) {
InterruptStatus.restoreIntrFlagIfSeen();
@@ -4365,11 +4570,13 @@ public final Clob getClob(int columnIndex) throws SQLException {
// Set up a context stack if we have CLOB whose value is a long
// column in the database.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
if (dvd.hasStream()) {
pushStack = true;
setupContextStack();
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
EmbedClob result = new EmbedClob(ec, dvd);
restoreIntrFlagIfSeen(pushStack, ec);
return result;
@@ -4391,6 +4598,7 @@ public final Clob getClob(int columnIndex) throws SQLException {
* @return an object representing a BLOB
*/
public final Blob getBlob(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getBlob");
return (getBlob(findColumnName(columnName)));
}
@@ -4406,6 +4614,7 @@ public final Blob getBlob(String columnName) throws SQLException {
* Feature not implemented for now.
*/
public final Clob getClob(String columnName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("getClob");
return (getClob(findColumnName(columnName)));
}
@@ -4542,6 +4751,8 @@ protected int findColumnName(String columnName)
int position = resultDescription.findColumnInsenstive(columnName);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1879
+//IC see: https://issues.apache.org/jira/browse/DERBY-1876
if (position == -1) {
throw newSQLException(SQLState.COLUMN_NOT_FOUND, columnName);
} else {
@@ -4581,6 +4792,7 @@ private final void closeCurrentStream() {
*
* @exception SQLException Thrown if this ResultSet is closed.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1095
final void checkIfClosed(String operation) throws SQLException {
// If the JDBC ResultSet has been explicitly closed, isClosed is
// true. In some cases, the underlying language ResultSet can be closed
@@ -4594,6 +4806,7 @@ final void checkIfClosed(String operation) throws SQLException {
// basic cleanup and mark it as closed.
if (!isClosed) {
closeCurrentStream();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4869
markClosed();
}
@@ -4619,6 +4832,7 @@ final void checkExecIfClosed(String operation) throws SQLException {
if (appConn.isClosed()) {
closeCurrentStream();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4869
markClosed();
throw Util.noCurrentConnection();
}
@@ -4658,6 +4872,7 @@ private static boolean isMaxFieldSizeType(int colType){
/*
* close result set if we have a transaction level error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1095
final SQLException closeOnTransactionError(Throwable thrownException) throws SQLException
{
SQLException sqle = handleException(thrownException);
@@ -4670,6 +4885,7 @@ final SQLException closeOnTransactionError(Throwable thrownException) throws SQL
try {
close();
} catch (Throwable t) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2472
sqle.setNextException(handleException(t));
}
}
@@ -4695,7 +4911,9 @@ protected final DataValueDescriptor getColumn(int columnIndex)
closeCurrentStream();
+//IC see: https://issues.apache.org/jira/browse/DERBY-1876
if (columnIndex < 1 || columnIndex > resultDescription.getColumnCount()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throw newSQLException(SQLState.COLUMN_NOT_FOUND, columnIndex);
}
if (isOnInsertRow || currentRowHasBeenUpdated && columnGotUpdated[columnIndex -1]) {
@@ -4726,10 +4944,13 @@ static final SQLException noStateChangeException(Throwable thrownException) {
// to convert the exception to a SQLException.
return TransactionResourceImpl.wrapInSQLException(thrownException);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1440
+//IC see: https://issues.apache.org/jira/browse/DERBY-2472
}
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-1585
A dynamic result was created in a procedure by a nested connection.
Once the procedure returns, there is a good chance that connection is closed,
so we re-attach the result set to the connection of the statement the called
@@ -4745,6 +4966,7 @@ void setDynamicResultSet(EmbedStatement owningStmt) {
if (owningStmt != null) {
this.owningStmt = owningStmt;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3305
this.applicationStmt = owningStmt.applicationStatement;
this.localConn = owningStmt.getEmbedConnection();
}
@@ -4759,6 +4981,7 @@ void setDynamicResultSet(EmbedStatement owningStmt) {
// or CallableStatement. Dynamic result sets created
// by Statement objects will already be marked as
// single use.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3247
this.singleUseActivation = theResults.getActivation();
}
@@ -4782,14 +5005,19 @@ public final int compareTo(Object other) {
* is TYPE_FORWARD_ONLY
*/
private void checkScrollCursor(String methodName) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed(methodName);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
if (stmt.getResultSetType() == java.sql.ResultSet.TYPE_FORWARD_ONLY)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6488
throw Util.generateCsSQLException(
SQLState.NOT_ON_FORWARD_ONLY_CURSOR, methodName);
}
private void checkUpdatableCursor(String operation) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
if (getConcurrency() != java.sql.ResultSet.CONCUR_UPDATABLE) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-100
throw Util.generateCsSQLException(
SQLState.UPDATABLE_RESULTSET_API_DISALLOWED,
operation);
@@ -4805,8 +5033,10 @@ private boolean checkRowPosition(int position, String positionText)
synchronized (getConnectionSynchronization()) {
setupContextStack();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
LanguageConnectionContext lcc =
getLanguageConnectionContext( getEmbedConnection() );
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
try {
try {
@@ -4817,8 +5047,10 @@ private boolean checkRowPosition(int position, String positionText)
* error. (Cache the LanguageConnectionContext)
*/
// No timeout for this operation (use 0)
+//IC see: https://issues.apache.org/jira/browse/DERBY-31
StatementContext statementContext =
lcc.pushStatementContext(isAtomic,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
concurrencyOfThisResultSet==java.sql.ResultSet.CONCUR_READ_ONLY,
getSQLText(),
getParameterValueSet(),
@@ -4827,6 +5059,11 @@ private boolean checkRowPosition(int position, String positionText)
boolean result = theResults.checkRowPosition(position);
lcc.popStatementContext(statementContext, null);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
InterruptStatus.restoreIntrFlagIfSeen(lcc);
return result;
@@ -4870,6 +5107,7 @@ final String getColumnSQLType(int column)
* @return the maximum length of the column
*/
private final int getMaxColumnWidth(int columnIndex) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1473
return resultDescription.getColumnDescriptor(columnIndex).
getType().getMaximumWidth();
}
@@ -4891,7 +5129,9 @@ private final SQLException dataTypeConversion(int column, String targetType) {
* @param columnIndex 1-based column index
* @throws SQLException if the column has already been accessed
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-3844
final void useStreamOrLOB(int columnIndex) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5489
checkLOBMultiCall(columnIndex);
columnUsedFlags[columnIndex - 1] = true;
}
@@ -4932,12 +5172,14 @@ private void checkLOBMultiCall(int columnIndex)
* @exception SQLException if a database error occurs
*/
public final boolean isClosed() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1095
if (isClosed) return true;
try {
// isClosed is not updated when EmbedConnection.close() is
// called, so we need to check the status of the
// connection
checkExecIfClosed("");
+//IC see: https://issues.apache.org/jira/browse/DERBY-100
return false;
} catch (SQLException sqle) {
return isClosed;
@@ -4950,6 +5192,7 @@ public final boolean isClosed() throws SQLException {
* @param w The warning to add to the warning chain.
*/
private void addWarning(SQLWarning w) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-690
if (topWarning == null) {
topWarning = w;
} else {
@@ -5158,6 +5401,9 @@ public void updateBinaryStream(String columnName, InputStream x)
* if a database-access error occurs
*/
public void updateCharacterStream(String columnName, java.io.Reader reader,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1445
+//IC see: https://issues.apache.org/jira/browse/DERBY-1445
+//IC see: https://issues.apache.org/jira/browse/DERBY-1445
long length) throws SQLException {
checkIfClosed("updateCharacterStream");
updateCharacterStream(findColumnName(columnName),reader,length);
@@ -5294,6 +5540,7 @@ public void updateBlob(String columnName, InputStream x, long length)
*/
public void updateBlob(String columnName, InputStream x)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateBlob");
updateBlob(findColumnName(columnName), x);
}
@@ -5408,6 +5655,7 @@ public void updateClob(String columnName, Reader x, long length)
*/
public void updateClob(String columnName, Reader x)
throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkIfClosed("updateClob");
updateClob(findColumnName(columnName), x);
}
@@ -5425,6 +5673,7 @@ public void updateClob(String columnName, Reader x)
* @exception SQLException Feature not implemented for now.
*/
public void updateRef(int columnIndex, Ref x)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
throws SQLException {
throw Util.notImplemented();
}
@@ -5736,6 +5985,7 @@ public T getObject(String columnName, Class type)
* @see org.apache.derby.iapi.jdbc.EngineResultSet#isNull(int)
*/
public boolean isNull(int columnIndex) throws SQLException{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2941
try {
DataValueDescriptor dvd = getColumn(columnIndex);
return dvd.isNull();
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedResultSet42.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedResultSet42.java
index 4a55ad5568..d2767fbae7 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedResultSet42.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedResultSet42.java
@@ -55,7 +55,10 @@ public EmbedResultSet42(org.apache.derby.impl.jdbc.EmbedConnection conn,
( int columnIndex, Object x, SQLType targetSqlType, int scaleOrLength )
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
checkIfClosed("updateObject");
+//IC see: https://issues.apache.org/jira/browse/DERBY-6089
+//IC see: https://issues.apache.org/jira/browse/DERBY-6089
updateObject( columnIndex, x, Util42.getTypeAsInt( targetSqlType ) );
adjustScale( columnIndex, scaleOrLength );
}
@@ -65,6 +68,7 @@ public EmbedResultSet42(org.apache.derby.impl.jdbc.EmbedConnection conn,
throws SQLException
{
checkIfClosed("updateObject");
+//IC see: https://issues.apache.org/jira/browse/DERBY-6089
updateObject( columnName, x, Util42.getTypeAsInt( targetSqlType ) );
}
@@ -72,6 +76,9 @@ public EmbedResultSet42(org.apache.derby.impl.jdbc.EmbedConnection conn,
( String columnName, Object x, SQLType targetSqlType, int scaleOrLength )
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
checkIfClosed("updateObject");
updateObject( findColumnName( columnName ), x, targetSqlType, scaleOrLength );
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedResultSetMetaData.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedResultSetMetaData.java
index 5a7e74873e..6f7824d209 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedResultSetMetaData.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedResultSetMetaData.java
@@ -43,6 +43,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
This class can be used outside of this package to convert a
ResultDescription into a ResultSetMetaData object.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1879
+//IC see: https://issues.apache.org/jira/browse/DERBY-1876
EmbedResultSetMetaData objects are shared across multiple threads
by being stored in the ResultDescription for a compiled plan.
@@ -60,6 +62,7 @@ public class EmbedResultSetMetaData implements ResultSetMetaData {
// constructor
//
public EmbedResultSetMetaData(ResultColumnDescriptor[] columnInfo) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
this.columnInfo = ArrayUtil.copy(columnInfo);
}
@@ -73,6 +76,8 @@ public EmbedResultSetMetaData(ResultColumnDescriptor[] columnInfo) {
* @return the number
*/
public final int getColumnCount() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1879
+//IC see: https://issues.apache.org/jira/browse/DERBY-1876
return columnInfo.length;
}
@@ -85,6 +90,8 @@ public final int getColumnCount() {
*
*/
public final boolean isAutoIncrement(int column) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1879
+//IC see: https://issues.apache.org/jira/browse/DERBY-1876
validColumnNumber(column);
ResultColumnDescriptor rcd = columnInfo[column - 1];
return rcd.isAutoincrement();
@@ -206,6 +213,7 @@ public final String getColumnName(int column) throws SQLException {
public final String getSchemaName(int column) throws SQLException {
ResultColumnDescriptor cd = columnInfo[column - 1];
+//IC see: https://issues.apache.org/jira/browse/DERBY-189
String s = cd.getSourceSchemaName();
// database returns null when no schema name to differentiate from empty name
return (s==null? "" : s);
@@ -310,6 +318,7 @@ public final boolean isReadOnly(int column) throws SQLException {
*/
public final boolean isWritable(int column) throws SQLException {
validColumnNumber(column);
+//IC see: https://issues.apache.org/jira/browse/DERBY-189
return columnInfo[column - 1].updatableByCursor();
}
@@ -324,6 +333,7 @@ public final boolean isDefinitelyWritable(int column) throws SQLException {
validColumnNumber(column);
// we just don't know if it is a base table column or not
+//IC see: https://issues.apache.org/jira/browse/DERBY-2423
return false;
}
@@ -335,6 +345,7 @@ private void validColumnNumber(int column) throws SQLException {
if (column < 1 ||
column > getColumnCount() )
throw Util.generateCsSQLException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
SQLState.COLUMN_NOT_FOUND, column);
}
@@ -392,6 +403,7 @@ public static ResultColumnDescriptor getResultColumnDescriptor(String name, Data
* @return true if this implements the interface
*/
public final boolean isWrapperFor(Class> iface) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
return iface.isInstance(this);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedSavepoint.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedSavepoint.java
index 78304be96a..3e07f95cd1 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedSavepoint.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedSavepoint.java
@@ -45,6 +45,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* @see java.sql.Savepoint
*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
final class EmbedSavepoint extends ConnectionChild
implements Savepoint {
@@ -63,12 +64,14 @@ final class EmbedSavepoint extends ConnectionChild
and restore it.
@exception SQLException on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
EmbedSavepoint(EmbedConnection conn, String name)
throws StandardException {
super(conn);
if (name == null) //this is an unnamed savepoint
{
//Generating a unique internal name for unnamed savepoints
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
savepointName = "i." + getLanguageConnectionContext( conn ).getUniqueSavepointName();
savepointID = getLanguageConnectionContext( conn ).getUniqueSavepointID();
} else
@@ -88,6 +91,7 @@ final class EmbedSavepoint extends ConnectionChild
* @exception SQLException if this is a named savepoint
*/
public int getSavepointId() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
if (savepointID == -1) {
throw newSQLException(SQLState.NO_ID_FOR_NAMED_SAVEPOINT);
}
@@ -103,6 +107,7 @@ public int getSavepointId() throws SQLException {
* @exception SQLException if this is an un-named savepoint
*/
public String getSavepointName() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
if (savepointID != -1) {
throw newSQLException(SQLState.NO_NAME_FOR_UNNAMED_SAVEPOINT);
}
@@ -120,6 +125,7 @@ String getInternalName() {
boolean sameConnection(EmbedConnection con) {
return
(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
getLCC( getEmbedConnection() ) ==
getLCC( con )
);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedStatement.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedStatement.java
index df888e9006..a3f9e88b19 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedStatement.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedStatement.java
@@ -1483,7 +1483,9 @@ public ParameterValueSet getParameterValueSet()
*
* @see #checkExecStatus()
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1095
final void checkStatus() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1395
if (!active) {
//
// Check the status of the connection first
@@ -1506,7 +1508,9 @@ its connection (as the underlying Connection is still active).
To avoid this heavier weight check on every method of [Prepared]Statement it is only used
on those methods that would end up using the database's connection to read or modify data.
E.g. execute*(), but not setXXX, etc.
+//IC see: https://issues.apache.org/jira/browse/DERBY-953
+//IC see: https://issues.apache.org/jira/browse/DERBY-953
If this Statement's Connection is closed an exception will
be thrown and the active field will be set to false,
completely marking the Statement as closed.
@@ -1534,6 +1538,7 @@ final void checkExecStatus() throws SQLException {
// Now this connection is closed for all
// future use.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1095
active = false;
throw Util.noCurrentConnection();
@@ -1543,6 +1548,7 @@ final void checkExecStatus() throws SQLException {
Close and clear all result sets associated with this statement
from the last execution.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-4869
void clearResultSets() throws SQLException
{
//
@@ -1593,6 +1599,7 @@ private void clearResultSetsMinion() throws SQLException
continue;
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1095
lrs.close();
} catch (SQLException sdynamic) {
if (sqle == null)
@@ -1611,6 +1618,7 @@ relies on it being there for subsequent (post-close) execution
*/
updateCount = -1L; // reset field
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
if (sqle != null)
throw sqle;
@@ -1669,6 +1677,9 @@ public final void setApplicationStatement(EngineStatement s) {
*/
private int processDynamicResults(java.sql.ResultSet[][] holder,
int maxDynamicResultSets)
+//IC see: https://issues.apache.org/jira/browse/DERBY-501
+//IC see: https://issues.apache.org/jira/browse/DERBY-1314
+//IC see: https://issues.apache.org/jira/browse/DERBY-1364
throws SQLException
{
@@ -1690,6 +1701,7 @@ private int processDynamicResults(java.sql.ResultSet[][] holder,
// ignore non-Derby result sets or results sets from another connection
// and closed result sets.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1585
EmbedResultSet lrs = EmbedStatement.processDynamicResult(
getEmbedConnection(), rs, this);
@@ -1722,6 +1734,7 @@ private int processDynamicResults(java.sql.ResultSet[][] holder,
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
updateCount = -1L;
results = sorted[0];
currentDynamicResultSet = 0;
@@ -1731,6 +1744,9 @@ private int processDynamicResults(java.sql.ResultSet[][] holder,
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-501
+//IC see: https://issues.apache.org/jira/browse/DERBY-1314
+//IC see: https://issues.apache.org/jira/browse/DERBY-1364
return actualCount;
}
@@ -1753,6 +1769,7 @@ private int processDynamicResults(java.sql.ResultSet[][] holder,
* dynamic result.
*/
static EmbedResultSet processDynamicResult(EmbedConnection conn,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1585
java.sql.ResultSet resultSet,
EmbedStatement callStatement)
{
@@ -1831,6 +1848,7 @@ void resultSetClosing(EmbedResultSet closingLRS) throws SQLException {
*/
private boolean getExecuteHoldable() throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
if (resultSetHoldability == java.sql.ResultSet.CLOSE_CURSORS_AT_COMMIT)
return false;
@@ -1839,6 +1857,7 @@ private boolean getExecuteHoldable() throws SQLException
return true;
return applicationStatement.getResultSetHoldability() ==
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
java.sql.ResultSet.HOLD_CURSORS_OVER_COMMIT;
}
@@ -1853,6 +1872,7 @@ private boolean getExecuteHoldable() throws SQLException
public boolean isPoolable() throws SQLException {
// Assert the statement is still active (not closed)
checkStatus();
+//IC see: https://issues.apache.org/jira/browse/DERBY-1235
return isPoolable;
}
@@ -1882,6 +1902,7 @@ public void setPoolable(boolean poolable) throws SQLException {
* whether this is a wrapper for an object with the given interface.
*/
public final boolean isWrapperFor(Class> interfaces) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1984
checkStatus();
return interfaces.isInstance(this);
}
@@ -1912,6 +1933,7 @@ public final T unwrap(java.lang.Class interfaces)
public void closeOnCompletion() throws SQLException
{
// Assert the statement is still active (not closed)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4869
checkStatus();
closeOnCompletion = true;
@@ -1920,6 +1942,7 @@ public void closeOnCompletion() throws SQLException
public boolean isCloseOnCompletion() throws SQLException
{
// Assert the statement is still active (not closed)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1234
checkStatus();
return closeOnCompletion;
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedXAConnection.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedXAConnection.java
index 7d5097200d..2ff8b22cce 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedXAConnection.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedXAConnection.java
@@ -48,6 +48,7 @@ public class EmbedXAConnection extends EmbedPooledConnection implements XAConnec
private EmbedXAResource xaRes;
public EmbedXAConnection(EmbeddedDataSourceInterface ds,
+//IC see: https://issues.apache.org/jira/browse/DERBY-5955
ResourceAdapter ra,
String u,
String p,
@@ -78,6 +79,7 @@ private boolean isGlobal() {
public final synchronized XAResource getXAResource() throws SQLException {
checkActive();
+//IC see: https://issues.apache.org/jira/browse/DERBY-1155
return xaRes;
}
@@ -104,6 +106,7 @@ public void checkAutoCommit(boolean autoCommit) throws SQLException {
public int checkHoldCursors(int holdability, boolean downgrade)
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
if (holdability == ResultSet.HOLD_CURSORS_OVER_COMMIT) {
if (isGlobal()) {
if (!downgrade)
@@ -199,6 +202,7 @@ public Statement wrapStatement(Statement s) throws SQLException {
Wrap and control a PreparedStatement
*/
public PreparedStatement wrapStatement(PreparedStatement ps, String sql, Object generatedKeys) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-941
ps = super.wrapStatement(ps,sql,generatedKeys);
XAStatementControl sc = new XAStatementControl(this, ps, sql, generatedKeys);
return (PreparedStatement) sc.applicationStatement;
@@ -207,6 +211,7 @@ public PreparedStatement wrapStatement(PreparedStatement ps, String sql, Object
Wrap and control a PreparedStatement
*/
public CallableStatement wrapStatement(CallableStatement cs, String sql) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-941
cs = super.wrapStatement(cs,sql);
XAStatementControl sc = new XAStatementControl(this, cs, sql);
return (CallableStatement) sc.applicationStatement;
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedXAResource.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedXAResource.java
index 1b47eb2ac1..5e9fb35a05 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedXAResource.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedXAResource.java
@@ -70,6 +70,7 @@ class EmbedXAResource implements XAResource {
this.con = con;
this.ra = ra;
// Setup the default value for the transaction timeout.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2432
this.timeoutSeconds = 0;
}
@@ -101,6 +102,7 @@ public final synchronized void commit(Xid xid, boolean onePhase)
// RM also does not know about this xid.
if (inDoubtCM == null)
throw new XAException(XAException.XAER_NOTA);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
ContextService csf = getContextService();
csf.setCurrentContextManager(inDoubtCM);
try {
@@ -146,6 +148,7 @@ public final synchronized void commit(Xid xid, boolean onePhase)
throw new XAException(XAException.XAER_PROTO);
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2432
tranState.xa_commit(onePhase);
} catch (SQLException sqle) {
throw wrapInXAException(sqle);
@@ -299,6 +302,7 @@ public final synchronized int prepare(Xid xid) throws XAException {
returnConnectionToResource(tranState, xid_im);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2432
if (SanityManager.DEBUG) {
if (con.realConnection != null) {
SanityManager.ASSERT(
@@ -314,6 +318,7 @@ public final synchronized int prepare(Xid xid) throws XAException {
} catch (SQLException sqle) {
XAException xe = wrapInXAException(sqle);
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
if (ExceptionUtil.
isDeferredConstraintViolation(sqle.getSQLState())) {
// We are rolling back
@@ -336,6 +341,7 @@ public final synchronized int prepare(Xid xid) throws XAException {
* is equal to Integer.MAX_VALUE it means no timeout.
*/
public synchronized int getTransactionTimeout() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2432
return timeoutSeconds;
}
@@ -463,6 +469,8 @@ public final synchronized void rollback(Xid xid) throws XAException {
if (inDoubtCM == null)
throw new XAException(XAException.XAER_NOTA);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
ContextService csf = getContextService();
csf.setCurrentContextManager(inDoubtCM);
@@ -506,6 +514,7 @@ public final synchronized void rollback(Xid xid) throws XAException {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2432
tranState.xa_rollback();
} catch (SQLException sqle) {
throw wrapInXAException(sqle);
@@ -536,6 +545,7 @@ public final synchronized void rollback(Xid xid) throws XAException {
* values are XAER_RMERR, XAER_RMFAIL, or XAER_INVAL.
*/
public synchronized boolean setTransactionTimeout(int seconds)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2432
throws XAException {
if (seconds < 0) {
// throw an exception if invalid value was specified
@@ -550,6 +560,7 @@ public synchronized boolean setTransactionTimeout(int seconds)
*/
private long getDefaultXATransactionTimeout() throws XAException {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
LanguageConnectionContext lcc = getLanguageConnectionContext( con );
TransactionController tc = lcc.getTransactionExecute();
@@ -661,8 +672,10 @@ public final synchronized void start(Xid xid,
// and holdability false (cannot hold cursors across
// XA transactions.
con.realConnection.setHoldability(
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
ResultSet.CLOSE_CURSORS_AT_COMMIT);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
getLanguageConnectionContext( con.realConnection ).
getTransactionExecute().
createXATransactionFromLocalTransaction(
@@ -677,11 +690,13 @@ public final synchronized void start(Xid xid,
throw wrapInXAException(sqle);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6741
tranState = new XATransactionState
(
getContextManager( con.realConnection ),
con.realConnection, this, xid_im
);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2432
if (!ra.addConnection(xid_im, tranState))
throw new XAException(XAException.XAER_DUPID);
@@ -728,6 +743,7 @@ public final synchronized void start(Xid xid,
// get this state and store in the connection handle so
// that we can restore the isolation when we are in the
// local mode.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1325
try {
if (con.currentConnectionHandle != null) {
con.currentConnectionHandle.getIsolationUptoDate();
@@ -839,6 +855,7 @@ else if (sqlstate.equals(SQLState.LOCK_TIMEOUT))
xaErrorCode = XAException.XA_RBTIMEOUT;
else if (seErrorCode >= ExceptionSeverity.SESSION_SEVERITY)
xaErrorCode = XAException.XAER_RMFAIL;
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
else if (ExceptionUtil.isDeferredConstraintViolation(sqlstate)) {
xaErrorCode = XAException.XA_RBINTEGRITY;
} else {
@@ -847,6 +864,7 @@ else if (ExceptionUtil.isDeferredConstraintViolation(sqlstate)) {
xae = new XAException(message);
xae.errorCode = xaErrorCode;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5542
xae.initCause(se);
return xae;
}
@@ -857,6 +875,8 @@ else if (ExceptionUtil.isDeferredConstraintViolation(sqlstate)) {
*/
private static XAException wrapInXAException(StandardException se) {
return wrapInXAException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-1440
+//IC see: https://issues.apache.org/jira/browse/DERBY-2472
TransactionResourceImpl.wrapInSQLException(se));
}
@@ -866,6 +886,7 @@ private static XAException wrapInXAException(StandardException se) {
* @param tranState
* @param xid_im
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2432
void returnConnectionToResource(XATransactionState tranState,
XAXactId xid_im) {
@@ -927,6 +948,7 @@ private static void closeUnusedConnection(EmbedConnection conn) {
* Removes the xid from currently active transactions
* @param xid_im
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2432
void removeXATransaction(XAXactId xid_im) {
XATransactionState tranState =
(XATransactionState) ra.removeConnection(xid_im);
@@ -945,12 +967,14 @@ void setCurrentXid(XAXactId aCurrentXid) {
*/
private static ContextService getContextService()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6741
return AccessController.doPrivileged
(
new PrivilegedAction()
{
public ContextService run()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return ContextService.getFactory();
}
}
@@ -980,6 +1004,7 @@ public ContextManager run()
*/
private LanguageConnectionContext getLanguageConnectionContext( final EmbedConnection conn )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
return AccessController.doPrivileged
(
new PrivilegedAction()
@@ -999,6 +1024,7 @@ public LanguageConnectionContext run()
private LanguageConnectionContext getLanguageConnectionContext( final EmbedPooledConnection conn )
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6751
if ( lcc == null )
{
try {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EncryptedLOBFile.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EncryptedLOBFile.java
index 4fc58cadd6..bf53e50791 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EncryptedLOBFile.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EncryptedLOBFile.java
@@ -78,6 +78,7 @@ class EncryptedLOBFile extends LOBFile {
if (len < 0)
throw new IndexOutOfBoundsException (
MessageService.getTextMessage (
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
SQLState.BLOB_NONPOSITIVE_LENGTH, len));
//starting position of the 1st block
long startPos = pos - pos % blockSize;
@@ -113,6 +114,7 @@ long getFilePointer() {
* @throws IOException
*/
void seek (long pos) throws IOException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2379
long fileLength = super.length();
if (pos > fileLength + tailSize) {
//this should never happen
@@ -262,6 +264,7 @@ void write(byte[] b) throws IOException, StandardException {
*/
int readByte() throws IOException, StandardException {
long fileLength = super.length();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2379
if (currentPos >= fileLength + tailSize)
throw new EOFException ();
if (currentPos >= fileLength)
@@ -332,6 +335,7 @@ int read(byte[] buff, int off, int len)
* @throws StandardException if error occurred during decryption
*/
void setLength(long size) throws IOException, StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2379
long fileLength = super.length();
if (size > fileLength + tailSize) {
//this should never happen
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/InternalClob.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/InternalClob.java
index 4f8c683cda..33ec5cbbd9 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/InternalClob.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/InternalClob.java
@@ -62,6 +62,7 @@ interface InternalClob {
* currently unknown (not cached).
*/
long getCharLengthIfKnown();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4241
/**
* Returns a stream serving the raw bytes of the Clob.
@@ -121,6 +122,7 @@ interface InternalClob {
* @throws IOException if accessing underlying I/O resources fail
* @throws SQLException if accessing underlying resources fail
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-3825
Reader getInternalReader(long characterPosition)
throws IOException, SQLException;
@@ -133,6 +135,7 @@ Reader getInternalReader(long characterPosition)
* @return Update count, starting at zero.
*/
long getUpdateCount();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
/**
* Returns a writer to write data into the Clob.
@@ -148,6 +151,7 @@ Reader getInternalReader(long characterPosition)
* read-only
*/
Writer getWriter(long charPos) throws IOException, SQLException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2646
/**
* Inserts the given string at the specified character position.
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBFile.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBFile.java
index 951c16c0ff..1cf54ddfc1 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBFile.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBFile.java
@@ -46,6 +46,7 @@ class LOBFile {
* cannot be opened
*/
LOBFile(StorageFile lobFile) throws FileNotFoundException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3889
storageFile = lobFile;
randomAccessFile = lobFile.getRandomAccessFile("rw");
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBInputStream.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBInputStream.java
index 30b162c7e1..2185885add 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBInputStream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBInputStream.java
@@ -40,6 +40,7 @@ Licensed to the Apache Software Foundation (ASF) under one
*/
public class LOBInputStream
+//IC see: https://issues.apache.org/jira/browse/DERBY-3935
extends InputStream
implements PositionedStream {
@@ -52,6 +53,7 @@ public class LOBInputStream
closed = false;
this.control = control;
pos = position;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2346
updateCount = control.getUpdateCount ();
}
@@ -120,14 +122,17 @@ public class LOBInputStream
public int read(byte[] b, int off, int len) throws IOException {
if (closed)
throw new IOException (
+//IC see: https://issues.apache.org/jira/browse/DERBY-5090
MessageService.getTextMessage(MessageId.OBJECT_CLOSED));
try {
int ret = control.read(b, off, len, pos);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2247
if (ret != -1) {
pos += ret;
return ret;
}
return -1;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
} catch (StandardException se) {
String state = se.getSQLState();
if (state.equals(ExceptionUtil.getSQLStateFromIdentifier(
@@ -172,6 +177,7 @@ public void close() throws IOException {
public int read() throws IOException {
if (closed)
throw new IOException (
+//IC see: https://issues.apache.org/jira/browse/DERBY-5090
MessageService.getTextMessage(MessageId.OBJECT_CLOSED));
try {
int ret = control.read(pos);
@@ -179,6 +185,8 @@ public int read() throws IOException {
pos += 1;
return ret;
} catch (StandardException se) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
throw Util.newIOException(se);
}
}
@@ -188,6 +196,7 @@ public int read() throws IOException {
* @return if stream is modified since created
*/
boolean isObsolete () {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2346
return updateCount != control.getUpdateCount();
}
@@ -213,6 +222,7 @@ long length () throws IOException {
// - reposition
public InputStream asInputStream() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3935
return this;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBOutputStream.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBOutputStream.java
index fc1973037b..702dd73170 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBOutputStream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBOutputStream.java
@@ -64,6 +64,7 @@ public class LOBOutputStream extends OutputStream {
public void write(int b) throws IOException {
if (closed)
throw new IOException (
+//IC see: https://issues.apache.org/jira/browse/DERBY-5090
MessageService.getTextMessage(MessageId.OBJECT_CLOSED));
try {
pos = control.write(b, pos);
@@ -103,15 +104,19 @@ public void write(int b) throws IOException {
public void write(byte[] b, int off, int len) throws IOException {
if (closed)
throw new IOException (
+//IC see: https://issues.apache.org/jira/browse/DERBY-5090
MessageService.getTextMessage(MessageId.OBJECT_CLOSED));
try {
pos = control.write(b, off, len, pos);
} catch (StandardException se) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
if (se.getSQLState().equals(
ExceptionUtil.getSQLStateFromIdentifier(
SQLState.BLOB_INVALID_OFFSET))) {
throw new ArrayIndexOutOfBoundsException(se.getMessage());
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
throw Util.newIOException(se);
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBStoredProcedure.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBStoredProcedure.java
index f4116efb06..7155e5ead1 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBStoredProcedure.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBStoredProcedure.java
@@ -43,6 +43,7 @@ public class LOBStoredProcedure {
* @throws SQLException
*/
public static int CLOBCREATELOCATOR() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3576
EngineLOB clob = (EngineLOB)getEmbedConnection().createClob();
return clob.getLocator();
}
@@ -149,6 +150,7 @@ public static String CLOBGETSUBSTRING(int LOCATOR,
long pos, int len) throws SQLException {
// Don't read more than what we can represent as a VARCHAR.
// See DERBY-3769.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
len = Math.min(len, Limits.MAX_CLOB_RETURN_LEN);
return getClobObjectCorrespondingtoLOCATOR(LOCATOR).getSubString(pos, len);
}
@@ -211,6 +213,7 @@ private static Clob getClobObjectCorrespondingtoLOCATOR(int LOCATOR)
* @throws SQLException
*/
public static int BLOBCREATELOCATOR() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3576
EngineLOB blob = (EngineLOB)getEmbedConnection().createBlob();
return blob.getLocator();
}
@@ -308,6 +311,7 @@ public static byte[] BLOBGETBYTES(int LOCATOR, long pos, int len)
throws SQLException {
// Don't read more than what we can represent as a VARBINARY.
// See DERBY-3769.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
len = Math.min(len, Limits.MAX_BLOB_RETURN_LEN);
return getBlobObjectCorrespondingtoLOCATOR(LOCATOR).getBytes(pos, len);
}
@@ -369,8 +373,11 @@ private static Blob getBlobObjectCorrespondingtoLOCATOR(int LOCATOR)
private static EmbedConnection getEmbedConnection() throws SQLException {
//DERBY-4664 Do not use DriverManager("jdbc:default:connection") because
// some other product's Driver might hijack our stored procedure.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4664
+//IC see: https://issues.apache.org/jira/browse/DERBY-4668
InternalDriver id = InternalDriver.activeDriver();
if (id != null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6094
EmbedConnection conn = (EmbedConnection) id.connect( "jdbc:default:connection", null, 0 );
if (conn != null)
return conn;
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBStreamControl.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBStreamControl.java
index b80e6414f7..225f569df9 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBStreamControl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/LOBStreamControl.java
@@ -56,6 +56,7 @@ Licensed to the Apache Software Foundation (ASF) under one
* blob data irrespective of if its in memory or in file.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6161
final class LOBStreamControl {
private LOBFile tmpFile;
private byte [] dataBytes = new byte [0];
@@ -83,8 +84,10 @@ final class LOBStreamControl {
* @param data initial value
*/
LOBStreamControl (EmbedConnection conn, byte [] data)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
throws IOException, StandardException {
this.conn = conn;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2346
updateCount = 0;
bufferSize =
Math.min(Math.max(DEFAULT_BUF_SIZE, data.length), MAX_BUF_SIZE);
@@ -93,14 +96,18 @@ final class LOBStreamControl {
private void init(byte [] b, long len)
throws IOException, StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
Object monitor = findService(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6161
Property.DATABASE_MODULE, conn.getDBName());
final DataFactory df = (DataFactory) findServiceModule(
monitor, DataFactory.MODULE);
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
AccessController.doPrivileged (new PrivilegedExceptionAction() {
public Object run() throws IOException {
//create a temporary file
+//IC see: https://issues.apache.org/jira/browse/DERBY-3889
StorageFile lobFile =
df.getStorageFactory().createTemporaryFile("lob", null);
if (df.databaseEncrypted()) {
@@ -121,10 +128,12 @@ public Object run() throws IOException {
//now this call will write into the file
if (len != 0)
write(b, 0, (int) len, 0);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2713
dataBytes = null;
}
private long updateData(byte[] bytes, int offset, int len, long pos)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
throws StandardException {
if (dataBytes == null) {
if ((int) pos == 0) {
@@ -134,7 +143,9 @@ private long updateData(byte[] bytes, int offset, int len, long pos)
}
else {
//invalid postion
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
throw StandardException.newException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
SQLState.BLOB_POSITION_TOO_LARGE, pos);
}
}
@@ -160,9 +171,11 @@ private long updateData(byte[] bytes, int offset, int len, long pos)
}
private void isValidPostion(long pos)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
throws IOException, StandardException {
if (pos < 0)
throw StandardException.newException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
SQLState.BLOB_NONPOSITIVE_LENGTH, (pos + 1));
if (pos > Integer.MAX_VALUE)
throw StandardException.newException(
@@ -200,8 +213,10 @@ private void isValidOffset(int off, int length) throws StandardException {
synchronized long write(int b, long pos)
throws IOException, StandardException {
isValidPostion(pos);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2346
updateCount++;
if (isBytes) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2713
if (pos < bufferSize) {
byte [] bytes = {(byte) b};
updateData(bytes, 0, 1, pos);
@@ -210,6 +225,7 @@ synchronized long write(int b, long pos)
init(dataBytes, pos);
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2247
tmpFile.seek(pos);
tmpFile.write(b);
return tmpFile.getFilePointer();
@@ -240,8 +256,10 @@ synchronized long write(byte[] b, int off, int len, long pos)
throw new ArrayIndexOutOfBoundsException (e.getMessage());
throw e;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2346
updateCount++;
if (isBytes) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2713
if (pos + len <= bufferSize)
return updateData(b, off, len, pos);
else {
@@ -279,6 +297,7 @@ synchronized int read(long pos)
}
private int readBytes(byte [] b, int off, int len, long pos) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2247
if (pos >= dataBytes.length)
return -1;
int lengthFromPos = dataBytes.length - (int) pos;
@@ -305,6 +324,7 @@ synchronized int read(byte[] buff, int off, int len, long pos)
if (isBytes) {
return readBytes(buff, off, len, pos);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2247
tmpFile.seek(pos);
return tmpFile.read (buff, off, len);
}
@@ -344,20 +364,26 @@ long getLength() throws IOException {
* @throws IOException
*/
synchronized void truncate(long size)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
throws IOException, StandardException {
isValidPostion(size);
if (isBytes) {
byte [] tmpByte = new byte [(int) size];
System.arraycopy(dataBytes, 0, tmpByte, 0, (int) size);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2345
dataBytes = tmpByte;
} else {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2713
if (size < bufferSize) {
dataBytes = new byte [(int) size];
+//IC see: https://issues.apache.org/jira/browse/DERBY-2247
read(dataBytes, 0, dataBytes.length, 0);
isBytes = true;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3889
releaseTempFile(tmpFile);
tmpFile = null;
} else {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
tmpFile.setLength(size);
}
}
@@ -378,16 +404,19 @@ synchronized void truncate(long size)
*/
synchronized void copyData(InputStream inStream, long length)
throws IOException, StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2713
byte [] data = new byte [bufferSize];
long sz = 0;
while (sz < length) {
int len = (int) Math.min (length - sz, bufferSize);
len = inStream.read(data, 0, len);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3793
if (len == -1) {
if (length != Long.MAX_VALUE) {
// We reached EOF before all the requested bytes are read.
throw new EOFException(MessageService.getTextMessage(
MessageId.STREAM_PREMATURE_EOF,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
length, sz));
} else {
// End of data, but no length checking.
@@ -399,6 +428,7 @@ synchronized void copyData(InputStream inStream, long length)
}
// If we copied until EOF, and we read more data than the length of the
// marker, see if we have a Derby end-of-stream marker.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4241
long curLength = getLength();
if (length == Long.MAX_VALUE && curLength > 2) {
byte[] eos = new byte[3];
@@ -429,6 +459,7 @@ synchronized void copyData(InputStream inStream, long length)
* {@code LOBStreamControl}-object fails
* @throws UTFDataFormatException if an invalid UTF-8 encoding is detected
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-4241
synchronized long copyUtf8Data(final InputStream utf8Stream,
final long charLength)
throws IOException, StandardException {
@@ -484,6 +515,7 @@ synchronized long copyUtf8Data(final InputStream utf8Stream,
if (charLength != Long.MAX_VALUE && charCount != charLength) {
throw new EOFException(MessageService.getTextMessage(
MessageId.STREAM_PREMATURE_EOF,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
charLength, charCount));
}
return charCount;
@@ -499,8 +531,10 @@ protected void finalize() throws Throwable {
}
private void deleteFile(final StorageFile file) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6161
file.delete();
return null;
}
@@ -514,6 +548,7 @@ public Object run() {
void free() throws IOException {
dataBytes = null;
if (tmpFile != null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3889
releaseTempFile(tmpFile);
tmpFile = null;
}
@@ -561,12 +596,18 @@ private void releaseTempFile(LOBFile file) throws IOException {
* @throws IOException if writing to the temporary file fails
* @throws StandardException
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2346
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
synchronized long replaceBytes (byte [] buf, long stPos, long endPos)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
throws IOException, StandardException {
long length = getLength();
if (isBytes) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5062
long finalLength = length - endPos + stPos + buf.length;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2713
if (finalLength > bufferSize) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2802
byte [] tmpBytes = dataBytes;
init (tmpBytes, stPos);
write (buf, 0, buf.length, getLength());
@@ -589,6 +630,7 @@ synchronized long replaceBytes (byte [] buf, long stPos, long endPos)
//create new file with 0 size
byte tmp [] = new byte [0];
+//IC see: https://issues.apache.org/jira/browse/DERBY-2379
LOBFile oldFile = tmpFile;
init (tmp, 0);
byte [] tmpByte = new byte [1024];
@@ -613,6 +655,7 @@ synchronized long replaceBytes (byte [] buf, long stPos, long endPos)
tmpFile.write (tmpByte, 0, rdLen);
}while (true);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3889
releaseTempFile(oldFile);
}
updateCount++;
@@ -633,6 +676,7 @@ long getUpdateCount() {
* can't call this entry point.
*/
private static Object findServiceModule( final Object serviceModule, final String factoryInterface)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
throws StandardException
{
try {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/PositionedStoreStream.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/PositionedStoreStream.java
index 6a7eb9098b..f30aeab6dc 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/PositionedStoreStream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/PositionedStoreStream.java
@@ -59,6 +59,7 @@ Licensed to the Apache Software Foundation (ASF) under one
public class PositionedStoreStream
extends InputStream
implements PositionedStream, Resetable {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3935
/** Underlying store stream serving bytes. */
//@GuardedBy("EmbedConnection.getConnectionSynchronization()")
@@ -83,6 +84,7 @@ public class PositionedStoreStream
* @param in a {@link Resetable}-stream
*/
public PositionedStoreStream(InputStream in)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3970
throws IOException, StandardException {
this.stream = in;
// We need to know the stream is in a consistent state.
@@ -100,6 +102,7 @@ public PositionedStoreStream(InputStream in)
*/
public int read(byte[] b)
throws IOException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3735
return read(b, 0, b.length);
}
@@ -114,6 +117,7 @@ public int read(byte[] b)
public int read(byte[] b, int off, int len)
throws IOException {
int ret = this.stream.read(b, off, len);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3735
if (ret > -1) {
this.pos += ret;
}
@@ -129,6 +133,7 @@ public int read(byte[] b, int off, int len)
public int read()
throws IOException {
int ret = this.stream.read();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3735
if (ret > -1) {
this.pos++;
}
@@ -157,6 +162,7 @@ public long skip(long toSkip)
*/
public void resetStream()
throws IOException, StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3781
((Resetable)this.stream).resetStream();
this.pos = 0L;
}
@@ -169,6 +175,7 @@ public void resetStream()
*/
public void initStream()
throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3781
((Resetable)this.stream).initStream();
}
@@ -178,6 +185,7 @@ public void initStream()
* @see Resetable#closeStream
*/
public void closeStream() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3781
((Resetable)this.stream).closeStream();
}
@@ -202,17 +210,20 @@ public void closeStream() {
*/
public void reposition(final long requestedPos)
throws IOException, StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3935
if (SanityManager.DEBUG) {
if (requestedPos < 0) {
SanityManager.THROWASSERT("Negative position: " + requestedPos);
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3781
if (this.pos > requestedPos) {
// Reset stream to reposition from start.
resetStream();
}
if (this.pos < requestedPos) {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3770
InputStreamUtil.skipFully(stream, requestedPos - pos);
} catch (EOFException eofe) {
// A position after the end of the stream was requested.
@@ -235,6 +246,7 @@ public long getPosition() {
}
public InputStream asInputStream() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3935
return this;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/ResourceAdapterImpl.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/ResourceAdapterImpl.java
index 0357c28bbd..e3fbe80a9c 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/ResourceAdapterImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/ResourceAdapterImpl.java
@@ -67,9 +67,11 @@ public void boot(boolean create, Properties properties)
// loaded.
connectionTable = new Hashtable();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
AccessFactory af =
(AccessFactory)findServiceModule(this, AccessFactory.MODULE);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
rm = (XAResourceManager) af.getXAResourceManager();
@@ -80,6 +82,7 @@ public void stop()
{
active = false;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
for (Enumeration e = connectionTable.elements();
e.hasMoreElements(); ) {
@@ -115,6 +118,7 @@ public synchronized boolean addConnection(XAXactId xid, Object conn) {
// put this into the transaction table, if the xid is already
// present as an in-doubt transaction, we need to remove it from
// the run time list
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
connectionTable.put(xid, (XATransactionState) conn);
return true;
}
@@ -128,6 +132,7 @@ public synchronized Object removeConnection(XAXactId xid) {
/** @see org.apache.derby.iapi.jdbc.ResourceAdapter#cancelXATransaction(XAXactId, String)
*/
public void cancelXATransaction(XAXactId xid, String messageId)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2871
throws XAException
{
XATransactionState xaState = (XATransactionState) findConnection(xid);
@@ -150,6 +155,7 @@ public XAResourceManager getXAResourceManager()
* can't call this entry point.
*/
private static Object findServiceModule( final Object serviceModule, final String factoryInterface)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
throws StandardException
{
try {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/SQLExceptionFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/SQLExceptionFactory.java
index fc967c255d..d66b1fe22d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/SQLExceptionFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/SQLExceptionFactory.java
@@ -71,6 +71,7 @@ public SQLException getSQLException(String message, String messageId,
// Create dummy exception which ferries arguments needed to serialize
// SQLExceptions across the DRDA network layer.
//
+//IC see: https://issues.apache.org/jira/browse/DERBY-6488
StandardException ferry =
wrapArgsForTransportAcrossDRDA(messageId, t, args);
@@ -136,8 +137,10 @@ else if (sqlState.startsWith(SQLState.TRANSACTION_PREFIX)) {
@Override
public final SQLException getSQLException(String messageId,
SQLException next, Throwable cause, Object... args) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6262
String message = MessageService.getTextMessage(messageId, args);
int severity = StandardException.getSeverityFromIdentifier(messageId);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
return getSQLException(message, messageId, next, severity, cause, args);
}
@@ -155,6 +158,7 @@ public final SQLException getSQLException(String messageId,
*/
private StandardException wrapArgsForTransportAcrossDRDA(
String messageId, Throwable cause, Object[] args) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6488
// If the cause is a StandardException with the same message id, we
// already have what we need. Just return that exception.
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/StoreStreamClob.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/StoreStreamClob.java
index 4d56326b40..7b0d7681cf 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/StoreStreamClob.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/StoreStreamClob.java
@@ -96,6 +96,7 @@ final class StoreStreamClob
* @param conChild the connection (child) this Clob belongs to
*/
public StoreStreamClob(CharacterStreamDescriptor csd,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
ConnectionChild conChild)
throws StandardException {
if (SanityManager.DEBUG) {
@@ -103,6 +104,7 @@ public StoreStreamClob(CharacterStreamDescriptor csd,
// supposed to be a position aware stream already!
SanityManager.ASSERT(!csd.isPositionAware());
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3970
try {
this.positionedStoreStream =
new PositionedStoreStream(csd.getStream());
@@ -119,6 +121,7 @@ public StoreStreamClob(CharacterStreamDescriptor csd,
}
this.conChild = conChild;
this.synchronizationObject = conChild.getConnectionSynchronization();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
if (SanityManager.DEBUG) {
// Creating the positioned stream should reset the stream.
SanityManager.ASSERT(positionedStoreStream.getPosition() == 0);
@@ -136,6 +139,7 @@ public StoreStreamClob(CharacterStreamDescriptor csd,
*/
public void release() {
if (!released) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3825
if (this.internalReader != null) {
this.internalReader.close();
}
@@ -154,6 +158,7 @@ public void release() {
public long getCharLength()
throws SQLException {
checkIfValid();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
if (this.csd.getCharLength() == 0) {
// Decode the stream to find the length.
long charLength = 0;
@@ -165,12 +170,14 @@ public long getCharLength()
} catch (Throwable t) {
throw noStateChangeLOB(t);
} finally {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5055
ConnectionChild.restoreIntrFlagIfSeen(
true, conChild.getEmbedConnection());
conChild.restoreContextStack();
}
}
// Update the stream descriptor.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
this.csd = new CharacterStreamDescriptor.Builder().
copyState(this.csd).charLength(charLength).build();
}
@@ -183,6 +190,7 @@ public long getCharLength()
* @return The number of characters in the Clob, or {@code -1} if unknown.
*/
public long getCharLengthIfKnown() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4241
checkIfValid();
// Treat a cached value of zero as a special case.
return (csd.getCharLength() == 0 ? -1 : csd.getCharLength());
@@ -205,6 +213,7 @@ public InputStream getRawByteStream()
checkIfValid();
try {
// Skip the encoded length.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
this.positionedStoreStream.reposition(this.csd.getDataOffset());
} catch (StandardException se) {
throw Util.generateCsSQLException(se);
@@ -257,6 +266,7 @@ public Reader getReader(long pos)
* @throws SQLException if accessing the store resources fail
*/
public Reader getInternalReader(long characterPosition)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3825
throws IOException, SQLException {
if (this.internalReader == null) {
if (positionedStoreStream.getPosition() != 0) {
@@ -292,6 +302,7 @@ public void close() {
* @return Zero (read-only Clob).
*/
public long getUpdateCount() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
return 0L;
}
@@ -321,6 +332,7 @@ public long insertString(String str, long pos) {
* @return {@code true} if released, {@code false} if not.
*/
public boolean isReleased() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
return released;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/TemporaryClob.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/TemporaryClob.java
index 7f54691d50..ab3707e234 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/TemporaryClob.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/TemporaryClob.java
@@ -42,6 +42,7 @@ Licensed to the Apache Software Foundation (ASF) under one
* 1-based. Byte positions are always 0-based.
*/
final class TemporaryClob implements InternalClob {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2827
/**
* Connection child assoicated with this Clob.
@@ -113,6 +114,7 @@ static InternalClob cloneClobContent(String dbName,
* @throws SQLException if accessing underlying resources fail
*/
static InternalClob cloneClobContent(String dbName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2800
ConnectionChild conChild,
InternalClob clob,
long length)
@@ -131,6 +133,7 @@ static InternalClob cloneClobContent(String dbName,
* null
*/
TemporaryClob (ConnectionChild conChild) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2646
if (conChild == null) {
throw new NullPointerException("conChild cannot be ");
}
@@ -179,12 +182,14 @@ public synchronized InputStream getRawByteStream()
* @param conChild connection object used to obtain synchronization object
*/
TemporaryClob (String data, ConnectionChild conChild)
+//IC see: https://issues.apache.org/jira/browse/DERBY-5760
throws IOException, StandardException {
if (conChild == null) {
throw new NullPointerException("conChild cannot be ");
}
this.conChild = conChild;
bytes = new LOBStreamControl(conChild.getEmbedConnection(), getByteFromString (data));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4023
this.cachedCharLength = data.length();
}
/**
@@ -201,6 +206,7 @@ public synchronized InputStream getRawByteStream()
*/
//@GuardedBy(this)
private long getBytePosition (final long charPos)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2646
throws IOException {
long bytePos;
if (charPos == this.posCache.getCharPos()) {
@@ -230,6 +236,7 @@ private long getBytePosition (final long charPos)
* @return Update count.
*/
public long getUpdateCount() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
return bytes.getUpdateCount();
}
@@ -243,6 +250,7 @@ public long getUpdateCount() {
*/
public synchronized Writer getWriter (long pos)
throws IOException, SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2646
checkIfValid();
// If pos is too large, an error will first be thrown when the writer
// is written to. Is this okay behavior, is does it break the spec?
@@ -271,6 +279,7 @@ public synchronized Reader getReader (long pos)
}
// getCSD obtains a descriptor for the stream to allow the reader
// to configure itself.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
Reader isr = new UTF8Reader(getCSD(), conChild,
conChild.getConnectionSynchronization());
@@ -293,6 +302,7 @@ public synchronized Reader getReader (long pos)
*/
public Reader getInternalReader(long characterPosition)
throws IOException, SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
if (this.internalReader == null) {
// getCSD obtains a descriptor for the stream to allow the reader
// to configure itself.
@@ -322,6 +332,7 @@ public void close() {
*/
public synchronized long getCharLength() throws IOException {
checkIfValid();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
if (cachedCharLength == 0) {
cachedCharLength = UTF8Util.skipUntilEOF(
new BufferedInputStream(getRawByteStream()));
@@ -335,6 +346,7 @@ public synchronized long getCharLength() throws IOException {
* @return The number of characters in the Clob, or {@code -1} if unknown.
*/
public synchronized long getCharLengthIfKnown() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4241
checkIfValid();
// Treat a cached value of zero as a special case.
return (cachedCharLength == 0 ? -1 : cachedCharLength);
@@ -368,6 +380,7 @@ public synchronized long insertString (String str, long insertionPoint)
throw new IllegalArgumentException(
"Position must be positive: " + insertionPoint);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
long prevLength = cachedCharLength;
updateInternalState(insertionPoint);
long byteInsertionPoint = getBytePosition(insertionPoint);
@@ -401,6 +414,7 @@ public synchronized long insertString (String str, long insertionPoint)
throw Util.generateCsSQLException(se);
}
// Update the length if we know the previous length.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
if (prevLength != 0) {
long newLength = (insertionPoint -1) + str.length();
if (newLength > prevLength) {
@@ -420,6 +434,7 @@ public synchronized long insertString (String str, long insertionPoint)
* @return {@code true} if released, {@code false} if not.
*/
public synchronized boolean isReleased() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
return released;
}
@@ -447,6 +462,7 @@ public synchronized void truncate(long newCharLength)
new BufferedInputStream(getRawByteStream()), newCharLength);
this.bytes.truncate(byteLength);
// Reset the internal state, and then update the length.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
updateInternalState(newCharLength);
cachedCharLength = newCharLength;
} catch (StandardException se) {
@@ -495,6 +511,7 @@ else if (c > 0x07FF) {
private void copyClobContent(InternalClob clob)
throws IOException, SQLException {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4241
long knownLength = clob.getCharLengthIfKnown();
if (knownLength == -1) {
// Decode UTF-8 data and copy until EOF, obtain char length.
@@ -523,8 +540,11 @@ private void copyClobContent(InternalClob clob)
* @throws SQLException if accessing underlying resources fail
*/
private void copyClobContent(InternalClob clob, long charLength)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2646
+//IC see: https://issues.apache.org/jira/browse/DERBY-2800
throws IOException, SQLException {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4241
long knownLength = clob.getCharLengthIfKnown();
if (knownLength > charLength || knownLength == -1) {
// Decode and copy the requested number of chars.
@@ -534,6 +554,7 @@ private void copyClobContent(InternalClob clob, long charLength)
this.cachedCharLength = knownLength;
// Copy raw bytes until EOF.
// Special case optimization, avoids UTF-8 decoding.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3793
this.bytes.copyData(clob.getRawByteStream(), Long.MAX_VALUE);
} else {
// The known length must be smaller than the requested length.
@@ -570,6 +591,8 @@ private final void checkIfValid() {
*/
private final void updateInternalState(long charChangePosition) {
// Discard the internal reader, don't want to deliver stale data.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
if (internalReader != null) {
internalReader.close();
internalReader = null;
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java
index cce450b4bd..8249b582e9 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java
@@ -154,6 +154,7 @@ public final class TransactionResourceImpl
// interface is used. Thus, we look there first.
// Default to APP.
username = IdUtil.getUserNameFromURLProps(info);
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
drdaID = info.getProperty(Attribute.DRDAID_ATTR, null);
@@ -240,6 +241,7 @@ StandardException shutdownDatabaseException() {
* XAResource, which uses the xa_commit or xa_rollback interface as a
* safeguard.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
void commit() throws StandardException
{
lcc.userCommit();
@@ -268,6 +270,7 @@ void clearContextInError()
/**
* Resolve: probably superfluous
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
void clearLcc()
{
lcc = null;
@@ -283,6 +286,7 @@ final void setupContextStack()
}
final void restoreContextStack() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
if ((csf == null) || (cm == null))
return;
@@ -296,6 +300,7 @@ final void restoreContextStack() {
/**
* clean up the error and wrap the real exception in some SQLException.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
final SQLException handleException(Throwable thrownException,
boolean autoCommit,
boolean rollbackOnAutoCommit)
@@ -356,8 +361,11 @@ final SQLException handleException(Throwable thrownException,
}
InterruptStatus.restoreIntrFlagIfSeen();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
return wrapInSQLException(thrownException);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1440
+//IC see: https://issues.apache.org/jira/browse/DERBY-2472
} catch (Throwable t) {
@@ -366,6 +374,8 @@ final SQLException handleException(Throwable thrownException,
}
InterruptStatus.restoreIntrFlagIfSeen();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
/*
We'd rather throw the Throwable,
@@ -373,6 +383,8 @@ final SQLException handleException(Throwable thrownException,
We assume if we are in this degenerate
case that it is actually a java exception
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1440
+//IC see: https://issues.apache.org/jira/browse/DERBY-2472
throw wrapInSQLException(t);
//throw t;
}
@@ -391,6 +403,7 @@ final SQLException handleException(Throwable thrownException,
* @return true if this is a login failure exception
*/
private boolean isLoginException(Throwable thrownException) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6426
if ((thrownException instanceof StandardException) &&
((StandardException) thrownException).getSQLState().equals(SQLState.LOGIN_FAILED)) {
return true;
@@ -414,6 +427,7 @@ public static SQLException wrapInSQLException(Throwable thrownException) {
if (thrownException instanceof SQLException) {
// Server side JDBC can end up with a SQLException in the nested
// stack. Return the exception with no wrapper.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1440
return (SQLException) thrownException;
}
@@ -421,6 +435,7 @@ public static SQLException wrapInSQLException(Throwable thrownException) {
StandardException se = (StandardException) thrownException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5243
if (SQLState.CONN_INTERRUPT.equals(se.getSQLState())) {
Thread.currentThread().interrupt();
}
@@ -436,6 +451,7 @@ public static SQLException wrapInSQLException(Throwable thrownException) {
// chain. Therefore, call wrapInSQLException() recursively to
// convert the cause chain into a chain of SQLExceptions.
return Util.seeNextException(se.getMessageId(),
+//IC see: https://issues.apache.org/jira/browse/DERBY-6488
wrapInSQLException(se.getCause()), se.getCause(),
se.getArguments());
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/UTF8Reader.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/UTF8Reader.java
index e3143ef76f..8f0f504318 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/UTF8Reader.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/UTF8Reader.java
@@ -119,6 +119,7 @@ public UTF8Reader(CharacterStreamDescriptor csd, ConnectionChild conChild,
int buffersize = calculateBufferSize(csd);
this.buffer = new char[buffersize];
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
if (csd.isPositionAware()) {
// Check and save the stream state.
if (SanityManager.DEBUG) {
@@ -145,6 +146,7 @@ public UTF8Reader(CharacterStreamDescriptor csd, ConnectionChild conChild,
this.in = csd.getStream();
}
// Add the header portion to the utfCount.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
utfCount = csd.getDataOffset();
}
@@ -162,6 +164,7 @@ public UTF8Reader(CharacterStreamDescriptor csd, ConnectionChild conChild,
public int read() throws IOException
{
synchronized (lock) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2824
// check if closed..
if (noMoreReads)
@@ -220,16 +223,22 @@ public int read(char[] cbuf, int off, int len) throws IOException
public long skip(long len) throws IOException {
if (len < 0) {
throw new IllegalArgumentException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-2824
"Number of characters to skip must be positive: " + len);
}
synchronized (lock) {
// check if closed..
if (noMoreReads)
throw new IOException(READER_CLOSED);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2824
+//IC see: https://issues.apache.org/jira/browse/DERBY-2824
+//IC see: https://issues.apache.org/jira/browse/DERBY-2824
if (readPositionInBuffer >= charactersInBuffer) {
// do somthing
if (fillBuffer()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2868
+//IC see: https://issues.apache.org/jira/browse/DERBY-2686
return 0L;
}
}
@@ -253,6 +262,7 @@ public void close()
{
synchronized (lock) {
closeIn();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2824
parent = null;
noMoreReads = true;
}
@@ -389,6 +399,7 @@ private boolean fillBuffer() throws IOException
charactersInBuffer = 0;
readPositionInBuffer = 0;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3825
try {
try {
@@ -403,9 +414,11 @@ private boolean fillBuffer() throws IOException
}
}
// Keep track of how much we are allowed to read.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
final long utfLen = csd.getByteLength();
final long maxFieldSize = csd.getMaxCharLength();
readChars:
+//IC see: https://issues.apache.org/jira/browse/DERBY-2824
while (
(charactersInBuffer < buffer.length) &&
((utfCount < utfLen) || (utfLen == 0)) &&
@@ -416,16 +429,19 @@ private boolean fillBuffer() throws IOException
if (c == -1) {
if (utfLen == 0) {
// Close the stream if it cannot be reset.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
if (!csd.isPositionAware()) {
closeIn();
}
break readChars;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2824
throw utfFormatException("Reached EOF prematurely, " +
"read " + utfCount + " out of " + utfLen + " bytes");
}
int finalChar;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2824
switch (c >> 4) {
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
// 0xxxxxxx
@@ -439,6 +455,7 @@ private boolean fillBuffer() throws IOException
utfCount += 2;
int char2 = in.read();
if (char2 == -1)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2824
throw utfFormatException("Reached EOF when reading " +
"second byte in a two byte character encoding; " +
"byte/char position " + utfCount + "/" +
@@ -460,6 +477,7 @@ private boolean fillBuffer() throws IOException
int char2 = in.read();
int char3 = in.read();
if (char2 == -1 || char3 == -1)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2824
throw utfFormatException("Reached EOF when reading " +
"second/third byte in a three byte character " +
"encoding; byte/char position " + utfCount + "/" +
@@ -472,11 +490,13 @@ private boolean fillBuffer() throws IOException
// that was terminated with
// (11100000, 00000000, 00000000)
// Close the stream if it cannot be reset.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
if (!csd.isPositionAware()) {
closeIn();
}
break readChars;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2824
throw utfFormatException("Internal error: Derby-" +
"specific EOF marker read");
}
@@ -495,6 +515,7 @@ private boolean fillBuffer() throws IOException
default:
// 10xx xxxx, 1111 xxxx
+//IC see: https://issues.apache.org/jira/browse/DERBY-2824
throw utfFormatException("Invalid UTF encoding at " +
"byte/char position " + utfCount + "/" +
readerCharCount + ": (int)" + c);
@@ -517,15 +538,18 @@ private boolean fillBuffer() throws IOException
}
// Close the stream if it cannot be reset.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
if (!csd.isPositionAware()) {
closeIn();
}
return true;
} finally {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5055
ConnectionChild.restoreIntrFlagIfSeen(true, parent.getEmbedConnection());
parent.restoreContextStack();
}
} catch (SQLException sqle) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
throw Util.newIOException(sqle);
}
}
@@ -542,7 +566,9 @@ private boolean fillBuffer() throws IOException
private void resetUTF8Reader()
throws IOException, StandardException {
// Skip the length encoding bytes.
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
this.positionedIn.reposition(csd.getDataOffset());
+//IC see: https://issues.apache.org/jira/browse/DERBY-3907
this.utfCount = this.rawStreamPos = this.positionedIn.getPosition();
// If bufferable, discard buffered stream and create a new one.
if (csd.isBufferable()) {
@@ -574,6 +600,7 @@ void reposition(long requestedCharPos)
SanityManager.ASSERT(this.positionedIn != null);
SanityManager.ASSERT(requestedCharPos > 0);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3825
if (requestedCharPos <= readerCharCount - charactersInBuffer) {
// The stream must be reset, because the requested position is
// before the current lower buffer boundary.
@@ -606,6 +633,7 @@ private final int calculateBufferSize(CharacterStreamDescriptor csd) {
// Using the maximum buffer size will be optimal,
// unless the data is smaller than the maximum buffer.
int bufferSize = MAXIMUM_BUFFER_SIZE;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3934
long knownLength = csd.getCharLength();
long maxCharLength = csd.getMaxCharLength();
if (knownLength < 1) {
@@ -629,6 +657,7 @@ private final int calculateBufferSize(CharacterStreamDescriptor csd) {
* @throws IOException if reading from the stream fails
*/
private final void persistentSkip(long toSkip)
+//IC see: https://issues.apache.org/jira/browse/DERBY-3825
throws IOException {
long remaining = toSkip;
while (remaining > 0) {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/UpdatableBlobStream.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/UpdatableBlobStream.java
index 6b4a13dbdf..ac748fb425 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/UpdatableBlobStream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/UpdatableBlobStream.java
@@ -35,6 +35,7 @@ Licensed to the Apache Software Foundation (ASF) under one
* it will update itself to point to LOBInputStream and reflect changes made to
* the Blob after the current position of the stream.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2830
class UpdatableBlobStream extends InputStream {
/**
* Flag to check if it is using stream from LOBStreamControl or from DVD.
@@ -61,6 +62,7 @@ class UpdatableBlobStream extends InputStream {
* @param is InputStream this class is going to use internally.
* @throws IOException if an I/O error occurs
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2890
UpdatableBlobStream (EmbedBlob blob, InputStream is)
throws IOException {
// The entire Blob has been requested, hence set length to infinity (or
@@ -81,15 +83,19 @@ class UpdatableBlobStream extends InputStream {
* has to be restricted.
* @throws IOException
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2830
UpdatableBlobStream (EmbedBlob blob, InputStream is, long pos, long len)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2890
throws IOException {
this.blob = blob;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2711
stream = is;
maxPos = pos + len;
//Skip to the requested position
//inside the stream.
if (pos > 0) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2730
skip(pos);
}
}
@@ -109,8 +115,10 @@ private void updateIfRequired () throws IOException {
try {
stream = blob.getBinaryStream();
} catch (SQLException ex) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3783
throw Util.newIOException(ex);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3770
InputStreamUtil.skipFully(stream, pos);
}
}
@@ -134,10 +142,12 @@ private void updateIfRequired () throws IOException {
* @see InputStream#read
*/
public int read() throws IOException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2711
updateIfRequired();
//If the current position inside the stream has exceeded maxPos, the
//read should return -1 signifying end of stream.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2890
if (pos >= maxPos) {
return -1;
}
@@ -174,6 +184,7 @@ public int read() throws IOException {
*/
public int read(byte[] b, int off, int len) throws IOException {
updateIfRequired();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4061
long remaining = maxPos - pos;
// Return EOF if the maximum allowed position has been reached,
// and we're trying to read at least one byte.
@@ -207,6 +218,7 @@ public int read(byte[] b, int off, int len) throws IOException {
* @see java.io.InputStream#read(byte[])
*/
public int read(byte[] b) throws IOException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4061
return read(b, 0, b.length);
}
@@ -229,6 +241,7 @@ public int read(byte[] b) throws IOException {
* @see java.io.InputStream#skip(long)
*/
public long skip(long n) throws IOException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2711
updateIfRequired();
long retValue = stream.skip(n);
if (retValue > 0)
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/Util.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/Util.java
index 2f34bde65a..7620077a03 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/Util.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/Util.java
@@ -47,6 +47,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
REMIND: May want to investigate putting some of this in the protocol
side, for the errors that any Derby JDBC driver might return.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
The ASSERT mechanism is a wrapper of the basic services,
to ensure that failed asserts at this level will behave
@@ -104,6 +105,7 @@ public static void logSQLException(SQLException se) {
(message != null) && (message.equals("Connection refused : java.lang.OutOfMemoryError")))
return;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
logError( "\nERROR " + se.getSQLState() + ": " + se.getMessage() + "\n", se );
}
private static void logError( String errorMessage, Throwable t )
@@ -136,6 +138,7 @@ public static void ASSERT(EmbedConnection conn, boolean mustBeTrue, String msg)
try {
SanityManager.ASSERT(mustBeTrue, msg);
} catch (Throwable t) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6488
throw conn.handleException(t);
}
}
@@ -147,6 +150,7 @@ public static void ASSERT(EmbedConnection conn, boolean mustBeTrue, String msg)
*/
public static void checkForSupportedDataType(int dataType) throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6089
if ( !isSupportedType( dataType ) )
{
throw generateCsSQLException( SQLState.DATA_TYPE_NOT_SUPPORTED, typeName( dataType ) );
@@ -189,6 +193,7 @@ private static boolean isSupportedType(int dataType)
case Types.ARRAY:
case Types.DATALINK:
case Types.DISTINCT:
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
case Types.NCHAR:
case Types.NCLOB:
case Types.NVARCHAR:
@@ -217,6 +222,7 @@ private static boolean isSupportedType(int dataType)
public static SQLException generateCsSQLException(
String error, Object... args) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6488
return generateCsSQLException(error, null, args);
}
@@ -227,12 +233,14 @@ static SQLException generateCsSQLException(
}
public static SQLException generateCsSQLException(StandardException se) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6253
return ExceptionFactory.getInstance().getSQLException(
se.getMessage(), se.getMessageId(), (SQLException) null,
se.getSeverity(), se, se.getArguments());
}
public static SQLException noCurrentConnection() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6488
return generateCsSQLException(SQLState.NO_CURRENT_CONNECTION);
}
@@ -248,7 +256,9 @@ public static SQLException noCurrentConnection() {
* @return an SQLException wrapping another SQLException
*/
static SQLException seeNextException(String messageId, SQLException next,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6488
Throwable cause, Object... args) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6253
return ExceptionFactory.getInstance().getSQLException(
messageId, next, cause, args);
}
@@ -259,6 +269,8 @@ public static SQLException javaException(Throwable t) {
msg = t.getMessage();
if (msg == null) msg = "";
name = t.getClass().getName();
+//IC see: https://issues.apache.org/jira/browse/DERBY-1440
+//IC see: https://issues.apache.org/jira/browse/DERBY-2472
SQLException next = null;
Throwable cause = t.getCause();
if (cause != null) {
@@ -271,9 +283,11 @@ public static SQLException javaException(Throwable t) {
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6488
SQLException result = seeNextException(
SQLState.JAVA_EXCEPTION, next, t, name, msg);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6346
if ( result.getErrorCode() >= logSeverityLevel ) { logSQLException( result ); }
return result;
@@ -281,16 +295,19 @@ public static SQLException javaException(Throwable t) {
public static SQLException policyNotReloaded( Throwable t ) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6488
return generateCsSQLException(
SQLState.POLICY_NOT_RELOADED, t, t.getMessage());
}
public static SQLException notImplemented() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-955
return notImplemented( MessageService.getTextMessage(MessageId.CONN_NO_DETAILS) );
}
public static SQLException notImplemented(String feature) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6488
return generateCsSQLException(SQLState.NOT_IMPLEMENTED, feature);
}
@@ -300,10 +317,12 @@ static SQLException setStreamFailure(IOException e) {
msg = e.getMessage();
if (msg == null)
msg = e.getClass().getName();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6262
return generateCsSQLException(SQLState.SET_STREAM_FAILURE, e, msg);
}
static SQLException typeMisMatch(int targetSQLType) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6488
return generateCsSQLException(
SQLState.TYPE_MISMATCH, typeName(targetSQLType));
}
@@ -325,6 +344,7 @@ public static int[] squashLongs( long[] longs )
* @return an {@code IOException} linked to {@code cause}
*/
static IOException newIOException(Throwable cause) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6253
return new IOException(cause);
}
@@ -332,12 +352,15 @@ public static String typeName(int jdbcType) {
switch (jdbcType) {
case Types.ARRAY: return TypeId.ARRAY_NAME;
case Types.BIT : return TypeId.BIT_NAME;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
case Types.BOOLEAN : return TypeId.BOOLEAN_NAME;
case Types.DATALINK: return TypeId.DATALINK_NAME;
case Types.TINYINT : return TypeId.TINYINT_NAME;
case Types.SMALLINT : return TypeId.SMALLINT_NAME;
case Types.INTEGER : return TypeId.INTEGER_NAME;
case Types.BIGINT : return TypeId.BIGINT_NAME;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
case Types.FLOAT : return TypeId.FLOAT_NAME;
case Types.REAL : return TypeId.REAL_NAME;
@@ -363,7 +386,9 @@ public static String typeName(int jdbcType) {
case Types.OTHER : return "OTHER";
case Types.JAVA_OBJECT : return "Types.JAVA_OBJECT";
case Types.REF : return TypeId.REF_NAME;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6000
case JDBC40Translation.REF_CURSOR: return TypeId.REF_CURSOR;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
case Types.ROWID: return TypeId.ROWID_NAME;
case Types.STRUCT: return TypeId.STRUCT_NAME;
case StoredFormatIds.XML_TYPE_ID : return TypeId.XML_NAME;
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/Util42.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/Util42.java
index e99b038db4..b048effb9b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/Util42.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/Util42.java
@@ -48,6 +48,7 @@ public static int getTypeAsInt( SQLType sqlType )
{
int jdbcType = ((JDBCType) sqlType).getVendorTypeNumber();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6089
Util.checkForSupportedDataType( jdbcType );
return jdbcType;
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/XAStatementControl.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/XAStatementControl.java
index 7afde0aad6..9a410702de 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/XAStatementControl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/XAStatementControl.java
@@ -56,6 +56,7 @@ private XAStatementControl(EmbedXAConnection xaConnection) {
this.applicationConnection = xaConnection.currentConnectionHandle;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-1163
XAStatementControl(EmbedXAConnection xaConnection,
Statement realStatement) throws SQLException {
this(xaConnection);
@@ -65,6 +66,7 @@ private XAStatementControl(EmbedXAConnection xaConnection) {
((EmbedStatement) realStatement).setApplicationStatement(
applicationStatement);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-1163
XAStatementControl(EmbedXAConnection xaConnection,
PreparedStatement realPreparedStatement,
String sql, Object generatedKeys) throws SQLException {
@@ -74,6 +76,7 @@ private XAStatementControl(EmbedXAConnection xaConnection) {
((EmbedStatement) realPreparedStatement).setApplicationStatement(
applicationStatement);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-1163
XAStatementControl(EmbedXAConnection xaConnection,
CallableStatement realCallableStatement,
String sql) throws SQLException {
@@ -88,6 +91,8 @@ private XAStatementControl(EmbedXAConnection xaConnection) {
* Close the realStatement within this control.
*/
public void closeRealStatement() throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4310
+//IC see: https://issues.apache.org/jira/browse/DERBY-4155
realStatement.close();
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/XATransactionState.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/XATransactionState.java
index a9e23bb7b7..6461c880ad 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/XATransactionState.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/XATransactionState.java
@@ -46,8 +46,10 @@ Licensed to the Apache Software Foundation (ASF) under one or more
/**
*/
final class XATransactionState extends ContextImpl {
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
/** Rollback-only due to timeout */
+//IC see: https://issues.apache.org/jira/browse/DERBY-2432
final static int TRO_TIMEOUT = -3;
/** Rollback-only due to deadlock */
final static int TRO_DEADLOCK = -2;
@@ -58,7 +60,9 @@ final class XATransactionState extends ContextImpl {
// final static int T2_ASSOCIATION_SUSPENDED = 2;
final static int TC_COMPLETED = 3; // rollback/commit called
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
final EmbedConnection conn;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1155
final EmbedXAResource creatingResource;
// owning XAResource
private EmbedXAResource associatedResource;
@@ -117,6 +121,7 @@ private synchronized boolean okToCleanup() {
/**
When an XAResource suspends a transaction (end(TMSUSPEND)) it must be resumed
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
using the same XAConnection. This has been the traditional Cloudscape/Derby behaviour,
though there does not seem to be a specific reference to this behaviour in
the JTA spec. Note that while the transaction is suspended by this XAResource,
@@ -124,6 +129,7 @@ When an XAResource suspends a transaction (end(TMSUSPEND)) it must be resumed
*/
HashMap suspendedList;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
/**
Association state of the transaction.
@@ -156,6 +162,7 @@ private static class CancelXATransactionTask extends TimerTask {
* @param xaState the XA state object for the transaction to cancel
*/
public CancelXATransactionTask(XATransactionState xaState) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4137
this.xaState = xaState;
}
@@ -178,9 +185,11 @@ public synchronized void run() {
}
private static TimerFactory getTimerFactory() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return getMonitor().getTimerFactory();
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-1155
XATransactionState(ContextManager cm, EmbedConnection conn,
EmbedXAResource resource, XAXactId xid) {
@@ -190,6 +199,7 @@ private static TimerFactory getTimerFactory() {
this.creatingResource = resource;
this.associationState = XATransactionState.T1_ASSOCIATED;
this.xid = xid;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2871
this.performTimeoutRollback = false; // there is no transaction yet
}
@@ -200,6 +210,7 @@ public void cleanupOnError(Throwable t) {
StandardException se = (StandardException) t;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1095
if (se.getSeverity() >= ExceptionSeverity.SESSION_SEVERITY) {
popMe();
return;
@@ -226,6 +237,7 @@ else if (se.isLockTimeout())
}
void start(EmbedXAResource resource, int flags) throws XAException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1155
synchronized (this) {
if (associationState == XATransactionState.TRO_FAIL)
@@ -257,6 +269,7 @@ void start(EmbedXAResource resource, int flags) throws XAException {
case XATransactionState.T0_NOT_ASSOCIATED:
break;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2432
case XATransactionState.TRO_DEADLOCK:
case XATransactionState.TRO_TIMEOUT:
case XATransactionState.TRO_FAIL:
@@ -353,6 +366,7 @@ boolean end(EmbedXAResource resource, int flags,
if (resource != associatedResource)
throw new XAException(XAException.XAER_PROTO);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
if (suspendedList == null) {
suspendedList =
new HashMap();
@@ -384,8 +398,10 @@ boolean end(EmbedXAResource resource, int flags,
* @param timeoutMillis The number of milliseconds to be elapsed before
* the transaction will be rolled back.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2432
synchronized void scheduleTimeoutTask(long timeoutMillis) {
// Mark the transaction to be rolled back bby timeout
+//IC see: https://issues.apache.org/jira/browse/DERBY-2871
performTimeoutRollback = true;
// schedule a time out task if the timeout was specified
if (timeoutMillis > 0) {
@@ -424,6 +440,7 @@ synchronized int xa_prepare() throws SQLException {
try {
retVal = conn.xa_prepare();
} catch (SQLException e) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
if (ExceptionUtil.isDeferredConstraintViolation(e.getSQLState())) {
// we are rolling back
xa_finalize();
@@ -448,8 +465,10 @@ synchronized int xa_prepare() throws SQLException {
private void xa_finalize() {
if (timeoutTask != null) {
getTimerFactory().cancel(timeoutTask);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4137
timeoutTask = null;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2871
performTimeoutRollback = false;
}
@@ -474,6 +493,7 @@ void cancel(String messageId) throws XAException {
// just before the xa_commit/rollback
// obtained this object's monitor.
if (performTimeoutRollback) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2871
// Log the message about the transaction cancelled
if (messageId != null)
@@ -509,6 +529,7 @@ void cancel(String messageId) throws XAException {
*/
private static ModuleFactory getMonitor()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/BasicAuthenticationServiceImpl.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/BasicAuthenticationServiceImpl.java
index 56d415e7f4..c393886cb6 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/BasicAuthenticationServiceImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/BasicAuthenticationServiceImpl.java
@@ -81,6 +81,7 @@ public boolean canSupport(Properties properties) {
String authenticationProvider = PropertyUtil.getPropertyFromSet(
properties,
org.apache.derby.shared.common.reference.Property.AUTHENTICATION_PROVIDER_PARAMETER);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
if ( (authenticationProvider != null) &&
(authenticationProvider.length() != 0) &&
@@ -185,6 +186,7 @@ public boolean authenticateUser(String userName,
// be retrieved at the datbase level only).
//
String userNameProperty =
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
org.apache.derby.shared.common.reference.Property.USER_PROPERTY_PREFIX.concat(
userName);
@@ -197,6 +199,7 @@ public boolean authenticateUser(String userName,
{
// hash passed-in password
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5693
passedUserPassword = hashPasswordUsingStoredAlgorithm(
userName, userPassword, definedUserPassword);
} catch (StandardException se) {
@@ -235,6 +238,7 @@ public boolean authenticateUser(String userName,
try {
Properties props = getDatabaseProperties();
if (props != null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5693
hashUsingDefaultAlgorithm(
userName, userPassword, props);
}
@@ -293,6 +297,7 @@ private String hashPasswordUsingStoredAlgorithm(
throws StandardException
{
if (storedPassword.startsWith( PasswordHasher.ID_PATTERN_SHA1_SCHEME )) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5693
return hashPasswordSHA1Scheme(password);
}
else
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationSchemeBase.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationSchemeBase.java
index 8bed29f533..d237a24338 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationSchemeBase.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationSchemeBase.java
@@ -103,6 +103,7 @@ private void setInitDirContextEnv(Properties dbProps) {
//
initDirContextEnv = new Properties();
+//IC see: https://issues.apache.org/jira/browse/DERBY-1174
if(dbProps != null) {
for (Enumeration keys = dbProps.propertyNames(); keys.hasMoreElements(); ) {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationService.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationService.java
index a37ae165b7..35d77aa279 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationService.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationService.java
@@ -80,6 +80,7 @@ public boolean canSupport(Properties properties) {
authenticationProvider = PropertyUtil.getPropertyFromSet(
properties,
org.apache.derby.shared.common.reference.Property.AUTHENTICATION_PROVIDER_PARAMETER);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
if ( (authenticationProvider != null) &&
(StringUtil.SQLEqualsIgnoreCase(authenticationProvider,
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/LDAPAuthenticationSchemeImpl.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/LDAPAuthenticationSchemeImpl.java
index 9aa95c6d0a..d9d8bef9b4 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/LDAPAuthenticationSchemeImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/LDAPAuthenticationSchemeImpl.java
@@ -146,6 +146,7 @@ public boolean authenticateUser(String userName,
userDN =
authenticationService.getProperty(
org.apache.derby.shared.common.reference.Property.USER_PROPERTY_PREFIX);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
if (userDN == (String) null) {
userDN = getDNFromUID(userName);
@@ -167,6 +168,7 @@ public boolean authenticateUser(String userName,
// it is happening right here
+//IC see: https://issues.apache.org/jira/browse/DERBY-857
DirContext ctx = privInitialDirContext(env);
@@ -197,6 +199,7 @@ public boolean authenticateUser(String userName,
*/
private DirContext privInitialDirContext(final Properties env) throws NamingException {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
return AccessController.doPrivileged(
new PrivilegedExceptionAction() {
public DirContext run() throws NamingException {
@@ -233,6 +236,7 @@ protected void setJNDIProviderProperties()
//
String ldapServer = authenticationService.getProperty(
org.apache.derby.shared.common.reference.Property.AUTHENTICATION_SERVER_PARAMETER);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
if (ldapServer == (String) null) {
@@ -245,6 +249,7 @@ protected void setJNDIProviderProperties()
} else {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1000
if (ldapServer.startsWith(dfltLDAPURL) || ldapServer.startsWith("ldaps://") )
this.providerURL = ldapServer;
else if (ldapServer.startsWith("//"))
@@ -368,6 +373,7 @@ else if (ldapServer.startsWith("//"))
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
if (SanityManager.DEBUG &&
SanityManager.DEBUG_ON(
AuthenticationServiceBase.AuthenticationTrace)) {
@@ -427,6 +433,7 @@ private String getDNFromUID(String uid)
env = initDirContextEnv;
DirContext ctx = privInitialDirContext(env);
+//IC see: https://issues.apache.org/jira/browse/DERBY-857
// Construct Search Filter
SearchControls ctls = new SearchControls();
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/NativeAuthenticationServiceImpl.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/NativeAuthenticationServiceImpl.java
index 9027c7461e..179f92da13 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/NativeAuthenticationServiceImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/NativeAuthenticationServiceImpl.java
@@ -208,6 +208,7 @@ private boolean validAuthenticationProvider()
if ( _credentialsDB != null )
{
// make sure that it is a well-formed database name
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( getMonitor().getCanonicalServiceName( _credentialsDB ) == null )
{
throw StandardException.newException( SQLState.BAD_CREDENTIALS_DB_NAME, _credentialsDB );
@@ -342,6 +343,7 @@ public void boot(boolean create, Properties properties)
private boolean authenticatingInThisDatabase( String userVisibleDatabaseName )
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return authenticatingInThisService( getMonitor().getCanonicalServiceName( userVisibleDatabaseName ) );
}
@@ -368,6 +370,7 @@ private boolean isCredentialsService( String canonicalDatabaseName )
String canonicalCredentialsDBName = getCanonicalServiceName( _credentialsDB );
String canonicalDB = getMonitor().getCanonicalServiceName( canonicalDatabaseName );
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( canonicalCredentialsDBName == null ) { return false; }
else { return canonicalCredentialsDBName.equals( canonicalDatabaseName ); }
@@ -384,6 +387,7 @@ private String getCanonicalServiceName()
private String getCanonicalServiceName( String rawName )
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return getMonitor().getCanonicalServiceName( rawName );
}
@@ -420,12 +424,14 @@ private String getCanonicalServiceName( String rawName )
SQLWarning warnings = null;
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5607
Properties properties = new Properties();
properties.setProperty( Attribute.USERNAME_ATTR, userName );
properties.setProperty( Attribute.PASSWORD_ATTR, userPassword );
String connectionURL = Attribute.PROTOCOL + _credentialsDB;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6094
Connection conn = InternalDriver.activeDriver().connect( connectionURL, properties, 0 );
warnings = conn.getWarnings();
@@ -496,6 +502,7 @@ else if ( SQLState.DATABASE_NOT_FOUND.startsWith( sqlState ) )
//
// we expect to find a data dictionary
//
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
DataDictionary dd = (DataDictionary) AuthenticationServiceBase.getServiceModule( this, DataDictionary.MODULE );
UserDescriptor userDescriptor = dd.getUser( userName );
@@ -555,6 +562,7 @@ else if ( SQLState.DATABASE_NOT_FOUND.startsWith( sqlState ) )
if ( remainingLifetime <= expirationThreshold )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5647
if ( dd.getAuthorizationDatabaseOwner().equals( userName ) )
{
throw SQLWarningFactory.newSQLWarning( SQLState.DBO_PASSWORD_EXPIRES_SOON, databaseName );
@@ -575,6 +583,7 @@ else if ( SQLState.DATABASE_NOT_FOUND.startsWith( sqlState ) )
*/
private static ModuleFactory getMonitor()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/SpecificAuthenticationServiceImpl.java b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/SpecificAuthenticationServiceImpl.java
index a951fbf5b1..7d6231ae40 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/SpecificAuthenticationServiceImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/jdbc/authentication/SpecificAuthenticationServiceImpl.java
@@ -76,6 +76,7 @@ public boolean canSupport(Properties properties) {
specificAuthenticationScheme = PropertyUtil.getPropertyFromSet(
properties,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
org.apache.derby.shared.common.reference.Property.AUTHENTICATION_PROVIDER_PARAMETER);
if (
((specificAuthenticationScheme != null) &&
@@ -116,6 +117,7 @@ public void boot(boolean create, Properties properties)
Throwable t;
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Class> sasClass = Class.forName(specificAuthenticationScheme);
if (!UserAuthenticator.class.isAssignableFrom(sasClass)) {
throw StandardException.newException(SQLState.AUTHENTICATION_NOT_IMPLEMENTED,
@@ -137,12 +139,14 @@ public void boot(boolean create, Properties properties)
t = ie;
} catch (IllegalAccessException iae) {
t = iae;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
} catch (NoSuchMethodException nsme) {
t = nsme;
} catch (java.lang.reflect.InvocationTargetException ite) {
t = ite;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-5741
String detail = t.getClass().getName() + ": " + t.getMessage();
throw StandardException.newException
( SQLState.AUTHENTICATION_SCHEME_ERROR, specificAuthenticationScheme, detail );
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/load/ColumnInfo.java b/java/org.apache.derby.engine/org/apache/derby/impl/load/ColumnInfo.java
index 5dada6fefa..5733dfb2c0 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/load/ColumnInfo.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/load/ColumnInfo.java
@@ -76,11 +76,14 @@ public ColumnInfo(Connection conn,
String tName,
String insertColumnList,
String vtiColumnIndexes,
+//IC see: https://issues.apache.org/jira/browse/DERBY-4555
+//IC see: https://issues.apache.org/jira/browse/DERBY-6894
String vtiColumnPrefix,
String[] headerColumnNames)
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
vtiColumnNames = new ArrayList(1);
insertColumnNames = new ArrayList(1);
columnTypes = new ArrayList(1);
@@ -88,6 +91,8 @@ public ColumnInfo(Connection conn,
udtClassNames = new HashMap();
noOfColumns = 0;
this.conn = conn;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4555
+//IC see: https://issues.apache.org/jira/browse/DERBY-6894
this.headerColumnNames=headerColumnNames;
if (sName == null) {
// Use the current schema if no schema is specified.
@@ -138,6 +143,8 @@ public ColumnInfo(Connection conn,
while (st.hasMoreTokens())
{
int cIndex;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4555
+//IC see: https://issues.apache.org/jira/browse/DERBY-6894
String columnIndex = (st.nextToken()).trim();
if("\"".equals(columnIndex.substring(0,1))){
@@ -170,6 +177,8 @@ public ColumnInfo(Connection conn,
//Check for matchng patterns of column names
private int readHeaders(String columnPattern)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4555
+//IC see: https://issues.apache.org/jira/browse/DERBY-6894
throws SQLException
{
if(headerColumnNames!=null){
@@ -226,9 +235,11 @@ private boolean initializeColumnInfo(String columnPattern)
insertColumnNames.add(columnName);
String sqlType = typeName + getTypeOption(typeName , columnSize , columnSize , decimalDigits);
columnTypes.add(sqlType);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
jdbcColumnTypes.add((int) dataType);
noOfColumns++;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
if ( dataType == java.sql.Types.JAVA_OBJECT )
{
udtClassNames.put( "COLUMN" + noOfColumns, getUDTClassName( dmd, typeName ) );
@@ -248,6 +259,7 @@ private boolean initializeColumnInfo(String columnPattern)
// look up the class name of a UDT
private String getUDTClassName( DatabaseMetaData dmd, String sqlTypeName )
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws SQLException
{
String className = null;
@@ -270,6 +282,7 @@ private String getUDTClassName( DatabaseMetaData dmd, String sqlTypeName )
rs.close();
}
catch (Exception e) { throw LoadError.unexpectedError( e ); }
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
if ( className == null ) { className = "???"; }
@@ -282,6 +295,7 @@ public static final boolean importExportSupportedType(int type){
return !(type == java.sql.Types.BIT ||
type == java.sql.Types.OTHER ||
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
type == Types.SQLXML );
}
@@ -325,6 +339,7 @@ else if(precision == 0 && scale!=0)
* Get the column type names.
*/
public String getColumnTypeNames()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws Exception
{
// we use the object serializer logic
@@ -461,6 +476,7 @@ private boolean tableExists() throws SQLException
*/
public String getExpectedVtiColumnTypesAsString() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
StringBuffer vtiColumnTypes = new StringBuffer();
// expected types of data in the import file, based on
// the how columns in the data file are mapped to
@@ -550,9 +566,11 @@ public static int[] getExpectedVtiColumnTypes(String columnTypesStr,
* @see getColumnTypeNames()
*/
public static String[] getExpectedColumnTypeNames
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
( String columnTypeNamesString, int noOfColumns )
throws Exception
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
ArrayList list = (ArrayList)
ImportAbstract.destringifyObject( columnTypeNamesString );
@@ -582,8 +600,10 @@ public static HashMap getExpectedUDTClasses( String stringVersion )
if ( stringMap == null ) { return null; }
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
HashMap> retval = new HashMap>();
Iterator entries = stringMap.entrySet().iterator();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5021
while ( entries.hasNext() )
{
@@ -592,6 +612,7 @@ public static HashMap getExpectedUDTClasses( String stringVersion )
String className = (String) entry.getValue();
Class> classValue = Class.forName( className );
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
retval.put( columnName, classValue );
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/load/Export.java b/java/org.apache.derby.engine/org/apache/derby/impl/load/Export.java
index b029949912..f9370439d0 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/load/Export.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/load/Export.java
@@ -66,6 +66,7 @@ private void doExport() throws SQLException
doAllTheWork();
} catch (IOException iex) {
//in case of ioexception, catch it and throw it as our own exception
+//IC see: https://issues.apache.org/jira/browse/DERBY-2858
throw LoadError.errorWritingData(iex);
}
} catch (Exception ex) {
@@ -74,6 +75,7 @@ private void doExport() throws SQLException
}
private Export(Connection con, String schemaName ,
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
String tableName, String selectStatement ,
String outputFileName, String characterDelimeter,
String columnDelimeter, String codeset)
@@ -103,12 +105,14 @@ private Export(Connection con, String schemaName ,
*/
private void setLobsExtFileName(String lobsFileName) throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
if (lobsFileName == null) {
throw PublicAPI.wrapStandardException(
StandardException.newException(
SQLState.LOB_DATA_FILE_NULL));
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
this.lobsFileName = lobsFileName;
lobsInExtFile = true;
}
@@ -146,6 +150,7 @@ private boolean dataFileExists(String fileName) throws SQLException {
fileName = FileUtil.stripProtocolFromFileName( fileName );
File file = new File(fileName);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2556
return fileExists(file);
}
@@ -157,9 +162,11 @@ private boolean dataFileExists(String fileName) throws SQLException {
* @throws SecurityException if the required privileges are missing
*/
private final boolean fileExists(final File file) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return (AccessController.doPrivileged(
new PrivilegedAction() {
public Boolean run() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
return file.exists();
}
})).booleanValue();
@@ -185,6 +192,7 @@ public static void exportTable(Connection con, String schemaName,
throws SQLException {
/** Make sure that the current user has permission to perform this operation */
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
try {
SecurityUtil.authorize( Securable.EXPORT_TABLE );
}
@@ -280,6 +288,7 @@ public static void exportQuery(Connection con, String selectStatement,
* @exception SQLException on errors
*/
public static void exportQuery(Connection con, String selectStatement,
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
String outputFileName, String columnDelimeter,
String characterDelimeter, String codeset,
String lobsFileName)
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/load/ExportAbstract.java b/java/org.apache.derby.engine/org/apache/derby/impl/load/ExportAbstract.java
index df866e083a..9eb58037df 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/load/ExportAbstract.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/load/ExportAbstract.java
@@ -75,11 +75,13 @@ protected ResultSet resultSetForEntity() throws Exception {
private String[] getOneRowAtATime(ResultSet rs,
boolean[] isLargeBinary,
boolean[] isLargeChar)
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
throws Exception
{
if (rs.next()){
int columnCount = exportResultSetForObject.getColumnCount();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5017
ResultSetMetaData rsm=rs.getMetaData();
String[] rowObjects = new String[columnCount];
for (int colNum = 0; colNum < columnCount; colNum++) {
@@ -114,6 +116,7 @@ private String[] getOneRowAtATime(ResultSet rs,
// TODO : handling of Nulls.
}
else {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
String columnValue;
int jdbcColumnNumber = colNum + 1;
@@ -134,6 +137,7 @@ private String[] getOneRowAtATime(ResultSet rs,
// write a Serializable as a string
public static String stringifyObject( Object udt ) throws Exception
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
DynamicByteArrayOutputStream dbaos = new DynamicByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream( dbaos );
@@ -169,6 +173,7 @@ protected void doAllTheWork() throws Exception {
ctype == Types.FLOAT ||ctype == Types.INTEGER || ctype == Types.NUMERIC ||
ctype == Types.REAL ||ctype == Types.SMALLINT || ctype == Types.TINYINT)
isNumeric[i] = true;
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
else
isNumeric[i] = false;
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/load/ExportWriteData.java b/java/org.apache.derby.engine/org/apache/derby/impl/load/ExportWriteData.java
index 94cbb9fe65..ec8a1d5b6b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/load/ExportWriteData.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/load/ExportWriteData.java
@@ -39,6 +39,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
final class ExportWriteData extends ExportWriteDataAbstract
implements java.security.PrivilegedExceptionAction {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
private String outputFileName;
private String lobsFileName;
@@ -57,6 +58,8 @@ final class ExportWriteData extends ExportWriteDataAbstract
private char[] charBuf;
//writes data into the o/p file using control file properties
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
ExportWriteData(String outputFileName, ControlInfo controlFileReader)
throws Exception {
this.outputFileName = outputFileName;
@@ -100,26 +103,31 @@ private void openFiles() throws Exception {
outputFileName = FileUtil.stripProtocolFromFileName( outputFileName );
if ( lobsInExtFile ) { lobsFileName = FileUtil.stripProtocolFromFileName( lobsFileName ); }
+//IC see: https://issues.apache.org/jira/browse/DERBY-2456
FileOutputStream anOutputStream = null;
BufferedOutputStream buffered = null;
FileOutputStream lobOutputStream = null;
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5363
File outputFile = new File(outputFileName);
anOutputStream = new FileOutputStream(outputFileName);
FileUtil.limitAccessToOwner(outputFile);
buffered = new BufferedOutputStream(anOutputStream);
+//IC see: https://issues.apache.org/jira/browse/DERBY-777
aStream = dataCodeset == null ?
new OutputStreamWriter(buffered) :
new OutputStreamWriter(buffered, dataCodeset);
// if lobs are exported to an external file, then
// setup the required streams to write lob data.
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
if (lobsInExtFile)
{
// setup streams to write large objects into the external file.
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
File lobsFile = new File(lobsFileName);
if (lobsFile.getParentFile() == null) {
// lob file name is unqualified. Make lobs file
@@ -133,6 +141,7 @@ private void openFiles() throws Exception {
lobOutputStream = new FileOutputStream(lobsFile);
FileUtil.limitAccessToOwner(lobsFile);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5363
lobOutBinaryStream = new BufferedOutputStream(lobOutputStream);
@@ -176,6 +185,7 @@ private void openFiles() throws Exception {
* data file
* @exception Exception if there is an error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
void writeColumnDefinitionOptionally(String[] columnNames,
String[] columnTypes)
throws Exception {
@@ -183,6 +193,7 @@ void writeColumnDefinitionOptionally(String[] columnNames,
//do uppercase because the ui shows the values as True and False
if (columnDefinition.toUpperCase(java.util.Locale.ENGLISH).equals(ControlInfo.INTERNAL_TRUE.toUpperCase(java.util.Locale.ENGLISH))) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5491
String tempStr="";
//put the start and stop delimiters around the column name and type
for (int i=0; i0){
+//IC see: https://issues.apache.org/jira/browse/DERBY-4555
+//IC see: https://issues.apache.org/jira/browse/DERBY-6892
skip=extraArgs[0];
if(skip<0) throw PublicAPI.wrapStandardException(StandardException.newException
(SQLState.LANG_INVALID_NUMBEROF_HEADER_LINES));
@@ -181,6 +191,7 @@ public static void importTable(Connection connection, String schemaName,
* @exception SQLException on errors
*/
public static void importData(Connection connection, String schemaName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
String tableName, String insertColumnList,
String columnIndexes, String inputFileName,
String columnDelimiter,
@@ -190,6 +201,7 @@ public static void importData(Connection connection, String schemaName,
throws SQLException
{
/** Make sure that the current user has permission to perform this operation */
+//IC see: https://issues.apache.org/jira/browse/DERBY-6616
try {
if ( lobsInExtFile )
{
@@ -201,6 +213,10 @@ public static void importData(Connection connection, String schemaName,
}
}
catch (StandardException se) { throw PublicAPI.wrapStandardException( se ); }
+//IC see: https://issues.apache.org/jira/browse/DERBY-4555
+//IC see: https://issues.apache.org/jira/browse/DERBY-6894
+//IC see: https://issues.apache.org/jira/browse/DERBY-4555
+//IC see: https://issues.apache.org/jira/browse/DERBY-6894
if(extraArgs.length>0){
skip=extraArgs[0];
if(skip<0) throw PublicAPI.wrapStandardException(StandardException.newException
@@ -224,7 +240,9 @@ public static void importData(Connection connection, String schemaName,
*
*/
private static void performImport
+//IC see: https://issues.apache.org/jira/browse/DERBY-2193
(Connection connection,
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
String schemaName,
String insertColumnList,
String columnIndexes,
@@ -237,6 +255,7 @@ public static void importData(Connection connection, String schemaName,
boolean lobsInExtFile)
throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Integer importCounter = bumpImportCounter();
try {
@@ -251,11 +270,14 @@ public static void importData(Connection connection, String schemaName,
ColumnInfo columnInfo = new ColumnInfo(connection , schemaName ,
tableName, insertColumnList,
+//IC see: https://issues.apache.org/jira/browse/DERBY-4555
+//IC see: https://issues.apache.org/jira/browse/DERBY-6894
columnIndexes, COLUMNNAMEPREFIX,readHeaders(inputFileName ,
characterDelimiter,
columnDelimiter,
codeset));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
String columnTypeNames = null;
String udtClassNames = null;
try {
@@ -278,6 +300,7 @@ public static void importData(Connection connection, String schemaName,
sb.append(",") ;
sb.append(quoteStringArgument(codeset));
sb.append(", ");
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
sb.append( columnInfo.getExpectedNumberOfColumnsInFile());
sb.append(", ");
sb.append(quoteStringArgument(
@@ -286,6 +309,7 @@ public static void importData(Connection connection, String schemaName,
sb.append(lobsInExtFile);
sb.append(", ");
sb.append( importCounter.intValue() );
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
sb.append(", ");
sb.append(quoteStringArgument( columnTypeNames ) );
sb.append(", ");
@@ -319,6 +343,7 @@ public static void importData(Connection connection, String schemaName,
else
insertColumnNames = "";
String insertSql = "INSERT INTO " + entityName + insertColumnNames +
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
" --DERBY-PROPERTIES insertMode=" + insertModeValue + "\n" +
" SELECT " + cNamesWithCasts + " from " +
importvti + " AS importvti" ;
@@ -357,6 +382,8 @@ public static void importData(Connection connection, String schemaName,
//Read the header lines to get column names to identify columns by name
private static String[] readHeaders(String inputFileName ,String characterDelimiter,String columnDelimiter,String codeset)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4555
+//IC see: https://issues.apache.org/jira/browse/DERBY-6894
throws SQLException
{
try {
@@ -395,7 +422,10 @@ private static String[] readHeaders(String inputFileName ,String characterDelimi
/** virtual method from the abstract class
* @exception Exception on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
ImportReadData getImportReadData() throws Exception {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4555
+//IC see: https://issues.apache.org/jira/browse/DERBY-6892
return new ImportReadData(inputFileName, controlFileReader, skip);
}
@@ -405,6 +435,7 @@ ImportReadData getImportReadData() throws Exception {
*/
private static synchronized int bumpImportCounter()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2193
return ++_importCounter;
}
@@ -419,8 +450,10 @@ private static SQLException formatImportError( Import importer, String input
if ( importer != null ) { lineNumber = importer.getCurrentLineNumber(); }
StandardException se = StandardException.newException
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
( SQLState.UNEXPECTED_IMPORT_ERROR, lineNumber, inputFile, t.getMessage() );
se.initCause(t);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2472
return PublicAPI.wrapStandardException(se);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportAbstract.java b/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportAbstract.java
index 28478f43c2..e2e7478c64 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportAbstract.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportAbstract.java
@@ -41,6 +41,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
abstract class ImportAbstract extends VTITemplate {
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
ControlInfo controlFileReader;
ImportReadData importReadData;
@@ -51,11 +52,13 @@ abstract class ImportAbstract extends VTITemplate {
int lineNumber = 0;
String[] nextRow;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
ImportResultSetMetaData importResultSetMetaData;
int noOfColumnsExpected;
protected boolean lobsInExtFile = false;
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
String tableColumnTypesStr;
int[] tableColumnTypes;
String columnTypeNamesString;
@@ -90,6 +93,7 @@ void doAllTheWork() throws Exception {
nextRow = new String[numberOfColumns];
tableColumnTypes = ColumnInfo.getExpectedVtiColumnTypes(tableColumnTypesStr,
numberOfColumns);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
columnTypeNames = ColumnInfo.getExpectedColumnTypeNames( columnTypeNamesString, numberOfColumns );
udtClasses = ColumnInfo.getExpectedUDTClasses( udtClassNamesString );
// get the ResultSetMetaData now as we know it's needed
@@ -102,6 +106,7 @@ void doAllTheWork() throws Exception {
// while (next()) ;
}
//the column names will be Column#
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
void loadColumnNames() {
for (int i=1; i<=numberOfColumns; i++)
columnNames[i-1] = COLUMNNAMEPREFIX + i;
@@ -129,9 +134,11 @@ public int getRow() throws SQLException {
public boolean next() throws SQLException {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2193
lineNumber++;
return (importReadData.readNextRow(nextRow));
} catch (Exception ex) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3068
throw importError(ex);
}
}
@@ -157,8 +164,11 @@ public boolean wasNull() {
*/
public String getString(int columnIndex) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
if (columnIndex <= numberOfColumns) {
String val = nextRow[columnIndex-1];
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
+//IC see: https://issues.apache.org/jira/browse/DERBY-2465
if (isColumnInExtFile(columnIndex)) {
// a clob column data is stored in an external
// file, the reference to it is in the main file.
@@ -184,6 +194,8 @@ public String getString(int columnIndex) throws SQLException {
*/
public java.sql.Clob getClob(int columnIndex) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
+//IC see: https://issues.apache.org/jira/browse/DERBY-2465
java.sql.Clob clob = null;
if (lobsInExtFile)
{
@@ -211,11 +223,14 @@ public java.sql.Clob getClob(int columnIndex) throws SQLException {
*/
public java.sql.Blob getBlob(int columnIndex) throws SQLException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
java.sql.Blob blob = null;
if (lobsInExtFile)
{
// lob data is in another file, read from the external file.
blob = importReadData.getBlobColumnFromExtFile(
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
+//IC see: https://issues.apache.org/jira/browse/DERBY-2465
nextRow[columnIndex-1], columnIndex);
} else {
// data is in the main export file, stored in hex format.
@@ -263,6 +278,7 @@ public java.sql.Blob getBlob(int columnIndex) throws SQLException {
public Object getObject(int columnIndex) throws SQLException
{
byte[] bytes = getBytes( columnIndex );
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
try {
Class udtClass = importResultSetMetaData.getUDTClass( columnIndex );
@@ -322,6 +338,7 @@ public byte[] getBytes(int columnIndex) throws SQLException {
// if hex data is null, then column value is SQL NULL
wasNull = (hexData == null);
byte[] data = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
if (hexData != null) {
// Derby export calls Resultset.getString() method
// to write binary data types. Derby getString()
@@ -375,6 +392,7 @@ private boolean isColumnInExtFile(int colIndex)
* @throws SQLException
*/
public SQLException importError(Exception ex) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3068
Exception closeException = null;
if (importReadData != null)
try {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportBlob.java b/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportBlob.java
index e431b06723..706cfa1bf3 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportBlob.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportBlob.java
@@ -66,6 +66,7 @@ public ImportBlob(ImportLobFile lobFile, long position, long length)
*/
public ImportBlob(byte[] data)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
blobData = data;
blobLength = data.length;
}
@@ -180,6 +181,7 @@ public java.io.InputStream getBinaryStream () throws SQLException
/** Return an unimplemented feature error */
private SQLException methodNotImplemented()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return LoadError.unexpectedError( new Exception("Method not implemented")) ;
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportClob.java b/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportClob.java
index 709bb2e17e..8ef33c31f1 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportClob.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportClob.java
@@ -168,6 +168,7 @@ public java.io.Reader getCharacterStream() throws SQLException {
*/
public int setString(long pos, String str, int offset, int len)
throws SQLException { throw methodNotImplemented(); }
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
/**
* This routine is not used by the VTI to read the data, so no
@@ -202,6 +203,7 @@ public int setString(long pos, String str, int offset, int len)
/** Return an unimplemented feature error */
private SQLException methodNotImplemented()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return LoadError.unexpectedError( new Exception("Method not implemented")) ;
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportLobFile.java b/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportLobFile.java
index 03fa22246f..c5f69abdd5 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportLobFile.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportLobFile.java
@@ -53,6 +53,7 @@ class ImportLobFile
* @param lobFile the file which has the LOB Data.
* @param dataCodeset the code set to use char data in the file.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
ImportLobFile(File lobFile, String dataCodeset) throws Exception {
this.dataCodeset = dataCodeset;
openLobFile(lobFile);
@@ -71,9 +72,11 @@ private void openLobFile(final File lobFile)
try {
// open the lob file under a privelged block.
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
lobRaf = AccessController.doPrivileged
(new java.security.PrivilegedExceptionAction(){
public RandomAccessFile run() throws IOException{
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
return new RandomAccessFile(lobFile, "r");
}
}
@@ -82,6 +85,7 @@ public RandomAccessFile run() throws IOException{
throw pae.getException();
}
} catch (FileNotFoundException ex) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
throw PublicAPI.wrapStandardException(
StandardException.newException(
SQLState.LOB_DATA_FILE_NOT_FOUND,
@@ -136,6 +140,8 @@ public String getString(long offset, int length) throws IOException {
// wrap a reader on top of the stream, so that calls
// to read the clob data from the file can read the
// with approapriate data code set.
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
+//IC see: https://issues.apache.org/jira/browse/DERBY-2465
lobReader = dataCodeset == null ?
new InputStreamReader(lobLimitIn) :
new InputStreamReader(lobLimitIn, dataCodeset);
@@ -160,6 +166,8 @@ public String getString(long offset, int length) throws IOException {
* @exception IOException on any I/O error.
*/
public java.io.Reader getCharacterStream(long offset, long length)
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
+//IC see: https://issues.apache.org/jira/browse/DERBY-2465
throws IOException
{
lobInputStream.seek(offset);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportReadData.java b/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportReadData.java
index 2539e2f908..2b1785bb9f 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportReadData.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportReadData.java
@@ -33,6 +33,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import org.apache.derby.shared.common.sanity.SanityManager;
import java.sql.SQLException;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
final class ImportReadData implements java.security.PrivilegedExceptionAction {
//Read data from this file
private String inputFileName;
@@ -144,6 +145,8 @@ private void loadPropertiesInfo() throws Exception {
}
//inputFileName: File to read data from
//controlFileReader: File used to interpret data in the inputFileName
+//IC see: https://issues.apache.org/jira/browse/DERBY-4555
+//IC see: https://issues.apache.org/jira/browse/DERBY-6892
ImportReadData(String inputFileName, ControlInfo controlFileReader,short skipLines)
throws Exception {
this.skipLines=skipLines;
@@ -158,6 +161,8 @@ private void loadPropertiesInfo() throws Exception {
loadMetaData();
lobFileHandles = new ImportLobFile[numberOfColumns];
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
+//IC see: https://issues.apache.org/jira/browse/DERBY-2465
}
@@ -179,6 +184,8 @@ protected void ignoreFirstRow() throws Exception {
* @exception Exception if there is an error
*/
protected void ignoreHeaderLines() throws Exception {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4555
+//IC see: https://issues.apache.org/jira/browse/DERBY-6894
for(int i =0;i -1) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2193
/* This is a hack to fix a problem: When there is missing data in columns
and hasDelimiterAtEnd==true, then the last delimiter was read as the last column data.
@@ -853,6 +870,7 @@ private boolean readNextDelimitedRow(String[] returnStringArray) throws Exceptio
actually same as the delimiter.
*/
if (!hasDelimiterAtEnd) {//normal path:
+//IC see: https://issues.apache.org/jira/browse/DERBY-2193
returnStringArray[upperLimit] = new String(currentToken,
positionOfNonWhiteSpaceCharInFront, totalCharsSoFar);
}
@@ -883,6 +901,8 @@ else if (totalCharsSoFar==fieldSeparatorLength && isFieldSep(currentToken) ){
else
returnStringArray[upperLimit] = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4555
+//IC see: https://issues.apache.org/jira/browse/DERBY-6894
lineNumber++;
return true;
}
@@ -963,6 +983,8 @@ boolean readNextToken(char[] delimiter, int delimiterIndex,
* @param colIndex number of the column. starts at 1.
* @exception SQLException on any errors.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
+//IC see: https://issues.apache.org/jira/browse/DERBY-2465
String getClobColumnFromExtFileAsString(String lobLocationStr, int colIndex)
throws SQLException
{
@@ -994,6 +1016,7 @@ java.sql.Clob getClobColumnFromExtFile(String lobLocationStr, int colIndex)
{
try {
initExternalLobFile(lobLocationStr, colIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
if (lobLength == -1 ){
// lob length -1 indicates columnn value is a NULL,
// just return null.
@@ -1015,10 +1038,13 @@ java.sql.Clob getClobColumnFromExtFile(String lobLocationStr, int colIndex)
* @param colIndex number of the column. starts at 1.
* @exception SQLException on any errors.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
+//IC see: https://issues.apache.org/jira/browse/DERBY-2465
java.sql.Blob getBlobColumnFromExtFile(String lobLocationStr, int colIndex)
throws SQLException
{
initExternalLobFile(lobLocationStr, colIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
if (lobLength == -1) {
// lob length -1 indicates columnn value is a NULL,
// just return null.
@@ -1050,6 +1076,7 @@ private void initExternalLobFile(String lobLocationStr, int colIndex)
int lengthIndex = lobLocationStr.lastIndexOf(".") ;
int offsetIndex = lobLocationStr.lastIndexOf(".",
lengthIndex -1);
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
lobLength = Integer.parseInt(lobLocationStr.substring(
lengthIndex + 1,
@@ -1058,12 +1085,15 @@ private void initExternalLobFile(String lobLocationStr, int colIndex)
offsetIndex+1,
lengthIndex));
lobFileName = lobLocationStr.substring(0 , offsetIndex);
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
+//IC see: https://issues.apache.org/jira/browse/DERBY-2465
if (lobFileHandles[colIndex-1] == null) {
// open external file where the lobs are stored.
try {
// each lob column in the table has it's own file handle.
// separate file handles are must, lob stream objects
// can not be reused until the whole row is inserted.
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
File lobsFile = new File (lobFileName);
if (lobsFile.getParentFile() == null) {
// lob file name is unqualified. lob file
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportResultSetMetaData.java b/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportResultSetMetaData.java
index dd53e1aaf9..f475e1195d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportResultSetMetaData.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/load/ImportResultSetMetaData.java
@@ -38,9 +38,11 @@ class ImportResultSetMetaData extends VTIMetaDataTemplate {
private final HashMap udtClasses;
public ImportResultSetMetaData(int numberOfColumns,
+//IC see: https://issues.apache.org/jira/browse/DERBY-378
String[] columnNames,
int[] columnWidths,
int[] tableColumnTypes,
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
String[] columnTypeNames,
HashMap udtClasses ) {
this.numberOfColumns = numberOfColumns;
@@ -106,6 +108,7 @@ public int getColumnType(int column) {
// CHAR FOR BIT DATA
colType = java.sql.Types.BINARY;
break;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
case java.sql.Types.JAVA_OBJECT:
// User-defined type
colType = java.sql.Types.JAVA_OBJECT;
@@ -124,6 +127,7 @@ public int isNullable(int column) {
}
public int getColumnDisplaySize(int column) {
if (columnWidths == null)
+//IC see: https://issues.apache.org/jira/browse/DERBY-104
return Limits.DB2_VARCHAR_MAXWIDTH;
else
return columnWidths[column-1];
@@ -131,12 +135,14 @@ public int getColumnDisplaySize(int column) {
public String getColumnTypeName(int column) throws SQLException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
return columnTypeNames[ column - 1 ];
}
/**
* Get the class bound to a UDT column.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6621
Class getUDTClass( int column ) throws SQLException
{
String columnName = getColumnName( column );
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/load/LoadError.java b/java/org.apache.derby.engine/org/apache/derby/impl/load/LoadError.java
index cbe965263f..9f7c3d94ab 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/load/LoadError.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/load/LoadError.java
@@ -37,6 +37,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
class LoadError {
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
Raised if, the Derby database connection is null.
*/
@@ -53,6 +54,7 @@ static SQLException connectionNull() {
static SQLException dataAfterStopDelimiter(int lineNumber, int columnNumber) {
return PublicAPI.wrapStandardException(
StandardException.newException(SQLState.DATA_AFTER_STOP_DELIMITER,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
lineNumber, columnNumber));
}
@@ -64,6 +66,7 @@ static SQLException dataAfterStopDelimiter(int lineNumber, int columnNumber) {
static SQLException dataFileNotFound(String fileName, Exception ex) {
return PublicAPI.wrapStandardException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-2472
StandardException.newException(SQLState.DATA_FILE_NOT_FOUND, ex,
fileName));
}
@@ -102,6 +105,7 @@ static SQLException entityNameMissing() {
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Raised if, field and record separators are substring of each other.
*/
static SQLException fieldAndRecordSeparatorsSubset() {
@@ -127,6 +131,7 @@ static SQLException invalidColumnName(String columnName) {
static SQLException invalidColumnNumber(int numberOfColumns) {
return PublicAPI.wrapStandardException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
StandardException.newException(SQLState.INVALID_COLUMN_NUMBER, numberOfColumns ));
}
@@ -159,6 +164,8 @@ static SQLException recordSeparatorMissing(int lineNumber) {
static SQLException unexpectedEndOfFile(int lineNumber) {
return PublicAPI.wrapStandardException(
StandardException.newException(SQLState.UNEXPECTED_END_OF_FILE,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
lineNumber));
}
@@ -167,6 +174,7 @@ static SQLException unexpectedEndOfFile(int lineNumber) {
*/
static SQLException errorWritingData(IOException ioe) {
return PublicAPI.wrapStandardException(
+//IC see: https://issues.apache.org/jira/browse/DERBY-2858
StandardException.newException(SQLState.ERROR_WRITING_DATA, ioe));
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/BCClass.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/BCClass.java
index 2fa0719c8d..58c1d335f9 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/BCClass.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/BCClass.java
@@ -348,6 +348,7 @@ ClassFactory getClassFactory() {
* @param limit
* @param value
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
void addLimitExceeded(BCMethod mb, String limitName, int limit, int value)
{
StringBuffer sb = new StringBuffer();
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/BCJava.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/BCJava.java
index 465b1d69af..23c10b1ef4 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/BCJava.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/BCJava.java
@@ -283,6 +283,8 @@ String vmType(BCMethodDescriptor md) {
} catch (StandardException se) {
if (SanityManager.DEBUG) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
SanityManager.THROWASSERT("Unexpected exception", se);
}
@@ -328,6 +330,7 @@ static short vmTypeId(String vmTypeS) {
* can't call this entry point.
*/
private static Object startSystemModule( final String factoryInterface )
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
throws StandardException
{
try {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/BCMethod.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/BCMethod.java
index e84a0d7d3b..fbafa60868 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/BCMethod.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/BCMethod.java
@@ -64,6 +64,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* Method Builder implementation for generating bytecode.
*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-742
class BCMethod implements MethodBuilder {
/**
@@ -89,6 +90,8 @@ class BCMethod implements MethodBuilder {
* Fast access for the parametes, will be null
* if the method has no parameters.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
BCLocalField[] parameters;
/**
@@ -99,7 +102,9 @@ class BCMethod implements MethodBuilder {
Vector thrownExceptions; // expected to be names of Classes under Throwable
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
CodeChunk myCode;
protected ClassMember myEntry;
@@ -127,6 +132,7 @@ class BCMethod implements MethodBuilder {
this.cb = (BCClass) cb;
modClass = this.cb.modify();
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
myReturnType = returnType;
myName = methodName;
@@ -140,6 +146,8 @@ class BCMethod implements MethodBuilder {
String[] vmParamterTypes;
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
if (parms != null && parms.length != 0) {
int len = parms.length;
vmParamterTypes = new String[len];
@@ -165,6 +173,8 @@ class BCMethod implements MethodBuilder {
// get code chunk
myCode = new CodeChunk(this.cb);
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
parameterTypes = parms;
}
//
@@ -177,6 +187,7 @@ class BCMethod implements MethodBuilder {
* overflowing to. Those sub-methods are hidden from any caller.
*/
public String getName() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
return myName;
}
@@ -202,6 +213,7 @@ public void addThrownException(String exceptionClass) {
// Allowing this would cause the method overflow/split to
// break as the top-level method would not have the exception
// added in the sub method.
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
if (SanityManager.DEBUG)
{
if (myCode.getPC() != 0)
@@ -210,7 +222,9 @@ public void addThrownException(String exceptionClass) {
}
if (thrownExceptions == null)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
thrownExceptions = new Vector();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
thrownExceptions.add(exceptionClass);
}
@@ -230,7 +244,11 @@ public void complete() {
// the last instruction. Note this value can
// be changed by the splitMethod call.
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
+//IC see: https://issues.apache.org/jira/browse/DERBY-766
if (myCode.getPC() > CODE_SPLIT_LENGTH)
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
splitMethod();
// write exceptions attribute info
@@ -238,6 +256,7 @@ public void complete() {
// get the code attribute to put itself into the class
// provide the final header information needed
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
myCode.complete(this, modClass, myEntry, maxStack, currentVarNum);
}
@@ -358,6 +377,7 @@ protected void writeExceptions() {
for (int i = 0; i < numExc; i++) {
// put each exception into the constant pool
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
String e = thrownExceptions.get(i).toString();
int ei2 = modClass.addClassReference(e);
@@ -443,6 +463,7 @@ private Type popStack() {
private Type[] copyStack()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-742
Type[] stack = new Type[stackTypeOffset];
System.arraycopy(stackTypes, 0, stack, 0, stackTypeOffset);
return stack;
@@ -537,6 +558,8 @@ else if (value >= Short.MIN_VALUE && value <= Short.MAX_VALUE)
int cpe = modClass.addConstant(value);
addInstrCPE(VMOpcode.LDC, cpe);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
+//IC see: https://issues.apache.org/jira/browse/DERBY-766
growStack(type.width(), type);
}
@@ -590,6 +613,8 @@ else if (value == 2.0)
else
{
int cpe = modClass.addConstant(value);
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
addInstrCPE(VMOpcode.LDC, cpe);
}
growStack(1, Type.FLOAT);
@@ -609,6 +634,10 @@ public void push(double value) {
}
public void push(String value) {
int cpe = modClass.addConstant(value);
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
addInstrCPE(VMOpcode.LDC, cpe);
growStack(1, Type.STRING);
}
@@ -733,8 +762,12 @@ public int callMethod(short opcode, String declaringClass, String methodName,
int rw = rt.width();
if (rw != 0)
growStack(rw, rt);
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
else
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5947
+//IC see: https://issues.apache.org/jira/browse/DERBY-5947
overflowMethodCheck();
}
// Check the declared type of the method
@@ -796,6 +829,7 @@ public void cast(String className) {
// classes to check relationships or any other
// information. Thus other optimizations where a cast
// is not required are not implemented.
+//IC see: https://issues.apache.org/jira/browse/DERBY-740
Type tbc = stackTypes[stackTypeOffset - 1];
short sourceType = tbc.vmType();
@@ -935,12 +969,15 @@ Upon entry the top word(s) on the stack is
word
word2,word1 -> word2, word1, word2
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
So that we are left with word after the put.
*/
public void putField(LocalField field) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
BCLocalField lf = (BCLocalField) field;
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
putField(lf.type, lf.cpi, true);
}
@@ -952,6 +989,7 @@ public void putField(String fieldName, String fieldType) {
Type ft = cb.factory.type(fieldType);
int cpi = modClass.addFieldReference(cb.classType.vmNameSimple, fieldName, ft.vmName());
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
putField(ft, cpi, true);
}
@@ -1036,12 +1074,14 @@ private void conditionalIf(short opcode) {
// 'if' so that we can set up the 'else' block with the
// correct stack on entry.
+//IC see: https://issues.apache.org/jira/browse/DERBY-742
condition = new Conditional(condition, myCode, opcode, copyStack());
}
public void startElseCode() {
// start the else code
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
Type[] entryStack = condition.startElse(this, myCode, copyStack());
for (int i = stackDepth = 0; i < entryStack.length; i++)
@@ -1052,10 +1092,12 @@ public void startElseCode() {
}
public void completeConditional() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
condition = condition.end(this, myCode, stackTypes, stackTypeOffset);
}
public void pop() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-167
if (SanityManager.DEBUG) {
if (stackDepth == 0)
SanityManager.THROWASSERT("pop when stack is empty!");
@@ -1064,6 +1106,7 @@ public void pop() {
myCode.addInstr(toPop.width() == 2 ? VMOpcode.POP2 : VMOpcode.POP);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5947
overflowMethodCheck();
}
@@ -1139,6 +1182,7 @@ public void setArrayElement(int element) {
/**
Create an array instance
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Stack ... =>
...,arrayref
*/
@@ -1189,6 +1233,8 @@ public void pushNewArray(String className, int size) {
*/
private void addInstrCPE(short opcode, int cpe)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
if (cpe >= VMOpcode.MAX_CONSTANT_POOL_ENTRIES)
cb.addLimitExceeded(this, "constant_pool_count",
VMOpcode.MAX_CONSTANT_POOL_ENTRIES, cpe);
@@ -1228,6 +1274,7 @@ public boolean statementNumHitLimit(int noStatementsAdded)
*
public Object e23()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
... existing code
// split point
return e23_0();
@@ -1262,6 +1309,7 @@ private Object e23_1()
*/
private void overflowMethodCheck()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5947
if (stackDepth != 0) {
// Can only overflow to new method if the stack is empty.
return;
@@ -1294,6 +1342,8 @@ private void overflowMethodCheck()
return;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
BCMethod subMethod = getNewSubMethod(myReturnType, false);
// stop any recursion
@@ -1340,6 +1390,8 @@ private void overflowMethodCheck()
* define it with no parameters.
* @return A valid empty sub method.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
final BCMethod getNewSubMethod(String returnType, boolean withParameters) {
int modifiers = myEntry.getModifier();
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/CodeChunk.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/CodeChunk.java
index 5f94057d89..0867342a8e 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/CodeChunk.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/CodeChunk.java
@@ -756,6 +756,7 @@ private void fixLengths(BCMethod mb, int maxStack, int maxLocals, int codeLength
* now that it holds all of the instructions and
* the exception table.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
void complete(BCMethod mb, ClassHolder ch,
ClassMember method, int maxStack, int maxLocals) {
@@ -794,6 +795,7 @@ void complete(BCMethod mb, ClassHolder ch,
limitHit(ioe);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
fixLengths(mb, maxStack, maxLocals, codeLength);
method.addAttribute("Code", out);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/Conditional.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/Conditional.java
index 0fd6962aa0..bd4e19d376 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/Conditional.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/Conditional.java
@@ -53,6 +53,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
Note all branches here are using relative offsets, not absolute program counters.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
If the then code leads to the conditional branch offset being too big (>32k)
because the then code is larger than 32767 bytes then this is built:
@@ -97,9 +98,12 @@ Licensed to the Apache Software Foundation (ASF) under one or more
if condition branch to tb: (relative offset +8)
goto_w eb: // indirect for else block (5 bytes)
tb:
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
then code (> 32767 bytes)
goto_w end:
eb:
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
else code (> 32767 bytes)
end:
@@ -147,6 +151,7 @@ class Conditional {
* @param ifOpcode Opcode for the if check.
* @param entryStack Type stack on entering the conditional then block.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-742
Conditional(Conditional parent, CodeChunk chunk, short ifOpcode, Type[] entryStack) {
this.parent = parent;
if_pc = chunk.getPC();
@@ -163,6 +168,7 @@ class Conditional {
* @param thenStack Type stack on completing the conditional then block.
* @return the type stack on entering the then block
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
Type[] startElse(BCMethod mb, CodeChunk chunk, Type[] thenStack) {
// reserve space for the goto end we will be adding
@@ -178,6 +184,7 @@ Type[] startElse(BCMethod mb, CodeChunk chunk, Type[] thenStack) {
// instructions in a goto to get its pc.
thenGoto_pc = chunk.getPC() - 3;
+//IC see: https://issues.apache.org/jira/browse/DERBY-742
Type[] entryStack = stack;
stack = thenStack;
@@ -204,8 +211,10 @@ Conditional end(BCMethod mb, CodeChunk chunk, Type[] elseStack, int stackNumber)
fillIn(mb, chunk, branch_pc, chunk.getPC());
+//IC see: https://issues.apache.org/jira/browse/DERBY-742
if (SanityManager.DEBUG)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6699
if (stackNumber != stack.length) {
StringBuilder sb = new StringBuilder();
@@ -229,6 +238,7 @@ Conditional end(BCMethod mb, CodeChunk chunk, Type[] elseStack, int stackNumber)
for (int i = 0; i < stackNumber; i++)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2230
if (stack[i].vmType() != elseStack[i].vmType()) {
if( !stack[i].vmName().equals(elseStack[i].vmName()))
SanityManager.THROWASSERT("ByteCode Conditional then/else stack mismatch: then: "
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/GClass.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/GClass.java
index d1faf22eb0..97a9cf2c3b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/GClass.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/GClass.java
@@ -65,6 +65,7 @@ public GeneratedClass getGeneratedClass() throws StandardException {
protected void writeClassFile(String dir, boolean logMessage, Throwable t)
throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
if (SanityManager.DEBUG) {
@@ -77,10 +78,12 @@ protected void writeClassFile(String dir, boolean logMessage, Throwable t)
filename = filename + ".class";
final File classFile = new File(dir,filename);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4287
FileOutputStream fos = null;
try {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
fos = AccessController.doPrivileged(
new PrivilegedExceptionAction() {
public FileOutputStream run()
@@ -96,12 +99,14 @@ public FileOutputStream run()
fos.flush();
if (logMessage) {
// find the error stream
+//IC see: https://issues.apache.org/jira/browse/DERBY-5062
HeaderPrintWriter errorStream = Monitor.getStream();
errorStream.printlnWithHeader("Wrote class "+getFullName()+" to file "+classFile.toString()+". Please provide support with the file and the following exception message: "+t);
}
fos.close();
} catch (IOException e) {
if (SanityManager.DEBUG)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
SanityManager.THROWASSERT("Unable to write .class file", e);
}
}
@@ -144,6 +149,7 @@ final void validateType(String typeName1)
else
cf.loadApplicationClass(typeName);
} catch (ClassNotFoundException cnfe) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
SanityManager.THROWASSERT("Class "+typeName+" not found", cnfe);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/Type.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/Type.java
index 24863efb48..b6afc3e40d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/Type.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/Type.java
@@ -49,6 +49,7 @@ final class Type {
@Override
public String toString() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6699
StringBuilder sb = new StringBuilder();
sb.append("[");
sb.append(javaName);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/d_BCValidate.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/d_BCValidate.java
index 37388d6c57..e03585d44a 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/d_BCValidate.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/bytecode/d_BCValidate.java
@@ -58,6 +58,7 @@ static void checkMethod(short opcode, Type dt, String methodName, String[] debug
if (SanityManager.DEBUG) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-624
String reason = null;
try {
@@ -77,6 +78,7 @@ static void checkMethod(short opcode, Type dt, String methodName, String[] debug
Class[] params = NO_PARAMS;
Class> declaring = loadClass(declaringClass);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
if (debugParameterTypes != null) {
params = new Class[debugParameterTypes.length];
@@ -94,8 +96,10 @@ static void checkMethod(short opcode, Type dt, String methodName, String[] debug
// we try to fall into these categories to avoid having to grant
// permissions to derby jars for the function tests.
+//IC see: https://issues.apache.org/jira/browse/DERBY-624
ClassLoader myLoader = d_BCValidate.class.getClassLoader();
boolean sameClassLoader;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6854
try {
ClassLoader declareLoader = AccessController.doPrivileged(
(PrivilegedAction)
@@ -114,6 +118,7 @@ static void checkMethod(short opcode, Type dt, String methodName, String[] debug
String actualReturnType;
if (methodName.equals("")) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Constructor> c;
if (sameClassLoader)
@@ -205,6 +210,7 @@ static void checkMethod(short opcode, Type dt, String methodName, String[] debug
static {
if (SanityManager.DEBUG) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
primitives = new Hashtable>();
primitives.put("boolean", Boolean.TYPE);
primitives.put("byte", Byte.TYPE);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/cache/ClockPolicy.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/cache/ClockPolicy.java
index 41706c011f..2af7511b1b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/cache/ClockPolicy.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/cache/ClockPolicy.java
@@ -136,6 +136,7 @@ final class ClockPolicy implements ReplacementPolicy {
@Override
public int size() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6733
synchronized (clock) {
return clock.size();
}
@@ -366,6 +367,7 @@ synchronized boolean isEvicted() {
*/
private Holder moveHand() {
synchronized (clock) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3582
if (clock.isEmpty()) {
return null;
}
@@ -414,6 +416,7 @@ private Holder rotateClock(CacheEntry entry, boolean allowEvictions)
final Holder h = moveHand();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3582
if (h == null) {
// There are no elements in the clock, hence there is no
// reusable entry.
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/cache/ConcurrentCache.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/cache/ConcurrentCache.java
index 0ee7b56e4c..c4c26610e9 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/cache/ConcurrentCache.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/cache/ConcurrentCache.java
@@ -207,6 +207,7 @@ void evictEntry(Object key) {
CacheEntry entry = cache.remove(key);
entry.getCacheable().clearIdentity();
entry.setCacheable(null);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6733
countEviction();
}
@@ -226,6 +227,8 @@ private Cacheable insertIntoFreeSlot(Object key, CacheEntry entry)
throws StandardException {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2911
+//IC see: https://issues.apache.org/jira/browse/DERBY-3493
replacementPolicy.insertEntry(entry);
} catch (StandardException se) {
// Failed to insert the entry into the replacement policy. Make
@@ -285,6 +288,8 @@ private void settingIdentityComplete(
*/
public Cacheable find(Object key) throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2911
+//IC see: https://issues.apache.org/jira/browse/DERBY-3493
if (stopped) {
return null;
}
@@ -298,6 +303,7 @@ public Cacheable find(Object key) throws StandardException {
// The object is already cached. Increase the use count and
// return it.
entry.keep(true);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6733
countHit();
return item;
} else {
@@ -361,9 +367,11 @@ public Cacheable findCached(Object key) throws StandardException {
// locked it, getCacheable() returns null and so should we do.
Cacheable item = entry.getCacheable();
if (item != null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6733
countHit();
entry.keep(true);
} else {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6733
countMiss();
}
return item;
@@ -388,6 +396,8 @@ public Cacheable findCached(Object key) throws StandardException {
public Cacheable create(Object key, Object createParameter)
throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2911
+//IC see: https://issues.apache.org/jira/browse/DERBY-3493
if (stopped) {
return null;
}
@@ -627,6 +637,7 @@ public void shutdown() throws StandardException {
if (cleaner != null) {
cleaner.unsubscribe();
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6733
deregisterMBean();
}
@@ -713,12 +724,14 @@ public Collection values() {
@Override
public void registerMBean(String dbName) throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6733
if (SanityManager.DEBUG) {
SanityManager.ASSERT(mbean == null, "registerMBean() called twice");
}
ManagementService managementService =
(ManagementService) getSystemModule(Module.JMX);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if (managementService != null) {
mbean = managementService.registerMBean(
@@ -731,8 +744,11 @@ public void registerMBean(String dbName) throws StandardException {
@Override
public void deregisterMBean() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6733
+//IC see: https://issues.apache.org/jira/browse/DERBY-6733
if (mbean != null) {
ManagementService managementService =
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
(ManagementService) getSystemModule(Module.JMX);
if (managementService != null) {
managementService.unregisterMBean(mbean);
@@ -794,6 +810,7 @@ long getMaxEntries() {
/** Get the number of allocated entries in the cache. */
long getAllocatedEntries() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6733
return replacementPolicy.size();
}
@@ -808,6 +825,7 @@ long getUsedEntries() {
*/
private static Object getSystemModule( final String factoryInterface )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/daemon/BasicDaemon.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/daemon/BasicDaemon.java
index f06c7fa61a..b34bdcb685 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/daemon/BasicDaemon.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/daemon/BasicDaemon.java
@@ -759,6 +759,7 @@ public Void run() {
*/
static ModuleFactory getMonitor()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/daemon/IndexStatisticsDaemonImpl.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/daemon/IndexStatisticsDaemonImpl.java
index c1c049a601..8127ce2fda 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/daemon/IndexStatisticsDaemonImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/daemon/IndexStatisticsDaemonImpl.java
@@ -223,12 +223,15 @@ public IndexStatisticsDaemonImpl(HeaderPrintWriter log, boolean doLog,
// For now allow users to override the new behavior through a debug
// property. Will be removed or renamed in a future release.
boolean keepDisposableStats = PropertyUtil.getSystemBoolean(
+//IC see: https://issues.apache.org/jira/browse/DERBY-5680
Property.STORAGE_AUTO_INDEX_STATS_DEBUG_KEEP_DISPOSABLE_STATS);
this.skipDisposableStats = dbAtLeast10_9(db) && !keepDisposableStats;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3790
this.db = db;
this.dbOwner = userName;
this.databaseName = databaseName;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
this.ctxMgr = getContextService().newContextManager();
this.timeOfCreation = System.currentTimeMillis();
trace(0, "created{log=" + doLog + ", traceLog=" +
@@ -246,6 +249,7 @@ public IndexStatisticsDaemonImpl(HeaderPrintWriter log, boolean doLog,
/** Tells if the database is 10.9 or newer. */
private boolean dbAtLeast10_9(Database db) {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3790
return db.getDataDictionary().checkVersion(
DataDictionary.DD_VERSION_DERBY_10_9, null);
} catch (StandardException se) {
@@ -266,6 +270,7 @@ private boolean dbAtLeast10_9(Database db) {
* @param td base table descriptor to update index statistics for
*/
public void schedule(TableDescriptor td) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4939
String schedulingReason = td.getIndexStatsUpdateReason();
synchronized (queue) {
if (acceptWork(td)) {
@@ -273,6 +278,7 @@ public void schedule(TableDescriptor td) {
queue.add(td);
wuScheduled++;
log(AS_BACKGROUND_TASK, td,
+//IC see: https://issues.apache.org/jira/browse/DERBY-5089
"update scheduled" +
(schedulingReason == null
? ""
@@ -282,6 +288,7 @@ public void schedule(TableDescriptor td) {
if (runningThread == null) {
//DERBY-5582. Make sure the thread is in the derby group
// to avoid potential security manager issues
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
runningThread = BasicDaemon.getMonitor().getDaemonThread(this, "index-stat-thread", false);
runningThread.start();
}
@@ -308,6 +315,7 @@ private boolean acceptWork(TableDescriptor td) {
// duplicates should yield acceptable performance. Also, we don't
// look for duplicates if the queue is already full.
for (int i=0; i < queue.size(); i++) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
TableDescriptor work = queue.get(i);
if (work.tableNameEquals(table, schema)) {
accept = false;
@@ -318,6 +326,7 @@ private boolean acceptWork(TableDescriptor td) {
// If the work was rejected, trace it.
if (!accept) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5089
String msg = td.getQualifiedName() + " rejected, ";
if (daemonDisabled) {
wuRejectedOther++;
@@ -347,10 +356,12 @@ private boolean acceptWork(TableDescriptor td) {
private void generateStatistics(LanguageConnectionContext lcc,
TableDescriptor td)
throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5089
trace(1, "processing " + td.getQualifiedName());
boolean lockConflictSeen = false;
while (true) {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5680
updateIndexStatsMinion(lcc, td, null, AS_BACKGROUND_TASK);
break;
} catch (StandardException se) {
@@ -385,6 +396,7 @@ private void generateStatistics(LanguageConnectionContext lcc,
/** Return true if we are being shutdown */
private boolean isShuttingDown() {
synchronized (queue) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5088
if (daemonDisabled || daemonLCC == null){
return true;
} else {
@@ -420,6 +432,8 @@ private void updateIndexStatsMinion(LanguageConnectionContext lcc,
// can only properly identify disposable stats if cds == null,
// which means we are processing all indexes on the conglomerate.
final boolean identifyDisposableStats = (cds == null);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6283
+//IC see: https://issues.apache.org/jira/browse/DERBY-5680
// Fetch descriptors if we're updating statistics for all indexes.
if (cds == null) {
@@ -447,6 +461,8 @@ private void updateIndexStatsMinion(LanguageConnectionContext lcc,
// unique single column indexes. This set is the "non disposable
// stat list".
UUID[] non_disposable_objectUUID = new UUID[cds.length];
+//IC see: https://issues.apache.org/jira/browse/DERBY-6283
+//IC see: https://issues.apache.org/jira/browse/DERBY-5680
try
{
@@ -460,6 +476,7 @@ private void updateIndexStatsMinion(LanguageConnectionContext lcc,
}
IndexRowGenerator irg = cds[i].getIndexDescriptor();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3790
// Skip single-column unique indexes unless we're told not to,
// or we are running in soft-upgrade-mode on a pre 10.9 db.
@@ -473,6 +490,8 @@ private void updateIndexStatsMinion(LanguageConnectionContext lcc,
// at this point have found a stat for an existing
// index which is not a single column unique index, add it
// to the list of "non disposable stats"
+//IC see: https://issues.apache.org/jira/browse/DERBY-6283
+//IC see: https://issues.apache.org/jira/browse/DERBY-5680
conglomerateNumber[i] = cds[i].getConglomerateNumber();
non_disposable_objectUUID[i] = cds[i].getUUID();
@@ -495,6 +514,7 @@ private void updateIndexStatsMinion(LanguageConnectionContext lcc,
// are not single column unique.
if (identifyDisposableStats) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5680
// Note this loop is not controlled by the skipDisposableStats
// flag. The above loop controls if we drop single column unique
@@ -502,6 +522,7 @@ private void updateIndexStatsMinion(LanguageConnectionContext lcc,
// stats with no associated index (orphaned stats).
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
List existingStats = td.getStatistics();
StatisticsDescriptor[] stats = (StatisticsDescriptor[])
existingStats.toArray(
@@ -518,6 +539,8 @@ private void updateIndexStatsMinion(LanguageConnectionContext lcc,
UUID referencedIndex = stats[si].getReferenceID();
boolean isValid = false;
for (int ci=0; ci < conglomerateNumber.length; ci++) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6283
+//IC see: https://issues.apache.org/jira/browse/DERBY-5680
if (referencedIndex.equals(non_disposable_objectUUID[ci])) {
isValid = true;
break;
@@ -532,6 +555,7 @@ private void updateIndexStatsMinion(LanguageConnectionContext lcc,
// mechanism in case of another bug like DERBY-5681 in Derby.
if (!isValid) {
String msg = "dropping disposable statistics entry " +
+//IC see: https://issues.apache.org/jira/browse/DERBY-5789
stats[si].getUUID() + " for index " +
stats[si].getReferenceID() + " (cols=" +
stats[si].getColumnCount() + ")";
@@ -572,6 +596,8 @@ private void updateIndexStatsMinion(LanguageConnectionContext lcc,
// Subtract one for the RowLocation added for indexes.
int numCols = indexRow[indexNumber].nColumns() - 1;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6283
+//IC see: https://issues.apache.org/jira/browse/DERBY-5680
long[] cardinality = new long[numCols];
KeyComparator cmp = new KeyComparator(indexRow[indexNumber]);
@@ -640,6 +666,8 @@ not hold record locks */
int retries = 0;
while (true) {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6283
+//IC see: https://issues.apache.org/jira/browse/DERBY-5680
writeUpdatedStats(lcc, td,
non_disposable_objectUUID[indexNumber],
cmp.getRowCount(), cardinality, asBackgroundTask);
@@ -692,6 +720,7 @@ private void writeUpdatedStats(LanguageConnectionContext lcc,
// Update the heap row count estimate.
setHeapRowEstimate(tc, td.getHeapConglomerateId(), numRows);
// Drop existing index statistics for this index.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5770
if (!lcc.dataDictionaryInWriteMode()) {
dd.startWriting(lcc);
}
@@ -713,6 +742,7 @@ private void writeUpdatedStats(LanguageConnectionContext lcc,
}
// Log some information.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5124
ConglomerateDescriptor cd = dd.getConglomerateDescriptor(index);
log(asBackgroundTask, td,
"wrote stats for index " +
@@ -731,6 +761,7 @@ private void writeUpdatedStats(LanguageConnectionContext lcc,
"rolled back index stats because index has been dropped");
lcc.internalRollback();
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-5770
conglomerateGone = (cd == null);
}
@@ -764,6 +795,7 @@ private void invalidateStatements(LanguageConnectionContext lcc,
int retries = 0;
while (true) {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5770
if (!lcc.dataDictionaryInWriteMode()) {
dd.startWriting(lcc);
}
@@ -841,16 +873,19 @@ private void setHeapRowEstimate(TransactionController tc, long tableId,
*/
public void run() {
final long runStart = System.currentTimeMillis();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5088
ContextService ctxService = null;
// Implement the outer-level exception handling here.
try {
// DERBY-5088: Factory-call may fail.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
ctxService = getContextService();
ctxService.setCurrentContextManager(ctxMgr);
processingLoop();
} catch (ShutdownException se) {
// The database is/has been shut down.
// Log processing statistics and exit.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5089
trace(1, "swallowed shutdown exception: " + extractIstatInfo(se));
stop();
ctxMgr.cleanupOnError(se, db.isActive());
@@ -862,6 +897,7 @@ public void run() {
// happens because the background thread interacts with store
// on a lower level
if (!isShuttingDown()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5089
log(AS_BACKGROUND_TASK, null, re,
"runtime exception during normal operation");
throw re;
@@ -895,6 +931,7 @@ private void processingLoop() {
daemonLCC.getTransactionExecute().setNoLockWait(true);
} catch (StandardException se) {
log(AS_BACKGROUND_TASK, null, se,
+//IC see: https://issues.apache.org/jira/browse/DERBY-5088
"failed to initialize index statistics updater");
return;
}
@@ -920,13 +957,16 @@ private void processingLoop() {
tc = null;
daemonLCC = null;
queue.clear();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5089
trace(1, "daemon disabled");
+//IC see: https://issues.apache.org/jira/browse/DERBY-5082
break;
}
if (queue.isEmpty()) {
trace(1, "queue empty");
break;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
td = queue.get(0);
}
try {
@@ -1012,6 +1052,7 @@ public void runExplicitly(LanguageConnectionContext lcc,
String runContext)
throws StandardException {
updateIndexStatsMinion(lcc, td, cds, AS_EXPLICIT_TASK);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5089
trace(0, "explicit run completed" + (runContext != null
? " (" + runContext + "): "
: ": ") +
@@ -1031,8 +1072,10 @@ public void stop() {
// 'queue' and the value of 'daemonDisabled'.
boolean clearContext = false;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5087
synchronized (queue) {
if (!daemonDisabled) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5447
clearContext = true;
StringBuffer sb = new StringBuffer(100);
sb.append("stopping daemon, active=").
@@ -1044,7 +1087,9 @@ public void stop() {
log(AS_BACKGROUND_TASK, null, sb.toString());
// If there is no running thread and the daemon lcc is still
// around, destroy the transaction and clear the lcc reference.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5082
if (runningThread == null && daemonLCC != null &&
+//IC see: https://issues.apache.org/jira/browse/DERBY-5088
!isShuttingDown()) {
// try/catch as safe-guard against shutdown race condition.
try {
@@ -1080,10 +1125,12 @@ public void stop() {
// (if any) has been shut down to avoid Java deadlocks
// when closing the container handles obtained with this
// context.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5447
if (clearContext) {
// DERBY-5336: Trigger cleanup code to remove the context
// from the context service. This pattern was
// copied from BasicDaemon.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5336
ctxMgr.cleanupOnError(StandardException.normalClose(), false);
}
}
@@ -1102,11 +1149,13 @@ private boolean handleFatalErrors(ContextManager cm, StandardException se) {
// We are not allowed to write into the database, most likely the
// data dictionary. No point to keep doing work we can't gain from.
disable = true;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5088
} else if (isShuttingDown() ||
se.getSeverity() >= ExceptionSeverity.DATABASE_SEVERITY) {
// DERBY-4037: Swallow exceptions raised during shutdown.
// The database or system is going down. Probably handled elsewhere
// but disable daemon anyway.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5089
trace(1, "swallowed exception during shutdown: " +
extractIstatInfo(se));
disable = true;
@@ -1179,6 +1228,7 @@ private static void sleep(long ms) {
try {
Thread.sleep(ms);
} catch (InterruptedException ie) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
InterruptStatus.setInterrupted();
}
}
@@ -1188,6 +1238,7 @@ private static String fmtScanTimes(long[][] timings) {
// timings[x] = [conglomId, start, end]
StringBuffer sb = new StringBuffer("scan durations (");
for (int i=0; i < timings.length && timings[i][0] > 0; i++) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5108
sb.append('c').append(timings[i][0]).append('=');
// Handle corner-case where the scans are aborted due to the
// index statistics daemon being shut down under us.
@@ -1222,6 +1273,7 @@ private void log(boolean asBackgroundTask, TableDescriptor td, String msg) {
private void log(boolean asBackgroundTask, TableDescriptor td, Throwable t,
String msg) {
if (asBackgroundTask && (doLog || t != null)) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5680
logAlways(td, t, msg);
}
}
@@ -1313,6 +1365,7 @@ private static String cardToStr(long[] cardinality) {
/** Purely for debugging, to avoid printing too much info. */
private static String extractIstatInfo(Throwable t) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5089
String istatClass = IndexStatisticsDaemonImpl.class.getName();
StackTraceElement[] stack = t.getStackTrace();
String trace = "";
@@ -1329,6 +1382,7 @@ private static String extractIstatInfo(Throwable t) {
break;
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-5089
if (t instanceof StandardException) {
sqlState = ", SQLSTate=" + ((StandardException)t).getSQLState();
}
@@ -1342,6 +1396,7 @@ private static String extractIstatInfo(Throwable t) {
*/
private static ContextService getContextService()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getFactory();
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/daemon/SingleThreadDaemonFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/daemon/SingleThreadDaemonFactory.java
index 239b957c8f..da8f7b498a 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/daemon/SingleThreadDaemonFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/daemon/SingleThreadDaemonFactory.java
@@ -37,6 +37,7 @@ public class SingleThreadDaemonFactory implements DaemonFactory
public SingleThreadDaemonFactory()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
contextService = getContextService();
}
@@ -49,11 +50,13 @@ public DaemonService createNewDaemon(String name)
{
BasicDaemon daemon = new BasicDaemon(contextService);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
final Thread daemonThread = BasicDaemon.getMonitor().getDaemonThread(daemon, name, false);
// DERBY-3745. setContextClassLoader for thread to null to avoid
// leaking class loaders.
try {
AccessController.doPrivileged(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
new PrivilegedAction() {
public Object run() {
daemonThread.setContextClassLoader(null);
@@ -78,6 +81,7 @@ public Object run() {
*/
private static ContextService getContextService()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getFactory();
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/jce/JCECipherFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/jce/JCECipherFactory.java
index 5f96f3ca33..e136b70741 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/jce/JCECipherFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/jce/JCECipherFactory.java
@@ -540,7 +540,9 @@ else if (cryptoAlgorithmShort.equals(DES)) {
// provider package should be set by property
if (Security.getProvider(cryptoProviderShort) == null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Class> cryptoClass = Class.forName(cryptoProvider);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6626
if (!Provider.class.isAssignableFrom(cryptoClass)) {
throw StandardException.newException(
SQLState.ENCRYPTION_NOT_A_PROVIDER,
@@ -568,6 +570,7 @@ public Void run() {
if (externalKey != null) {
// incorrect to specify external key and boot password
+//IC see: https://issues.apache.org/jira/browse/DERBY-1156
if (properties.getProperty((newAttrs ?
Attribute.NEW_BOOT_PASSWORD :
Attribute.BOOT_PASSWORD)) != null)
@@ -577,6 +580,7 @@ public Void run() {
org.apache.derby.iapi.util.StringUtil.fromHexString(externalKey,
0,
externalKey.length());
+//IC see: https://issues.apache.org/jira/browse/DERBY-746
if (generatedKey == null) {
throw StandardException.newException(
// If length is even, we assume invalid character(s),
@@ -588,8 +592,10 @@ public Void run() {
} else {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1156
generatedKey = handleBootPassword(create, properties, newAttrs);
if(create || newAttrs)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1156
persistentProperties.put(Attribute.CRYPTO_KEY_LENGTH,
keyLengthBits+"-"+generatedKey.length);
}
@@ -601,6 +607,7 @@ public Void run() {
if (create)
{
persistentProperties.put(Attribute.DATA_ENCRYPTION, "true");
+//IC see: https://issues.apache.org/jira/browse/DERBY-1156
// Set two new properties to allow for future changes to the log and data encryption
// schemes. This property is introduced in version 10 , value starts at 1.
@@ -612,6 +619,7 @@ public Void run() {
return;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6626
catch (ClassNotFoundException cnfe)
{
t = StandardException.newException(
@@ -627,6 +635,7 @@ public Void run() {
{
t = iae;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
catch (NoSuchMethodException nsme)
{
t = nsme;
@@ -653,6 +662,7 @@ public Void run() {
private byte[] handleBootPassword(boolean create,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1156
Properties properties,
boolean newPasswd)
throws StandardException {
@@ -689,11 +699,13 @@ private byte[] handleBootPassword(boolean create,
byte[] generatedKey;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1156
if (create || newPasswd)
{
//
generatedKey = generateUniqueBytes();
+//IC see: https://issues.apache.org/jira/browse/DERBY-1156
persistentProperties.put(RawStoreFactory.ENCRYPTED_KEY,
saveSecretKey(generatedKey, bootPassword));
@@ -716,6 +728,7 @@ public void saveProperties(Properties properties)
{
// put the cipher properties to be persistent into the
// system perisistent properties.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1156
for (Enumeration e = persistentProperties.keys();
e.hasMoreElements(); )
{
@@ -808,6 +821,7 @@ public String changeBootPassword(String changeString, Properties properties, Cip
if (newBPAscii == null || newBPAscii.length < CipherFactory.MIN_BOOTPASS_LENGTH)
throw StandardException.newException(SQLState.ILLEGAL_BP_LENGTH,
CipherFactory.MIN_BOOTPASS_LENGTH);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
// verify old key
@@ -900,6 +914,7 @@ public String changeBootPassword(String changeString, Properties properties, Cip
Please note, this process of verifying the key does not provide any added security but only is
intended to allow to fail gracefully if a wrong encryption key is used
+//IC see: https://issues.apache.org/jira/browse/DERBY-862
StandardException is thrown if there are any problems during the process of verification
of the encryption key or if there is any mismatch of the encryption key.
@@ -937,6 +952,8 @@ public void verifyKey(boolean create, StorageFactory sf, Properties properties)
verifyKeyFile.writeInt(checksum.length);
verifyKeyFile.write(checksum);
verifyKeyFile.write(data);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4963
+//IC see: https://issues.apache.org/jira/browse/DERBY-4963
verifyKeyFile.sync();
}
else
@@ -1023,6 +1040,7 @@ private byte[] getMD5Checksum(byte[] data)
@exception IOException Any exception during accessing the file for read/write
*/
private StorageRandomAccessFile privAccessFile(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6626
StorageFactory storageFactory,
String fileName,
final String filePerms)
@@ -1056,6 +1074,7 @@ public StorageRandomAccessFile run() throws IOException {
private InputStream privAccessGetInputStream(StorageFactory storageFactory,String fileName)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6626
final StorageFile verifyKeyFile
= storageFactory.newStorageFile("", fileName);
try
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/jce/JCECipherProvider.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/jce/JCECipherProvider.java
index 96bf3da1d5..81fa6d0357 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/jce/JCECipherProvider.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/jce/JCECipherProvider.java
@@ -338,6 +338,8 @@ else if (mode == CipherFactory.DECRYPT)
{
// should never happen
if (SanityManager.DEBUG)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
SanityManager.THROWASSERT(ise);
}
catch (GeneralSecurityException gse)
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/jmx/JMXManagementService.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
index e316debc8b..0fef083379 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
@@ -111,11 +111,14 @@ public JMXManagementService() {
public synchronized void boot(boolean create, Properties properties)
throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3424
registeredMbeans = new HashMap();
systemIdentifier =
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
getMonitor().getUUIDFactory().createUUID().toString();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3429
findServer();
myManagementBean = (ObjectName) registerMBean(this,
@@ -125,7 +128,9 @@ public synchronized void boot(boolean create, Properties properties)
registerMBean(
new Version(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
getMonitor().getEngineVersion(),
+//IC see: https://issues.apache.org/jira/browse/DERBY-3506
SystemPermission.ENGINE),
VersionMBean.class,
"type=Version,jar=derby.jar");
@@ -158,6 +163,8 @@ public synchronized void stop() {
registeredMbeans = null;
myManagementServer = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3424
+//IC see: https://issues.apache.org/jira/browse/DERBY-3385
systemIdentifier = null;
}
@@ -203,6 +210,7 @@ public MBeanServer run() {
*
*/
public synchronized Object registerMBean(final T bean,
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
final Class beanInterface,
final String keyProperties)
throws StandardException {
@@ -213,6 +221,8 @@ public synchronized Object registerMBean(final T bean,
+ ",system=" + systemIdentifier);
final StandardMBean standardMBean =
+//IC see: https://issues.apache.org/jira/browse/DERBY-1378
+//IC see: https://issues.apache.org/jira/browse/DERBY-3424
new StandardMBean(bean, beanInterface) {
/**
@@ -229,6 +239,7 @@ protected String getClassName(MBeanInfo info) {
};
// new StandardMBean(bean, beanInterface);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3424
registeredMbeans.put(beanName, standardMBean);
if (mbeanServer != null)
jmxRegister(standardMBean, beanName);
@@ -289,9 +300,11 @@ public void unregisterMBean(Object mbeanIdentifier)
private synchronized void unregisterMBean(final ObjectName mbeanName)
{
//Has this service been shut down?
+//IC see: https://issues.apache.org/jira/browse/DERBY-4306
if (registeredMbeans == null)
return;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3424
if (registeredMbeans.remove(mbeanName) == null)
return;
@@ -339,12 +352,15 @@ public Object run() throws JMException {
}
public synchronized boolean isManagementActive() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3424
+//IC see: https://issues.apache.org/jira/browse/DERBY-1387
return mbeanServer != null;
}
public synchronized void startManagement() {
//Has this service been shut down?
+//IC see: https://issues.apache.org/jira/browse/DERBY-3424
if (registeredMbeans == null)
return;
@@ -365,6 +381,7 @@ public synchronized void startManagement() {
// If we registered this as a management bean
// then leave it registered to allow the mbeans
// to be re-registered with JMX
+//IC see: https://issues.apache.org/jira/browse/DERBY-3499
if (mbeanName.equals(myManagementBean) &&
mbeanServer.isRegistered(myManagementBean))
continue;
@@ -395,6 +412,8 @@ public synchronized void stopManagement() {
continue;
jmxUnregister(mbeanName);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-3424
+//IC see: https://issues.apache.org/jira/browse/DERBY-1387
mbeanServer = null;
}
}
@@ -403,6 +422,7 @@ public synchronized void stopManagement() {
* Control permission (permissions are immutable).
*/
private final static SystemPermission CONTROL =
+//IC see: https://issues.apache.org/jira/browse/DERBY-3491
new SystemPermission(
SystemPermission.JMX, SystemPermission.CONTROL);
@@ -412,6 +432,7 @@ public synchronized void stopManagement() {
*/
private void checkJMXControl() {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3462
if (System.getSecurityManager() != null)
AccessController.checkPermission(CONTROL);
} catch (AccessControlException e) {
@@ -428,6 +449,7 @@ public synchronized String getSystemIdentifier() {
@Override
public String quotePropertyValue(String value) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6733
return ObjectName.quote(value);
}
@@ -437,6 +459,7 @@ public String quotePropertyValue(String value) {
*/
private static ModuleFactory getMonitor()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/jmxnone/NoManagementService.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/jmxnone/NoManagementService.java
index c43311df1f..e313001cc1 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/jmxnone/NoManagementService.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/jmxnone/NoManagementService.java
@@ -31,6 +31,7 @@ public final class NoManagementService implements ManagementService {
public NoManagementService() {
}
public Object registerMBean(T bean,
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
Class beanInterface,
String keyProperties)
{
@@ -39,6 +40,8 @@ public Object registerMBean(T bean,
public void unregisterMBean(Object mbeanIdentifier) {
}
public boolean isManagementActive() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3424
+//IC see: https://issues.apache.org/jira/browse/DERBY-1387
return false;
}
public void startManagement() {
@@ -49,6 +52,7 @@ public String getSystemIdentifier() {
return null;
}
public String quotePropertyValue(String value) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6733
return null;
}
-}
\ No newline at end of file
+}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/AbstractPool.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/AbstractPool.java
index 125775cbe9..90fa3b4edb 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/AbstractPool.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/AbstractPool.java
@@ -396,6 +396,7 @@ private void getAndApply(boolean dbOnly, Dictionary p, String key) {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5224
Serializable value = (Serializable) PropertyUtil.getPropertyFromSet(dbOnly, p, key);
if (value != null) {
validate(key, value, p);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/ActiveLock.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/ActiveLock.java
index 28487244ca..3616961e2e 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/ActiveLock.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/ActiveLock.java
@@ -52,6 +52,7 @@ public final class ActiveLock extends Lock {
/**
If true then this lock can be granted even if
it is not the first lock request on the wait queue.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
This can occur if the compatibility space already holds
a lock on the object.
*/
@@ -64,6 +65,7 @@ version of this class may become mutable - mutable identity.
MT - single thread required
*/
protected ActiveLock(CompatibilitySpace space, Lockable ref,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
Object qualifier) {
super(space, ref, qualifier);
}
@@ -94,6 +96,7 @@ protected void clearPotentiallyGranted() {
/**
Wait for a lock to be granted, returns when the lock is granted.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
The sleep wakeup scheme depends on the two booleans wakeUpNow and potentiallyGranted.
MT - Single thread required - and assumed to be the thread requesting the lock.
@@ -119,6 +122,10 @@ else if (timeout > 0) {
}
} catch (InterruptedException ie) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4769
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
+//IC see: https://issues.apache.org/jira/browse/DERBY-4967
+//IC see: https://issues.apache.org/jira/browse/DERBY-4967
wakeUpNow = Constants.WAITING_LOCK_INTERRUPTED;
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java
index 1eb440ed99..ea92d401a5 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java
@@ -359,6 +359,7 @@ public Lock lockObject(CompatibilitySpace compatibilitySpace, Lockable ref,
//
// This logic supports the use-case of DERBY-6554.
//
+//IC see: https://issues.apache.org/jira/browse/DERBY-6554
blockedByParent =
(timeout == 0) &&
compatibilitySpace.getOwner().isNestedOwner() &&
@@ -403,6 +404,7 @@ public Lock lockObject(CompatibilitySpace compatibilitySpace, Lockable ref,
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6554
return null;
}
@@ -616,6 +618,7 @@ public Lock lockObject(CompatibilitySpace compatibilitySpace, Lockable ref,
{
// ending wait because of lock timeout or interrupt
+//IC see: https://issues.apache.org/jira/browse/DERBY-4967
if (wakeupReason ==
Constants.WAITING_LOCK_INTERRUPTED) {
@@ -942,6 +945,7 @@ private String toDebugString()
if (SanityManager.DEBUG)
{
String str = "";
+//IC see: https://issues.apache.org/jira/browse/DERBY-5491
int i = 0;
for (Entry entry : locks.values())
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/Control.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/Control.java
index f103779afd..117ac020a2 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/Control.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/Control.java
@@ -35,6 +35,7 @@ public interface Control {
public Lock getLock(CompatibilitySpace compatibilitySpace,
Object qualifier);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
//EXCLUDE-START-lockdiag-
/**
@@ -59,6 +60,7 @@ public Lock getLock(CompatibilitySpace compatibilitySpace,
public List getWaiting();
public boolean isGrantable(boolean otherWaiters,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
CompatibilitySpace compatibilitySpace,
Object qualifier);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/D_LockControl.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/D_LockControl.java
index fc844649e1..c03b1c0ba8 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/D_LockControl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/D_LockControl.java
@@ -118,6 +118,7 @@ public void diag_detail(Properties prop) {}
*/
static void debugLock(String type, CompatibilitySpace compatibilitySpace,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
Object group, Lockable ref, Object qualifier,
int timeout) {
@@ -169,6 +170,7 @@ static String debugLockString(CompatibilitySpace compatibilitySpace,
static String debugLockString(CompatibilitySpace compatibilitySpace,
Object group, Lockable ref) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
if (SanityManager.DEBUG) {
@@ -189,6 +191,7 @@ static String debugLockString(CompatibilitySpace compatibilitySpace,
static String debugLockString(CompatibilitySpace compatibilitySpace,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
Object group, Lockable ref,
Object qualifier, int timeout) {
@@ -198,6 +201,7 @@ static String debugLockString(CompatibilitySpace compatibilitySpace,
debugAppendObject(sb, " Lockable ", ref);
debugAppendObject(sb, " Qualifier=", qualifier);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
debugAppendObject(sb, " CompatibilitySpace=", compatibilitySpace);
debugAppendObject(sb, " Group=", group);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/Deadlock.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/Deadlock.java
index a1ecf961ec..d958b3d387 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/Deadlock.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/Deadlock.java
@@ -572,6 +572,7 @@ private static void addInfo(StringBuffer sb, String desc, Object data) {
*/
static Context getContext( final String contextID )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getContext( contextID );
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/Lock.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/Lock.java
index 7def6ea328..6143cc20bf 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/Lock.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/Lock.java
@@ -38,6 +38,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
class Lock implements Latch, Control {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1704
/**
Compatibility space the object is locked in.
@@ -76,6 +77,7 @@ public final Lockable getLockable() {
/**
Return the compatibility space this lock is held in.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
MT - Thread safe
*/
@@ -150,6 +152,7 @@ public final boolean equals(Object other) {
if (other instanceof Lock) {
Lock ol = (Lock) other;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
return (space == ol.space) && ref.equals(ol.ref)
&& (qualifier == ol.qualifier);
}
@@ -166,6 +169,7 @@ public LockControl getLockControl() {
}
public Lock getLock(CompatibilitySpace compatibilitySpace,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
Object qualifier) {
if ((space == compatibilitySpace) && (this.qualifier == qualifier)) {
return this;
@@ -222,6 +226,7 @@ public List getWaiting() {
}
public boolean isGrantable(boolean noWaitersBeforeMe,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
CompatibilitySpace compatibilitySpace,
Object requestQualifier)
{
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/LockControl.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/LockControl.java
index e5814c9407..03c0d08212 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/LockControl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/LockControl.java
@@ -670,6 +670,7 @@ private void addWaiter(Lock lockItem, LockTable ls) {
* @return The removed lock request
*/
private Object popFrontWaiter(LockTable ls) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1704
return removeWaiter(0, ls);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/LockSpace.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/LockSpace.java
index eefd15a898..607a13c2f5 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/LockSpace.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/LockSpace.java
@@ -39,6 +39,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
A LockSpace represents the complete set of locks held within
a single compatibility space, broken into groups of locks.
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
A LockSpace contains a HashMap keyed by the group reference,
the data for each key is a HashMap of Lock's.
@@ -63,6 +64,7 @@ final class LockSpace implements CompatibilitySpace {
/** Cached HashMaps for storing lock groups. */
private final ArrayDeque> spareGroups =
new ArrayDeque>(MAX_CACHED_GROUPS);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
// the Limit info.
private Object callbackGroup;
@@ -76,7 +78,9 @@ final class LockSpace implements CompatibilitySpace {
* @param owner an object representing the owner of the compatibility space
*/
LockSpace(LockOwner owner) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
groups = new HashMap>();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
this.owner = owner;
}
@@ -97,6 +101,7 @@ protected synchronized void addLock(Object group, Lock lock)
Lock lockInGroup = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
HashMap dl = groups.get(group);
if (dl == null) {
dl = getGroupMap(group);
@@ -121,6 +126,7 @@ protected synchronized void addLock(Object group, Lock lock)
if (groupSize > nextLimitCall) {
inLimit = true;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
callback.reached(this, group, limit,
new LockList(java.util.Collections.enumeration(dl.keySet())), groupSize);
inLimit = false;
@@ -144,11 +150,14 @@ else if (newGroupSize < (nextLimitCall / 2))
Unlock all the locks in a group and then remove the group.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2327
synchronized void unlockGroup(LockTable lset, Object group) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
HashMap dl = groups.remove(group);
if (dl == null)
return;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
for (Lock lock : dl.keySet()) {
lset.unlock(lock, 0);
}
@@ -162,15 +171,18 @@ synchronized void unlockGroup(LockTable lset, Object group) {
private HashMap getGroupMap(Object group) {
HashMap dl = spareGroups.poll();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
if (dl == null)
dl = new HashMap(5, 0.8f);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1704
groups.put(group, dl);
return dl;
}
private void saveGroup(HashMap dl) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
if (spareGroups.size() < MAX_CACHED_GROUPS) {
spareGroups.offer(dl);
dl.clear();
@@ -180,12 +192,15 @@ private void saveGroup(HashMap dl) {
/**
Unlock all locks in the group that match the key
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2327
synchronized void unlockGroup(LockTable lset, Object group, Matchable key) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
HashMap dl = groups.get(group);
if (dl == null)
return; // no group at all
boolean allUnlocked = true;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
for (Iterator e = dl.keySet().iterator(); e.hasNext(); ) {
Lock lock = e.next();
if (!key.match(lock.getLockable())) {
@@ -199,6 +214,7 @@ synchronized void unlockGroup(LockTable lset, Object group, Matchable key) {
if (allUnlocked) {
groups.remove(group);
saveGroup(dl);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
if ((callbackGroup != null) && group.equals(callbackGroup)) {
nextLimitCall = limit;
}
@@ -206,6 +222,7 @@ synchronized void unlockGroup(LockTable lset, Object group, Matchable key) {
}
synchronized void transfer(Object oldGroup, Object newGroup) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
HashMap from = groups.get(oldGroup);
if (from == null)
return;
@@ -224,6 +241,7 @@ synchronized void transfer(Object oldGroup, Object newGroup) {
// place the contents of to into from
mergeGroups(to, from);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1704
Object oldTo = groups.put(newGroup, from);
if (SanityManager.DEBUG) {
SanityManager.ASSERT(oldTo == to, "inconsistent state in LockSpace");
@@ -234,22 +252,27 @@ synchronized void transfer(Object oldGroup, Object newGroup) {
}
clearLimit(oldGroup);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1704
groups.remove(oldGroup);
}
private void mergeGroups(HashMap from, HashMap into) {
for (Lock lock : from.keySet()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
Lock lockI = into.get(lock);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
if (lockI == null) {
// lock is only in from list
into.put(lock, lock);
} else {
// merge the locks
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Lock fromL = lock;
Lock intoL = lockI;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
intoL.count += fromL.getCount();
}
@@ -257,10 +280,12 @@ private void mergeGroups(HashMap from, HashMap into) {
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2327
synchronized int unlockReference(LockTable lset, Lockable ref,
Object qualifier, Object group) {
// look for locks matching our reference and qualifier.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
HashMap dl = groups.get(group);
if (dl == null)
return 0;
@@ -275,6 +300,8 @@ synchronized int unlockReference(LockTable lset, Lockable ref,
if (dl.isEmpty()) {
groups.remove(group);
saveGroup(dl);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
if ((callbackGroup != null) && group.equals(callbackGroup)) {
nextLimitCall = limit;
}
@@ -293,6 +320,7 @@ synchronized int unlockReference(LockTable lset, Lockable ref,
Return true if locks are held in a group
*/
synchronized boolean areLocksHeld(Object group) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1704
return groups.containsKey(group);
}
@@ -307,6 +335,7 @@ synchronized boolean areLocksHeld() {
synchronized boolean isLockHeld(Object group, Lockable ref, Object qualifier) {
// look for locks matching our reference and qualifier.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
HashMap dl = groups.get(group);
if (dl == null)
return false;
@@ -346,6 +375,7 @@ synchronized int deadlockCount(int bail) {
int count = 0;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
for (HashMap group: groups.values()) {
for (Lock lock: group.keySet()) {
count += lock.getCount();
@@ -364,6 +394,7 @@ synchronized int deadlockCount(int bail) {
*/
class LockList implements Enumeration {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
private Enumeration lockGroup;
@@ -376,6 +407,7 @@ public boolean hasMoreElements() {
}
public Lockable nextElement() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return (lockGroup.nextElement()).getLockable();
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/LockTable.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/LockTable.java
index 15544f60cb..ccf070e634 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/LockTable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/LockTable.java
@@ -154,5 +154,6 @@ boolean zeroDurationLockObject(CompatibilitySpace space, Lockable ref,
* @param waiters the map to add the waiters to
* @see LockControl#addWaiters
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
void addWaiters(Map waiters);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/LockTableVTI.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/LockTableVTI.java
index 4639ad0c66..4838f22d6e 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/LockTableVTI.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/LockTableVTI.java
@@ -51,6 +51,7 @@ class LockTableVTI implements Enumeration
private ListIterator waitingList;
private Latch nextLock;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1704
LockTableVTI(Map clonedLockTable)
{
outerControl = clonedLockTable.values().iterator();
@@ -65,6 +66,7 @@ public boolean hasMoreElements() {
for (;;) {
if (control == null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1704
if (!outerControl.hasNext())
return false;
//System.out.println("new control lock ");
@@ -102,6 +104,7 @@ private Latch getNextLock(Control control) {
Latch lock = null;
if (grantedList != null) {
if (grantedList.hasNext()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5224
lock = (Latch) grantedList.next();
}
else
@@ -111,6 +114,7 @@ private Latch getNextLock(Control control) {
if (lock == null) {
if (waitingList != null) {
if (waitingList.hasNext()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5224
lock = (Latch) waitingList.next();
}
else
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/TableNameInfo.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/TableNameInfo.java
index d2c4b63823..240e134662 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/TableNameInfo.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/TableNameInfo.java
@@ -70,12 +70,14 @@ public String getTableName(Long conglomId) {
return "?";
// see if we have already seen this conglomerate
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
TableDescriptor td = tableCache.get(conglomId);
if (td == null)
{
// first time we see this conglomerate, get it from the
// ddCache
ConglomerateDescriptor cd = ddCache.get(conglomId);
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
if (cd != null)
{
@@ -143,6 +145,7 @@ public String getTableType(Long conglomId) {
String type;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
TableDescriptor td = tableCache.get(conglomId);
if (td != null)
{
@@ -176,6 +179,7 @@ public String getTableType(Long conglomId) {
public String getIndexName(Long conglomId) {
if (conglomId == null)
return "?";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return indexCache.get(conglomId);
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/Timeout.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/Timeout.java
index 724c0d226d..c91bca87df 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/Timeout.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/locks/Timeout.java
@@ -160,6 +160,7 @@ private String buildLockTableString() throws StandardException
// need language here to print out tablenames
LanguageConnectionContext lcc = (LanguageConnectionContext)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
Deadlock.getContext(LanguageConnectionContext.CONTEXT_ID);
if( lcc != null )
tc = lcc.getTransactionExecute();
@@ -262,6 +263,7 @@ public static String buildString( Enumeration table, long time ) throws Standard
*/
private void dumpLock() throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Hashtable attributes = new Hashtable(17);
Object lock_type = currentLock.getQualifier();
@@ -293,6 +295,7 @@ private void dumpLock() throws StandardException
if( attributes.get(VirtualLockTable.CONTAINERID) != null && tc != null )
{
Long value = (Long)attributes.get(VirtualLockTable.CONTAINERID);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
conglomId = tc.findConglomid( value.longValue() );
attributes.put( VirtualLockTable.CONGLOMID, conglomId );
}
@@ -306,6 +309,7 @@ private void dumpLock() throws StandardException
{
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
containerId = tc.findContainerid( conglomId.longValue() );
attributes.put( VirtualLockTable.CONTAINERID, containerId );
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/BaseMonitor.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/BaseMonitor.java
index a5f7712dd3..0bf0e5a949 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/BaseMonitor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/BaseMonitor.java
@@ -89,6 +89,7 @@ that the its was loaded in for all class loading.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
abstract class BaseMonitor
implements ModuleFactory, BundleFinder {
@@ -98,6 +99,7 @@ abstract class BaseMonitor
Hash table of objects that implement PersistentService keyed by their getType() method.
*/
private final HashMap serviceProviders =
+//IC see: https://issues.apache.org/jira/browse/DERBY-6619
new HashMap();
private static final String LINE =
"----------------------------------------------------------------";
@@ -124,6 +126,7 @@ Hash table of objects that implement PersistentService keyed by their getType()
private PrintWriter logging;
ThreadGroup daemonGroup;
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
// class registry
/* one byte format identifiers never used
@@ -133,10 +136,13 @@ Hash table of objects that implement PersistentService keyed by their getType()
// private InstanceGetter[] rc4;
/* Constructor */
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
BaseMonitor() {
super();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
services = new Vector(0, 1);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
services.add(new TopService(this)); // first element is always the free-floating service
}
@@ -155,8 +161,10 @@ public void shutdown() {
inShutdown = true;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-4601
Monitor.getStream().println(LINE);
//Make a note of Engine shutdown in the log file
+//IC see: https://issues.apache.org/jira/browse/DERBY-4755
Monitor.getStream().println(
MessageService.getTextMessage(
MessageId.CONN_SHUT_DOWN_ENGINE,
@@ -178,6 +186,7 @@ public void shutdown() {
if (position == 0)
break;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
ts = services.get(position);
}
@@ -198,9 +207,12 @@ public void shutdown() {
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-4601
Monitor.getStream().println(LINE);
(services.get(0)).shutdown();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
stopContextService();
}
@@ -238,6 +250,7 @@ protected final void runWithState(Properties properties, PrintWriter log) {
logging = log;
// false indicates the full monitor is required, not the lite.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6617
if (!initialize(false)) {
dumpTempWriter(true);
return;
@@ -246,8 +259,10 @@ protected final void runWithState(Properties properties, PrintWriter log) {
// if monitor is already set then the system is already
// booted or in the process of booting or shutting down.
if ( setMonitor( this ) ) { return; }
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
MessageService.setFinder(this);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1439
if (SanityManager.DEBUG) {
reportOn = Boolean.valueOf(PropertyUtil.getSystemProperty("derby.monitor.verbose")).booleanValue();
@@ -276,6 +291,7 @@ protected final void runWithState(Properties properties, PrintWriter log) {
}
Vector> bootImplementations = getImplementations(bootProperties, false);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Vector> systemImplementations = null;
Vector> applicationImplementations = null;
@@ -289,6 +305,7 @@ protected final void runWithState(Properties properties, PrintWriter log) {
}
Vector> defaultImplementations = getDefaultImplementations();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
int implementationCount = 0;
if (bootImplementations != null)
@@ -307,6 +324,7 @@ protected final void runWithState(Properties properties, PrintWriter log) {
implementationCount++;
implementationSets = new ArrayList>>(implementationCount);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
if (bootImplementations != null)
implementationSets.add(bootImplementations);
@@ -329,12 +347,14 @@ protected final void runWithState(Properties properties, PrintWriter log) {
addDebugFlags(applicationProperties.getProperty(Monitor.DEBUG_TRUE), true);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-623
addDebugFlags(PropertyUtil.getSystemProperty(Monitor.DEBUG_FALSE), false);
addDebugFlags(PropertyUtil.getSystemProperty(Monitor.DEBUG_TRUE), true);
}
try {
systemStreams = (InfoStreams) Monitor.startSystemModule("org.apache.derby.shared.common.stream.InfoStreams");
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
if (SanityManager.DEBUG) {
SanityManager.SET_DEBUG_STREAM(systemStreams.stream().getPrintWriter());
@@ -344,9 +364,12 @@ protected final void runWithState(Properties properties, PrintWriter log) {
uuidFactory = (UUIDFactory) Monitor.startSystemModule("org.apache.derby.iapi.services.uuid.UUIDFactory");
+//IC see: https://issues.apache.org/jira/browse/DERBY-31
timerFactory = (TimerFactory)Monitor.startSystemModule("org.apache.derby.iapi.services.timer.TimerFactory");
Monitor.startSystemModule(Module.JMX);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3424
+//IC see: https://issues.apache.org/jira/browse/DERBY-1387
} catch (StandardException se) {
@@ -356,6 +379,8 @@ protected final void runWithState(Properties properties, PrintWriter log) {
dumpTempWriter(true);
return;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6117
+//IC see: https://issues.apache.org/jira/browse/DERBY-6617
} catch (AccessControlException e) {
dumpTempWriter(true);
throw e;
@@ -375,6 +400,7 @@ protected final void runWithState(Properties properties, PrintWriter log) {
// bootup all the service providers
determineSupportedServiceProviders();
+//IC see: https://issues.apache.org/jira/browse/DERBY-927
// See if automatic booting of persistent services is required
boolean bootAll = Boolean.valueOf(PropertyUtil.getSystemProperty(Property.BOOT_ALL)).booleanValue();
@@ -415,6 +441,7 @@ public Object findService(String factoryInterface, String serviceName) {
TopService myts = null;
synchronized (this) {
for (int i = 1; i < services.size(); i++) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
TopService ts = services.get(i);
if (ts.isPotentialService(key)) {
myts = ts;
@@ -547,6 +574,7 @@ private synchronized TopService findTopService(Object serviceModule) {
if (serviceModule == null)
return services.get(0);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
for (int i = 1; i < services.size(); i++) {
TopService ts = services.get(i);
@@ -600,6 +628,7 @@ public InstanceGetter classFromIdentifier(int fmtId)
off = fmtId - StoredFormatIds.MIN_TWO_BYTE_FORMAT_ID;
iga = rc2;
if (iga == null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6188
iga = rc2 = new InstanceGetter[ RegisteredFormatIds.countTwoByteIDs() ];
}
@@ -619,6 +648,7 @@ public InstanceGetter classFromIdentifier(int fmtId)
Throwable t;
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
Class> clazz = Class.forName(className);
final Constructor> constructor = clazz.getDeclaredConstructor();
@@ -637,6 +667,7 @@ public InstanceGetter classFromIdentifier(int fmtId)
t = iae;
} catch (InstantiationException ie) {
t = ie;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
} catch (NoSuchMethodException nsme) {
t = nsme;
} catch (InvocationTargetException ite) {
@@ -691,6 +722,7 @@ public Object newInstanceFromIdentifier(int identifier)
catch (IllegalAccessException iae) {
t = iae;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
catch (NoSuchMethodException iae) {
t = iae;
}
@@ -701,6 +733,7 @@ public Object newInstanceFromIdentifier(int identifier)
t = le;
}
throw StandardException.newException(SQLState.REGISTERED_CLASS_INSTANCE_ERROR,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
t, identifier, "XX" /*ci.getClassName()*/);
}
@@ -721,6 +754,7 @@ protected Object loadInstance(Class> factoryInterface, Properties properties)
instance = loadInstance(localImplementations, factoryInterface, properties);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
for (List> set : implementationSets) {
instance = loadInstance(set, factoryInterface, properties);
if (instance != null)
@@ -731,6 +765,7 @@ protected Object loadInstance(Class> factoryInterface, Properties properties)
}
private Object loadInstance(List> implementations,
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
Class> factoryInterface,
Properties properties) {
@@ -743,6 +778,7 @@ private Object loadInstance(List> implementations,
// try to create an instance
Object instance = newInstance((Class) implementations.get(index));
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
if (BaseMonitor.canSupport(instance, properties))
return instance;
@@ -786,10 +822,12 @@ private static int findImplementation(List> implementations,
private Object newInstance(Class> classObject) {
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
final Constructor> constructor = classObject.getDeclaredConstructor();
final Object module = constructor.newInstance();
// Get and report any warnings generated during initialization
+//IC see: https://issues.apache.org/jira/browse/DERBY-6619
try {
final Method getWarn = classObject.getMethod("getWarnings");
final String warnings = (String)getWarn.invoke(module);
@@ -815,6 +853,7 @@ private Object newInstance(Class> classObject) {
catch (IllegalAccessException e) {
report(classObject.getName() + " " + e.toString());
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
catch (NoSuchMethodException e) {
report(classObject.getName() + " " + e.toString());
}
@@ -851,6 +890,7 @@ public String[] getServiceList(String protocol) {
// count the number of services that implement the required protocol
for (int i = 1; i < services.size(); i++) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
ts = services.get(i);
if (ts.isActiveService()) {
if (ts.getKey().getFactoryInterface().getName().equals(protocol))
@@ -863,6 +903,7 @@ public String[] getServiceList(String protocol) {
if (count != 0) {
int j = 0;
for (int i = 1; i < services.size(); i++) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
ts = services.get(i);
if (ts.isActiveService()) {
if (ts.getKey().getFactoryInterface().getName().equals(protocol)) {
@@ -970,6 +1011,7 @@ public void startServices(Properties properties, boolean bootAll) {
try {
if (protocolOrType.equals(Monitor.SERVICE_TYPE_DIRECTORY)) {
if (bootAll) // only if automatic booting is required
+//IC see: https://issues.apache.org/jira/browse/DERBY-927
findProviderAndStartService(name, properties, true);
} else {
bootService((PersistentService) null,
@@ -997,6 +1039,7 @@ public final boolean startPersistentService(String name, Properties properties)
throws StandardException {
return findProviderAndStartService(name, properties, false);
+//IC see: https://issues.apache.org/jira/browse/DERBY-927
}
@@ -1014,6 +1057,7 @@ public Object createPersistentService(String factoryInterface, String name, Prop
throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-927
PersistentService provider = findProviderForCreate(name);
if (provider == null) {
throw StandardException.newException(SQLState.PROTOCOL_UNKNOWN, name);
@@ -1064,6 +1108,7 @@ private Vector> getImplementations(Properties moduleList, boolean actua
return null;
Vector> implementations = actualModuleList ? new Vector>(moduleList.size()) : new Vector>(0,1);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
// Get my current JDK environment
int theJDKId = JVMInfo.JDK_ID;
@@ -1077,6 +1122,7 @@ private Vector> getImplementations(Properties moduleList, boolean actua
// module tagged name in the modules.properties file.
// used as the tag for dependent properties.
+//IC see: https://issues.apache.org/jira/browse/DERBY-927
String tag;
// Dynamically loaded code is defined by a property of
@@ -1138,6 +1184,7 @@ private Vector> getImplementations(Properties moduleList, boolean actua
try {
Class> possibleModule = Class.forName(className);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
// Look for the monitors special modules, PersistentService ones.
if (getPersistentServiceImplementation(possibleModule))
@@ -1169,6 +1216,7 @@ private Vector> getImplementations(Properties moduleList, boolean actua
offset += envModuleCount[eji];
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
implementations.add(offset, possibleModule);
envModuleCount[envJDKId]++;
@@ -1246,6 +1294,7 @@ private boolean getPersistentServiceImplementation( Class> possibleModule)
private Vector> getDefaultImplementations() {
Properties moduleList = getDefaultModuleProperties();
+//IC see: https://issues.apache.org/jira/browse/DERBY-626
return getImplementations(moduleList, true);
} // end of getDefaultImplementations
@@ -1266,6 +1315,7 @@ Properties getDefaultModuleProperties()
ClassLoader cl = getClass().getClassLoader();
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-798
Enumeration e = cl == null ?
ClassLoader.getSystemResources("org/apache/derby/modules.properties") :
cl.getResources("org/apache/derby/modules.properties");
@@ -1285,6 +1335,7 @@ Properties getDefaultModuleProperties()
for( Enumeration newKeys = otherList.keys(); newKeys.hasMoreElements() ;)
{
String key = (String) newKeys.nextElement();
+//IC see: https://issues.apache.org/jira/browse/DERBY-4815
if (moduleList.containsKey(key))
// RESOLVE how do we localize messages before we have finished initialization?
report( "Ignored duplicate property " + key + " in " + modulesPropertiesURL.toString());
@@ -1307,6 +1358,7 @@ Properties getDefaultModuleProperties()
if (SanityManager.DEBUG)
report("Can't load implementation list: " + ioe.toString());
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-626
if (SanityManager.DEBUG)
{
if (firstList)
@@ -1343,6 +1395,7 @@ protected static Properties removeRuntimeProperties(Properties properties) {
/**
Get InputStream for application properties file Returns nul if it does not exist.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
abstract InputStream applicationPropertiesStream()
throws IOException;
@@ -1420,11 +1473,13 @@ protected Properties readApplicationProperties() {
private void determineSupportedServiceProviders() {
for (Iterator i = serviceProviders.values().iterator(); i.hasNext(); ) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
PersistentService provider = i.next();
// see if this provider can live in this environment
if (!BaseMonitor.canSupport(provider, (Properties) null)) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-927
i.remove();
continue;
}
@@ -1504,6 +1559,7 @@ private boolean findProviderAndStartService(String name,
int colon = name.indexOf(':');
if (colon != -1) {
actualProvider = findProviderFromName(name, colon);
+//IC see: https://issues.apache.org/jira/browse/DERBY-927
// if null is returned here then its a sub-sub protocol/provider
// that we don't understand. Attempt to load it as an untyped name.
@@ -1583,6 +1639,7 @@ private boolean findProviderAndStartService(String name,
protected PersistentService findProviderForCreate(String name) throws StandardException {
// RESOLVE - hard code creating databases in directories for now.
+//IC see: https://issues.apache.org/jira/browse/DERBY-927
return (PersistentService) findProviderFromName(name, name.indexOf(':'));
}
@@ -1604,6 +1661,7 @@ private PersistentService findProviderFromName(String name, int colon) throws St
} else {
serviceType = name.substring(0, colon);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-927
return getServiceProvider(serviceType);
}
@@ -1617,6 +1675,7 @@ public PersistentService getServiceProvider(String subSubProtocol) throws Standa
if( ps != null)
return ps;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-927
return getPersistentService(subSubProtocol);
} // end of getServiceProvider
@@ -1647,6 +1706,7 @@ private PersistentService getPersistentService( final String className, String s
e,
subSubProtocol, className);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-927
return new StorageFactoryService( subSubProtocol, storageFactoryClass);
} // end of getPersistentService
@@ -1659,14 +1719,17 @@ private PersistentService getPersistentService( final String className, String s
private String getStorageFactoryClassName(String subSubProtocol)
{
String propertyName = Property.SUB_SUB_PROTOCOL_PREFIX + subSubProtocol;
+//IC see: https://issues.apache.org/jira/browse/DERBY-927
String className = PropertyUtil.getSystemProperty( propertyName);
if( className != null)
return className;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return storageFactories.get( subSubProtocol);
} // end of getStorageFactoryClassName
private static final HashMap storageFactories = new HashMap();
static {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
storageFactories.put( PersistentService.DIRECTORY,
"org.apache.derby.impl.io.DirStorageFactory");
storageFactories.put( PersistentService.CLASSPATH,
@@ -1677,6 +1740,8 @@ private String getStorageFactoryClassName(String subSubProtocol)
"org.apache.derby.impl.io.URLStorageFactory");
storageFactories.put( PersistentService.HTTPS,
"org.apache.derby.impl.io.URLStorageFactory");
+//IC see: https://issues.apache.org/jira/browse/DERBY-646
+//IC see: https://issues.apache.org/jira/browse/DERBY-4084
storageFactories.put( PersistentService.INMEMORY,
"org.apache.derby.impl.io.VFMemoryStorageFactory");
}
@@ -1729,6 +1794,7 @@ protected Object bootService(PersistentService provider,
}
for (int i = 1; i < services.size(); i++) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
TopService ts2 = services.get(i);
if (ts2.isPotentialService(serviceKey)) {
// if the service already exists then just return null
@@ -1762,6 +1828,7 @@ protected Object bootService(PersistentService provider,
}
ts = new TopService(this, serviceKey, provider, serviceLocale);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
services.add(ts);
}
@@ -1864,6 +1931,7 @@ protected Object bootService(PersistentService provider,
if (ts != null) {
ts.shutdown();
synchronized (this) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
services.remove(ts);
}
@@ -1877,6 +1945,7 @@ protected Object bootService(PersistentService provider,
Throwable nested = se.getCause();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2472
// never hide ThreadDeath
if (nested instanceof ThreadDeath)
@@ -1912,6 +1981,7 @@ protected Object bootService(PersistentService provider,
/**
Return the UUID factory for this system. Returns null
if there isn't one.
+//IC see: https://issues.apache.org/jira/browse/DERBY-862
See com.ibm.db2j.system.System
*/
public UUIDFactory getUUIDFactory() {
@@ -1925,6 +1995,7 @@ public UUIDFactory getUUIDFactory() {
* @return the system's Timer factory.
*/
public TimerFactory getTimerFactory() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-31
return timerFactory;
}
@@ -2069,6 +2140,7 @@ private static Locale setLocale(Properties properties)
public ResourceBundle getBundle(String messageId) {
ContextManager cm;
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
cm = getContextService().getCurrentContextManager();
} catch (ShutdownException se) {
cm = null;
@@ -2093,6 +2165,7 @@ public Thread getDaemonThread(Runnable task, String name, boolean setMinPriority
@Override
public final boolean isDaemonThread(Thread thread) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6631
return thread.getThreadGroup() == daemonGroup;
}
@@ -2102,6 +2175,7 @@ public final boolean isDaemonThread(Thread thread) {
*/
private static ContextService getContextService()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
@@ -2120,6 +2194,7 @@ public ContextService run()
*/
private static void stopContextService()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
AccessController.doPrivileged
(
new PrivilegedAction()
@@ -2158,7 +2233,9 @@ public Boolean run()
Returns false if the monitor cannot be initialized, true otherwise.
*/
abstract boolean initialize(boolean lite);
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
class ProviderEnumeration implements Enumeration
{
private Enumeration serviceProvidersKeys = (serviceProviders == null) ? null :
@@ -2180,6 +2257,7 @@ public PersistentService nextElement() throws NoSuchElementException
if( serviceProvidersKeys != null && serviceProvidersKeys.hasMoreElements())
return serviceProviders.get( serviceProvidersKeys.nextElement());
getNextStorageFactory();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
PersistentService ret = storageFactoryPersistentService;
storageFactoryPersistentService = null;
return ret;
@@ -2217,6 +2295,7 @@ private void getNextStorageFactory()
try
{
storageFactoryPersistentService
+//IC see: https://issues.apache.org/jira/browse/DERBY-927
= getPersistentService( getStorageFactoryClassName(PersistentService.DIRECTORY),
PersistentService.DIRECTORY);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/FileMonitor.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/FileMonitor.java
index be4baa8434..ecea70ca12 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/FileMonitor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/FileMonitor.java
@@ -89,6 +89,7 @@ public Object getEnvironment() {
* a SecurityException
*/
private ThreadGroup createDaemonGroup() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1439
try {
ThreadGroup group = new ThreadGroup("derby.daemons");
group.setDaemon(true);
@@ -98,6 +99,8 @@ private ThreadGroup createDaemonGroup() {
// let the daemon threads be created in the default thread group.
// This can only happen if the current Derby thread is a part of
// the root thread group "system".
+//IC see: https://issues.apache.org/jira/browse/DERBY-6117
+//IC see: https://issues.apache.org/jira/browse/DERBY-6617
reportThread(se);
return null;
}
@@ -107,6 +110,7 @@ private ThreadGroup createDaemonGroup() {
SECURITY WARNING.
This method is run in a privileged block in a Java 2 environment.
+//IC see: https://issues.apache.org/jira/browse/DERBY-623
Set the system home directory. Returns false if it couldn't for
some reason.
@@ -119,6 +123,7 @@ private boolean PBinitialize(boolean lite)
}
InputStream versionStream = getClass().getResourceAsStream("/" + ProductGenusNames.DBMS_INFO);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
engineVersion = ProductVersionHolder.getProductVersionHolderFromMyEnv(versionStream);
@@ -129,6 +134,7 @@ private boolean PBinitialize(boolean lite)
systemHome = System.getProperty(Property.SYSTEM_HOME_PROPERTY);
} catch (SecurityException se) {
// system home will be the current directory
+//IC see: https://issues.apache.org/jira/browse/DERBY-6617
report(se, Property.SYSTEM_HOME_PROPERTY);
systemHome = null;
}
@@ -162,10 +168,12 @@ private boolean PBinitialize(boolean lite)
// but avoids requiring read permission on the parent
// directory if it exists.
created = home.mkdir() || home.mkdirs();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6503
if (created) {
FileUtil.limitAccessToOwner(home);
}
} catch (SecurityException se) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6617
report(se, home);
return false;
} catch (IOException ioe) {
@@ -181,6 +189,7 @@ private boolean PBinitialize(boolean lite)
SECURITY WARNING.
This method is run in a privileged block in a Java 2 environment.
+//IC see: https://issues.apache.org/jira/browse/DERBY-623
Return a property from the JVM's system set.
In a Java2 environment this will be executed as a privileged block
@@ -193,6 +202,7 @@ private String PBgetJVMProperty(String key) {
// SECURITY PERMISSION - OP1
return System.getProperty(key);
} catch (SecurityException se) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6617
report(se, key);
return null;
}
@@ -228,6 +238,8 @@ private void report(SecurityException e, File file) {
}
private void reportThread(SecurityException e) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6117
+//IC see: https://issues.apache.org/jira/browse/DERBY-6617
report(MessageService.getTextMessage(
MessageId.CANNOT_SET_DAEMON, e.toString()));
}
@@ -242,6 +254,7 @@ private void reportThread(SecurityException e) {
final boolean initialize(final boolean lite)
{
// SECURITY PERMISSION - OP2, OP2a, OP2b
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return (AccessController.doPrivileged(new PrivilegedAction() {
public Boolean run() {
return Boolean.valueOf(PBinitialize(lite));
@@ -251,6 +264,7 @@ public Boolean run() {
final Properties getDefaultModuleProperties() {
// SECURITY PERMISSION - IP1
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return AccessController.doPrivileged(
new PrivilegedAction() {
public Properties run() {
@@ -264,6 +278,7 @@ public final String getJVMProperty(final String key) {
return PBgetJVMProperty(key);
// SECURITY PERMISSION - OP1
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return AccessController.doPrivileged(new PrivilegedAction() {
public String run() {
return PBgetJVMProperty(key);
@@ -275,6 +290,7 @@ public synchronized final Thread getDaemonThread(
final Runnable task,
final String name,
final boolean setMinPriority) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return AccessController.doPrivileged(new PrivilegedAction() {
public Thread run() {
try {
@@ -286,6 +302,7 @@ public Thread run() {
// daemon group has been automatically destroyed. If that's
// what happened, create a new daemon group and try again.
if (daemonGroup != null && daemonGroup.isDestroyed()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1439
daemonGroup = createDaemonGroup();
return FileMonitor.super.getDaemonThread(
task, name, setMinPriority);
@@ -301,6 +318,7 @@ final InputStream applicationPropertiesStream()
throws IOException {
try {
// SECURITY PERMISSION - OP3
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return AccessController.doPrivileged(
new PrivilegedExceptionAction() {
public InputStream run() throws IOException {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/ProtocolKey.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/ProtocolKey.java
index 0077c63834..3df381c9b5 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/ProtocolKey.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/ProtocolKey.java
@@ -67,6 +67,7 @@ static ProtocolKey create(String className, String identifier) throws StandardEx
t = cnfe;
} catch (IllegalArgumentException iae) {
t = iae;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
} catch (LinkageError le) {
t = le;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/ServiceBootContext.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/ServiceBootContext.java
index 00b1934768..9199a17e95 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/ServiceBootContext.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/ServiceBootContext.java
@@ -30,6 +30,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
stop cleanup on the stack at this point.
*/
final class ServiceBootContext extends ContextImpl {
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
ServiceBootContext(ContextManager cm) {
super(cm, "ServiceBoot");
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java
index 6a03e917c9..8b03f8dc65 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java
@@ -70,11 +70,13 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* This class implements the PersistentService interface using a StorageFactory class.
* It handles all subSubProtocols except for cache.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-927
final class StorageFactoryService implements PersistentService
{
/** Marker printed as the last line of the service properties file. */
private static final String SERVICE_PROPERTIES_EOF_TOKEN =
"#--- last line, don't put anything after this line ---";
+//IC see: https://issues.apache.org/jira/browse/DERBY-5283
private String home; // the path of the database home directory. Can be null
private String canonicalHome; // will be null if home is null
@@ -83,12 +85,14 @@ final class StorageFactoryService implements PersistentService
private StorageFactory rootStorageFactory;
private char separatorChar;
+//IC see: https://issues.apache.org/jira/browse/DERBY-927
StorageFactoryService( String subSubProtocol, Class storageFactoryClass)
throws StandardException
{
this.subSubProtocol = subSubProtocol;
this.storageFactoryClass = storageFactoryClass;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
Object monitorEnv = getMonitor().getEnvironment();
if (monitorEnv instanceof File)
{
@@ -96,6 +100,7 @@ final class StorageFactoryService implements PersistentService
try
{
AccessController.doPrivileged(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
new java.security.PrivilegedExceptionAction()
{
public Object run() throws IOException, StandardException
@@ -108,6 +113,7 @@ public Object run() throws IOException, StandardException
{
StorageFile rootDir = rootStorageFactory.newStorageFile( null);
boolean created = rootDir.mkdirs();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5363
if (created) {
rootDir.limitAccessToOwner();
}
@@ -132,6 +138,7 @@ public Object run() throws IOException, StandardException
catch( IOException ioe){ throw Monitor.exceptionStartingModule(/*serviceName, */ ioe); }
}
AccessController.doPrivileged(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
new java.security.PrivilegedAction()
{
public Object run()
@@ -187,6 +194,7 @@ public StorageFactory getStorageFactoryInstance(final boolean useHome,
new PrivilegedExceptionAction()
{
public StorageFactory run() throws InstantiationException,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
IllegalAccessException, IOException, NoSuchMethodException, InvocationTargetException
{
return privGetStorageFactoryInstance( useHome, databaseName, tempDirName, uniqueName);
@@ -205,6 +213,7 @@ private StorageFactory privGetStorageFactoryInstance( boolean useHome,
String databaseName,
String tempDirName,
String uniqueName)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throws InstantiationException,
IllegalAccessException,
IOException,
@@ -276,6 +285,7 @@ public Properties getServiceProperties( final String serviceName, Properties def
{
public Object run()
throws IOException, StandardException,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
InstantiationException, IllegalAccessException,
NoSuchMethodException, InvocationTargetException
{
@@ -293,6 +303,7 @@ public Object run()
{
StorageFactory storageFactory = privGetStorageFactoryInstance( true, serviceName, null, null);
StorageFile file = storageFactory.newStorageFile( PersistentService.PROPERTIES_NAME);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5283
resolveServicePropertiesFiles(storageFactory, file);
try {
InputStream is = file.getInputStream();
@@ -349,6 +360,7 @@ public void saveServiceProperties( final String serviceName,
{
public Object run() throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5283
StorageFile backupFile = replace
? storageFactory.newStorageFile(
PersistentService.PROPERTIES_NAME.concat("old"))
@@ -372,6 +384,7 @@ public Object run() throws StandardException
// The eof token should match the ISO-8859-1 encoding
// of the rest of the properties file written with store.
BufferedWriter bOut = new BufferedWriter(
+//IC see: https://issues.apache.org/jira/browse/DERBY-5424
new OutputStreamWriter(os,"ISO-8859-1"));
bOut.write(SERVICE_PROPERTIES_EOF_TOKEN);
bOut.newLine();
@@ -490,12 +503,16 @@ public Object run() throws StandardException
*/
public void saveServiceProperties(final String serviceName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-5260
final Properties properties)
throws StandardException {
try
{
AccessController.doPrivileged(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
new PrivilegedExceptionAction()
{
public Object run() throws StandardException
@@ -511,6 +528,7 @@ public Object run() throws StandardException
fos = new FileOutputStream(servicePropertiesFile);
FileUtil.limitAccessToOwner(servicePropertiesFile);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5363
properties.store(fos,
serviceName +
@@ -552,6 +570,7 @@ public Object run() throws StandardException
* file fails
*/
private void resolveServicePropertiesFiles(StorageFactory sf,
+//IC see: https://issues.apache.org/jira/browse/DERBY-5283
StorageFile spf)
throws StandardException {
StorageFile spfOld = sf.newStorageFile(PROPERTIES_NAME.concat("old"));
@@ -579,6 +598,7 @@ private void resolveServicePropertiesFiles(StorageFactory sf,
String lastLine = null;
try {
//service.properties always in ISO-8859-1 because written with Properties.store()
+//IC see: https://issues.apache.org/jira/browse/DERBY-5424
bin = new BufferedReader(new InputStreamReader(
new FileInputStream(spf.getPath()),"ISO-8859-1"));
String line;
@@ -690,6 +710,7 @@ protected String recreateServiceRoot( final String serviceName,
new PrivilegedExceptionAction()
{
public Object run()
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throws IOException, StandardException,
InstantiationException, IllegalAccessException,
NoSuchMethodException, InvocationTargetException
@@ -725,6 +746,7 @@ public Object run()
{
//First make sure backup service directory exists in the specified path
File backupRoot = new File(restoreFrom);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2556
if (fileExists(backupRoot))
{
//First make sure backup have service.properties
@@ -737,9 +759,11 @@ public Object run()
try
{
AccessController.doPrivileged(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
new PrivilegedExceptionAction()
{
public Object run()
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throws IOException, StandardException,
InstantiationException, IllegalAccessException,
NoSuchMethodException, InvocationTargetException
@@ -795,10 +819,12 @@ public String createServiceRoot(final String name, final boolean deleteExisting)
Throwable t = null;
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4428
return getProtocolLeadIn() + (String) AccessController.doPrivileged(
new PrivilegedExceptionAction()
{
public Object run()
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throws StandardException, IOException,
InstantiationException, IllegalAccessException,
NoSuchMethodException, InvocationTargetException
@@ -826,6 +852,7 @@ public Object run()
if (serviceDirectory.mkdirs())
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5363
serviceDirectory.limitAccessToOwner();
// DERBY-5096. The storageFactory canonicalName may need to be adjusted
// for casing after the directory is created. Just reset it after making the
@@ -842,6 +869,7 @@ public Object run()
throw ioe;
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-336
throw StandardException.newException(SQLState.SERVICE_DIRECTORY_CREATE_ERROR, serviceDirectory);
}
finally { storageFactory.shutdown(); }
@@ -857,6 +885,7 @@ public Object run()
throw (StandardException) t;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-336
throw StandardException.newException(SQLState.SERVICE_DIRECTORY_CREATE_ERROR, t, name);
} // end of createServiceRoot
@@ -876,6 +905,7 @@ private void vetService( StorageFactory storageFactory, String serviceName )
StorageFile seg0 = storageFactory.newStorageFile("seg0");
if (seg0.exists()) {
throw StandardException.newException
+//IC see: https://issues.apache.org/jira/browse/DERBY-5283
( SQLState.SERVICE_PROPERTIES_MISSING, serviceName, PersistentService.PROPERTIES_NAME );
}
}
@@ -903,9 +933,14 @@ public boolean removeServiceRoot(final String serviceName)
try
{
return AccessController.doPrivileged(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
new PrivilegedExceptionAction()
{
public Object run()
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throws StandardException, IOException,
InstantiationException, IllegalAccessException,
NoSuchMethodException, InvocationTargetException
@@ -919,6 +954,7 @@ public Object run()
// an extra sanity check. Prepending the
// protocol lead in to the canonical name from
// the storage factory should be enough.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4428
String tmpCanonical = getCanonicalServiceName(
getProtocolLeadIn() +
storageFactory.getCanonicalName());
@@ -945,6 +981,7 @@ public Object run()
} // end of removeServiceRoot
public String getCanonicalServiceName(String name)
+//IC see: https://issues.apache.org/jira/browse/DERBY-19
throws StandardException
{
int colon = name.indexOf( ':');
@@ -953,6 +990,7 @@ public String getCanonicalServiceName(String name)
// specifications here, which contain a colon (i.e. 'C:').
// The logic in this method may break in some cases if a colon is used
// in the directory or database name.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4171
if (colon < 2 && !getType().equals(PersistentService.DIRECTORY)) {
return null;
}
@@ -966,10 +1004,12 @@ public String getCanonicalServiceName(String name)
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return getProtocolLeadIn() + AccessController.doPrivileged(
new PrivilegedExceptionAction()
{
public String run()
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
throws StandardException, IOException,
InstantiationException, IllegalAccessException,
NoSuchMethodException, InvocationTargetException
@@ -986,6 +1026,7 @@ public String run()
}
catch (PrivilegedActionException pae)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-19
throw Monitor.exceptionStartingModule(pae.getException());
}
} // end of getCanonicalServiceName
@@ -1010,6 +1051,7 @@ public boolean isSameService(String serviceName1, String serviceName2)
{
if (SanityManager.DEBUG)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-19
try {
SanityManager.ASSERT(serviceName1.equals(getCanonicalServiceName(serviceName1)), serviceName1);
SanityManager.ASSERT(serviceName2.equals(getCanonicalServiceName(serviceName2)), serviceName2);
@@ -1029,9 +1071,11 @@ public boolean isSameService(String serviceName1, String serviceName2)
* @throws SecurityException if the required privileges are missing
*/
private final boolean fileExists(final File file) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
return (AccessController.doPrivileged(
new PrivilegedAction() {
public Boolean run() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
return file.exists();
}
})).booleanValue();
@@ -1058,6 +1102,7 @@ private String getProtocolLeadIn() {
// We prepend the subsub protocol name to the storage factory canonical
// name to form the service name, except in case of the default
// subsub prototcol (which is PersistentService.DIRECTORY).
+//IC see: https://issues.apache.org/jira/browse/DERBY-4428
if (getType().equals(PersistentService.DIRECTORY)) {
return "";
} else {
@@ -1071,6 +1116,7 @@ private String getProtocolLeadIn() {
*/
private static ModuleFactory getMonitor()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
@@ -1083,6 +1129,7 @@ public ModuleFactory run()
);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
final class DirectoryList implements Enumeration, PrivilegedAction
{
private String[] contents;
@@ -1103,6 +1150,7 @@ final class DirectoryList implements Enumeration, PrivilegedAction protocolTable;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
/**
*/
@@ -88,6 +90,7 @@ final class TopService {
TopService(BaseMonitor monitor) {
super();
this.monitor = monitor;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
protocolTable = new Hashtable();
moduleInstances = new Vector(0, 5);
}
@@ -101,6 +104,7 @@ final class TopService {
this.serviceLocale = serviceLocale;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
void setTopModule(Object instance) {
synchronized (this) {
ModuleInstance module = findModuleInstance(instance);
@@ -124,6 +128,7 @@ void setTopModule(Object instance) {
}
Object getService() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
return topModule.getInstance();
}
@@ -136,6 +141,7 @@ boolean isPotentialService(ProtocolKey otherKey) {
if (serviceType == null)
otherCanonicalName = otherKey.getIdentifier();
else {
+//IC see: https://issues.apache.org/jira/browse/DERBY-19
try
{
otherCanonicalName = serviceType.getCanonicalServiceName(otherKey.getIdentifier());
@@ -188,6 +194,8 @@ boolean isActiveService(ProtocolKey otherKey) {
try {
wait();
} catch (InterruptedException ioe) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
InterruptStatus.setInterrupted();
}
}
@@ -207,8 +215,10 @@ boolean isActiveService(ProtocolKey otherKey) {
the protocol table.
*/
synchronized Object findModule(ProtocolKey key, boolean findOnly, Properties properties) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
ModuleInstance module = protocolTable.get(key);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
if (module == null)
return null;
@@ -235,6 +245,7 @@ private ModuleInstance findModuleInstance(Object instance) {
// ArrayIndexOutOfBoundsException.
synchronized (moduleInstances) {
for (int i = 0; i < moduleInstances.size(); i++) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
ModuleInstance module = moduleInstances.get(i);
if (module.getInstance() == instance) {
return module;
@@ -281,6 +292,7 @@ Object bootModule(boolean create, Object service, ProtocolKey key, Properties pr
// and result in an ArrayIndexOutOfBoundsException.
synchronized (moduleInstances) {
if (i < moduleInstances.size()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
module = moduleInstances.get(i);
} else {
// No more instances to look at, break out of the loop.
@@ -329,6 +341,7 @@ Object bootModule(boolean create, Object service, ProtocolKey key, Properties pr
topModule == null ? (Object) null : topModule.getInstance());
moduleInstances.add(module);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
try {
BaseMonitor.boot(instance, create, properties);
@@ -359,6 +372,7 @@ Object bootModule(boolean create, Object service, ProtocolKey key, Properties pr
TopService.stop(instance);
moduleInstances.remove(module);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
// if we reached here it's because someone else beat us adding the module, so use theirs.
return findModule(key, true, properties);
@@ -387,6 +401,7 @@ boolean shutdown() {
return true;
module = moduleInstances.get(0);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
}
@@ -394,6 +409,7 @@ boolean shutdown() {
TopService.stop(instance);
synchronized (this) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5060
moduleInstances.remove(0);
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/DatabaseClasses.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/DatabaseClasses.java
index b401dd31b1..7ee966821e 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/DatabaseClasses.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/DatabaseClasses.java
@@ -64,6 +64,7 @@ in which case the class is removed. This is transparent to users.
@see org.apache.derby.iapi.services.loader.ClassFactory
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-485
abstract class DatabaseClasses
implements ClassFactory, ModuleControl
{
@@ -79,6 +80,7 @@ abstract class DatabaseClasses
** Constructor
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-485
DatabaseClasses() {
}
@@ -170,6 +172,7 @@ private static void WriteClassFile(String fullyQualifiedName, ByteArray bytecode
int lastDot = fullyQualifiedName.lastIndexOf((int)'.');
String filename = fullyQualifiedName.substring(lastDot+1,fullyQualifiedName.length()).concat(".class");
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
Object env = getMonitor().getEnvironment();
File dir = env instanceof File ? (File) env : null;
@@ -181,6 +184,7 @@ private static void WriteClassFile(String fullyQualifiedName, ByteArray bytecode
try {
FileOutputStream fis;
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
fis = AccessController.doPrivileged(
new PrivilegedExceptionAction() {
public FileOutputStream run() throws IOException {
@@ -199,6 +203,7 @@ public FileOutputStream run() throws IOException {
fis.close();
} catch (IOException e) {
if (SanityManager.DEBUG)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4859
SanityManager.THROWASSERT("Unable to write .class file", e);
}
}
@@ -228,6 +233,7 @@ public final Class loadApplicationClass(String className)
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-485
Throwable loadError;
try {
try {
@@ -305,6 +311,7 @@ public int getClassLoaderVersion() {
** Keep track of loaded generated classes and their GeneratedClass objects.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
abstract LoadedGeneratedClass loadGeneratedClassFromData(String fullyQualifiedName, ByteArray classDump);
/**
@@ -313,6 +320,7 @@ public int getClassLoaderVersion() {
*/
private static ModuleFactory getMonitor()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/JarLoader.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/JarLoader.java
index 129379946a..84cad4ff84 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/JarLoader.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/JarLoader.java
@@ -175,10 +175,12 @@ protected Class loadClass(String className, boolean resolve)
// not make assumptions about this check reducing the
// number of classes it has to check for.
if (className.startsWith("org.apache.derby.")
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
&& !isDerbyDriver(className)
&& !className.startsWith("org.apache.derby.jdbc.")
&& !className.startsWith("org.apache.derby.vti.")
&& !className.startsWith("org.apache.derby.agg.")
+//IC see: https://issues.apache.org/jira/browse/DERBY-6600
&& !className.startsWith("org.apache.derby.optional.")
&& !className.startsWith("org.apache.derby.impl.tools.optional.")
)
@@ -211,9 +213,11 @@ protected Class loadClass(String className, boolean resolve)
*/
private boolean isDerbyDriver(String className)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
return
(
className.startsWith("org.apache.derby.iapi.jdbc.AutoloadedDriver")
+//IC see: https://issues.apache.org/jira/browse/DERBY-6945
|| className.startsWith("org.apache.derby.iapi.client.ClientAutoloadedDriver")
);
}
@@ -231,6 +235,7 @@ public InputStream getResourceAsStream(String name) {
* Return the SQL name for the installed jar.
* Used for error and informational messages.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-538
final String getJarName() {
return IdUtil.mkQualifiedName(name);
}
@@ -243,6 +248,7 @@ Class loadClassData(String className, String jvmClassName, boolean resolve) {
try {
if (jar != null)
return loadClassDataFromJar(className, jvmClassName, resolve);
+//IC see: https://issues.apache.org/jira/browse/DERBY-538
if (isStream) {
// have to use a new stream each time
@@ -271,6 +277,7 @@ InputStream getStream(String name) {
if (jar != null)
return getRawStream(name);
+//IC see: https://issues.apache.org/jira/browse/DERBY-538
if (isStream) {
try {
@@ -293,6 +300,7 @@ InputStream getStream(String name) {
* as a java.util.jarFile.
*/
private Class loadClassDataFromJar(
+//IC see: https://issues.apache.org/jira/browse/DERBY-538
String className, String jvmClassName, boolean resolve)
throws IOException {
@@ -346,8 +354,10 @@ private Class loadClassData(JarEntry e, InputStream in,
String className, boolean resolve) throws IOException {
byte[] data = readData(e, in, className);
+//IC see: https://issues.apache.org/jira/browse/DERBY-538
Certificate[] signers = getSigners(className, e);
+//IC see: https://issues.apache.org/jira/browse/DERBY-538
synchronized (updateLoader) {
// see if someone else loaded it while we
@@ -381,8 +391,10 @@ Class checkLoaded(String className, boolean resolve) {
* resolve any classes or resources.
*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-538
void setInvalid() {
updateLoader = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-538
if (jar != null) {
try {
jar.close();
@@ -399,6 +411,7 @@ void setInvalid() {
*/
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-538
Get a stream for a resource directly from a JarFile.
In this case we can safely return the stream directly.
It's a new stream set up by the zip code to read just
@@ -419,6 +432,7 @@ private InputStream getRawStream(String name) {
/**
Get a stream from a zip file that is itself a stream.
+//IC see: https://issues.apache.org/jira/browse/DERBY-552
We copy to the contents to a byte array and return a
stream around that to the caller. Though a copy is
involved it has the benefit of:
@@ -443,6 +457,7 @@ private InputStream getRawStream(InputStream in, String name) {
if (e.getName().equals(name)) {
int size = (int) e.getSize();
+//IC see: https://issues.apache.org/jira/browse/DERBY-552
if (size == -1)
{
// unknown size so just pick a good buffer size.
@@ -472,6 +487,7 @@ private InputStream getRawStream(InputStream in, String name) {
* If this is a signed class and it has been compromised then
* a SecurityException will be thrown.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-538
byte[] readData(JarEntry ze, InputStream in, String className)
throws IOException {
@@ -555,6 +571,7 @@ MessageId.CM_SECURITY_EXCEPTION, className, getJarName(), e
*/
public String toString()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2331
return getJarName() + ":" + super.toString();
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/LoadedGeneratedClass.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/LoadedGeneratedClass.java
index 6f058575d5..f8d6bfada6 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/LoadedGeneratedClass.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/LoadedGeneratedClass.java
@@ -77,6 +77,7 @@ public Object newInstance(Context context) throws StandardException {
t = iae;
} catch (java.lang.reflect.InvocationTargetException ite) {
t = ite;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
} catch (NoSuchMethodException le) {
t = le;
} catch (LinkageError le) {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/ReflectClassesJava2.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/ReflectClassesJava2.java
index 65c968b057..b9fbabfea8 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/ReflectClassesJava2.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/ReflectClassesJava2.java
@@ -25,10 +25,12 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import org.apache.derby.iapi.util.ByteArray;
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-6654
Reflect loader with Privileged block for Java 2 security.
*/
public class ReflectClassesJava2 extends DatabaseClasses
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
implements java.security.PrivilegedAction
{
@@ -37,10 +39,12 @@ public class ReflectClassesJava2 extends DatabaseClasses
private int action = -1;
synchronized LoadedGeneratedClass loadGeneratedClassFromData(String fullyQualifiedName, ByteArray classDump) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-467
if (classDump == null || classDump.getArray() == null) {
if (preCompiled == null)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
preCompiled = new java.util.HashMap();
else
{
@@ -52,6 +56,7 @@ synchronized LoadedGeneratedClass loadGeneratedClassFromData(String fullyQualifi
// not a generated class, just load the class directly.
try {
Class jvmClass = Class.forName(fullyQualifiedName);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5935
ReflectGeneratedClass gc = new ReflectGeneratedClass(this, jvmClass);
preCompiled.put(fullyQualifiedName, gc);
return gc;
@@ -62,6 +67,7 @@ synchronized LoadedGeneratedClass loadGeneratedClassFromData(String fullyQualifi
// Generated class. Make sure that it lives in the org.apache.derby.exe package
int lastDot = fullyQualifiedName.lastIndexOf( "." );
+//IC see: https://issues.apache.org/jira/browse/DERBY-6654
String actualPackage;
if ( lastDot < 0 ) { actualPackage = ""; }
else
@@ -80,6 +86,7 @@ synchronized LoadedGeneratedClass loadGeneratedClassFromData(String fullyQualifi
public final Object run() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-485
try {
// SECURITY PERMISSION - MP2
switch (action) {
@@ -111,6 +118,7 @@ Class loadClassNotInDatabaseJar(String name) throws ClassNotFoundException {
// (the classLoader that loaded Derby).
// So we call Class.forName to ensure that we find the class.
try {
+//IC see: https://issues.apache.org/jira/browse/DERBY-485
ClassLoader cl;
synchronized(this) {
action = 2;
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/ReflectGeneratedClass.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/ReflectGeneratedClass.java
index d3874e0e12..8ce7c79e3f 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/ReflectGeneratedClass.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/ReflectGeneratedClass.java
@@ -45,6 +45,7 @@ public final class ReflectGeneratedClass extends LoadedGeneratedClass {
public ReflectGeneratedClass(ClassFactory cf, Class jvmClass) {
super(cf, jvmClass);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
methodCache = new Hashtable();
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/ReflectLoaderJava2.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/ReflectLoaderJava2.java
index 4d3eab5602..8baa704c88 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/ReflectLoaderJava2.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/ReflectLoaderJava2.java
@@ -56,11 +56,13 @@ that was added in Java2 and it needs to not implement loadClass()
Load a generated class from the passed in class data.
*/
LoadedGeneratedClass loadGeneratedClass(String name, ByteArray classData) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6621
Class jvmClass = defineClass(name, classData.getArray(), classData.getOffset(), classData.getLength());
resolveClass(jvmClass);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5935
return new ReflectGeneratedClass(cf, jvmClass);
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/ReflectMethod.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/ReflectMethod.java
index 36b9462294..198ef0ebf6 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/ReflectMethod.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/ReflectMethod.java
@@ -56,6 +56,7 @@ public Object invoke(Object ref)
} catch (InvocationTargetException ite) {
t = ite;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6493
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/UpdateLoader.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/UpdateLoader.java
index bcc2a26bb7..4b7ada1434 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/UpdateLoader.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/reflect/UpdateLoader.java
@@ -75,6 +75,7 @@ final class UpdateLoader implements LockOwner {
// class loading mechanism, javax. ones are not. However
// allowing database applications to override jvm classes
// seems a bad idea.
+//IC see: https://issues.apache.org/jira/browse/DERBY-538
"javax.",
// Allowing an application to possible override the engine's
@@ -102,8 +103,10 @@ final class UpdateLoader implements LockOwner {
this.normalizeToUpper = normalizeToUpper;
this.parent = parent;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
lf = (LockFactory) getServiceModule(parent, Module.LockFactory);
compat = (lf != null) ? lf.createCompatibilitySpace(this) : null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-2164
if (verbose) {
vs = Monitor.getStream();
@@ -118,6 +121,7 @@ final class UpdateLoader implements LockOwner {
private void initializeFromClassPath(String classpath) throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
final String[][] elements = IdUtil.parseDbClassPath(classpath);
final int jarCount = elements.length;
@@ -127,6 +131,7 @@ private void initializeFromClassPath(String classpath) throws StandardException
// Creating class loaders is a restricted operation
// so we need to use a privileged block.
AccessController.doPrivileged
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
(new java.security.PrivilegedAction(){
public Object run(){
@@ -138,6 +143,7 @@ public Object run(){
});
}
if (vs != null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5885
vs.println(MessageService.getTextMessage(MessageId.CM_CLASS_LOADER_START, classpath ));
}
@@ -146,6 +152,7 @@ public Object run(){
}
/**
+//IC see: https://issues.apache.org/jira/browse/DERBY-2331
Load the class from the class path. Called by JarLoader
when it has a request to load a class to fulfill
the sematics of derby.database.classpath.
@@ -189,6 +196,7 @@ Class loadClass(String className, boolean resolve)
// Refuse to load classes from restricted name spaces
// That is classes in those name spaces can be not
// loaded from installed jar files.
+//IC see: https://issues.apache.org/jira/browse/DERBY-538
for (int i = 0; i < RESTRICTED_PACKAGES.length; i++)
{
if (className.startsWith(RESTRICTED_PACKAGES[i]))
@@ -268,6 +276,8 @@ InputStream getResourceAsStream(String name) {
return null;
} finally {
if (unlockLoader) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
lf.unlock(compat, this, classLoaderLock, ShExQual.SH);
}
}
@@ -297,6 +307,7 @@ synchronized void modifyJar(boolean reload) throws StandardException {
// first close the existing jar file opens
close();
+//IC see: https://issues.apache.org/jira/browse/DERBY-538
if (reload) {
initializeFromClassPath(thisClasspath);
@@ -310,11 +321,13 @@ private boolean lockClassLoader(ShExQual qualifier)
return false;
ClassFactoryContext cfc = (ClassFactoryContext) getContextOrNull(ClassFactoryContext.CONTEXT_ID);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
// This method can be called from outside of the database
// engine, in which case tc will be null. In that case
// we lock the class loader only for the duration of
// the loadClass().
+//IC see: https://issues.apache.org/jira/browse/DERBY-2328
CompatibilitySpace lockSpace = null;
if (cfc != null) {
@@ -344,6 +357,7 @@ Class checkLoaded(String className, boolean resolve) {
void close() {
for (int i = 0; i < jarList.length; i++) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-538
jarList[i].setInvalid();
}
@@ -382,6 +396,7 @@ private String getClasspath()
throws StandardException {
ClassFactoryContext cfc = (ClassFactoryContext) getContextOrNull(ClassFactoryContext.CONTEXT_ID);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
PersistentSet ps = cfc.getPersistentSet();
@@ -401,6 +416,7 @@ JarReader getJarReader() {
if (jarReader == null) {
ClassFactoryContext cfc = (ClassFactoryContext) getContextOrNull(ClassFactoryContext.CONTEXT_ID);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
jarReader = cfc.getJarReader();
}
@@ -419,6 +435,7 @@ public boolean noWait() {
public boolean isNestedOwner()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6554
return false;
}
@@ -434,12 +451,14 @@ public boolean nestsUnder( LockOwner other )
*/
private static Context getContextOrNull( final String contextID )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
{
public Context run()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return ContextService.getContextOrNull( contextID );
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/stream/BasicHeaderPrintWriter.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/stream/BasicHeaderPrintWriter.java
index 3d5ba1e18b..91619c37fa 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/stream/BasicHeaderPrintWriter.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/stream/BasicHeaderPrintWriter.java
@@ -58,6 +58,7 @@ class BasicHeaderPrintWriter
* @see PrintWriterGetHeader
*/
BasicHeaderPrintWriter(OutputStream writeTo,
+//IC see: https://issues.apache.org/jira/browse/DERBY-205
PrintWriterGetHeader headerGetter, boolean canClose, String streamName){
super(writeTo, true);
this.headerGetter = headerGetter;
@@ -103,6 +104,7 @@ public PrintWriter getPrintWriter(){
}
public String getName(){
+//IC see: https://issues.apache.org/jira/browse/DERBY-205
return name;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/stream/RollingFileStream.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/stream/RollingFileStream.java
index f6099251ae..66b982ab3d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/stream/RollingFileStream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/stream/RollingFileStream.java
@@ -461,6 +461,7 @@ private boolean fileExists(final File file) {
Boolean value = AccessController.doPrivileged(new PrivilegedAction() {
public Boolean run() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
return file.exists();
}
@@ -495,6 +496,7 @@ private boolean fileRename(final File file1, final File file2) {
Boolean value = AccessController.doPrivileged(new PrivilegedAction() {
public Boolean run() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
return file1.renameTo(file2);
}
});
@@ -512,6 +514,7 @@ private long fileLength(final File file) {
Long value = AccessController.doPrivileged(new PrivilegedAction() {
public Long run() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
return file.length();
}
});
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/stream/SingleStream.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/stream/SingleStream.java
index 844bc7ca8a..2afd47dc8f 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/stream/SingleStream.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/stream/SingleStream.java
@@ -74,6 +74,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*
*/
public final class SingleStream
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
implements InfoStreams, ModuleControl, java.security.PrivilegedAction
{
@@ -129,6 +130,7 @@ private HeaderPrintWriter makeStream() {
// get the header
PrintWriterGetHeader header = makeHeader();
HeaderPrintWriter hpw = makeHPW(header);
+//IC see: https://issues.apache.org/jira/browse/DERBY-205
// If hpw == null then no properties were specified for the stream
// so use/create the default stream.
@@ -154,7 +156,9 @@ private HeaderPrintWriter makeHPW(PrintWriterGetHeader header) {
// the type of target is based on which property is used
// to set it. choices are file, method, field, stream
+//IC see: https://issues.apache.org/jira/browse/DERBY-205
String target = PropertyUtil.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6350
getSystemProperty(Property.ERRORLOG_STYLE_PROPERTY);
if (target != null) {
return makeStyleHPW(target, header);
@@ -169,6 +173,7 @@ private HeaderPrintWriter makeHPW(PrintWriterGetHeader header) {
getSystemProperty(Property.ERRORLOG_METHOD_PROPERTY);
if (target!=null)
return makeMethodHPW(target, header, false);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6350
target = PropertyUtil.
getSystemProperty(Property.ERRORLOG_FIELD_PROPERTY);
@@ -193,6 +198,7 @@ private HeaderPrintWriter PBmakeFileHPW(String fileName,
// See if this needs to be made relative to something ...
if (!streamFile.isAbsolute()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
Object monitorEnv = getMonitor().getEnvironment();
if (monitorEnv instanceof File)
streamFile = new File((File) monitorEnv, fileName);
@@ -206,6 +212,7 @@ private HeaderPrintWriter PBmakeFileHPW(String fileName,
fos = new FileOutputStream(streamFile.getPath(), true);
else
fos = new FileOutputStream(streamFile);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5363
FileUtil.limitAccessToOwner(streamFile);
} catch (IOException ioe) {
return useDefaultStream(header, ioe);
@@ -213,11 +220,13 @@ private HeaderPrintWriter PBmakeFileHPW(String fileName,
return useDefaultStream(header, se);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-205
return new BasicHeaderPrintWriter(new BufferedOutputStream(fos), header,
true, streamFile.getPath());
}
private HeaderPrintWriter makeMethodHPW(String methodInvocation,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6350
PrintWriterGetHeader header,
boolean canClose) {
@@ -228,6 +237,7 @@ private HeaderPrintWriter makeMethodHPW(String methodInvocation,
Throwable t;
try {
Class> theClass = Class.forName(className);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
try {
Method theMethod = theClass.getMethod(methodName, new Class[0]);
@@ -240,6 +250,7 @@ private HeaderPrintWriter makeMethodHPW(String methodInvocation,
try {
return makeValueHPW(theMethod, theMethod.invoke((Object) null,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6350
new Object[0]), header, methodInvocation, canClose);
} catch (IllegalAccessException iae) {
t = iae;
@@ -263,6 +274,7 @@ private HeaderPrintWriter makeMethodHPW(String methodInvocation,
}
private HeaderPrintWriter makeStyleHPW(String style,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6350
PrintWriterGetHeader header) {
HeaderPrintWriter res = null;
if ("rollingFile".equals(style)) {
@@ -304,6 +316,7 @@ private HeaderPrintWriter makeFieldHPW(String fieldAccess,
try {
return makeValueHPW(theField, theField.get((Object) null),
+//IC see: https://issues.apache.org/jira/browse/DERBY-6350
header, fieldAccess, false);
} catch (IllegalAccessException iae) {
t = iae;
@@ -336,6 +349,7 @@ else if ("java.lang.System.err".equals(fieldAccess))
private HeaderPrintWriter makeValueHPW(Member whereFrom, Object value,
PrintWriterGetHeader header, String name, boolean canClose) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6350
if (value instanceof OutputStream)
return new BasicHeaderPrintWriter((OutputStream) value, header, canClose, name);
@@ -365,6 +379,7 @@ private HeaderPrintWriter createDefaultStream(PrintWriterGetHeader header) {
*/
private HeaderPrintWriter useDefaultStream(PrintWriterGetHeader header) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-205
return new BasicHeaderPrintWriter(System.err, header, false, "System.err");
}
@@ -372,6 +387,7 @@ private HeaderPrintWriter useDefaultStream(PrintWriterGetHeader header, Throwabl
HeaderPrintWriter hpw = useDefaultStream(header);
+//IC see: https://issues.apache.org/jira/browse/DERBY-5363
while (t != null) {
Throwable causedBy = t.getCause();
String causedByStr =
@@ -411,6 +427,7 @@ public final HeaderPrintWriter run()
*/
private static ModuleFactory getMonitor()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/timer/SingletonTimerFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/timer/SingletonTimerFactory.java
index bad664b2fe..adfa018679 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/timer/SingletonTimerFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/timer/SingletonTimerFactory.java
@@ -205,6 +205,7 @@ public ClassLoader run() {
// RuntimePermission("getClassLoader") has not been granted.
// See the javadoc for Thread.getContextClassLoader() and
// Class.getClassLoader() for details.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6619
report(se, MessageId.CANNOT_GET_CLASSLOADER);
return null;
}
@@ -224,6 +225,7 @@ public Void run() {
// the DERBY-3745 fix, did not require setContextClassLoader
// permissions. We may leak class loaders if we are not able to
// set this, but cannot just fail.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6619
report(se, MessageId.CANNOT_SET_CLASSLOADER);
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/services/uuid/BasicUUIDFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/services/uuid/BasicUUIDFactory.java
index 972f522b13..ed925d14ac 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/services/uuid/BasicUUIDFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/services/uuid/BasicUUIDFactory.java
@@ -70,6 +70,7 @@ public final class BasicUUIDFactory
private long timemillis;
public BasicUUIDFactory() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
Object env = getMonitor().getEnvironment();
if (env != null) {
String s = env.toString();
@@ -165,6 +166,7 @@ private void resetCounters()
*/
private static ModuleFactory getMonitor()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/CursorInfo.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/CursorInfo.java
index b79f9ca769..101758707e 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/CursorInfo.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/CursorInfo.java
@@ -59,6 +59,7 @@ public class CursorInfo
********************************************************/
ExecCursorTableReference targetTable;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
List updateColumns;
int updateMode;
@@ -76,6 +77,7 @@ public CursorInfo()
(
int updateMode,
ExecCursorTableReference targetTable,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
List updateColumns
)
{
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericActivationHolder.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericActivationHolder.java
index 17c58a4b92..dcc7b9fa92 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericActivationHolder.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericActivationHolder.java
@@ -80,6 +80,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-3897
final public class GenericActivationHolder implements Activation
{
public BaseActivation ac;
@@ -243,12 +244,14 @@ public ResultSet execute() throws StandardException
{
/* Has the activation class changed or has the activation been
* invalidated? */
+//IC see: https://issues.apache.org/jira/browse/DERBY-5406
final boolean needNewClass =
gc == null || gc != ps.getActivationClass();
if (needNewClass || !ac.isValid())
{
GeneratedClass newGC;
+//IC see: https://issues.apache.org/jira/browse/DERBY-4279
if (needNewClass) {
// The statement has been re-prepared since the last time
@@ -576,6 +579,7 @@ public java.sql.ResultSet getTargetVTI()
}
public SQLSessionContext getSQLSessionContextForChildren() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3897
return ac.getSQLSessionContextForChildren();
}
@@ -601,6 +605,7 @@ public DependableFinder getDependableFinder()
{
// Vacuous implementation to make class concrete, only needed for
// BaseActivation
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
if (SanityManager.DEBUG) {
SanityManager.NOTREACHED();
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericColumnDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericColumnDescriptor.java
index 7d3d3fe3ba..cddbc1f794 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericColumnDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericColumnDescriptor.java
@@ -95,6 +95,7 @@ public GenericColumnDescriptor(ResultColumnDescriptor rcd)
{
name = rcd.getName();
tableName = rcd.getSourceTableName();
+//IC see: https://issues.apache.org/jira/browse/DERBY-189
schemaName = rcd.getSourceSchemaName();
columnPos = rcd.getColumnPosition();
type = rcd.getType();
@@ -174,6 +175,7 @@ public boolean isAutoincrement()
public boolean updatableByCursor()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-189
return updatableByCursor;
}
@@ -200,6 +202,7 @@ public void writeExternal(ObjectOutput out) throws IOException
fh.putInt("columnPos", columnPos);
fh.put("type", type);
fh.putBoolean("isAutoincrement", isAutoincrement);
+//IC see: https://issues.apache.org/jira/browse/DERBY-189
fh.putBoolean("updatableByCursor", updatableByCursor);
out.writeObject(fh);
return;
@@ -223,6 +226,7 @@ public void readExternal(ObjectInput in)
columnPos = fh.getInt("columnPos");
type = getStoredDataTypeDescriptor(fh.get("type"));
isAutoincrement = fh.getBoolean("isAutoincrement");
+//IC see: https://issues.apache.org/jira/browse/DERBY-189
updatableByCursor = fh.getBoolean("updatableByCursor");
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericLanguageFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericLanguageFactory.java
index 96badb0404..da85aa0971 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericLanguageFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericLanguageFactory.java
@@ -72,6 +72,7 @@ public GenericLanguageFactory() { }
*/
public void boot(boolean create, Properties startParams) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
LanguageConnectionFactory lcf = (LanguageConnectionFactory) findServiceModule(this, LanguageConnectionFactory.MODULE);
PropertyFactory pf = lcf.getPropertyFactory();
if (pf != null)
@@ -114,6 +115,8 @@ public ParameterValueSet newParameterValueSet(ClassInspector ci, int numParms, b
*/
public ResultDescription getResultDescription
(
+//IC see: https://issues.apache.org/jira/browse/DERBY-4610
+//IC see: https://issues.apache.org/jira/browse/DERBY-3049
ResultDescription inputResultDescription,
int[] theCols
)
@@ -148,6 +151,7 @@ public ParameterValueSet newParameterValueSet(ClassInspector ci, int numParms, b
* can't call this entry point.
*/
private static Object findServiceModule( final Object serviceModule, final String factoryInterface)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
throws StandardException
{
try {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericParameter.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericParameter.java
index 1525efa372..6805fc9c7f 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericParameter.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericParameter.java
@@ -111,6 +111,7 @@ final class GenericParameter
{
this.pvs = pvs;
parameterMode = (this.isReturnOutputParameter = isReturnOutputParameter)
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
? (short) (ParameterMetaData.parameterModeOut) : (short) (ParameterMetaData.parameterModeIn);
}
@@ -126,6 +127,7 @@ final class GenericParameter
public GenericParameter getClone(GenericParameterValueSet pvs)
{
GenericParameter gpClone = new GenericParameter(pvs, isReturnOutputParameter);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4520
gpClone.initialize(this.getValue().cloneValue(false),
jdbcTypeId, declaredClassName);
gpClone.isSet = true;
@@ -191,6 +193,7 @@ void setOutParameter(int sqlType, int scale)
}
switch (parameterMode) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
case (ParameterMetaData.parameterModeIn):
case (ParameterMetaData.parameterModeUnknown):
default:
@@ -244,6 +247,7 @@ private StandardException throwInvalidOutParamMap(int sqlType) {
void validate() throws StandardException
{
switch (parameterMode) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
case (ParameterMetaData.parameterModeUnknown):
break;
case (ParameterMetaData.parameterModeIn):
@@ -312,6 +316,7 @@ public String toString()
{
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1693
return value.getTraceString();
}
catch (StandardException se)
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericParameterValueSet.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericParameterValueSet.java
index 232be26e0b..39c03c1144 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericParameterValueSet.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericParameterValueSet.java
@@ -97,6 +97,7 @@ private GenericParameterValueSet(int numParms, GenericParameterValueSet pvs)
*/
public void initialize(DataTypeDescriptor[] types) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-738
for (int i = 0; i < parms.length; i++)
{
DataTypeDescriptor dtd = types[i];
@@ -154,6 +155,7 @@ public DataValueDescriptor getParameterForSet(int position) throws StandardExcep
try {
GenericParameter gp = parms[position];
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
if (gp.parameterMode == (ParameterMetaData.parameterModeOut))
throw StandardException.newException(SQLState.LANG_RETURN_OUTPUT_PARAM_CANNOT_BE_SET);
@@ -174,6 +176,7 @@ public DataValueDescriptor getParameterForGet(int position) throws StandardExcep
GenericParameter gp = parms[position];
switch (gp.parameterMode) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
case (ParameterMetaData.parameterModeIn):
case (ParameterMetaData.parameterModeUnknown):
throw StandardException.newException(SQLState.LANG_NOT_OUTPUT_PARAMETER, Integer.toString(position + 1));
@@ -189,9 +192,11 @@ public DataValueDescriptor getParameterForGet(int position) throws StandardExcep
public void setParameterAsObject(int position, Object value) throws StandardException {
UserDataValue dvd = (UserDataValue) getParameterForSet(position);
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
GenericParameter gp = parms[position];
if (value != null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
{
@@ -226,6 +231,7 @@ public boolean allAreSet()
if (!gp.isSet)
{
switch (gp.parameterMode) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
case (ParameterMetaData.parameterModeOut):
break;
case (ParameterMetaData.parameterModeInOut):
@@ -262,6 +268,7 @@ public void transferDataValues(ParameterValueSet pvstarget) throws StandardExce
DataValueDescriptor dvd = oldp.getValue();
InputStream is = null;
// See if the value type can hold a stream.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4563
if (dvd.hasStream()) {
// DERBY-4455: Don't materialize the stream when
// transferring it. If the stream has been drained already,
@@ -347,6 +354,7 @@ public ParameterValueSet getClone()
public void registerOutParameter(int parameterIndex, int jdbcType, int scale)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6089
checkPosition( parameterIndex );
Util.checkSupportedRaiseStandard( jdbcType );
parms[ parameterIndex ].setOutParameter( jdbcType, scale );
@@ -394,6 +402,7 @@ public int getParameterNumber(GenericParameter theParam)
/**
Check that there are not output parameters defined
by the parameter set. If there are unknown parameter
+//IC see: https://issues.apache.org/jira/browse/DERBY-2400
types they are forced to input types. i.e. Derby static method
calls with parameters that are array.
@@ -407,6 +416,7 @@ public boolean checkNoDeclaredOutputParameters() {
GenericParameter gp = parms[i];
switch (gp.parameterMode) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2438
case (ParameterMetaData.parameterModeIn):
break;
case (ParameterMetaData.parameterModeInOut):
@@ -459,6 +469,7 @@ public DataValueDescriptor getReturnValueForSet() throws StandardException
if (SanityManager.DEBUG)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
if (!hasReturnOutputParam)
SanityManager.THROWASSERT("getReturnValueForSet called on non-return parameter");
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericPreparedStatement.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericPreparedStatement.java
index f6cd679003..91145112b1 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericPreparedStatement.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericPreparedStatement.java
@@ -183,6 +183,7 @@ public class GenericPreparedStatement
/* Get the UUID for this prepared statement */
UUIDFactory uuidFactory =
getMonitor().getUUIDFactory();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
UUIDValue = uuidFactory.createUUID();
UUIDString = UUIDValue.toString();
@@ -228,6 +229,7 @@ private boolean isUpToDate() {
}
/** Check if this statement is currently being compiled. */
+//IC see: https://issues.apache.org/jira/browse/DERBY-2380
final synchronized boolean isCompiling() {
return compilingStatement;
}
@@ -257,9 +259,11 @@ public void rePrepare(LanguageConnectionContext lcc)
public void rePrepare(LanguageConnectionContext lcc, boolean forMetaData)
throws StandardException {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2380
if (!upToDate()) {
PreparedStatement ps = statement.prepare(lcc, forMetaData);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4279
if (SanityManager.DEBUG)
SanityManager.ASSERT(ps == this, "ps != this");
}
@@ -279,6 +283,7 @@ public Activation getActivation(LanguageConnectionContext lcc,
GeneratedClass gc = getActivationClass();
if (gc == null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4279
rePrepare(lcc);
gc = getActivationClass();
}
@@ -292,6 +297,7 @@ public Activation getActivation(LanguageConnectionContext lcc,
// deadlock.
lcc.closeUnusedActivations();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3897
Activation parentAct = null;
StatementContext stmctx = lcc.getStatementContext();
@@ -368,6 +374,7 @@ public ResultSet execute(Activation activation,
private ResultSet executeStmt(Activation activation,
boolean rollbackParentContext,
boolean forMetaData,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3897
long timeoutMillis)
throws
StandardException
@@ -430,6 +437,7 @@ private ResultSet executeStmt(Activation activation,
/* put it in try block to unlock the PS in any case
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-388
if (!spsAction) {
// only re-prepare if this isn't an SPS for a trigger-action;
// if it _is_ an SPS for a trigger action, then we can't just
@@ -447,8 +455,11 @@ private ResultSet executeStmt(Activation activation,
StatementContext statementContext = lccToUse.pushStatementContext(
isAtomic, updateMode==CursorNode.READ_ONLY, getSource(), pvs, rollbackParentContext, timeoutMillis);
+//IC see: https://issues.apache.org/jira/browse/DERBY-231
statementContext.setActivation(activation);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3327
+//IC see: https://issues.apache.org/jira/browse/DERBY-1331
if (needsSavepoint())
{
@@ -464,6 +475,7 @@ private ResultSet executeStmt(Activation activation,
lccToUse.validateStmtExecution(executionConstants);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
ResultSet resultSet;
try {
@@ -488,6 +500,9 @@ private ResultSet executeStmt(Activation activation,
}
lccToUse.popStatementContext(statementContext, null);
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
+//IC see: https://issues.apache.org/jira/browse/DERBY-6419
if (activation.getSQLSessionContextForChildren() != null) {
lccToUse.popNestedSessionContext(activation);
@@ -513,12 +528,14 @@ public ResultDescription getResultDescription() {
}
public DataTypeDescriptor[] getParameterTypes() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
return ArrayUtil.copy(paramTypeDescriptors);
}
/** Return the type of the parameter (0-based indexing) */
public DataTypeDescriptor getParameterType( int idx ) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6206
if ( paramTypeDescriptors == null )
{
throw StandardException.newException( SQLState.NO_INPUT_PARAMETERS );
@@ -531,6 +548,7 @@ public DataTypeDescriptor getParameterType( int idx ) throws StandardException
throw StandardException.newException
(
SQLState.LANG_INVALID_PARAM_POSITION,
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
idx+1,
paramTypeDescriptors.length
);
@@ -620,6 +638,7 @@ public long getGenerateTimeInMillis()
*/
public Timestamp getBeginCompileTimestamp()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6206
return DataTypeUtilities.clone( beginCompileTimestamp );
}
@@ -630,6 +649,7 @@ public Timestamp getBeginCompileTimestamp()
*/
public Timestamp getEndCompileTimestamp()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6206
return DataTypeUtilities.clone( endCompileTimestamp );
}
@@ -843,7 +863,9 @@ public void makeInvalid(int action, LanguageConnectionContext lcc)
boolean alreadyInvalid;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
switch (action) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
case DependencyManager.RECHECK_PRIVILEGES:
return;
}
@@ -858,7 +880,9 @@ public void makeInvalid(int action, LanguageConnectionContext lcc)
// flag to indicate that an invalidation was requested. A
// re-compilation will be triggered if this flag is set, but
// not until the current compilation is done.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5406
invalidatedWhileCompiling = true;
+//IC see: https://issues.apache.org/jira/browse/DERBY-424
return;
}
@@ -868,6 +892,7 @@ public void makeInvalid(int action, LanguageConnectionContext lcc)
isValid = false;
// block compiles while we are invalidating
+//IC see: https://issues.apache.org/jira/browse/DERBY-2380
beginCompiling();
}
@@ -903,6 +928,7 @@ public void makeInvalid(int action, LanguageConnectionContext lcc)
}
}
} finally {
+//IC see: https://issues.apache.org/jira/browse/DERBY-2380
endCompiling();
}
}
@@ -998,6 +1024,7 @@ public boolean referencesSessionSchema()
* @return true if references SESSION schema tables/views, else false
*/
public boolean referencesSessionSchema(StatementNode qt)
+//IC see: https://issues.apache.org/jira/browse/DERBY-424
throws StandardException {
//If the query references a SESSION schema table (temporary or permanent), then
// mark so in this statement
@@ -1018,6 +1045,7 @@ public boolean referencesSessionSchema(StatementNode qt)
@exception StandardException thrown on failure.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2096
void completeCompile(StatementNode qt)
throws StandardException {
//if (finished)
@@ -1050,6 +1078,7 @@ void completeCompile(StatementNode qt)
}
isValid = true;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5947
rowCountStats.reset();
}
@@ -1224,6 +1253,7 @@ public ExecPreparedStatement getClone() throws StandardException
clone.updateMode = updateMode;
clone.needsSavepoint = needsSavepoint;
clone.rowCountStats = rowCountStats;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5947
return clone;
}
@@ -1239,6 +1269,7 @@ public void setCacheHolder(Cacheable cacheHolder) {
if (!isValid || (inUseCount != 0))
return;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
ContextManager cm = getContextService().getCurrentContextManager();
LanguageConnectionContext lcc =
(LanguageConnectionContext)
@@ -1258,6 +1289,8 @@ public void setCacheHolder(Cacheable cacheHolder) {
{
if (SanityManager.DEBUG)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
+//IC see: https://issues.apache.org/jira/browse/DERBY-2581
SanityManager.THROWASSERT("Unexpected exception", se);
}
}
@@ -1274,8 +1307,10 @@ public boolean isStorable() {
}
public void setRequiredPermissionsList(
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
List requiredPermissionsList)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
this.requiredPermissionsList = requiredPermissionsList;
}
@@ -1285,6 +1320,8 @@ public List getRequiredPermissionsList()
}
public final long getVersionCounter() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5459
+//IC see: https://issues.apache.org/jira/browse/DERBY-2402
return versionCounter;
}
@@ -1329,6 +1366,7 @@ int incrementExecutionCount() {
synchronized long getInitialRowCount(int rsNum, long rowCount) {
// Allocate the list of row counts lazily.
if (rowCounts == null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
rowCounts = new ArrayList();
}
@@ -1337,6 +1375,7 @@ synchronized long getInitialRowCount(int rsNum, long rowCount) {
if (rsNum >= rowCounts.size()) {
int newSize = rsNum + 1;
rowCounts.addAll(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
Collections.nCopies(newSize - rowCounts.size(), (Long) null));
}
@@ -1344,6 +1383,7 @@ synchronized long getInitialRowCount(int rsNum, long rowCount) {
// set it if it is not already set.
Long initialCount = rowCounts.get(rsNum);
if (initialCount == null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6885
rowCounts.set(rsNum, rowCount);
return rowCount;
} else {
@@ -1401,6 +1441,7 @@ public long getInitialRowCount(int rsNum, long currentRowCount) {
*/
private static ContextService getContextService()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return AccessController.doPrivileged
(
new PrivilegedAction()
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericResultDescription.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericResultDescription.java
index d1763c13e4..be95e3d710 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericResultDescription.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericResultDescription.java
@@ -95,6 +95,7 @@ public GenericResultDescription()
public GenericResultDescription(ResultColumnDescriptor[] columns,
String statementType)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
this.columns = ArrayUtil.copy(columns);
this.statementType = statementType;
}
@@ -107,6 +108,8 @@ public GenericResultDescription(ResultColumnDescriptor[] columns,
*/
public GenericResultDescription
(
+//IC see: https://issues.apache.org/jira/browse/DERBY-4610
+//IC see: https://issues.apache.org/jira/browse/DERBY-3049
ResultDescription rd,
int[] theCols
)
@@ -143,6 +146,7 @@ public int getColumnCount()
}
public ResultColumnDescriptor[] getColumnInfo() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5840
return ArrayUtil.copy(columns);
}
@@ -170,6 +174,8 @@ public ResultColumnDescriptor getColumnDescriptor(int position) {
*/
public ResultDescription truncateColumns(int truncateFrom)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4610
+//IC see: https://issues.apache.org/jira/browse/DERBY-3049
if (SanityManager.DEBUG)
{
if (!(truncateFrom > 0 && columns != null))
@@ -281,6 +287,8 @@ public String toString()
* Set the meta data if it has not already been set.
*/
public synchronized void setMetaData(ResultSetMetaData rsmd) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1879
+//IC see: https://issues.apache.org/jira/browse/DERBY-1876
if (metaData == null)
metaData = rsmd;
}
@@ -300,6 +308,7 @@ public synchronized ResultSetMetaData getMetaData() {
*/
public int findColumnInsenstive(String columnName) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
final Map workMap;
synchronized (this) {
@@ -314,6 +323,7 @@ public int findColumnInsenstive(String columnName) {
SQLToUpperCase(
getColumnDescriptor(i).getName());
+//IC see: https://issues.apache.org/jira/browse/DERBY-6885
final Integer value = i;
map.put(key, value);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericStatement.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericStatement.java
index 36250d319f..fa5a9ba16d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericStatement.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericStatement.java
@@ -67,6 +67,7 @@ public GenericStatement(SchemaDescriptor compilationSchema, String statementText
{
this.compilationSchema = compilationSchema;
this.statementText = statementText;
+//IC see: https://issues.apache.org/jira/browse/DERBY-231
this.isForReadOnly = isForReadOnly;
}
@@ -82,6 +83,7 @@ public PreparedStatement prepare(LanguageConnectionContext lcc) throws StandardE
** Note: don't reset state since this might be
** a recompilation of an already prepared statement.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-5406
return prepare(lcc, false);
}
public PreparedStatement prepare(LanguageConnectionContext lcc, boolean forMetaData) throws StandardException
@@ -91,7 +93,9 @@ public PreparedStatement prepare(LanguageConnectionContext lcc, boolean forMetaD
** a recompilation of an already prepared statement.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-5406
final int depth = lcc.getStatementDepth();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5406
String prevErrorId = null;
while (true) {
boolean recompile = false;
@@ -139,6 +143,7 @@ public PreparedStatement prepare(LanguageConnectionContext lcc, boolean forMetaD
// invalidatedWhileCompiling and isValid are protected by
// synchronization on the prepared statement.
synchronized (preparedStmt) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5406
if (recompile || preparedStmt.invalidatedWhileCompiling) {
preparedStmt.isValid = false;
preparedStmt.invalidatedWhileCompiling = false;
@@ -250,6 +255,7 @@ private PreparedStatement prepMinion(LanguageConnectionContext lcc, boolean cach
{
for (;;) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4279
if (foundInCache) {
if (preparedStmt.referencesSessionSchema()) {
@@ -266,17 +272,21 @@ private PreparedStatement prepMinion(LanguageConnectionContext lcc, boolean cach
return preparedStmt;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2380
if (!preparedStmt.isCompiling()) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4279
break;
}
try {
preparedStmt.wait();
} catch (InterruptedException ie) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4741
InterruptStatus.setInterrupted();
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2380
preparedStmt.beginCompiling();
}
@@ -296,6 +306,7 @@ private PreparedStatement prepMinion(LanguageConnectionContext lcc, boolean cach
{
// since this is for compilation only, set atomic
// param to true and timeout param to 0
+//IC see: https://issues.apache.org/jira/browse/DERBY-231
statementContext = lcc.pushStatementContext(true, isForReadOnly, getSource(),
null, false, 0L);
}
@@ -311,6 +322,7 @@ private PreparedStatement prepMinion(LanguageConnectionContext lcc, boolean cach
CompilerContext cc = lcc.pushCompilerContext(compilationSchema);
if (prepareIsolationLevel !=
+//IC see: https://issues.apache.org/jira/browse/DERBY-6206
TransactionControl.UNSPECIFIED_ISOLATION_LEVEL)
{
cc.setScanIsolationLevel(prepareIsolationLevel);
@@ -355,6 +367,7 @@ private PreparedStatement prepMinion(LanguageConnectionContext lcc, boolean cach
//Only top level statements go through here, nested statement
//will invoke this method from other places
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
StatementNode qt = (StatementNode)
p.parseStatement(statementText, paramDefaults);
@@ -362,11 +375,13 @@ private PreparedStatement prepMinion(LanguageConnectionContext lcc, boolean cach
// Call user-written tree-printer if it exists
walkAST( lcc, qt, ASTVisitor.AFTER_PARSE);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4415
if (SanityManager.DEBUG)
{
if (SanityManager.DEBUG_ON("DumpParseTree"))
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4087
SanityManager.GET_DEBUG_STREAM().print(
"\n\n============PARSE===========\n\n");
qt.treePrint();
@@ -375,6 +390,7 @@ private PreparedStatement prepMinion(LanguageConnectionContext lcc, boolean cach
if (SanityManager.DEBUG_ON("StopAfterParsing"))
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3946
lcc.setLastQueryTree( qt );
throw StandardException.newException(SQLState.LANG_STOP_AFTER_PARSING);
@@ -398,16 +414,19 @@ private PreparedStatement prepMinion(LanguageConnectionContext lcc, boolean cach
// transaction.
lcc.beginNestedTransaction(true);
+//IC see: https://issues.apache.org/jira/browse/DERBY-2096
qt.bindStatement();
bindTime = getCurrentTimeMillis(lcc);
// Call user-written tree-printer if it exists
walkAST( lcc, qt, ASTVisitor.AFTER_BIND);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4415
if (SanityManager.DEBUG)
{
if (SanityManager.DEBUG_ON("DumpBindTree"))
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4087
SanityManager.GET_DEBUG_STREAM().print(
"\n\n============BIND===========\n\n");
qt.treePrint();
@@ -456,14 +475,17 @@ private PreparedStatement prepMinion(LanguageConnectionContext lcc, boolean cach
}
// stop adding privileges for user-defined types
+//IC see: https://issues.apache.org/jira/browse/DERBY-6491
cc.skipTypePrivileges( true );
qt.optimizeStatement();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2096
optimizeTime = getCurrentTimeMillis(lcc);
// Call user-written tree-printer if it exists
walkAST( lcc, qt, ASTVisitor.AFTER_OPTIMIZE);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4415
// Statement logging if lcc.getLogStatementText() is true
if (istream != null)
@@ -534,6 +556,7 @@ private PreparedStatement prepMinion(LanguageConnectionContext lcc, boolean cach
{
if (SanityManager.DEBUG_ON("DumpOptimizedTree"))
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4087
SanityManager.GET_DEBUG_STREAM().print(
"\n\n============OPT===========\n\n");
qt.treePrint();
@@ -575,7 +598,10 @@ class in case it came from a StorablePreparedStatement
*/
preparedStmt.setConstantAction( qt.makeConstantAction() );
preparedStmt.setSavedObjects( cc.getSavedObjects() );
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
preparedStmt.setRequiredPermissionsList(cc.getRequiredPermissionsList());
+//IC see: https://issues.apache.org/jira/browse/DERBY-5459
+//IC see: https://issues.apache.org/jira/browse/DERBY-2402
preparedStmt.incrementVersionCounter();
preparedStmt.setActivationClass(ac);
preparedStmt.setNeedsSavepoint(qt.needsSavepoint());
@@ -586,11 +612,13 @@ class in case it came from a StorablePreparedStatement
qt.executeSchemaName()
);
preparedStmt.setSPSName(qt.getSPSName());
+//IC see: https://issues.apache.org/jira/browse/DERBY-424
preparedStmt.completeCompile(qt);
preparedStmt.setCompileTimeWarnings(cc.getWarnings());
// Schedule updates of any stale index statistics we may
// have detected when creating the plan.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4938
TableDescriptor[] tds = qt.updateIndexStatisticsFor();
if (tds.length > 0) {
IndexStatisticsDaemon isd = lcc.getDataDictionary().
@@ -615,6 +643,7 @@ class in case it came from a StorablePreparedStatement
bindTime - parseTime, //bind time
optimizeTime - bindTime, //optimize time
generateTime - optimizeTime, //generate time
+//IC see: https://issues.apache.org/jira/browse/DERBY-4297
generateTime - beginTime, //total compile time
beginTimestamp,
endTimestamp);
@@ -626,6 +655,7 @@ class in case it came from a StorablePreparedStatement
lcc.popCompilerContext( cc );
}
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-730
catch (StandardException se)
{
if (foundInCache)
@@ -635,6 +665,7 @@ class in case it came from a StorablePreparedStatement
}
finally
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2380
preparedStmt.endCompiling();
}
@@ -649,6 +680,7 @@ class in case it came from a StorablePreparedStatement
/** Walk the AST, using a (user-supplied) Visitor */
private void walkAST( LanguageConnectionContext lcc, Visitable queryTree, int phase ) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4415
ASTVisitor visitor = lcc.getASTVisitor();
if ( visitor != null )
{
@@ -727,6 +759,7 @@ public boolean equals(Object other) {
GenericStatement os = (GenericStatement) other;
+//IC see: https://issues.apache.org/jira/browse/DERBY-231
return statementText.equals(os.statementText) && isForReadOnly==os.isForReadOnly
&& compilationSchema.equals(os.compilationSchema) &&
(prepareIsolationLevel == os.prepareIsolationLevel);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericStorablePreparedStatement.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericStorablePreparedStatement.java
index b3375e1cb3..7dbd5ab465 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericStorablePreparedStatement.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/GenericStorablePreparedStatement.java
@@ -155,6 +155,7 @@ public void loadGeneratedClass()
throws StandardException
{
LanguageConnectionContext lcc =
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
(LanguageConnectionContext) getContext
(LanguageConnectionContext.CONTEXT_ID);
ClassFactory classFactory = lcc.getLanguageConnectionFactory().getClassFactory();
@@ -288,6 +289,7 @@ public String toString()
*/
private static Context getContext( final String contextID )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getContext( contextID );
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/LanguageDbPropertySetter.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/LanguageDbPropertySetter.java
index bf9eb2a6e8..0d8dcc47c0 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/LanguageDbPropertySetter.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/LanguageDbPropertySetter.java
@@ -63,10 +63,12 @@ public void init(boolean dbOnly, Dictionary p) {
// Disallow changing sqlAuthorization from true to false or null after
// switching to Standard authorization
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
if (key.trim().equals(Property.SQL_AUTHORIZATION_PROPERTY))
{
LanguageConnectionContext lcc = (LanguageConnectionContext)
getContext(LanguageConnectionContext.CONTEXT_ID);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if (lcc.usesSqlAuthorization() && !Boolean.valueOf((String)value).booleanValue())
throw StandardException.newException(SQLState.PROPERTY_UNSUPPORTED_CHANGE,
@@ -112,6 +114,7 @@ public void init(boolean dbOnly, Dictionary p) {
*/
private static Context getContext( final String contextID )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getContext( contextID );
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/CoreDDFinderClassInfo.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/CoreDDFinderClassInfo.java
index c884a6e4de..e1b782d6cc 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/CoreDDFinderClassInfo.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/CoreDDFinderClassInfo.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.impl.sql.catalog.CoreDDFinderClassInfo
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
@@ -51,9 +52,11 @@ public Object getNewInstance()
case StoredFormatIds.VIEW_DESCRIPTOR_FINDER_V01_ID:
case StoredFormatIds.TABLE_PERMISSION_FINDER_V01_ID:
case StoredFormatIds.ROUTINE_PERMISSION_FINDER_V01_ID:
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
case StoredFormatIds.COLUMNS_PERMISSION_FINDER_V01_ID:
case StoredFormatIds.SEQUENCE_DESCRIPTOR_FINDER_V01_ID:
case StoredFormatIds.PERM_DESCRIPTOR_FINDER_V01_ID:
+//IC see: https://issues.apache.org/jira/browse/DERBY-3666
case StoredFormatIds.ROLE_GRANT_FINDER_V01_ID:
return new DDdependableFinder(fmtId);
case StoredFormatIds.COLUMN_DESCRIPTOR_FINDER_V01_ID:
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/DDColumnDependableFinder.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/DDColumnDependableFinder.java
index 7599952b93..191acf8a49 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/DDColumnDependableFinder.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/DDColumnDependableFinder.java
@@ -91,6 +91,7 @@ public DDColumnDependableFinder(int formatId)
* @return a dependable, a table descriptor with referencedColumnMap
* field set
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2138
Dependable findDependable(DataDictionary dd, UUID dependableObjectID)
throws StandardException
{
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/DD_Version.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/DD_Version.java
index 052ad9d302..93a0d7a279 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/DD_Version.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/DD_Version.java
@@ -128,34 +128,46 @@ private static String majorToString(int majorVersionNumber) {
return "10.0";
case DataDictionary.DD_VERSION_DERBY_10_1:
return "10.1";
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
case DataDictionary.DD_VERSION_DERBY_10_2:
return "10.2";
case DataDictionary.DD_VERSION_DERBY_10_3:
return "10.3";
+//IC see: https://issues.apache.org/jira/browse/DERBY-3036
case DataDictionary.DD_VERSION_DERBY_10_4:
return "10.4";
case DataDictionary.DD_VERSION_DERBY_10_5:
return "10.5";
case DataDictionary.DD_VERSION_DERBY_10_6:
return "10.6";
+//IC see: https://issues.apache.org/jira/browse/DERBY-4657
case DataDictionary.DD_VERSION_DERBY_10_7:
return "10.7";
+//IC see: https://issues.apache.org/jira/browse/DERBY-4864
case DataDictionary.DD_VERSION_DERBY_10_8:
return "10.8";
+//IC see: https://issues.apache.org/jira/browse/DERBY-5016
case DataDictionary.DD_VERSION_DERBY_10_9:
return "10.9";
+//IC see: https://issues.apache.org/jira/browse/DERBY-5688
case DataDictionary.DD_VERSION_DERBY_10_10:
return "10.10";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6104
case DataDictionary.DD_VERSION_DERBY_10_11:
return "10.11";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6588
case DataDictionary.DD_VERSION_DERBY_10_12:
return "10.12";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6811
case DataDictionary.DD_VERSION_DERBY_10_13:
return "10.13";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6911
case DataDictionary.DD_VERSION_DERBY_10_14:
return "10.14";
+//IC see: https://issues.apache.org/jira/browse/DERBY-6941
case DataDictionary.DD_VERSION_DERBY_10_15:
return "10.15";
+//IC see: https://issues.apache.org/jira/browse/DERBY-7010
case DataDictionary.DD_VERSION_DERBY_10_16:
return "10.16";
default:
@@ -203,6 +215,7 @@ void upgradeIfNeeded(DD_Version dictionaryVersion,
} else {
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if (isFullUpgrade(startParams, dictionaryVersion.toString())) {
performMajorUpgrade = true;
} else {
@@ -215,6 +228,7 @@ void upgradeIfNeeded(DD_Version dictionaryVersion,
if (performMajorUpgrade) {
// real upgrade changes. Get user name of current user.
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
String userName = IdUtil.getUserNameFromURLProps(startParams);
doFullUpgrade(tc, dictionaryVersion.majorVersionNumber,IdUtil.getUserAuthorizationId(userName));
//DERBY-5996(Create readme files (cautioning users against
@@ -226,6 +240,7 @@ void upgradeIfNeeded(DD_Version dictionaryVersion,
bootingDictionary.af.createReadMeFiles();
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-541
if (!minorOnly && !isReadOnly) {
// apply changes that can be made and will continue to work
// against previous version.
@@ -321,6 +336,7 @@ private void applySafeChanges(TransactionController tc, int fromMajorVersionNumb
Do full upgrade. Apply changes that can NOT be safely made in soft upgrade.
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
Upgrade items for every new release
Drop and recreate the stored versions of the JDBC database metadata queries
@@ -353,6 +369,7 @@ private void doFullUpgrade(TransactionController tc, int fromMajorVersionNumber,
//This is to make sure that we have the stored versions of JDBC database
//metadata queries matching with this release of the engine.
bootingDictionary.updateMetadataSPSes(tc);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1107
/*
* OLD Cloudscape 5.1 upgrade code, Derby does not support
@@ -376,8 +393,10 @@ private void doFullUpgrade(TransactionController tc, int fromMajorVersionNumber,
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
HashSet newlyCreatedRoutines = new HashSet();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3191
if (fromMajorVersionNumber <= DataDictionary.DD_VERSION_DERBY_10_3)
{
// Add new system catalogs created for roles
@@ -385,6 +404,7 @@ private void doFullUpgrade(TransactionController tc, int fromMajorVersionNumber,
tc, DataDictionary.SYSROLES_CATALOG_NUM);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2613
if (fromMajorVersionNumber <= DataDictionary.DD_VERSION_DERBY_10_1)
{
// add catalogs 1st, subsequent procedure adding may depend on
@@ -405,6 +425,7 @@ private void doFullUpgrade(TransactionController tc, int fromMajorVersionNumber,
// since 10.0. Will not work to upgrade any db previous to 10.0,
// thus only checks for 10.0 rather than <= 10.0.
bootingDictionary.create_10_1_system_procedures(
+//IC see: https://issues.apache.org/jira/browse/DERBY-4127
tc,
newlyCreatedRoutines,
bootingDictionary.getSystemUtilSchemaDescriptor().getUUID());
@@ -425,6 +446,8 @@ private void doFullUpgrade(TransactionController tc, int fromMajorVersionNumber,
tc, DataDictionary.SYSPERMS_CATALOG_NUM);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-239
+//IC see: https://issues.apache.org/jira/browse/DERBY-523
if (fromMajorVersionNumber <= DataDictionary.DD_VERSION_DERBY_10_1)
{
// On upgrade from versions before 10.2, create system procedures
@@ -436,6 +459,7 @@ private void doFullUpgrade(TransactionController tc, int fromMajorVersionNumber,
if (SanityManager.DEBUG)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2613
SanityManager.ASSERT((aid != null),
"Failed to get new Database Owner authorization");
}
@@ -445,6 +469,7 @@ private void doFullUpgrade(TransactionController tc, int fromMajorVersionNumber,
// make sure we flag that we need to add permissions to the
// following pre-existing routines:
+//IC see: https://issues.apache.org/jira/browse/DERBY-4127
newlyCreatedRoutines.add( "SYSCS_INPLACE_COMPRESS_TABLE" );
newlyCreatedRoutines.add( "SYSCS_GET_RUNTIMESTATISTICS" );
newlyCreatedRoutines.add( "SYSCS_SET_RUNTIMESTATISTICS" );
@@ -496,6 +521,7 @@ private void doFullUpgrade(TransactionController tc, int fromMajorVersionNumber,
bootingDictionary.upgradeSYSROUTINEPERMS_10_6( tc );
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-5688
if (fromMajorVersionNumber <= DataDictionary.DD_VERSION_DERBY_10_8)
{
// On upgrade from versions before 10.9, create system procedures
@@ -511,9 +537,11 @@ private void doFullUpgrade(TransactionController tc, int fromMajorVersionNumber,
// sql (schema, schema object) parts of the file name to remove
// path delimiters. ALso, we now use no schema subdirectories since
// there is no chance of name collision with the UUID.
+//IC see: https://issues.apache.org/jira/browse/DERBY-5357
bootingDictionary.upgradeJarStorage(tc);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-5688
if (fromMajorVersionNumber <= DataDictionary.DD_VERSION_DERBY_10_9)
{
// On upgrade from versions before 10.10, create system procedures
@@ -545,10 +573,17 @@ private void doFullUpgrade(TransactionController tc, int fromMajorVersionNumber,
bootingDictionary.create_10_12_system_procedures( tc, newlyCreatedRoutines );
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-4555
+//IC see: https://issues.apache.org/jira/browse/DERBY-6892
if (fromMajorVersionNumber <= DataDictionary.DD_VERSION_DERBY_10_12)
{
// On upgrade from versions before 10.13, create system procedures
// added in 10.13.
+//IC see: https://issues.apache.org/jira/browse/DERBY-6903
+//IC see: https://issues.apache.org/jira/browse/DERBY-6904
+//IC see: https://issues.apache.org/jira/browse/DERBY-6905
+//IC see: https://issues.apache.org/jira/browse/DERBY-6906
+//IC see: https://issues.apache.org/jira/browse/DERBY-534
bootingDictionary.create_10_13_system_procedures( tc, newlyCreatedRoutines );
}
@@ -592,6 +627,7 @@ private void handleMinorRevisionChange(TransactionController tc, DD_Version from
// match the version we are using. We don't want to do this for lower
// database versions because on reverting to the previous version the
// SPSes won't be restored.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1107
if (fromVersion.majorVersionNumber >= DataDictionary.DD_VERSION_DERBY_10_5)
bootingDictionary.updateMetadataSPSes(tc);
@@ -623,6 +659,7 @@ private void handleMinorRevisionChange(TransactionController tc, DD_Version from
// invalidate all the procedures we need to indicate that
// any procedure we read off disk is automatically invalid,
// so we do not try to load the generated class.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
bootingDictionary.setReadOnlyUpgrade();
}
@@ -665,6 +702,7 @@ protected void dropSystemCatalog(TransactionController tc,
SchemaDescriptor sd = bootingDictionary.getSystemSchemaDescriptor();
TableDescriptor td = bootingDictionary.getTableDescriptor(
crf.getCatalogName(),
+//IC see: https://issues.apache.org/jira/browse/DERBY-3012
sd, tc);
ConglomerateDescriptor[] cds = td.getConglomerateDescriptors();
for (int index = 0; index < cds.length; index++)
@@ -739,6 +777,7 @@ public final void writeExternal( ObjectOutput out ) throws IOException
jbmsVersion.getMinorVersion()*100 +jbmsVersion.getMaintVersion() + (jbmsVersion.isBeta() ? 0 : 1) + 2
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
5.0.22 => (0*100) + 22 + 2 = 24 - (5.0 has a unique major number)
5.1.2 => (1*100) + 2 + 2 = 104 - (5.1 has a unique major number)
@@ -756,6 +795,7 @@ public final void writeExternal( ObjectOutput out ) throws IOException
private int getJBMSMinorVersionNumber()
{
ProductVersionHolder jbmsVersion = DataDictionaryImpl.getMonitor().getEngineVersion();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
return jbmsVersion.getMinorVersion()*100 +jbmsVersion.getMaintVersion() + (jbmsVersion.isBeta() ? 0 : 1) + 2;
}
@@ -851,6 +891,7 @@ boolean checkVersion(int requiredMajorVersion, String feature) throws StandardEx
* can't call this entry point.
*/
private static boolean isFullUpgrade( final Properties startParams, final String oldVersionInfo )
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
throws StandardException
{
try {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/DDdependableFinder.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/DDdependableFinder.java
index 2429146754..512a141d7b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/DDdependableFinder.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/DDdependableFinder.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.impl.sql.catalog.DDdependableFinder
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
@@ -166,15 +167,18 @@ public String getSQLObjectType()
case StoredFormatIds.VIEW_DESCRIPTOR_FINDER_V01_ID:
return Dependable.VIEW;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
case StoredFormatIds.TABLE_PERMISSION_FINDER_V01_ID:
return Dependable.TABLE_PERMISSION;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
case StoredFormatIds.COLUMNS_PERMISSION_FINDER_V01_ID:
return Dependable.COLUMNS_PERMISSION;
case StoredFormatIds.ROUTINE_PERMISSION_FINDER_V01_ID:
return Dependable.ROUTINE_PERMISSION;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3666
case StoredFormatIds.ROLE_GRANT_FINDER_V01_ID:
return Dependable.ROLE_GRANT;
@@ -201,6 +205,7 @@ public String getSQLObjectType()
public final Dependable getDependable(DataDictionary dd, UUID dependableObjectID)
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2138
Dependable dependable = findDependable(dd, dependableObjectID);
if (dependable == null)
throw StandardException.newException(SQLState.LANG_OBJECT_NOT_FOUND,
@@ -255,6 +260,7 @@ Dependable findDependable(DataDictionary dd, UUID dependableObjectID)
case StoredFormatIds.VIEW_DESCRIPTOR_FINDER_V01_ID:
return dd.getViewDescriptor(dependableObjectID);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
case StoredFormatIds.COLUMNS_PERMISSION_FINDER_V01_ID:
return dd.getColumnPermissions(dependableObjectID);
@@ -266,6 +272,7 @@ Dependable findDependable(DataDictionary dd, UUID dependableObjectID)
case StoredFormatIds.ROLE_GRANT_FINDER_V01_ID:
return dd.getRoleGrantDescriptor(dependableObjectID);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
case StoredFormatIds.SEQUENCE_DESCRIPTOR_FINDER_V01_ID:
return dd.getSequenceDescriptor(dependableObjectID);
@@ -279,6 +286,7 @@ Dependable findDependable(DataDictionary dd, UUID dependableObjectID)
SanityManager.THROWASSERT(
"getDependable() called with unexpeced formatId = " + formatId);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-2138
return null;
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/DropDependencyFilter.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/DropDependencyFilter.java
index 782eed8f29..f7d23fde80 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/DropDependencyFilter.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/DropDependencyFilter.java
@@ -140,6 +140,7 @@ private UUIDFactory getUUIDFactory()
{
if ( uuidFactory == null )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
uuidFactory = DataDictionaryImpl.getMonitor().getUUIDFactory();
}
return uuidFactory;
@@ -156,6 +157,7 @@ private BooleanDataValue getTrueValue()
{
if ( trueValue == null )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
trueValue = new SQLBoolean( true );
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/IndexInfoImpl.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/IndexInfoImpl.java
index 0c53ad87f3..8183abcc25 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/IndexInfoImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/IndexInfoImpl.java
@@ -49,6 +49,7 @@ class IndexInfoImpl
* @param indexNumber (0-based) number of index within catalog's indexes
* @param crf CatalogRowFactory for the catalog
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
IndexInfoImpl(int indexNumber, CatalogRowFactory crf)
{
this.crf = crf;
@@ -61,6 +62,7 @@ class IndexInfoImpl
*
* @return long The conglomerate number for the index.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
long getConglomerateNumber()
{
return conglomerateNumber;
@@ -71,6 +73,7 @@ long getConglomerateNumber()
*
* @param conglomerateNumber The conglomerateNumber for the index.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
void setConglomerateNumber(long conglomerateNumber)
{
this.conglomerateNumber = conglomerateNumber;
@@ -81,8 +84,10 @@ void setConglomerateNumber(long conglomerateNumber)
*
* @return String The index name for the index.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
String getIndexName()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
return crf.getIndexName(indexNumber);
}
@@ -93,6 +98,7 @@ String getIndexName()
*/
int getColumnCount()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
return crf.getIndexColumnCount(indexNumber);
}
@@ -101,6 +107,7 @@ int getColumnCount()
*
* @return IndexRowGenerator The IRG for this index.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
IndexRowGenerator getIndexRowGenerator()
{
return irg;
@@ -111,6 +118,7 @@ IndexRowGenerator getIndexRowGenerator()
*
* @param irg The IndexRowGenerator for this index.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
void setIndexRowGenerator(IndexRowGenerator irg)
{
this.irg = irg;
@@ -126,6 +134,7 @@ void setIndexRowGenerator(IndexRowGenerator irg)
*/
int getBaseColumnPosition(int colNumber)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
return crf.getIndexColumnPositions(indexNumber)[colNumber];
}
@@ -136,6 +145,7 @@ int getBaseColumnPosition(int colNumber)
*/
boolean isIndexUnique()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
return crf.isIndexUnique(indexNumber);
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/PermissionsCacheable.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/PermissionsCacheable.java
index ebbf7ce75d..5fdc5fe9c4 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/PermissionsCacheable.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/PermissionsCacheable.java
@@ -130,6 +130,7 @@ else if( key instanceof RoutinePermsDescriptor)
AliasDescriptor ad = dd.getAliasDescriptor( routinePermsKey.getRoutineUUID());
SchemaDescriptor sd = dd.getSchemaDescriptor( ad.getSchemaUUID(),
ConnectionUtil.getCurrentLCC().getTransactionExecute());
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
if (sd.isSystemSchema() && !sd.isSchemaWithGrantableRoutines())
permissions = new RoutinePermsDescriptor( dd,
routinePermsKey.getGrantee(),
@@ -141,6 +142,7 @@ else if( routinePermsKey.getGrantee().equals( sd.getAuthorizationId()))
routinePermsKey.getGrantee(),
Authorizer.SYSTEM_AUTHORIZATION_ID,
routinePermsKey.getRoutineUUID(),
+//IC see: https://issues.apache.org/jira/browse/DERBY-464
true);
}
catch( java.sql.SQLException sqle)
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/PermissionsCatalogRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/PermissionsCatalogRowFactory.java
index f37dafd75f..89f6a367d8 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/PermissionsCatalogRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/PermissionsCatalogRowFactory.java
@@ -37,6 +37,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
abstract class PermissionsCatalogRowFactory extends CatalogRowFactory
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
PermissionsCatalogRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
{
super(uuidf,ef,dvf);
@@ -60,6 +61,7 @@ DataValueDescriptor getNullAuthorizationID()
*
* @return The internal authorization ID
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
String getAuthorizationID( ExecRow row, int columnPos)
throws StandardException
{
@@ -74,6 +76,7 @@ String getAuthorizationID( ExecRow row, int columnPos)
*
* @exception StandardException standard error policy
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
abstract ExecIndexRow buildIndexKeyRow( int indexNumber,
PermissionsDescriptor perm)
throws StandardException;
@@ -90,6 +93,7 @@ abstract ExecIndexRow buildIndexKeyRow( int indexNumber,
*
* @exception StandardException standard error policy
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
abstract int orPermissions( ExecRow row, PermissionsDescriptor perm, boolean[] colsChanged)
throws StandardException;
@@ -105,6 +109,7 @@ abstract int orPermissions( ExecRow row, PermissionsDescriptor perm, boolean[] c
*
* @exception StandardException standard error policy
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
abstract int removePermissions( ExecRow row, PermissionsDescriptor perm, boolean[] colsChanged)
throws StandardException;
@@ -118,5 +123,6 @@ abstract int removePermissions( ExecRow row, PermissionsDescriptor perm, boolean
* @param perm Permission descriptor
* @throws StandardException
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
abstract void setUUIDOfThePassedDescriptor(ExecRow row, PermissionsDescriptor perm) throws StandardException;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/RoleClosureIteratorImpl.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/RoleClosureIteratorImpl.java
index ebb53b740f..ca9af87929 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/RoleClosureIteratorImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/RoleClosureIteratorImpl.java
@@ -120,6 +120,7 @@ public class RoleClosureIteratorImpl implements RoleClosureIterator
this.root = root;
this.dd = dd;
this.tc = tc;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
seenSoFar = new HashMap();
lifo = new ArrayList(); // remaining work stack
@@ -131,6 +132,7 @@ public class RoleClosureIteratorImpl implements RoleClosureIterator
null,
false,
false);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
List dummyList = new ArrayList();
dummyList.add(dummy);
currNodeIter = dummyList.iterator();
@@ -150,6 +152,7 @@ public String next() throws StandardException {
} else if (graph == null) {
// We get here the second time next is called.
graph = dd.getRoleGrantGraph(tc, inverse);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
List outArcs = graph.get(root);
if (outArcs != null) {
currNodeIter = outArcs.iterator();
@@ -183,6 +186,7 @@ public String next() throws StandardException {
while (lifo.size() > 0 && currNodeIter == null) {
newNode = lifo.remove(lifo.size() - 1);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
// In the example (see interface doc), the
// iterator of outgoing arcs for f (grant inverse)
@@ -204,6 +208,7 @@ public String next() throws StandardException {
}
if (result != null) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3223
String role = inverse ? result.getRoleName(): result.getGrantee();
seenSoFar.put(role, null);
return role;
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSALIASESRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSALIASESRowFactory.java
index 1500bc2b85..3ed086beba 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSALIASESRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSALIASESRowFactory.java
@@ -112,9 +112,11 @@ class SYSALIASESRowFactory extends CatalogRowFactory
//
/////////////////////////////////////////////////////////////////////////////
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
SYSALIASESRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
{
super(uuidf,ef,dvf);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
initInfo(SYSALIASES_COLUMN_COUNT, "SYSALIASES", indexColumnPositions, uniqueness, uuids);
}
@@ -219,6 +221,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
/* 7th column is SYSTEMALIAS (boolean) */
row.setColumn
(SYSALIASES_SYSTEMALIAS, new SQLBoolean(systemAlias));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
/* 8th column is ALIASINFO (org.apache.derby.catalog.AliasInfo) */
row.setColumn(SYSALIASES_ALIASINFO,
@@ -325,6 +328,9 @@ public TupleDescriptor buildDescriptor(
{
case AliasInfo.ALIAS_NAME_SPACE_PROCEDURE_AS_CHAR:
case AliasInfo.ALIAS_NAME_SPACE_FUNCTION_AS_CHAR:
+//IC see: https://issues.apache.org/jira/browse/DERBY-335
+//IC see: https://issues.apache.org/jira/browse/DERBY-335
+//IC see: https://issues.apache.org/jira/browse/DERBY-335
case AliasInfo.ALIAS_TYPE_SYNONYM_AS_CHAR:
case AliasInfo.ALIAS_TYPE_UDT_AS_CHAR:
case AliasInfo.ALIAS_TYPE_AGGREGATE_AS_CHAR:
@@ -369,6 +375,7 @@ public TupleDescriptor buildDescriptor(
* @return array of SystemColumn suitable for making this catalog.
*/
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[] {
@@ -381,6 +388,7 @@ public SystemColumn[] buildColumnList()
SystemColumnImpl.getIndicatorColumn("ALIASTYPE"),
SystemColumnImpl.getIndicatorColumn("NAMESPACE"),
SystemColumnImpl.getColumn("SYSTEMALIAS",
+//IC see: https://issues.apache.org/jira/browse/DERBY-3484
Types.BOOLEAN, false),
SystemColumnImpl.getJavaColumn("ALIASINFO",
"org.apache.derby.catalog.AliasInfo", true),
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCHECKSRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCHECKSRowFactory.java
index b2899b3734..dae7353989 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCHECKSRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCHECKSRowFactory.java
@@ -82,9 +82,11 @@ class SYSCHECKSRowFactory extends CatalogRowFactory
//
/////////////////////////////////////////////////////////////////////////////
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
SYSCHECKSRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
{
super(uuidf,ef,dvf);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
initInfo(SYSCHECKS_COLUMN_COUNT, TABLENAME_STRING, indexColumnPositions, uniqueness, uuids );
}
@@ -141,6 +143,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
*/
row.setColumn(SYSCHECKS_REFERENCEDCOLUMNS,
new UserType(rcd));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
return row;
}
@@ -215,6 +218,7 @@ public TupleDescriptor buildDescriptor(
*/
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCOLPERMSRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCOLPERMSRowFactory.java
index e7740e03eb..57cae0b510 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCOLPERMSRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCOLPERMSRowFactory.java
@@ -82,6 +82,7 @@ class SYSCOLPERMSRowFactory extends PermissionsCatalogRowFactory
public static final int
GRANTEE_COL_NUM_IN_GRANTEE_TABLE_TYPE_GRANTOR_INDEX = 1;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
private static final boolean[] indexUniqueness = { true, true, false};
@@ -91,17 +92,21 @@ class SYSCOLPERMSRowFactory extends PermissionsCatalogRowFactory
,"6074401f-0103-0e39-b8e7-00000010f010" // heap UUID
,"787c0020-0103-0e39-b8e7-00000010f010" // index1
,"c9a3808d-010c-42a2-ae15-0000000f67f8" //index2
+//IC see: https://issues.apache.org/jira/browse/DERBY-1543
,"80220011-010c-bc85-060d-000000109ab8" //index3
};
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
SYSCOLPERMSRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
{
super(uuidf,ef,dvf);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
initInfo(COLUMN_COUNT, TABLENAME_STRING, indexColumnPositions, indexUniqueness, uuids);
}
public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
UUID oid;
String colPermID = null;
DataValueDescriptor grantee = null;
@@ -118,6 +123,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent) throws Standa
else
{
ColPermsDescriptor cpd = (ColPermsDescriptor) td;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
oid = cpd.getUUID();
if ( oid == null )
{
@@ -137,6 +143,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent) throws Standa
row.setColumn( GRANTOR_COL_NUM, grantor);
row.setColumn( TABLEID_COL_NUM, new SQLChar(tableID));
row.setColumn( TYPE_COL_NUM, new SQLChar(type));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
row.setColumn( COLUMNS_COL_NUM, new UserType( (Object) columns));
return row;
} // end of makeRow
@@ -151,6 +158,7 @@ public TupleDescriptor buildDescriptor(ExecRow row,
SanityManager.ASSERT( row.nColumns() == COLUMN_COUNT,
"Wrong size row passed to SYSCOLPERMSRowFactory.buildDescriptor");
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
String colPermsUUIDString = row.getColumn( COLPERMSID_COL_NUM).getString();
UUID colPermsUUID = getUUIDFactory().recreateUUID(colPermsUUIDString);
String tableUUIDString = row.getColumn( TABLEID_COL_NUM).getString();
@@ -163,6 +171,7 @@ public TupleDescriptor buildDescriptor(ExecRow row,
"r".equals( type) || "R".equals( type),
"Invalid type passed to SYSCOLPERMSRowFactory.buildDescriptor");
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
ColPermsDescriptor colPermsDesc =
new ColPermsDescriptor( dataDictionary,
getAuthorizationID( row, GRANTEE_COL_NUM),
@@ -174,6 +183,7 @@ public TupleDescriptor buildDescriptor(ExecRow row,
/** builds a column list for the catalog */
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[] {
@@ -215,11 +225,13 @@ public ExecIndexRow buildIndexKeyRow( int indexNumber,
row.setColumn(2, new SQLChar(tableUUIDStr));
row.setColumn(3, new SQLChar(colPerms.getType()));
break;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
case COLPERMSID_INDEX_NUM:
row = getExecutionFactory().getIndexableRow( 1);
String colPermsUUIDStr = perm.getObjectID().toString();
row.setColumn(1, new SQLChar(colPermsUUIDStr));
break;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1543
case TABLEID_INDEX_NUM:
row = getExecutionFactory().getIndexableRow( 1);
colPerms = (ColPermsDescriptor) perm;
@@ -317,6 +329,7 @@ public int removePermissions( ExecRow row, PermissionsDescriptor perm, boolean[]
* @see PermissionsCatalogRowFactory#setUUIDOfThePassedDescriptor
*/
public void setUUIDOfThePassedDescriptor(ExecRow row, PermissionsDescriptor perm)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
throws StandardException
{
DataValueDescriptor existingPermDVD = row.getColumn(COLPERMSID_COL_NUM);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
index ae5c6294fb..f4ea521b4d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
@@ -113,6 +113,11 @@ public class SYSCOLUMNSRowFactory extends CatalogRowFactory
private final DataDictionary dataDictionary;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6903
+//IC see: https://issues.apache.org/jira/browse/DERBY-6904
+//IC see: https://issues.apache.org/jira/browse/DERBY-6905
+//IC see: https://issues.apache.org/jira/browse/DERBY-6906
+//IC see: https://issues.apache.org/jira/browse/DERBY-534
SYSCOLUMNSRowFactory(DataDictionary dd,UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
{
this(dd, uuidf, ef, dvf, TABLENAME_STRING);
@@ -123,6 +128,7 @@ public class SYSCOLUMNSRowFactory extends CatalogRowFactory
{
super(uuidf,ef,dvf);
this.dataDictionary = dd;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
initInfo(SYSCOLUMNS_COLUMN_COUNT, myName, indexColumnPositions, uniqueness, uuids);
}
@@ -141,6 +147,11 @@ public class SYSCOLUMNSRowFactory extends CatalogRowFactory
*/
@Override
public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6903
+//IC see: https://issues.apache.org/jira/browse/DERBY-6904
+//IC see: https://issues.apache.org/jira/browse/DERBY-6905
+//IC see: https://issues.apache.org/jira/browse/DERBY-6906
+//IC see: https://issues.apache.org/jira/browse/DERBY-534
throws StandardException{
return makeRow(td, getHeapColumnCount());
}
@@ -163,6 +174,7 @@ private ExecRow makeRow(TupleDescriptor td, int columnCount)
Object defaultSerializable = null;
long autoincStart = 0;
long autoincInc = 0;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3175
long autoincValue = 0;
boolean autoincCycle = false;
//The SYSCOLUMNS table's autoinc related columns change with different
@@ -172,6 +184,7 @@ private ExecRow makeRow(TupleDescriptor td, int columnCount)
//start value? Following variable is used to keep track of what happened
//to the autoincrement column.
long autoinc_create_or_modify_Start_Increment = -1;
+//IC see: https://issues.apache.org/jira/browse/DERBY-783
if (td != null)
{
@@ -182,12 +195,20 @@ private ExecRow makeRow(TupleDescriptor td, int columnCount)
tabID = column.getReferencingUUID().toString();
colName = column.getColumnName();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
colID = column.getPosition();
autoincStart = column.getAutoincStart();
autoincInc = column.getAutoincInc();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3175
autoincValue = column.getAutoincValue();
+//IC see: https://issues.apache.org/jira/browse/DERBY-783
autoinc_create_or_modify_Start_Increment = column.getAutoinc_create_or_modify_Start_Increment();
autoincCycle = column.getAutoincCycle();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6903
+//IC see: https://issues.apache.org/jira/browse/DERBY-6904
+//IC see: https://issues.apache.org/jira/browse/DERBY-6905
+//IC see: https://issues.apache.org/jira/browse/DERBY-6906
+//IC see: https://issues.apache.org/jira/browse/DERBY-534
if (column.getDefaultInfo() != null)
{
@@ -212,6 +233,11 @@ private ExecRow makeRow(TupleDescriptor td, int columnCount)
/* Build the row to insert */
row = getExecutionFactory().getValueRow(columnCount);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6903
+//IC see: https://issues.apache.org/jira/browse/DERBY-6904
+//IC see: https://issues.apache.org/jira/browse/DERBY-6905
+//IC see: https://issues.apache.org/jira/browse/DERBY-6906
+//IC see: https://issues.apache.org/jira/browse/DERBY-534
/* 1st column is REFERENCEID (UUID - char(36)) */
row.setColumn(SYSCOLUMNS_REFERENCEID, new SQLChar(tabID));
@@ -225,6 +251,7 @@ private ExecRow makeRow(TupleDescriptor td, int columnCount)
/* 4th column is COLUMNDATATYPE */
row.setColumn(SYSCOLUMNS_COLUMNDATATYPE,
new UserType(typeDesc));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
/* 5th column is COLUMNDEFAULT */
row.setColumn(SYSCOLUMNS_COLUMNDEFAULT,
@@ -253,11 +280,17 @@ private ExecRow makeRow(TupleDescriptor td, int columnCount)
// In this case, the autoincValue may have a
// different value than the autoincStart.
row.setColumn(SYSCOLUMNS_AUTOINCREMENTVALUE,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3175
new SQLLongint(autoincValue));
row.setColumn(SYSCOLUMNS_AUTOINCREMENTSTART,
new SQLLongint(autoincStart));
row.setColumn(SYSCOLUMNS_AUTOINCREMENTINC,
new SQLLongint(autoincInc));
+//IC see: https://issues.apache.org/jira/browse/DERBY-6903
+//IC see: https://issues.apache.org/jira/browse/DERBY-6904
+//IC see: https://issues.apache.org/jira/browse/DERBY-6905
+//IC see: https://issues.apache.org/jira/browse/DERBY-6906
+//IC see: https://issues.apache.org/jira/browse/DERBY-534
if (row.nColumns() >= 10) {
// This column is present only if the data dictionary version is
// 10.14 or higher.
@@ -272,6 +305,7 @@ private ExecRow makeRow(TupleDescriptor td, int columnCount)
ColumnDescriptor column = (ColumnDescriptor)td;
row.setColumn(SYSCOLUMNS_AUTOINCREMENTVALUE, new SQLLongint(autoincStart));
+//IC see: https://issues.apache.org/jira/browse/DERBY-783
row.setColumn(SYSCOLUMNS_AUTOINCREMENTSTART, new SQLLongint(autoincStart));
row.setColumn(SYSCOLUMNS_AUTOINCREMENTINC, new SQLLongint(
column.getTableDescriptor().getColumnDescriptor(colName).getAutoincInc()));
@@ -305,6 +339,11 @@ else if(autoinc_create_or_modify_Start_Increment == ColumnDefinitionNode.MODIFY_
new SQLLongint());
row.setColumn(SYSCOLUMNS_AUTOINCREMENTINC,
new SQLLongint());
+//IC see: https://issues.apache.org/jira/browse/DERBY-6903
+//IC see: https://issues.apache.org/jira/browse/DERBY-6904
+//IC see: https://issues.apache.org/jira/browse/DERBY-6905
+//IC see: https://issues.apache.org/jira/browse/DERBY-6906
+//IC see: https://issues.apache.org/jira/browse/DERBY-534
if (row.nColumns() >= 10) {
// This column is present only if the data dictionary version is
// 10.14 or higher.
@@ -374,6 +413,11 @@ public TupleDescriptor buildDescriptor(
{
int expectedCols =
+//IC see: https://issues.apache.org/jira/browse/DERBY-6903
+//IC see: https://issues.apache.org/jira/browse/DERBY-6904
+//IC see: https://issues.apache.org/jira/browse/DERBY-6905
+//IC see: https://issues.apache.org/jira/browse/DERBY-6906
+//IC see: https://issues.apache.org/jira/browse/DERBY-534
dd.checkVersion(DataDictionary.DD_VERSION_DERBY_10_14, null)
? SYSCOLUMNS_COLUMN_COUNT
: (SYSCOLUMNS_COLUMN_COUNT - 1);
@@ -392,6 +436,7 @@ public TupleDescriptor buildDescriptor(
UUID defaultUUID = null;
UUID uuid = null;
UUIDFactory uuidFactory = getUUIDFactory();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3175
long autoincStart, autoincInc, autoincValue;
boolean autoincCycle = false;
@@ -468,6 +513,7 @@ else if (object instanceof DefaultInfoImpl)
/* 7th column is AUTOINCREMENTVALUE (long) */
autoincValue = row.getColumn(SYSCOLUMNS_AUTOINCREMENTVALUE).getLong();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3175
/* 8th column is AUTOINCREMENTSTART (long) */
autoincStart = row.getColumn(SYSCOLUMNS_AUTOINCREMENTSTART).getLong();
@@ -475,6 +521,11 @@ else if (object instanceof DefaultInfoImpl)
/* 9th column is AUTOINCREMENTINC (long) */
autoincInc = row.getColumn(SYSCOLUMNS_AUTOINCREMENTINC).getLong();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6903
+//IC see: https://issues.apache.org/jira/browse/DERBY-6904
+//IC see: https://issues.apache.org/jira/browse/DERBY-6905
+//IC see: https://issues.apache.org/jira/browse/DERBY-6906
+//IC see: https://issues.apache.org/jira/browse/DERBY-534
if (row.nColumns() >= 10){
DataValueDescriptor col = row.getColumn(SYSCOLUMNS_AUTOINCREMENTINCCYCLE);
autoincCycle = col.getBoolean();
@@ -514,6 +565,7 @@ public int getPrimaryKeyIndexNumber()
* @return array of SystemColumn suitable for making this catalog.
*/
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
@@ -531,6 +583,11 @@ public SystemColumn[] buildColumnList()
SystemColumnImpl.getColumn("AUTOINCREMENTSTART", Types.BIGINT, true),
SystemColumnImpl.getColumn("AUTOINCREMENTINC", Types.BIGINT, true),
SystemColumnImpl.getColumn("AUTOINCREMENTCYCLE", Types.BOOLEAN, true)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6903
+//IC see: https://issues.apache.org/jira/browse/DERBY-6904
+//IC see: https://issues.apache.org/jira/browse/DERBY-6905
+//IC see: https://issues.apache.org/jira/browse/DERBY-6906
+//IC see: https://issues.apache.org/jira/browse/DERBY-534
};
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCONGLOMERATESRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCONGLOMERATESRowFactory.java
index e99d5feea5..733482ec3b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCONGLOMERATESRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCONGLOMERATESRowFactory.java
@@ -106,11 +106,13 @@ public class SYSCONGLOMERATESRowFactory extends CatalogRowFactory
,"80000016-00d0-fd77-3ed8-000a0a0b1900" // SYSCONGLOMERATES_INDEX3
};
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
SYSCONGLOMERATESRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
{
super(uuidf,ef,dvf);
initInfo(SYSCONGLOMERATES_COLUMN_COUNT,
TABLENAME_STRING, indexColumnPositions,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
uniqueness, uuids );
}
@@ -155,6 +157,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
schemaID = conglomerate.getSchemaID().toString();
}
tabID = conglomerate.getTableID().toString();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
conglomNumber = conglomerate.getConglomerateNumber();
conglomName = conglomerate.getConglomerateName();
conglomUUIDString = conglomerate.getUUID().toString();
@@ -179,6 +182,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
/* 3rd column is CONGLOMERATENUMBER (long) */
row.setColumn(3, new SQLLongint(conglomNumber));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
/* 4th column is CONGLOMERATENAME (varchar(128))
** If null, use the tableid so we always
@@ -189,6 +193,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
/* 5th column is ISINDEX (boolean) */
row.setColumn(5, new SQLBoolean(supportsIndex));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
/* 6th column is DESCRIPTOR
* (user type org.apache.derby.catalog.IndexDescriptor)
@@ -204,6 +209,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
/* 7th column is ISCONSTRAINT (boolean) */
row.setColumn(7, new SQLBoolean(supportsConstraint));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
/* 8th column is CONGLOMERATEID (UUID - char(36)) */
row.setColumn(8, new SQLChar(conglomUUIDString));
@@ -430,6 +436,7 @@ protected String getConglomerateName(ExecRow row)
*/
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[] {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCONSTRAINTSRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCONSTRAINTSRowFactory.java
index 8e70b50db0..986a780eee 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCONSTRAINTSRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSCONSTRAINTSRowFactory.java
@@ -98,10 +98,12 @@ public class SYSCONSTRAINTSRowFactory extends CatalogRowFactory
//
/////////////////////////////////////////////////////////////////////////////
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
SYSCONSTRAINTSRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
{
super(uuidf,ef,dvf);
initInfo(SYSCONSTRAINTS_COLUMN_COUNT, TABLENAME_STRING,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
indexColumnPositions, uniqueness, uuids );
}
@@ -132,6 +134,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
String schemaID = null;
boolean deferrable =
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
ConstraintDefinitionNode.DEFERRABLE_DEFAULT;
boolean initiallyDeferred =
ConstraintDefinitionNode.INITIALLY_DEFERRED_DEFAULT;
@@ -184,6 +187,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
schemaID = constraint.getSchemaDescriptor().getUUID().toString();
// constraint characteristics
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
deferrable = constraint.deferrable();
initiallyDeferred = constraint.initiallyDeferred();
enforced = constraint.enforced();
@@ -216,11 +220,13 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
row.setColumn(SYSCONSTRAINTS_SCHEMAID, new SQLChar(schemaID));
/* 6th column is STATE (char(1)) */
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
row.setColumn(SYSCONSTRAINTS_STATE,
new SQLChar(encodeCharacteristics(deferrable, initiallyDeferred, enforced)));
/* 7th column is REFERENCED */
row.setColumn(SYSCONSTRAINTS_REFERENCECOUNT, new SQLInteger(referenceCount));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
return row;
}
@@ -243,6 +249,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
private String encodeCharacteristics(
boolean deferrable, boolean initiallyDeferred, boolean enforced) {
char c;
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
if (deferrable) {
if (initiallyDeferred) {
@@ -322,6 +329,7 @@ public TupleDescriptor buildDescriptor(
String constraintSType;
String constraintStateStr;
boolean deferrable =
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
ConstraintDefinitionNode.DEFERRABLE_DEFAULT;
boolean initiallyDeferred =
ConstraintDefinitionNode.INITIALLY_DEFERRED_DEFAULT;
@@ -497,6 +505,7 @@ public TupleDescriptor buildDescriptor(
switch (constraintStateStr.charAt(0))
{
case 'E':
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
deferrable = false;
initiallyDeferred = false;
enforced = true;
@@ -561,6 +570,8 @@ public TupleDescriptor buildDescriptor(
constraintDesc = ddg.newUniqueConstraintDescriptor(
td,
constraintName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
deferrable,
initiallyDeferred,
keyColumns,//genReferencedColumns(dd, td), //int referencedColumns[],
@@ -582,6 +593,7 @@ public TupleDescriptor buildDescriptor(
constraintDesc = ddg.newForeignKeyConstraintDescriptor(
td,
constraintName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
deferrable,
initiallyDeferred,
keyColumns,//genReferencedColumns(dd, td), //int referencedColumns[],
@@ -608,6 +620,7 @@ public TupleDescriptor buildDescriptor(
constraintDesc = ddg.newCheckConstraintDescriptor(
td,
constraintName,
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
deferrable,
initiallyDeferred,
constraintUUID,
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSDEPENDSRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSDEPENDSRowFactory.java
index 32de7debf2..a472d96cec 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSDEPENDSRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSDEPENDSRowFactory.java
@@ -86,10 +86,12 @@ public class SYSDEPENDSRowFactory extends CatalogRowFactory
//
/////////////////////////////////////////////////////////////////////////////
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
SYSDEPENDSRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
{
super(uuidf,ef,dvf);
initInfo(SYSDEPENDS_COLUMN_COUNT,TABLENAME_STRING, indexColumnPositions,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
uniqueness, uuids );
}
@@ -153,6 +155,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
/* 2nd column is DEPENDENTFINDER */
row.setColumn(SYSDEPENDS_DEPENDENTTYPE,
new UserType(dependentBloodhound));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
/* 3rd column is PROVIDERID (UUID - char(36)) */
row.setColumn(SYSDEPENDS_PROVIDERID, new SQLChar(providerID));
@@ -232,6 +235,7 @@ public TupleDescriptor buildDescriptor(
* @return array of SystemColumn suitable for making this catalog.
*/
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[] {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSDUMMY1RowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSDUMMY1RowFactory.java
index a4850d016d..b099e14e77 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSDUMMY1RowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSDUMMY1RowFactory.java
@@ -64,11 +64,13 @@ class SYSDUMMY1RowFactory extends CatalogRowFactory
*/
SYSDUMMY1RowFactory(UUIDFactory uuidf,
ExecutionFactory ef,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
DataValueFactory dvf)
{
super(uuidf,ef,dvf);
initInfo(SYSDUMMY1_COLUMN_COUNT, "SYSDUMMY1",
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
null, null, uuids);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java
index dc50a2c5fb..f41d4a1999 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java
@@ -104,10 +104,12 @@ class SYSFILESRowFactory extends CatalogRowFactory
//
/////////////////////////////////////////////////////////////////////////////
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
SYSFILESRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
{
super(uuidf,ef,dvf);
initInfo(SYSFILES_COLUMN_COUNT, TABLENAME_STRING,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
indexColumnPositions, uniqueness, uuids );
}
@@ -158,6 +160,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
/* 4th column is GENERATIONID (long) */
row.setColumn(GENERATION_ID_COL_NUM, new SQLLongint(generationId));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
return row;
}
@@ -246,6 +249,7 @@ public TupleDescriptor buildDescriptor(
* @return array of SystemColumn suitable for making this catalog.
*/
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[] {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSFOREIGNKEYSRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSFOREIGNKEYSRowFactory.java
index 3acef3af69..a9d51be129 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSFOREIGNKEYSRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSFOREIGNKEYSRowFactory.java
@@ -90,10 +90,12 @@ public class SYSFOREIGNKEYSRowFactory extends CatalogRowFactory
//
/////////////////////////////////////////////////////////////////////////////
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
SYSFOREIGNKEYSRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
{
super(uuidf,ef,dvf);
initInfo(SYSFOREIGNKEYS_COLUMN_COUNT, TABLENAME_STRING,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
indexColumnPositions, uniqueness, uuids );
}
@@ -246,6 +248,7 @@ public TupleDescriptor buildDescriptor(
* @return array of SystemColumn suitable for making this catalog.
*/
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[] {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSKEYSRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSKEYSRowFactory.java
index 43010c8a5b..0a72c3b915 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSKEYSRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSKEYSRowFactory.java
@@ -73,9 +73,11 @@ public class SYSKEYSRowFactory extends CatalogRowFactory
//
/////////////////////////////////////////////////////////////////////////////
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
SYSKEYSRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
{
super(uuidf,ef,dvf);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
initInfo(SYSKEYS_COLUMN_COUNT, TABLENAME_STRING, indexColumnPositions, uniqueness, uuids );
}
@@ -198,6 +200,7 @@ public TupleDescriptor buildDescriptor(
* @return array of SystemColumn suitable for making this catalog.
*/
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[] {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSPERMSRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSPERMSRowFactory.java
index 1ed00c4cb3..9f846ad884 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSPERMSRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSPERMSRowFactory.java
@@ -324,6 +324,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
* @return array of SystemColumn suitable for making this catalog.
*/
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[]{
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSROLESRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSROLESRowFactory.java
index 74ec8b6641..d17048772f 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSROLESRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSROLESRowFactory.java
@@ -58,6 +58,7 @@ public class SYSROLESRowFactory extends CatalogRowFactory
private static final int[][] indexColumnPositions =
{
{SYSROLES_ROLEID, SYSROLES_GRANTEE, SYSROLES_GRANTOR},
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
{SYSROLES_ROLEID, SYSROLES_ISDEF},
{SYSROLES_ROLE_UUID}
};
@@ -116,6 +117,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
throws StandardException
{
ExecRow row;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
String oid_string = null;
String roleid = null;
String grantee = null;
@@ -126,6 +128,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
if (td != null)
{
RoleGrantDescriptor rgd = (RoleGrantDescriptor)td;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
roleid = rgd.getRoleName();
grantee = rgd.getGrantee();
@@ -133,6 +136,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
wao = rgd.isWithAdminOption();
isdef = rgd.isDef();
UUID oid = rgd.getUUID();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
oid_string = oid.toString();
}
@@ -185,7 +189,9 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
throws StandardException {
DataValueDescriptor col;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
RoleGrantDescriptor descriptor;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
String oid_string;
String roleid;
String grantee;
@@ -203,6 +209,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
// first column is uuid of this role grant descriptor (char(36))
col = row.getColumn(1);
oid_string = col.getString();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
// second column is roleid (varchar(128))
col = row.getColumn(2);
@@ -224,6 +231,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
col = row.getColumn(6);
isdef = col.getString();
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
descriptor = ddg.newRoleGrantDescriptor
(getUUIDFactory().recreateUUID(oid_string),
roleid,
@@ -242,9 +250,11 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
* @return array of SystemColumn suitable for making this catalog.
*/
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[] {
+//IC see: https://issues.apache.org/jira/browse/DERBY-3137
SystemColumnImpl.getUUIDColumn("UUID", false),
SystemColumnImpl.getIdentifierColumn("ROLEID", false),
SystemColumnImpl.getIdentifierColumn("GRANTEE", false),
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSROUTINEPERMSRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSROUTINEPERMSRowFactory.java
index abb7cc6d56..bd39280dab 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSROUTINEPERMSRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSROUTINEPERMSRowFactory.java
@@ -77,17 +77,21 @@ public class SYSROUTINEPERMSRowFactory extends PermissionsCatalogRowFactory
,"185e801c-0103-0e39-b8e7-00000010f010" // heap UUID
,"c065801d-0103-0e39-b8e7-00000010f010" // index1
,"40f70088-010c-4c2f-c8de-0000000f43a0" // index2
+//IC see: https://issues.apache.org/jira/browse/DERBY-1543
,"08264012-010c-bc85-060d-000000109ab8" // index3
};
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
SYSROUTINEPERMSRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
{
super(uuidf,ef,dvf);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
initInfo( COLUMN_COUNT, TABLENAME_STRING, indexColumnPositions, indexUniqueness, uuids);
}
public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
UUID oid;
String routinePermID = null;
DataValueDescriptor grantee = null;
@@ -102,6 +106,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent) throws Standa
else
{
RoutinePermsDescriptor rpd = (RoutinePermsDescriptor) td;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
oid = rpd.getUUID();
if ( oid == null )
{
@@ -133,7 +138,9 @@ public TupleDescriptor buildDescriptor(ExecRow row,
SanityManager.ASSERT( row.nColumns() == COLUMN_COUNT,
"Wrong size row passed to SYSROUTINEPERMSRowFactory.buildDescriptor");
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
String routinePermsUUIDString = row.getColumn(ROUTINEPERMSID_COL_NUM).getString();
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
UUID routinePermsUUID = getUUIDFactory().recreateUUID(routinePermsUUIDString);
String aliasUUIDString = row.getColumn( ALIASID_COL_NUM).getString();
UUID aliasUUID = getUUIDFactory().recreateUUID(aliasUUIDString);
@@ -149,6 +156,7 @@ public TupleDescriptor buildDescriptor(ExecRow row,
/** builds a column list for the catalog */
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[] {
@@ -188,11 +196,13 @@ public ExecIndexRow buildIndexKeyRow( int indexNumber,
String routineUUIDStr = ((RoutinePermsDescriptor) perm).getRoutineUUID().toString();
row.setColumn(2, new SQLChar(routineUUIDStr));
break;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
case ROUTINEPERMSID_INDEX_NUM:
row = getExecutionFactory().getIndexableRow( 1);
String routinePermsUUIDStr = perm.getObjectID().toString();
row.setColumn(1, new SQLChar(routinePermsUUIDStr));
break;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1543
case ALIASID_INDEX_NUM:
row = getExecutionFactory().getIndexableRow( 1);
routineUUIDStr = ((RoutinePermsDescriptor) perm).getRoutineUUID().toString();
@@ -250,6 +260,7 @@ public int removePermissions( ExecRow row, PermissionsDescriptor perm, boolean[]
* @see PermissionsCatalogRowFactory#setUUIDOfThePassedDescriptor
*/
public void setUUIDOfThePassedDescriptor(ExecRow row, PermissionsDescriptor perm)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
throws StandardException
{
DataValueDescriptor existingPermDVD = row.getColumn(ROUTINEPERMSID_COL_NUM);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSSCHEMASRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSSCHEMASRowFactory.java
index 606750d7a6..161fe661b5 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSSCHEMASRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSSCHEMASRowFactory.java
@@ -95,10 +95,12 @@ public class SYSSCHEMASRowFactory extends CatalogRowFactory
//
/////////////////////////////////////////////////////////////////////////////
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
SYSSCHEMASRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
{
super(uuidf,ef,dvf);
initInfo(SYSSCHEMAS_COLUMN_COUNT, TABLENAME_STRING,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
indexColumnPositions, uniqueness, uuids );
}
@@ -221,6 +223,7 @@ public TupleDescriptor buildDescriptor(
* @return array of SystemColumn suitable for making this catalog.
*/
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[] {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSSEQUENCESRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSSEQUENCESRowFactory.java
index 65dae761a3..74c0f3644f 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSSEQUENCESRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSSEQUENCESRowFactory.java
@@ -253,6 +253,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
col = row.getColumn(SYSSEQUENCES_CURRENT_VALUE);
if ( col.isNull() ) { currentValue = null; }
else { currentValue = col.getLong(); }
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
col = row.getColumn(SYSSEQUENCES_START_VALUE);
startValue = col.getLong();
@@ -290,6 +291,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
* @return array of SystemColumn suitable for making this catalog.
*/
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[]{
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java
index a0b18d4c7a..7b36f37809 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java
@@ -118,10 +118,12 @@ public class SYSSTATEMENTSRowFactory extends CatalogRowFactory
//
/////////////////////////////////////////////////////////////////////////////
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
SYSSTATEMENTSRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
{
super(uuidf,ef,dvf);
initInfo(SYSSTATEMENTS_COLUMN_COUNT, TABLENAME_STRING,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
indexColumnPositions, uniqueness, uuids);
}
@@ -206,6 +208,7 @@ public ExecRow makeSYSSTATEMENTSrow(
/* 5th column is VALID */
row.setColumn(5, new SQLBoolean(valid));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
/* 6th column is TEXT */
row.setColumn(6, dvf.getLongvarcharDataValue(text));
@@ -225,6 +228,7 @@ public ExecRow makeSYSSTATEMENTSrow(
** CONSTANTSTATE is really a formatable StorablePreparedStatement.
*/
row.setColumn(10, new UserType(preparedStatement));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
/* 11th column is INITIALLY_COMPILABLE */
row.setColumn(11, new SQLBoolean(initiallyCompilable));
@@ -307,6 +311,7 @@ public TupleDescriptor buildDescriptor(
// In soft upgrade mode the plan may not be understand by this engine
// so force a recompile.
+//IC see: https://issues.apache.org/jira/browse/DERBY-4845
if (dd.isReadOnlyUpgrade()) {
valid = false;
} else {
@@ -380,6 +385,7 @@ public ExecRow makeEmptyRow()
* @return array of SystemColumn suitable for making this catalog.
*/
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[] {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSSTATISTICSRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSSTATISTICSRowFactory.java
index e2d55c9681..be22833d35 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSSTATISTICSRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSSTATISTICSRowFactory.java
@@ -116,6 +116,7 @@ public class SYSSTATISTICSRowFactory extends CatalogRowFactory
/*
* CONSTRUCTORS
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
SYSSTATISTICSRowFactory(UUIDFactory uuidf,
ExecutionFactory ef,
DataValueFactory dvf)
@@ -123,6 +124,7 @@ public class SYSSTATISTICSRowFactory extends CatalogRowFactory
super(uuidf,ef,dvf);
initInfo(SYSSTATISTICS_COLUMN_COUNT, TABLENAME_STRING,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
indexColumnPositions, uniqueness, uuids);
}
@@ -165,6 +167,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
row.setColumn(3, new SQLChar(tableID));
row.setColumn(4, new SQLTimestamp(updateTime));
row.setColumn(5, new SQLChar(statType));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
row.setColumn(6, new SQLBoolean(validStat));
row.setColumn(7, new SQLInteger(columnCount));
row.setColumn(8, new UserType(statisticsObject));
@@ -238,6 +241,7 @@ public TupleDescriptor buildDescriptor(
* @return array of SystemColumn suitable for making this catalog.
*/
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[] {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSTABLEPERMSRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSTABLEPERMSRowFactory.java
index 77dab51d37..cb101d4477 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSTABLEPERMSRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSTABLEPERMSRowFactory.java
@@ -83,17 +83,21 @@ public class SYSTABLEPERMSRowFactory extends PermissionsCatalogRowFactory
,"004b0019-0103-0e39-b8e7-00000010f010" // heap UUID
,"c851401a-0103-0e39-b8e7-00000010f010" // index1
,"80220011-010c-426e-c599-0000000f1120" // index2
+//IC see: https://issues.apache.org/jira/browse/DERBY-1543
,"f81e0010-010c-bc85-060d-000000109ab8" // index3
};
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
SYSTABLEPERMSRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
{
super(uuidf,ef,dvf);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
initInfo(COLUMN_COUNT, TABLENAME_STRING, indexColumnPositions, indexUniqueness, uuids);
}
public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
UUID oid;
DataValueDescriptor grantee = null;
DataValueDescriptor grantor = null;
@@ -114,6 +118,7 @@ public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent) throws Standa
else
{
TablePermsDescriptor tpd = (TablePermsDescriptor) td;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
oid = tpd.getUUID();
if ( oid == null )
{
@@ -157,6 +162,7 @@ public TupleDescriptor buildDescriptor(ExecRow row,
SanityManager.ASSERT( row.nColumns() == COLUMN_COUNT,
"Wrong size row passed to SYSTABLEPERMSRowFactory.buildDescriptor");
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
String tablePermsUUIDString = row.getColumn(TABLEPERMSID_COL_NUM).getString();
UUID tablePermsUUID = getUUIDFactory().recreateUUID(tablePermsUUIDString);
String tableUUIDString = row.getColumn( TABLEID_COL_NUM).getString();
@@ -183,6 +189,7 @@ public TupleDescriptor buildDescriptor(ExecRow row,
"Invalid SYSTABLEPERMS.triggerPriv column value: " + triggerPriv);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
TablePermsDescriptor tabPermsDesc =
new TablePermsDescriptor( dataDictionary,
getAuthorizationID( row, GRANTEE_COL_NUM),
@@ -196,6 +203,7 @@ public TupleDescriptor buildDescriptor(ExecRow row,
/** builds a column list for the catalog */
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[] {
@@ -238,11 +246,13 @@ public ExecIndexRow buildIndexKeyRow( int indexNumber,
String tableUUIDStr = ((TablePermsDescriptor) perm).getTableUUID().toString();
row.setColumn(2, new SQLChar(tableUUIDStr));
break;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
case TABLEPERMSID_INDEX_NUM:
row = getExecutionFactory().getIndexableRow( 1);
String tablePermsUUIDStr = perm.getObjectID().toString();
row.setColumn(1, new SQLChar(tablePermsUUIDStr));
break;
+//IC see: https://issues.apache.org/jira/browse/DERBY-1543
case TABLEID_INDEX_NUM:
row = getExecutionFactory().getIndexableRow( 1);
tableUUIDStr = ((TablePermsDescriptor) perm).getTableUUID().toString();
@@ -359,6 +369,7 @@ private boolean removeOnePermission( ExecRow row, boolean[] colsChanged, int col
* @see PermissionsCatalogRowFactory#setUUIDOfThePassedDescriptor
*/
public void setUUIDOfThePassedDescriptor(ExecRow row, PermissionsDescriptor perm)
+//IC see: https://issues.apache.org/jira/browse/DERBY-1330
throws StandardException
{
DataValueDescriptor existingPermDVD = row.getColumn(TABLEPERMSID_COL_NUM);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSTABLESRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSTABLESRowFactory.java
index 163d88a22f..146e92befe 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSTABLESRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSTABLESRowFactory.java
@@ -57,6 +57,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* @version 0.1
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
class SYSTABLESRowFactory extends CatalogRowFactory
{
private static final String TABLENAME_STRING = "SYSTABLES";
@@ -98,9 +99,11 @@ class SYSTABLESRowFactory extends CatalogRowFactory
//
/////////////////////////////////////////////////////////////////////////////
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
SYSTABLESRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
{
super(uuidf,ef,dvf);
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
initInfo(SYSTABLES_COLUMN_COUNT, TABLENAME_STRING, indexColumnPositions, (boolean[]) null, uuids);
}
@@ -179,6 +182,7 @@ public ExecRow makeRow(TupleDescriptor td,
tabSType = "V";
break;
+//IC see: https://issues.apache.org/jira/browse/DERBY-335
case TableDescriptor.SYNONYM_TYPE:
tabSType = "A";
break;
@@ -228,6 +232,7 @@ public ExecRow makeRow(TupleDescriptor td,
* @return corresponding empty index row
* @exception StandardException thrown on failure
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
ExecIndexRow buildEmptyIndexRow( int indexNumber,
RowLocation rowLocation)
throws StandardException
@@ -269,6 +274,7 @@ ExecIndexRow buildEmptyIndexRow( int indexNumber,
* cases) supported for now.
* @exception StandardException thrown on failure
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-3678
TupleDescriptor buildDescriptor(
ExecRow row,
TupleDescriptor parentTupleDescriptor,
@@ -307,6 +313,7 @@ public TupleDescriptor buildDescriptor(
DataDictionary dd )
throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3678
return buildDescriptorBody(
row,
parentTupleDescriptor,
@@ -366,6 +373,7 @@ public TupleDescriptor buildDescriptorBody(
case 'V' :
tableTypeEnum = TableDescriptor.VIEW_TYPE;
break;
+//IC see: https://issues.apache.org/jira/browse/DERBY-335
case 'A' :
tableTypeEnum = TableDescriptor.SYNONYM_TYPE;
break;
@@ -381,6 +389,7 @@ public TupleDescriptor buildDescriptorBody(
schemaUUID = getUUIDFactory().recreateUUID(schemaUUIDString);
schema = dd.getSchemaDescriptor(schemaUUID, isolationLevel, null);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3678
/* 5th column is LOCKGRANULARITY (char(1)) */
col = row.getColumn(SYSTABLES_LOCKGRANULARITY);
@@ -422,6 +431,7 @@ protected String getTableName(ExecRow row)
* @return array of SystemColumn suitable for making this catalog.
*/
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[] {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSTRIGGERSRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSTRIGGERSRowFactory.java
index d8c1eaf522..c7aed86504 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSTRIGGERSRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSTRIGGERSRowFactory.java
@@ -132,6 +132,7 @@ public class SYSTRIGGERSRowFactory extends CatalogRowFactory
super(uuidf,ef,dvf);
this.dataDictionary = dd;
initInfo(SYSTRIGGERS_COLUMN_COUNT, TABLENAME_STRING,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
indexColumnPositions, uniqueness, uuids);
}
@@ -265,6 +266,7 @@ private ExecRow makeRow(TupleDescriptor td, int columnCount)
* (user type org.apache.derby.catalog.ReferencedColumns)
*/
row.setColumn(12, new UserType(rcd));
+//IC see: https://issues.apache.org/jira/browse/DERBY-4062
/* 13th column is TRIGGERDEFINITION */
row.setColumn(13, dvf.getLongvarcharDataValue(triggerDefinition));
@@ -475,6 +477,7 @@ private Calendar getCalendarForCreationTimestamp()
whenClauseText = col.getString();
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6186
descriptor = ddg.newTriggerDescriptor(
dd.getSchemaDescriptor(suuid, null),
uuid,
@@ -512,6 +515,7 @@ private Calendar getCalendarForCreationTimestamp()
* @return array of SystemColumn suitable for making this catalog.
*/
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[] {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSVIEWSRowFactory.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSVIEWSRowFactory.java
index 04139e0db1..3b21495643 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSVIEWSRowFactory.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SYSVIEWSRowFactory.java
@@ -82,10 +82,12 @@ public class SYSVIEWSRowFactory extends CatalogRowFactory
//
/////////////////////////////////////////////////////////////////////////////
+//IC see: https://issues.apache.org/jira/browse/DERBY-3147
SYSVIEWSRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
{
super(uuidf,ef,dvf);
initInfo(SYSVIEWS_COLUMN_COUNT, TABLENAME_STRING,
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
indexColumnPositions, uniqueness, uuids );
}
@@ -261,6 +263,7 @@ public TupleDescriptor buildDescriptor(
* @return array of SystemColumn suitable for making this catalog.
*/
public SystemColumn[] buildColumnList()
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
return new SystemColumn[] {
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SequenceGenerator.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SequenceGenerator.java
index b7e13116ae..da0de0e956 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SequenceGenerator.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SequenceGenerator.java
@@ -238,6 +238,7 @@ public synchronized SequenceGenerator clone( boolean restart )
{
Long startValue;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
if ( restart ) { startValue = _RESTART_VALUE; }
else if ( _isExhausted ) { startValue = null; }
else { startValue = _currentValue; }
@@ -328,6 +329,7 @@ public synchronized Long peekAtCurrentValue()
{
Long currentValue = null;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
if ( !_isExhausted ) { currentValue = _currentValue; }
return currentValue;
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java
index b4bf38a781..cde9815bad 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java
@@ -135,6 +135,7 @@ public SequenceUpdater()
/** Normal constructor */
public SequenceUpdater( DataDictionaryImpl dd )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4565
this();
_dd = dd;
@@ -214,6 +215,7 @@ public void clean(boolean forRemove) throws StandardException
//
boolean gapClosed = false;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6554
try {
if ( _sequenceGenerator == null ) { gapClosed = true; }
else
@@ -245,6 +247,7 @@ public void clean(boolean forRemove) throws StandardException
Monitor.getStream().println( errorMessage );
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6554
_uuidString = null;
_sequenceGenerator = null;
}
@@ -262,6 +265,7 @@ public void clearIdentity()
{
//Doing check for lcc and db to be certain
LanguageConnectionContext lcc = getLCC();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5054
if (lcc != null)
{
Database db = lcc.getDatabase();
@@ -407,6 +411,7 @@ public synchronized BulkInsertUpdater getBulkInsertUpdater( boolean restart )
return;
case SequenceGenerator.RET_MARK_EXHAUSTED:
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
updateCurrentValueOnDisk( currentValue, null );
returnValue.setValue( currentValue );
return;
@@ -472,6 +477,7 @@ public synchronized boolean updateCurrentValueOnDisk( Long oldValue, Long newVal
SanityManager.ASSERT( oldValue == null, "We should be flushing unused sequence values here." );
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
ContextService csf = getContextService();
ContextManager cm = csf.getCurrentContextManager();
AccessFactory af = _dd.af;
@@ -495,10 +501,12 @@ public synchronized boolean updateCurrentValueOnDisk( Long oldValue, Long newVal
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6554
retval = updateCurrentValueOnDisk( nestedTransaction, oldValue, newValue, false );
}
catch (StandardException se)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6554
if ( !se.isLockTimeout() )
{
if ( se.isSelfDeadlock() )
@@ -523,11 +531,13 @@ public synchronized boolean updateCurrentValueOnDisk( Long oldValue, Long newVal
nestedTransaction.commit();
nestedTransaction.destroy();
+//IC see: https://issues.apache.org/jira/browse/DERBY-6554
if ( escalateToParentTransaction )
{
retval = updateCurrentValueOnDisk( executionTransaction, oldValue, newValue, false );
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6554
return retval;
}
}
@@ -562,12 +572,14 @@ protected SequencePreallocator makePreallocator( TransactionController tc )
return new SequenceRange( Integer.parseInt( className ) );
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6626
Class> klass = Class.forName(className);
if (!SequencePreallocator.class.isAssignableFrom(klass)) {
throw StandardException.newException(
SQLState.LANG_NOT_A_SEQUENCE_PREALLOCATOR, propertyName);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
return (SequencePreallocator) klass.getConstructor().newInstance();
}
catch (ClassNotFoundException e) { throw missingAllocator( propertyName, className, e ); }
@@ -597,6 +609,7 @@ private boolean isNumber( String text )
private static LanguageConnectionContext getLCC()
{
return (LanguageConnectionContext)
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
getContextOrNull(LanguageConnectionContext.CONTEXT_ID);
}
@@ -612,6 +625,7 @@ private StandardException unimplementedFeature()
*/
private static ContextService getContextService()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6648
if ( System.getSecurityManager() == null )
{
return ContextService.getFactory();
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SystemColumnImpl.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SystemColumnImpl.java
index 121120d7d1..41da8605e1 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SystemColumnImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SystemColumnImpl.java
@@ -131,10 +131,12 @@ static SystemColumn getIndicatorColumn(String name) {
*/
static SystemColumn getJavaColumn(String name, String javaClassName,
boolean nullability)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4484
throws StandardException
{
TypeId typeId = TypeId.getUserDefinedTypeId(javaClassName);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6003
DataTypeDescriptor dtd = new DataTypeDescriptor(typeId, nullability);
return new SystemColumnImpl(name, dtd);
@@ -162,6 +164,7 @@ public String getName()
* Return the type of this column.
*/
public DataTypeDescriptor getType() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
return type;
}
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java
index 0cc04b4db0..afa345457a 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java
@@ -51,6 +51,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* Used to save heapId, name pairs for non core tables.
*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
class TabInfoImpl
{
/**
@@ -72,6 +73,7 @@ class TabInfoImpl
*
* @param crf the associated CatalogRowFactory
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1739
TabInfoImpl(CatalogRowFactory crf)
{
this.heapConglomerate = -1;
@@ -98,6 +100,7 @@ class TabInfoImpl
*
* @return long The conglomerate for the heap.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
long getHeapConglomerate()
{
return heapConglomerate;
@@ -142,6 +145,7 @@ long getIndexConglomerate(int indexID)
* @param index Index number for index for table
* @param indexConglomerate The conglomerate for that index
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
void setIndexConglomerate(int index, long indexConglomerate)
{
/* Index names must be set before conglomerates.
@@ -169,6 +173,7 @@ void setIndexConglomerate(int index, long indexConglomerate)
* @param cd The ConglomerateDescriptor for one of the index
* for this table.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
void setIndexConglomerate(ConglomerateDescriptor cd)
{
int index;
@@ -218,8 +223,10 @@ void setIndexConglomerate(ConglomerateDescriptor cd)
*
* @return String The table name.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
String getTableName()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
return crf.getCatalogName();
}
@@ -294,6 +301,7 @@ int getIndexColumnCount(int indexNumber)
*
* @return IndexRowGenerator The IRG for the specified index number.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
IndexRowGenerator getIndexRowGenerator(int indexNumber)
{
if (SanityManager.DEBUG)
@@ -316,6 +324,7 @@ IndexRowGenerator getIndexRowGenerator(int indexNumber)
* @param indexNumber The index number.
* @param irg The IndexRowGenerator for the specified index number.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
void setIndexRowGenerator(int indexNumber, IndexRowGenerator irg)
{
if (SanityManager.DEBUG)
@@ -417,6 +426,9 @@ int insertRow( ExecRow row, TransactionController tc)
RowLocation[] notUsed = new RowLocation[1];
+//IC see: https://issues.apache.org/jira/browse/DERBY-3850
+//IC see: https://issues.apache.org/jira/browse/DERBY-177
+//IC see: https://issues.apache.org/jira/browse/DERBY-3693
return insertRowListImpl(new ExecRow[] {row},tc,notUsed);
}
@@ -438,12 +450,16 @@ int insertRowList(ExecRow[] rowList, TransactionController tc )
{
RowLocation[] notUsed = new RowLocation[1];
+//IC see: https://issues.apache.org/jira/browse/DERBY-3850
+//IC see: https://issues.apache.org/jira/browse/DERBY-177
+//IC see: https://issues.apache.org/jira/browse/DERBY-3693
return insertRowListImpl(rowList,tc,notUsed);
}
/**
Insert logic to insert a list of rows into a table. This logic has two
odd features.
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
Returns an indication if any returned row was a duplicate.
@@ -457,6 +473,9 @@ int insertRowList(ExecRow[] rowList, TransactionController tc )
ROWNOTDUPLICATE otherwise
*/
private int insertRowListImpl(ExecRow[] rowList, TransactionController tc,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3850
+//IC see: https://issues.apache.org/jira/browse/DERBY-177
+//IC see: https://issues.apache.org/jira/browse/DERBY-3693
RowLocation[] rowLocationOut)
throws StandardException
{
@@ -522,6 +541,9 @@ private int insertRowListImpl(ExecRow[] rowList, TransactionController tc,
heapLocation,
row );
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
+//IC see: https://issues.apache.org/jira/browse/DERBY-3330
+//IC see: https://issues.apache.org/jira/browse/DERBY-6419
insertRetCode = indexControllers[ ictr ].insert(
indexableRow.getRowArray());
@@ -667,6 +689,7 @@ private int deleteRows(TransactionController tc,
** is a start key and no stop key or vice versa.
*/
int lockMode = ((startKey != null) && (stopKey != null)) ?
+//IC see: https://issues.apache.org/jira/browse/DERBY-6063
TransactionController.MODE_RECORD :
TransactionController.MODE_TABLE;
@@ -758,6 +781,7 @@ private int deleteRows(TransactionController tc,
* @param indexNumber Key is appropriate for this index.
* @exception StandardException Thrown on failure
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
ExecRow getRow( TransactionController tc,
ExecIndexRow key,
int indexNumber )
@@ -791,6 +815,7 @@ ExecRow getRow( TransactionController tc,
*
* @exception StandardException thrown on failure.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
RowLocation getRowLocation(TransactionController tc,
ExecIndexRow key,
int indexNumber)
@@ -826,6 +851,7 @@ RowLocation getRowLocation(TransactionController tc,
* @param indexNumber Key is appropriate for this index.
* @exception StandardException Thrown on failure
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
ExecRow getRow( TransactionController tc,
ConglomerateController heapCC,
ExecIndexRow key,
@@ -919,6 +945,8 @@ private ExecRow getRowInternal( TransactionController tc,
*
* @exception StandardException Thrown on failure
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
void updateRow( ExecIndexRow key,
ExecRow newRow,
int indexNumber,
@@ -929,6 +957,9 @@ void updateRow( ExecIndexRow key,
{
ExecRow[] newRows = new ExecRow[1];
newRows[0] = newRow;
+//IC see: https://issues.apache.org/jira/browse/DERBY-3850
+//IC see: https://issues.apache.org/jira/browse/DERBY-177
+//IC see: https://issues.apache.org/jira/browse/DERBY-3693
updateRow(key, newRows, indexNumber, indicesToUpdate, colsToUpdate, tc);
}
@@ -949,6 +980,7 @@ void updateRow( ExecIndexRow key,
*
* @exception StandardException Thrown on failure
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
void updateRow( ExecIndexRow key,
ExecRow[] newRows,
int indexNumber,
@@ -973,11 +1005,20 @@ void updateRow( ExecIndexRow key,
// Row level locking
rc.openForUpdate(indicesToUpdate, TransactionController.MODE_RECORD, true);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3850
+//IC see: https://issues.apache.org/jira/browse/DERBY-177
+//IC see: https://issues.apache.org/jira/browse/DERBY-3693
/* Open the heap conglomerate */
heapCC = tc.openConglomerate(
getHeapConglomerate(),
false,
+//IC see: https://issues.apache.org/jira/browse/DERBY-3850
+//IC see: https://issues.apache.org/jira/browse/DERBY-177
+//IC see: https://issues.apache.org/jira/browse/DERBY-3693
+//IC see: https://issues.apache.org/jira/browse/DERBY-3850
+//IC see: https://issues.apache.org/jira/browse/DERBY-177
+//IC see: https://issues.apache.org/jira/browse/DERBY-3693
TransactionController.OPENMODE_FORUPDATE,
TransactionController.MODE_RECORD,
TransactionController.ISOLATION_REPEATABLE_READ);
@@ -1031,6 +1072,7 @@ void updateRow( ExecIndexRow key,
*
* @return The Properties associated with creating the heap.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
Properties getCreateHeapProperties()
{
return crf.getCreateHeapProperties();
@@ -1043,6 +1085,7 @@ Properties getCreateHeapProperties()
*
* @return The Properties associated with creating the specified index.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
Properties getCreateIndexProperties(int indexNumber)
{
return crf.getCreateIndexProperties(indexNumber);
@@ -1088,6 +1131,7 @@ private RowChanger getRowChanger( TransactionController tc,
cids[ictr] = getIndexConglomerate(ictr);
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
rc = crf.getExecutionFactory().getRowChanger(getHeapConglomerate(),
(StaticCompiledOpenConglomInfo) null,
(DynamicCompiledOpenConglomInfo) null,
@@ -1164,6 +1208,7 @@ public String toString()
{
if (SanityManager.DEBUG)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-1674
return "name: " + this.getTableName() +
"\n\theapCongolomerate: "+heapConglomerate +
"\n\tnumIndexes: " + ((indexes != null) ? indexes.length : 0) +
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/TableKey.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/TableKey.java
index 34adf1cc37..8bae649bc3 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/TableKey.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/TableKey.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.impl.sql.catalog.TableKey
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINResultSetDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINResultSetDescriptor.java
index 4163bd9ac5..eda0346dad 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINResultSetDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINResultSetDescriptor.java
@@ -116,6 +116,7 @@ public void setStatementParameters(PreparedStatement ps)
ps.setString(1, rs_id.toString());
ps.setString(2, op_identifier);
ps.setString(3, op_details);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6318
ps.setObject(4, no_opens, Types.INTEGER);
ps.setObject(5, no_index_updates, Types.INTEGER);
ps.setString(6, lock_mode);
@@ -155,6 +156,7 @@ public SystemColumn[] buildColumnList() {
return new SystemColumn[] {
SystemColumnImpl.getUUIDColumn("RS_ID", false),
+//IC see: https://issues.apache.org/jira/browse/DERBY-4772
SystemColumnImpl.getColumn("OP_IDENTIFIER", Types.VARCHAR, false,
TypeId.VARCHAR_MAXWIDTH),
SystemColumnImpl.getColumn("OP_DETAILS", Types.VARCHAR, true,
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINResultSetTimingsDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINResultSetTimingsDescriptor.java
index 42fe48ecf5..89095ac220 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINResultSetTimingsDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINResultSetTimingsDescriptor.java
@@ -78,6 +78,7 @@ public void setStatementParameters(PreparedStatement ps)
throws SQLException
{
ps.setString(1, timing_id.toString());
+//IC see: https://issues.apache.org/jira/browse/DERBY-6318
ps.setObject(2, constructor_time, Types.BIGINT);
ps.setObject(3, open_time, Types.BIGINT);
ps.setObject(4, next_time, Types.BIGINT);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINScanPropsDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINScanPropsDescriptor.java
index 566a9011bd..76c9850f4f 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINScanPropsDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINScanPropsDescriptor.java
@@ -105,6 +105,7 @@ public void setStatementParameters(PreparedStatement ps)
ps.setString(3, scan_object_type);
ps.setString(4, scan_type);
ps.setString(5, isolation_level);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6318
ps.setObject(6, no_visited_pages, Types.INTEGER);
ps.setObject(7, no_visited_rows, Types.INTEGER);
ps.setObject(8, no_qualified_rows, Types.INTEGER);
@@ -181,6 +182,7 @@ public SystemColumn[] buildColumnList() {
SystemColumnImpl.getColumn("NO_QUALIFIED_ROWS", Types.INTEGER, true),
SystemColumnImpl.getColumn("NO_VISITED_DELETED_ROWS", Types.INTEGER, true),
SystemColumnImpl.getColumn("NO_FETCHED_COLUMNS", Types.INTEGER, true),
+//IC see: https://issues.apache.org/jira/browse/DERBY-4772
SystemColumnImpl.getColumn("BITSET_OF_FETCHED_COLUMNS",
Types.VARCHAR, true, TypeId.VARCHAR_MAXWIDTH),
SystemColumnImpl.getColumn("BTREE_HEIGHT", Types.INTEGER, true),
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINSortPropsDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINSortPropsDescriptor.java
index 7e4d0be9cb..0f375de6da 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINSortPropsDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINSortPropsDescriptor.java
@@ -76,6 +76,7 @@ public void setStatementParameters(PreparedStatement ps)
{
ps.setString(1, sort_rs_id.toString());
ps.setString(2, sort_type);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6318
ps.setObject(3, no_input_rows, Types.INTEGER);
ps.setObject(4, no_output_rows, Types.INTEGER);
ps.setObject(5, no_merge_runs, Types.INTEGER);
@@ -126,6 +127,7 @@ public SystemColumn[] buildColumnList() {
SystemColumnImpl.getColumn("NO_INPUT_ROWS", Types.INTEGER, true),
SystemColumnImpl.getColumn("NO_OUTPUT_ROWS", Types.INTEGER, true),
SystemColumnImpl.getColumn("NO_MERGE_RUNS", Types.INTEGER, true),
+//IC see: https://issues.apache.org/jira/browse/DERBY-4772
SystemColumnImpl.getColumn("MERGE_RUN_DETAILS", Types.VARCHAR, true,
TypeId.VARCHAR_MAXWIDTH),
SystemColumnImpl.getColumn("ELIMINATE_DUPLICATES", Types.CHAR, true, 1),
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINStatementDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINStatementDescriptor.java
index 52cb68c65d..d01275624d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINStatementDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINStatementDescriptor.java
@@ -75,6 +75,7 @@ public XPLAINStatementDescriptor (
this.jvm_id = jvm_id;
this.os_id = os_id;
this.xplain_mode = xplain_mode;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6206
this.xplain_time = DataTypeUtilities.clone( xplain_time );
this.thread_id = thread_id;
this.xa_id = xa_id;
@@ -122,6 +123,7 @@ public SystemColumn[] buildColumnList() {
SystemColumnImpl.getIdentifierColumn("STMT_NAME", true),
SystemColumnImpl.getColumn("STMT_TYPE", Types.CHAR, false, 3),
SystemColumnImpl.getColumn("STMT_TEXT", Types.VARCHAR, false, TypeId.VARCHAR_MAXWIDTH),
+//IC see: https://issues.apache.org/jira/browse/DERBY-4772
SystemColumnImpl.getColumn("JVM_ID", Types.VARCHAR, false,
TypeId.VARCHAR_MAXWIDTH),
SystemColumnImpl.getColumn("OS_IDENTIFIER", Types.VARCHAR, false,
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINStatementTimingsDescriptor.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINStatementTimingsDescriptor.java
index 4876f4adf5..be8df8fe44 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINStatementTimingsDescriptor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/XPLAINStatementTimingsDescriptor.java
@@ -68,6 +68,7 @@ public XPLAINStatementTimingsDescriptor() {}
this.generate_time = generate_time;
this.compile_time = compile_time;
this.execute_time = execute_time;
+//IC see: https://issues.apache.org/jira/browse/DERBY-6206
this.begin_comp_time = DataTypeUtilities.clone( begin_comp_time );
this.end_comp_time = DataTypeUtilities.clone( end_comp_time );
this.begin_exe_time = DataTypeUtilities.clone( begin_exe_time );
@@ -78,6 +79,7 @@ public void setStatementParameters(PreparedStatement ps)
throws SQLException
{
ps.setString(1, timing_id.toString());
+//IC see: https://issues.apache.org/jira/browse/DERBY-6318
ps.setObject(2, parse_time, Types.BIGINT);
ps.setObject(3, bind_time, Types.BIGINT);
ps.setObject(4, optimize_time, Types.BIGINT);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AccessPathImpl.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AccessPathImpl.java
index 753592162d..e908d8449d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AccessPathImpl.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AccessPathImpl.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.impl.sql.compile.AccessPathImpl
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/ActivationClassBuilder.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/ActivationClassBuilder.java
index 332ecc4af7..4e61fd4f8d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/ActivationClassBuilder.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/ActivationClassBuilder.java
@@ -182,6 +182,7 @@ MethodBuilder startResetMethod() {
Upon entry the only word on the stack is the result set expression
*/
void finishExecuteMethod() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-5947
if (executeMethod != null) {
executeMethod.methodReturn();
@@ -312,6 +313,7 @@ void rememberCursor(MethodBuilder mb) {
/*
The first time a current datetime is needed, create the class
level support for it. The first half of the logic is in our parent
+//IC see: https://issues.apache.org/jira/browse/DERBY-1700
class.
*/
@Override
@@ -325,6 +327,7 @@ protected LocalField getCurrentSetup()
// to tell cdt to restart:
// cdt.forget();
+//IC see: https://issues.apache.org/jira/browse/DERBY-5947
MethodBuilder execute = getExecuteMethod();
execute.getField(lf);
execute.callMethod(
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AggregateDefinition.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AggregateDefinition.java
index da9c3ca30d..e25c8543b0 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AggregateDefinition.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AggregateDefinition.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.impl.sql.compile.AggregateDefinition
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AggregateNode.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AggregateNode.java
index 2bc9cc6f43..bd668fc50d 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AggregateNode.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AggregateNode.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.impl.sql.compile.AggregateNode
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
@@ -44,6 +45,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* It used for all system aggregates as well as user defined aggregates.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
class AggregateNode extends UnaryOperatorNode
{
static final class BuiltinAggDescriptor
@@ -55,6 +58,7 @@ static final class BuiltinAggDescriptor
public BuiltinAggDescriptor
(
+//IC see: https://issues.apache.org/jira/browse/DERBY-5466
String aggName,
String aggClassName,
TypeDescriptor argType,
@@ -137,6 +141,8 @@ static final class BuiltinAggDescriptor
* @param cm context manager
* @throws StandardException
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
AggregateNode(
ValueNode operand,
UserAggregateDefinition uadClass,
@@ -183,6 +189,7 @@ static final class BuiltinAggDescriptor
*/
AggregateNode(
ValueNode operand,
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
Class> uadClass,
boolean distinct,
String aggregateName,
@@ -225,6 +232,8 @@ private void setUserDefinedAggregate( UserAggregateDefinition userAgg )
*
* @exception StandardException Thrown on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
ValueNode replaceAggregatesWithColumnReferences(
ResultColumnList rcl, int tableNumber) throws StandardException
{
@@ -239,6 +248,8 @@ ValueNode replaceAggregatesWithColumnReferences(
String generatedColName;
CompilerContext cc = getCompilerContext();
generatedColName ="SQLCol" + cc.getNextColumnNumber();
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
generatedRC =
new ResultColumn(generatedColName, this, getContextManager());
generatedRC.markGenerated();
@@ -293,6 +304,8 @@ AggregateDefinition getAggregateDefinition()
*
* @return the result column
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
ResultColumn getGeneratedRC()
{
if (SanityManager.DEBUG)
@@ -313,6 +326,8 @@ ResultColumn getGeneratedRC()
*
* @return the column reference
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
ColumnReference getGeneratedRef()
{
if (SanityManager.DEBUG)
@@ -339,6 +354,7 @@ ColumnReference getGeneratedRef()
*/
@Override
ValueNode bindExpression(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
FromList fromList, SubqueryList subqueryList, List aggregates)
throws StandardException
{
@@ -352,6 +368,7 @@ ValueNode bindExpression(
boolean noSchema = true;
if ( userAggregateName != null )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5466
noSchema = (userAggregateName.getSchemaName() == null );
userAggregateName.bind();
}
@@ -360,6 +377,7 @@ ValueNode bindExpression(
// bind it now.
if (userAggregateName != null && uad == null)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5466
String schemaName = userAggregateName.getSchemaName();
AliasDescriptor ad = resolveAggregate
(
@@ -391,6 +409,7 @@ ValueNode bindExpression(
AliasDescriptor ad = ((UserAggregateDefinition) uad).getAliasDescriptor();
boolean isModernBuiltinAggregate =
SchemaDescriptor.STD_SYSTEM_SCHEMA_NAME.equals( ad.getSchemaName() );
+//IC see: https://issues.apache.org/jira/browse/DERBY-5466
if ( distinct && isModernBuiltinAggregate )
{
@@ -400,6 +419,7 @@ ValueNode bindExpression(
// set up dependency on the user-defined aggregate and compile a check for USAGE
// priv if needed. no need for a dependency if this is a builtin, system-supplied
// aggregate
+//IC see: https://issues.apache.org/jira/browse/DERBY-7041
if ( !isModernBuiltinAggregate )
{
getCompilerContext().createDependency( ad );
@@ -412,8 +432,10 @@ ValueNode bindExpression(
// aggregates. They are tricky. They masquerade as user-defined
// aggregates because they implement org.apache.derby.agg.Aggregator
//
+//IC see: https://issues.apache.org/jira/browse/DERBY-5466
if ( !isModernBuiltinAggregate )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-5466
getCompilerContext().addRequiredUsagePriv( ad );
}
}
@@ -421,6 +443,7 @@ ValueNode bindExpression(
// Add ourselves to the list of aggregates before we do anything else.
aggregates.add(this);
+//IC see: https://issues.apache.org/jira/browse/DERBY-6075
CompilerContext cc = getCompilerContext();
@@ -428,6 +451,7 @@ ValueNode bindExpression(
if (operand != null)
{
int previousReliability = orReliability( CompilerContext.AGGREGATE_RESTRICTION );
+//IC see: https://issues.apache.org/jira/browse/DERBY-6075
bindOperand(fromList, subqueryList, aggregates);
cc.setReliability( previousReliability );
@@ -450,6 +474,8 @@ ValueNode bindExpression(
// Also forbid any window function inside an aggregate unless in
// subquery, cf. SQL 2003, section 10.9, SR 7 a).
SelectNode.checkNoWindowFunctions(operand, aggregateName);
+//IC see: https://issues.apache.org/jira/browse/DERBY-3634
+//IC see: https://issues.apache.org/jira/browse/DERBY-4069
/*
** Check the type of the operand. Make sure that the user
@@ -519,9 +545,12 @@ ValueNode bindExpression(
{
ValueNode castNode = ((UserAggregateDefinition) uad).castInputValue
( operand, getContextManager() );
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
if ( castNode != null )
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6075
operand = castNode.bindExpression( fromList, subqueryList, aggregates );
}
}
@@ -537,6 +566,7 @@ ValueNode bindExpression(
* Resolve a user-defined aggregate.
*/
static AliasDescriptor resolveAggregate
+//IC see: https://issues.apache.org/jira/browse/DERBY-5466
( DataDictionary dd, SchemaDescriptor sd, String rawName, boolean noSchema )
throws StandardException
{
@@ -549,6 +579,8 @@ ValueNode bindExpression(
// been created yet. in that case, it doesn't have any aggregates in it.
if ( sd.getUUID() == null ) { return null; }
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
java.util.List list = dd.getRoutineList
( sd.getUUID().toString(), rawName, AliasInfo.ALIAS_NAME_SPACE_AGGREGATE_AS_CHAR );
@@ -561,6 +593,7 @@ ValueNode bindExpression(
* Construct an AliasDescriptor for a modern builtin aggregate.
*/
private static AliasDescriptor resolveBuiltinAggregate
+//IC see: https://issues.apache.org/jira/browse/DERBY-5466
( DataDictionary dd, String rawName, boolean noSchema )
throws StandardException
{
@@ -621,6 +654,7 @@ private void instantiateAggDef() throws StandardException
if ( uad == null )
{
Class> theClass = aggregateDefinitionClass;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
// get the class
if (theClass == null)
@@ -642,6 +676,7 @@ private void instantiateAggDef() throws StandardException
Object instance = null;
try
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6856
instance = theClass.getConstructor().newInstance();
}
catch (Throwable t)
@@ -695,6 +730,8 @@ boolean isDistinct()
*
* @return the class name
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
String getAggregatorClassName()
{
return aggregatorClassName.toString();
@@ -706,6 +743,8 @@ String getAggregatorClassName()
*
* @return the class name
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
String getAggregateName()
{
return aggregateName;
@@ -721,11 +760,14 @@ String getAggregateName()
*
* @exception StandardException on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
ResultColumn getNewAggregatorResultColumn(DataDictionary dd)
throws StandardException
{
String className = aggregatorClassName.toString();
+//IC see: https://issues.apache.org/jira/browse/DERBY-2937
DataTypeDescriptor compType =
DataTypeDescriptor.getSQLDataTypeDescriptor(className);
@@ -744,6 +786,8 @@ ResultColumn getNewAggregatorResultColumn(DataDictionary dd)
** Create a result column with this new node below
** it.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
return new ResultColumn(aggregateName, nullNode, getContextManager());
}
@@ -758,6 +802,8 @@ ResultColumn getNewAggregatorResultColumn(DataDictionary dd)
*
* @exception StandardException on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
ResultColumn getNewExpressionResultColumn(DataDictionary dd)
throws StandardException
{
@@ -772,6 +818,8 @@ ResultColumn getNewExpressionResultColumn(DataDictionary dd)
this.getNewNullResultExpression() :
operand;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
return new ResultColumn(
"##aggregate expression", node, getContextManager());
}
@@ -784,6 +832,8 @@ ResultColumn getNewExpressionResultColumn(DataDictionary dd)
*
* @exception StandardException on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
ValueNode getNewNullResultExpression()
throws StandardException
{
@@ -791,6 +841,7 @@ ValueNode getNewNullResultExpression()
** Create a result column with the aggrergate operand
** it.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-2937
return getNullNode(getTypeServices());
}
@@ -839,6 +890,7 @@ public String toString()
boolean isConstant()
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-3231
return false;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AggregateWindowFunctionNode.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AggregateWindowFunctionNode.java
index 4218c97341..08c218ee0b 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AggregateWindowFunctionNode.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AggregateWindowFunctionNode.java
@@ -30,6 +30,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
/**
* Represents aggregate function calls on a window
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
final class AggregateWindowFunctionNode extends WindowFunctionNode
{
@@ -54,6 +56,7 @@ final class AggregateWindowFunctionNode extends WindowFunctionNode
*/
@Override
ValueNode bindExpression(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
FromList fromList, SubqueryList subqueryList, List aggregates)
throws StandardException
{
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AllResultColumn.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AllResultColumn.java
index 4cffe48c5b..e8072ea050 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AllResultColumn.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AllResultColumn.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.impl.sql.compile.AllResultColumn
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
@@ -33,6 +34,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
class AllResultColumn extends ResultColumn
{
private TableName tableName;
@@ -70,16 +73,20 @@ ResultColumn cloneMe() throws StandardException
{
if (SanityManager.DEBUG)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-6464
SanityManager.ASSERT(getColumnDescriptor() == null,
"columnDescriptor is expected to be non-null");
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
return new AllResultColumn(tableName, getContextManager());
}
@Override
public TableName getTableNameObject() {
+//IC see: https://issues.apache.org/jira/browse/DERBY-13
return tableName;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AlterTableNode.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AlterTableNode.java
index 7b68d85141..6f2d8bd986 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AlterTableNode.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AlterTableNode.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.impl.sql.compile.AlterTableNode
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
@@ -44,6 +45,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
class AlterTableNode extends DDLStatementNode
{
// The alter table action
@@ -111,6 +114,8 @@ class AlterTableNode extends DDLStatementNode
* @param cm Context manager
* @exception StandardException
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
AlterTableNode(TableName tableName,
ContextManager cm) throws StandardException {
super(tableName, cm);
@@ -252,6 +257,7 @@ public String toString()
if (SanityManager.DEBUG)
{
return super.toString() +
+//IC see: https://issues.apache.org/jira/browse/DERBY-4087
"objectName: " + getObjectName() + "\n" +
"lockGranularity: " + lockGranularity + "\n" +
"compressTable: " + compressTable + "\n" +
@@ -279,8 +285,13 @@ public String toString()
* @param depth The depth to indent the sub-nodes
*/
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
void printSubNodes(int depth) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4087
if (SanityManager.DEBUG) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-4397
+//IC see: https://issues.apache.org/jira/browse/DERBY-4
if (tableElementList != null) {
printLabel(depth, "tableElementList: ");
tableElementList.treePrint(depth + 1);
@@ -346,6 +357,7 @@ public void bindStatement() throws StandardException
//If we are dealing with add column character type, then set that
//column's collation type to be the collation type of the schema.
//The collation derivation of such a column would be "implicit".
+//IC see: https://issues.apache.org/jira/browse/DERBY-2530
if (changeType == ADD_TYPE) {//the action is of type add.
if (tableElementList != null) {//check if is is add column
for (int i=0; i Limits.DB2_MAX_COLUMNS_IN_TABLE)
{
throw StandardException.newException(SQLState.LANG_TOO_MANY_COLUMNS_IN_TABLE_OR_VIEW,
@@ -406,6 +420,7 @@ public void bindStatement() throws StandardException
//If the sum of backing indexes for constraints in alter table statement and total number of indexes on the table
//so far is more than 32767, then we need to throw an exception
+//IC see: https://issues.apache.org/jira/browse/DERBY-104
if ((numBackingIndexes + baseTable.getTotalNumberOfIndexes()) > Limits.DB2_MAX_INDEXES_ON_TABLE)
{
throw StandardException.newException(SQLState.LANG_TOO_MANY_INDEXES_ON_TABLE,
@@ -432,6 +447,7 @@ public void bindStatement() throws StandardException
* the check constraints and generation clauses.
*/
if (numGenerationClauses > 0)
+//IC see: https://issues.apache.org/jira/browse/DERBY-4145
{ tableElementList.bindAndValidateGenerationClauses( schemaDescriptor, fromList, generatedColumns, baseTable ); }
if (numCheckConstraints > 0) { tableElementList.bindAndValidateCheckConstraints(fromList); }
if ( numReferenceConstraints > 0) { tableElementList.validateForeignKeysOnGenerationClauses( fromList, generatedColumns ); }
@@ -534,9 +550,11 @@ private void prepConstantAction() throws StandardException
{
conActions = new ConstraintConstantAction[numConstraints];
+//IC see: https://issues.apache.org/jira/browse/DERBY-3008
tableElementList.genConstraintActions(false, conActions, getRelativeName(), schemaDescriptor,
getDataDictionary());
+//IC see: https://issues.apache.org/jira/browse/DERBY-4244
for (int conIndex = 0; conIndex < conActions.length; conIndex++)
{
ConstraintConstantAction cca = conActions[conIndex];
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AndNode.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AndNode.java
index 0aff80d0c4..81075d2c12 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AndNode.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/AndNode.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.impl.sql.compile.AndNode
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
@@ -26,6 +27,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import org.apache.derby.iapi.services.context.ContextManager;
import org.apache.derby.shared.common.sanity.SanityManager;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
class AndNode extends BinaryLogicalOperatorNode
{
/**
@@ -49,6 +52,7 @@ class AndNode extends BinaryLogicalOperatorNode
* @param cm context manager
* @throws StandardException
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-532
AndNode(ValueNode leftOperand,
ValueNode rightOperand,
String methodName,
@@ -72,6 +76,7 @@ class AndNode extends BinaryLogicalOperatorNode
*/
@Override
ValueNode bindExpression(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
FromList fromList, SubqueryList subqueryList, List aggregates)
throws StandardException
{
@@ -98,6 +103,8 @@ ValueNode bindExpression(
* @exception StandardException Thrown on error
*/
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
ValueNode preprocess(int numTables,
FromList outerFromList,
SubqueryList outerSubqueryList,
@@ -159,6 +166,8 @@ ValueNode eliminateNots(boolean underNotNode)
/* Convert the AndNode to an OrNode */
ValueNode orNode;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
orNode = new OrNode(leftOperand, rightOperand, getContextManager());
orNode.setType(getTypeServices());
return orNode;
@@ -174,6 +183,8 @@ ValueNode eliminateNots(boolean underNotNode)
* @exception StandardException Thrown on error
*/
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
ValueNode putAndsOnTop()
throws StandardException
{
@@ -239,6 +250,8 @@ boolean verifyPutAndsOnTop()
* @exception StandardException Thrown on error
*/
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
ValueNode changeToCNF(boolean underTopAndNode)
throws StandardException
{
@@ -254,6 +267,8 @@ ValueNode changeToCNF(boolean underTopAndNode)
if (!(rightOperand instanceof AndNode) &&
!(rightOperand.isBooleanTrue()))
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
BooleanConstantNode trueNode =
new BooleanConstantNode(true, getContextManager());
AndNode newRightOperand = new AndNode(
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BaseColumnNode.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BaseColumnNode.java
index cf61dfadda..b1c44be7b6 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BaseColumnNode.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BaseColumnNode.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.impl.sql.compile.BaseColumnNode
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
@@ -40,6 +41,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
class BaseColumnNode extends ValueNode
{
private String columnName;
@@ -58,6 +61,8 @@ class BaseColumnNode extends ValueNode
* @param cm Context manager
* @throws StandardException
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
BaseColumnNode(
String columnName,
TableName tableName,
@@ -81,6 +86,7 @@ public String toString()
if (SanityManager.DEBUG)
{
return "columnName: " + columnName + "\n" +
+//IC see: https://issues.apache.org/jira/browse/DERBY-4087
"tableName: " +
( ( tableName != null) ?
tableName.toString() :
@@ -99,6 +105,8 @@ public String toString()
* @return The name of this column
*/
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
String getColumnName()
{
return columnName;
@@ -114,6 +122,8 @@ String getColumnName()
* supplied name.
*/
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
String getTableName()
{
return ( ( tableName != null) ? tableName.getTableName() : null );
@@ -128,8 +138,11 @@ String getTableName()
* @return The schema name for this column's table
*/
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
String getSchemaName() throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-189
return ( ( tableName != null) ? tableName.getSchemaName() : null );
}
@@ -173,8 +186,10 @@ protected int getOrderableVariantType()
*/
boolean isEquivalent(ValueNode o)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
if (isSameNodeKind(o)) {
BaseColumnNode other = (BaseColumnNode)o;
+//IC see: https://issues.apache.org/jira/browse/DERBY-5010
return other.tableName.equals(tableName)
&& other.columnName.equals(columnName);
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BaseJoinStrategy.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BaseJoinStrategy.java
index c5e2b6858c..a7d394f22a 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BaseJoinStrategy.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BaseJoinStrategy.java
@@ -88,6 +88,7 @@ void fillInScanArgs1(
mb.push(conglomNumber);
mb.push(acb.addItem(scoci));
+//IC see: https://issues.apache.org/jira/browse/DERBY-6003
mb.push(resultRowTemplate);
mb.push(innerTable.getResultSetNumber());
@@ -121,6 +122,7 @@ final void fillInScanArgs2(MethodBuilder mb,
//User may have supplied optimizer overrides in the sql
//Pass them onto execute phase so it can be shown in
//run time statistics.
+//IC see: https://issues.apache.org/jira/browse/DERBY-573
if (innerTable.getProperties() != null)
mb.push(PropertyUtil.sortProperties(innerTable.getProperties()));
else
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BaseTableNumbersVisitor.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BaseTableNumbersVisitor.java
index 288b0ca3aa..86a2e89c02 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BaseTableNumbersVisitor.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BaseTableNumbersVisitor.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.impl.sql.compile.BaseTableNumbersVisitor
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
@@ -34,6 +35,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* the bottom-most table number, which should correspond to a base
* table.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
class BaseTableNumbersVisitor implements Visitor
{
// JBitSet to hold the table numbers that we find.
@@ -54,6 +57,8 @@ class BaseTableNumbersVisitor implements Visitor
*
* @param tableMap JBitSet into which we put the table numbers we find.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
BaseTableNumbersVisitor(JBitSet tableMap)
{
this.tableMap = tableMap;
@@ -226,6 +231,7 @@ public boolean stopTraversal()
*/
public boolean visitChildrenFirst(Visitable node)
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-4421
return false;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java
index 3d88c624d0..43f1b2e0cd 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java
@@ -243,6 +243,7 @@ protected boolean userTypeStorable(TypeId thisType,
** If the other type is user-defined, use the java types to determine
** assignability.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
if (otherType.userType())
{
return cf.getClassInspector().assignableTo(
@@ -264,6 +265,7 @@ boolean numberConvertible(TypeId otherType,
boolean forDataTypeFunction)
{
if ( otherType.getBaseTypeId().isAnsiUDT() ) { return false; }
+//IC see: https://issues.apache.org/jira/browse/DERBY-4469
// Can't convert numbers to long types
if (otherType.isLongConcatableTypeId())
@@ -303,6 +305,7 @@ boolean numberStorable(TypeId thisType,
ClassFactory cf)
{
if ( otherType.getBaseTypeId().isAnsiUDT() ) { return false; }
+//IC see: https://issues.apache.org/jira/browse/DERBY-4469
/*
** Numbers can be stored into from other number types.
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BetweenOperatorNode.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BetweenOperatorNode.java
index 4c6553f6ac..5ff6ed7cb4 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BetweenOperatorNode.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BetweenOperatorNode.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.impl.sql.compile.BetweenOperatorNode
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
@@ -32,6 +33,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
class BetweenOperatorNode extends BinaryListOperatorNode
{
/**
@@ -110,6 +113,7 @@ ValueNode eliminateNots(boolean underNotNode)
/* leftO < rightOList.elementAt(0) */
leftBCO = new BinaryRelationalOperatorNode(
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
BinaryRelationalOperatorNode.K_LESS_THAN,
leftOperand,
rightOperandList.elementAt(0),
@@ -126,6 +130,7 @@ ValueNode eliminateNots(boolean underNotNode)
/* leftO > rightOList.elementAt(1) */
rightBCO = new BinaryRelationalOperatorNode(
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
BinaryRelationalOperatorNode.K_GREATER_THAN,
leftClone,
rightOperandList.elementAt(1),
@@ -161,6 +166,8 @@ ValueNode eliminateNots(boolean underNotNode)
* @exception StandardException Thrown on error
*/
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
ValueNode preprocess(int numTables,
FromList outerFromList,
SubqueryList outerSubqueryList,
@@ -205,6 +212,7 @@ ValueNode preprocess(int numTables,
/* Create the AND <= */
BinaryComparisonOperatorNode lessEqual =
new BinaryRelationalOperatorNode(
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
BinaryRelationalOperatorNode.K_LESS_EQUALS,
leftClone1,
rightOperandList.elementAt(1),
@@ -221,6 +229,7 @@ ValueNode preprocess(int numTables,
/* Create the AND >= */
BinaryComparisonOperatorNode greaterEqual =
new BinaryRelationalOperatorNode(
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
BinaryRelationalOperatorNode.K_GREATER_EQUALS,
leftOperand,
rightOperandList.elementAt(0),
@@ -274,8 +283,12 @@ void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb)
/* leftO >= rightOList.elementAt(0) */
leftBCO = new BinaryRelationalOperatorNode(
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
BinaryRelationalOperatorNode.K_GREATER_EQUALS,
leftOperand,
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
rightOperandList.elementAt(0),
false,
cm);
@@ -286,6 +299,9 @@ void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb)
rightBCO = new BinaryRelationalOperatorNode(
BinaryRelationalOperatorNode.K_LESS_EQUALS,
leftOperand,
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
rightOperandList.elementAt(1),
false,
cm);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryArithmeticOperatorNode.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryArithmeticOperatorNode.java
index 6f5c905b7c..aeadf93872 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryArithmeticOperatorNode.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryArithmeticOperatorNode.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.impl.sql.compile.BinaryArithmeticOperatorNode
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
@@ -38,6 +39,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
public final class BinaryArithmeticOperatorNode extends BinaryOperatorNode
{
// Allowed kinds
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
final static int K_DIVIDE = 0;
final static int K_MINUS = 1;
final static int K_PLUS = 2;
@@ -72,6 +74,7 @@ public final class BinaryArithmeticOperatorNode extends BinaryOperatorNode
ClassName.NumberDataValue,
cm);
this.kind = kind;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
final String op;
final String mNam;
@@ -109,6 +112,8 @@ public final class BinaryArithmeticOperatorNode extends BinaryOperatorNode
op = null;
mNam = null;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
setOperator(op);
setMethodName(mNam);
}
@@ -126,6 +131,7 @@ public final class BinaryArithmeticOperatorNode extends BinaryOperatorNode
*/
@Override
ValueNode bindExpression(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
FromList fromList, SubqueryList subqueryList, List aggregates)
throws StandardException
{
@@ -158,6 +164,8 @@ ValueNode bindExpression(
maxWidth = precision + 3;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
leftOperand = new CastNode(
leftOperand,
new DataTypeDescriptor(rightType, precision,
@@ -187,6 +195,8 @@ else if (rightType.isStringTypeId() && leftType.isNumericTypeId())
maxWidth = precision + 3;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
rightOperand = new CastNode(
rightOperand,
new DataTypeDescriptor(leftType, precision,
@@ -214,6 +224,7 @@ else if (rightType.isStringTypeId() && leftType.isNumericTypeId())
@Override
boolean isSameNodeKind(ValueNode o) {
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
return super.isSameNodeKind(o) &&
((BinaryArithmeticOperatorNode)o).kind == kind;
}
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryComparisonOperatorNode.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryComparisonOperatorNode.java
index b65f1df6af..c00bab812e 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryComparisonOperatorNode.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryComparisonOperatorNode.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.impl.sql.compile.BinaryComparisonOperatorNode
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
@@ -64,6 +65,8 @@ public abstract class BinaryComparisonOperatorNode extends BinaryOperatorNode
* @param cm The context manager
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
BinaryComparisonOperatorNode(
ValueNode leftOperand,
ValueNode rightOperand,
@@ -87,6 +90,8 @@ public abstract class BinaryComparisonOperatorNode extends BinaryOperatorNode
* normal comparability checks.
* @param val true if this was for a query rewrite
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
void setForQueryRewrite(boolean val)
{
forQueryRewrite=val;
@@ -136,6 +141,7 @@ boolean getBetweenSelectivity()
*/
@Override
ValueNode bindExpression(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
FromList fromList, SubqueryList subqueryList, List aggregates)
throws StandardException
{
@@ -158,6 +164,8 @@ ValueNode bindExpression(
{
DataTypeDescriptor rightTypeServices = rightOperand.getTypeServices();
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
rightOperand = new CastNode(
rightOperand,
new DataTypeDescriptor(
@@ -171,6 +179,8 @@ else if (! rightTypeId.isStringTypeId() && leftTypeId.isStringTypeId())
{
DataTypeDescriptor leftTypeServices = leftOperand.getTypeServices();
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
leftOperand = new CastNode(
leftOperand,
new DataTypeDescriptor(
@@ -195,6 +205,8 @@ else if (! rightTypeId.isStringTypeId() && leftTypeId.isStringTypeId())
*
* @exception StandardException Thrown on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
void bindComparisonOperator()
throws StandardException
{
@@ -207,6 +219,7 @@ void bindComparisonOperator()
boolean forEquals = operator.equals("=") || operator.equals("<>");
boolean cmp = leftOperand.getTypeServices().comparable(
+//IC see: https://issues.apache.org/jira/browse/DERBY-2569
rightOperand.getTypeServices(),
forEquals,
getClassFactory());
@@ -214,6 +227,7 @@ void bindComparisonOperator()
// optimizer. We will assume Mr. Optimizer knows what he is doing.
if (!cmp && !forQueryRewrite) {
throw StandardException.newException(SQLState.LANG_NOT_COMPARABLE,
+//IC see: https://issues.apache.org/jira/browse/DERBY-2668
leftOperand.getTypeServices().getSQLTypeNameWithCollation() ,
rightOperand.getTypeServices().getSQLTypeNameWithCollation());
@@ -250,6 +264,8 @@ void bindComparisonOperator()
* @exception StandardException Thrown on error
*/
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
ValueNode preprocess(int numTables,
FromList outerFromList,
SubqueryList outerSubqueryList,
@@ -333,6 +349,7 @@ ValueNode eliminateNots(boolean underNotNode)
*
* @exception StandardException Thrown on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-4412
abstract BinaryOperatorNode getNegation(ValueNode leftOperand,
ValueNode rightOperand)
throws StandardException;
@@ -385,6 +402,8 @@ abstract BinaryOperatorNode getNegation(ValueNode leftOperand,
* @exception StandardException Thrown on error
*/
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
ValueNode changeToCNF(boolean underTopAndNode)
throws StandardException
{
@@ -402,6 +421,8 @@ ValueNode changeToCNF(boolean underTopAndNode)
/** @see BinaryOperatorNode#genSQLJavaSQLTree */
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
ValueNode genSQLJavaSQLTree() throws StandardException
{
TypeId leftTypeId = leftOperand.getTypeId();
@@ -409,8 +430,10 @@ ValueNode genSQLJavaSQLTree() throws StandardException
/* If I have Java types, I need only add java->sql->java if the types
* are not comparable
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
if (leftTypeId.userType())
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2569
if (leftOperand.getTypeServices().comparable(leftOperand.getTypeServices(),
false, getClassFactory()))
return this;
@@ -420,8 +443,10 @@ false, getClassFactory()))
TypeId rightTypeId = rightOperand.getTypeId();
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
if (rightTypeId.userType())
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-2569
if (rightOperand.getTypeServices().comparable(rightOperand.getTypeServices(),
false, getClassFactory()))
return this;
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryListOperatorNode.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryListOperatorNode.java
index 69c066650e..e6014924c3 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryListOperatorNode.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryListOperatorNode.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.impl.sql.compile.BinaryListOperatorNode
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
@@ -47,6 +48,8 @@ public abstract class BinaryListOperatorNode extends ValueNode
ValueNode leftOperand;
ValueNodeList rightOperandList;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
BinaryListOperatorNode(
ValueNode leftOperand,
ValueNodeList rightOperandList,
@@ -88,6 +91,8 @@ public String toString()
* @param depth The depth of this node in the tree
*/
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
void printSubNodes(int depth)
{
if (SanityManager.DEBUG)
@@ -122,7 +127,9 @@ void printSubNodes(int depth)
* @exception StandardException Thrown on error
*/
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-6075
ValueNode bindExpression(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
FromList fromList, SubqueryList subqueryList, List aggregates)
throws StandardException
{
@@ -130,6 +137,7 @@ ValueNode bindExpression(
rightOperandList.bindExpression(fromList, subqueryList, aggregates);
/* Is there a ? parameter on the left? */
+//IC see: https://issues.apache.org/jira/browse/DERBY-582
if (leftOperand.requiresTypeFromContext())
{
/*
@@ -142,6 +150,7 @@ ValueNode bindExpression(
}
/* Set the left operand to the type of right parameter. */
+//IC see: https://issues.apache.org/jira/browse/DERBY-582
leftOperand.setType(rightOperandList.getTypeServices());
}
@@ -155,6 +164,7 @@ ValueNode bindExpression(
/* If the left operand is not a built-in type, then generate a conversion
* tree to a built-in type.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-776
if (leftOperand.getTypeId().userType())
{
leftOperand = leftOperand.genSQLJavaSQLTree();
@@ -178,6 +188,8 @@ ValueNode bindExpression(
*
* @exception StandardException Thrown on error
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
void bindComparisonOperator()
throws StandardException
{
@@ -215,6 +227,8 @@ void bindComparisonOperator()
* @exception StandardException Thrown on error
*/
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
ValueNode preprocess(int numTables,
FromList outerFromList,
SubqueryList outerSubqueryList,
@@ -235,6 +249,8 @@ ValueNode preprocess(int numTables,
*
* @param newLeftOperand The new leftOperand
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
void setLeftOperand(ValueNode newLeftOperand)
{
leftOperand = newLeftOperand;
@@ -245,6 +261,8 @@ void setLeftOperand(ValueNode newLeftOperand)
*
* @return The current leftOperand.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
ValueNode getLeftOperand()
{
return leftOperand;
@@ -256,6 +274,8 @@ ValueNode getLeftOperand()
* @param newRightOperandList The new rightOperandList
*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
void setRightOperandList(ValueNodeList newRightOperandList)
{
rightOperandList = newRightOperandList;
@@ -266,6 +286,8 @@ void setRightOperandList(ValueNodeList newRightOperandList)
*
* @return The current rightOperandList.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
ValueNodeList getRightOperandList()
{
return rightOperandList;
@@ -315,6 +337,8 @@ boolean categorize(JBitSet referencedTabs, boolean simplePredsOnly)
* @exception StandardException Thrown on error
*/
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
ValueNode remapColumnReferencesToExpressions()
throws StandardException
{
@@ -374,11 +398,13 @@ protected int getOrderableVariantType() throws StandardException
* @exception StandardException on error
*/
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-4421
void acceptChildren(Visitor v)
throws StandardException
{
super.acceptChildren(v);
+//IC see: https://issues.apache.org/jira/browse/DERBY-4421
if (leftOperand != null)
{
leftOperand = (ValueNode)leftOperand.accept(v);
@@ -395,6 +421,7 @@ void acceptChildren(Visitor v)
*/
boolean isEquivalent(ValueNode o) throws StandardException
{
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
if (! isSameNodeKind(o)) {
return false;
}
@@ -406,6 +433,7 @@ boolean isEquivalent(ValueNode o) throws StandardException
return false;
}
+//IC see: https://issues.apache.org/jira/browse/DERBY-4600
if (!rightOperandList.isEquivalent(other.rightOperandList))
{
return false;
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryLogicalOperatorNode.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryLogicalOperatorNode.java
index 6f93af5d04..69c0afb8d5 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryLogicalOperatorNode.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryLogicalOperatorNode.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
@@ -31,10 +32,13 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import org.apache.derby.shared.common.sanity.SanityManager;
import org.apache.derby.iapi.types.DataTypeDescriptor;
+//IC see: https://issues.apache.org/jira/browse/DERBY-742
abstract class BinaryLogicalOperatorNode extends BinaryOperatorNode
{
boolean shortCircuitValue;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
BinaryLogicalOperatorNode(
ValueNode leftOperand,
ValueNode rightOperand,
@@ -59,12 +63,14 @@ abstract class BinaryLogicalOperatorNode extends BinaryOperatorNode
*/
@Override
ValueNode bindExpression(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
FromList fromList, SubqueryList subqueryList, List aggregates)
throws StandardException
{
//following is to check if we have something like "? AND 1=1" or "2>1 OR ?"
if (leftOperand.isParameterNode() || rightOperand.isParameterNode())
throw StandardException.newException( SQLState.LANG_UNTYPED_PARAMETER_IN_WHERE_CLAUSE );
+//IC see: https://issues.apache.org/jira/browse/DERBY-5885
super.bindExpression(fromList, subqueryList, aggregates);
@@ -134,6 +140,7 @@ void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb)
// put an extra left of the stack for potential
// use in the else clause.
+//IC see: https://issues.apache.org/jira/browse/DERBY-176
mb.dup();
// stack - left, left
mb.push(shortCircuitValue);
@@ -166,6 +173,7 @@ void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb)
mb.conditionalIf();
// stack: left
+//IC see: https://issues.apache.org/jira/browse/DERBY-742
mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getImmutable",
ClassName.BooleanDataValue, 0);
diff --git a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryOperatorNode.java b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryOperatorNode.java
index e76d22c532..03994781bf 100644
--- a/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryOperatorNode.java
+++ b/java/org.apache.derby.engine/org/apache/derby/impl/sql/compile/BinaryOperatorNode.java
@@ -2,6 +2,7 @@
Derby - Class org.apache.derby.impl.sql.compile.BinaryOperatorNode
+//IC see: https://issues.apache.org/jira/browse/DERBY-1377
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
@@ -45,6 +46,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
class BinaryOperatorNode extends OperatorNode
{
String operator;
@@ -54,6 +57,8 @@ class BinaryOperatorNode extends OperatorNode
/*
** These identifiers are used in the grammar.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
final static int PLUS = 1;
final static int MINUS = 2;
final static int TIMES = 3;
@@ -85,6 +90,7 @@ class BinaryOperatorNode extends OperatorNode
// possible.
// Allowed kinds
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
final static int K_XMLEXISTS = 0;
final static int K_XMLQUERY = 1;
final static int K_BASE = 2; // when BinaryOperatorNode is used
@@ -122,8 +128,11 @@ class BinaryOperatorNode extends OperatorNode
/** The query expression if the operator is XMLEXISTS or XMLQUERY. */
private String xmlQuery;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
BinaryOperatorNode(ContextManager cm) {
super(cm);
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
kind = K_BASE;
}
@@ -157,6 +166,8 @@ class BinaryOperatorNode extends OperatorNode
this.rightOperand = rightOperand;
this.leftInterfaceType = leftInterfaceType;
this.rightInterfaceType = rightInterfaceType;
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
this.kind = K_BASE;
}
@@ -230,6 +241,8 @@ void setMethodName(String methodName)
* Used when we don't know the interface type until
* later in binding.
*/
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
void setLeftRightInterfaceType(String iType)
{
leftInterfaceType = iType;
@@ -243,6 +256,8 @@ void setLeftRightInterfaceType(String iType)
* @param depth The depth of this node in the tree
*/
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-673
+//IC see: https://issues.apache.org/jira/browse/DERBY-5973
void printSubNodes(int depth)
{
if (SanityManager.DEBUG)
@@ -277,7 +292,9 @@ void printSubNodes(int depth)
* @exception StandardException Thrown on error
*/
@Override
+//IC see: https://issues.apache.org/jira/browse/DERBY-6075
ValueNode bindExpression(
+//IC see: https://issues.apache.org/jira/browse/DERBY-6213
FromList fromList, SubqueryList subqueryList, List