rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
if( deadlockTrace ) { currentTime = System.currentTimeMillis(); timeoutLockTable = factory.makeVirtualLockTable(); } } } } if (willQuitWait) { if (SanityManager.DEBUG) { if (lockDebug != null)
if (lockDebug != null) { String type = ((deadlockData != null) ? "deadlock:" : "timeout:"); SanityManager.DEBUG_PRINT( type, "wait on lockitem caused " + type + lockDebug); } } if (deadlockData == null)
public Lock lockObject(Object compatabilitySpace, Lockable ref, Object qualifier, int timeout, Latch latch) throws StandardException { if (SanityManager.DEBUG) { if (SanityManager.DEBUG_ON("memoryLeakTrace")) { if (size() > 1000) System.out.println("memoryLeakTrace:LockSet: " + size()); } } Control gc...
String type = (deadlockWait ? "deadlock:" : "timeout:"); SanityManager.DEBUG_PRINT( type, "wait on lockitem caused " + type + lockDebug); }
if (deadlockTrace) { throw Timeout.buildException( waitingLock, timeoutLockTable, currentTime); } else { StandardException se = StandardException.newException( SQLState.LOCK_TIMEOUT); throw se; } } else { throw Deadlock.buildException( factory, deadlockData); }
public Lock lockObject(Object compatabilitySpace, Lockable ref, Object qualifier, int timeout, Latch latch) throws StandardException { if (SanityManager.DEBUG) { if (SanityManager.DEBUG_ON("memoryLeakTrace")) { if (size() > 1000) System.out.println("memoryLeakTrace:LockSet: " + size()); } } Control gc...
if(!deadlockWait) { if( deadlockTrace ) { throw Timeout.buildException(waitingLock, timeoutLockTable, currentTime); } else { StandardException se = StandardException.newException( SQLState.LOCK_TIMEOUT); throw se; }
} finally { if (nextWaitingLock != null) { nextWaitingLock.wakeUp(Constants.WAITING_LOCK_GRANT); nextWaitingLock = null;
public Lock lockObject(Object compatabilitySpace, Lockable ref, Object qualifier, int timeout, Latch latch) throws StandardException { if (SanityManager.DEBUG) { if (SanityManager.DEBUG_ON("memoryLeakTrace")) { if (size() > 1000) System.out.println("memoryLeakTrace:LockSet: " + size()); } } Control gc...
if (deadlockData != null) { throw Deadlock.buildException(factory, deadlockData); }
public Lock lockObject(Object compatabilitySpace, Lockable ref, Object qualifier, int timeout, Latch latch) throws StandardException { if (SanityManager.DEBUG) { if (SanityManager.DEBUG_ON("memoryLeakTrace")) { if (size() > 1000) System.out.println("memoryLeakTrace:LockSet: " + size()); } } Control gc...
} finally { if (nextWaitingLock != null) { nextWaitingLock.wakeUp(Constants.WAITING_LOCK_GRANT); nextWaitingLock = null; } } if (actualTimeout != C_LockFactory.WAIT_FOREVER) { if (wakeupReason != Constants.WAITING_LOCK_IN_WAIT) earlyWakeupCount++; if (earlyWakeupCount > 5) { long now = System.currentTimeMillis(); ...
if (actualTimeout != C_LockFactory.WAIT_FOREVER) { if (wakeupReason != Constants.WAITING_LOCK_IN_WAIT) earlyWakeupCount++; if (earlyWakeupCount > 5) { long now = System.currentTimeMillis(); if (startWaitTime != 0) { long sleepTime = now - startWaitTime; actualTimeout -= sleepTime; } startWaitTime = now; } } } ...
public Lock lockObject(Object compatabilitySpace, Lockable ref, Object qualifier, int timeout, Latch latch) throws StandardException { if (SanityManager.DEBUG) { if (SanityManager.DEBUG_ON("memoryLeakTrace")) { if (size() > 1000) System.out.println("memoryLeakTrace:LockSet: " + size()); } } Control gc...
}
public Lock lockObject(Object compatabilitySpace, Lockable ref, Object qualifier, int timeout, Latch latch) throws StandardException { if (SanityManager.DEBUG) { if (SanityManager.DEBUG_ON("memoryLeakTrace")) { if (size() > 1000) System.out.println("memoryLeakTrace:LockSet: " + size()); } } Control gc...
}
void setDeadlockTrace(boolean val) { // set this without synchronization deadlockTrace = val; if (val && lockTraces == null) lockTraces = new Hashtable(); else if (!val && lockTraces != null) { lockTraces = null; } }
fileData.seek(pageOffset);
backupRaf.seek(pageOffset);
private void writeToBackup(RandomAccessFile backupRaf, long pageNumber, byte[] pageData) throws StandardException { byte[] dataToWrite; try { if (pageNumber == FIRST_ALLOC_PAGE_NUMBER) { // write header into the alloc page array regardless of dirty // bit because the alloc page have zero'ed out the bo...
xar.start(xid, XAResource.TMJOIN); printState("1st global(existing)", conn); xar.end(xid, XAResource.TMSUCCESS); printState("local", conn);
private void testSetIsolationWithStatement(Statement s, XAResource xar, Connection conn) throws SQLException, XAException { Xid xid; System.out.println("Issue SQL to change isolation in local transaction"); s.executeUpdate("set current isolation = RR"); printState("SQL to change isolation in local", conn); xid...
conn.setAutoCommit(false); testHoldability(conn,ResultSet.HOLD_CURSORS_OVER_COMMIT); testHoldability(conn,ResultSet.CLOSE_CURSORS_AT_COMMIT);
conn.setAutoCommit(false); if(HAVE_DRIVER_MANAGER_CLASS){ testHoldability(conn,ResultSet.HOLD_CURSORS_OVER_COMMIT); testHoldability(conn,ResultSet.CLOSE_CURSORS_AT_COMMIT); }
public static void main (String args[]) { try { /* Load the JDBC Driver class */ // use the ij utility to read the property file and // make the initial connection. ij.getPropertyArg(args); Connection conn = ij.startJBMS(); createAndPopulateTable(conn); //set autocommit to off after creating table and in...
Connection conn_main=null; PreparedStatement ps_main=null;
Connection conn_main = null; PreparedStatement ps_main = null; stmtIsClosed = false;
void startClientTestMethods() { Connection conn_main=null; PreparedStatement ps_main=null; try { Class.forName("org.apache.derby.jdbc.ClientDriver"); conn_main = DriverManager.getConnection("jdbc:derby:" + "//localhost:1527/mydb;" + ...
t_setPoolable();
void startClientTestMethods() { Connection conn_main=null; PreparedStatement ps_main=null; try { Class.forName("org.apache.derby.jdbc.ClientDriver"); conn_main = DriverManager.getConnection("jdbc:derby:" + "//localhost:1527/mydb;" + ...
Connection conn_main=null; PreparedStatement ps_main=null;
Connection conn_main = null; PreparedStatement ps_main = null; stmtIsClosed = false;
void startEmbeddedTestMethods() { Connection conn_main=null; PreparedStatement ps_main=null; try { Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); conn_main = DriverManager.getConnection("jdbc:derby:mydb1;" + "create=true"); ...
PreparedStatement ps = conn_main.prepareStatement("INSERT INTO " +
ps = conn_main.prepareStatement("INSERT INTO " +
void startEmbeddedTestMethods() { Connection conn_main=null; PreparedStatement ps_main=null; try { Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); conn_main = DriverManager.getConnection("jdbc:derby:mydb1;" + "create=true"); ...
t_setPoolable();
void startEmbeddedTestMethods() { Connection conn_main=null; PreparedStatement ps_main=null; try { Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); conn_main = DriverManager.getConnection("jdbc:derby:mydb1;" + "create=true"); ...
boolean b; b = ps.isPoolable(); System.out.println("UnImplemented Exception not thrown in code"); } catch(SQLException e) { if(SQLState.NOT_IMPLEMENTED.equals (e.getSQLState())) { System.out.println("Unexpected SQLException"+e);
if (!ps.isPoolable()) System.out.println("Expected a poolable statement"); } catch(SQLException sqle) { if (ExceptionUtil.getSQLStateFromIdentifier( SQLState.ALREADY_CLOSED).equals(sqle.getSQLState()) || stmtIsClosed) { } else { System.out.println("Unexpected SQLException " + sqle); sqle.printStackTrace();
void t_isPoolable() { try { boolean b; b = ps.isPoolable(); System.out.println("UnImplemented Exception not thrown in code"); } catch(SQLException e) { if(SQLState.NOT_IMPLEMENTED.equals (e.getSQLState())) { System.out.println("Unexpected SQLE...
System.out.println("UnImplemented Exception not thrown in code"); } catch(SQLException e) { if(SQLState.NOT_IMPLEMENTED.equals (e.getSQLState())) { System.out.println("Unexpected SQLException"+e);
if (ps.isPoolable()) System.out.println("Expected a non-poolable statement"); ps.setPoolable(true); if (!ps.isPoolable()) System.out.println("Expected a poolable statement"); } catch(SQLException sqle) { if (ExceptionUtil.getSQLStateFromIdentifier( SQLState.ALREADY_CLOSED).equals(sqle.getSQLState()) || stmtIsClos...
void t_setPoolable() { try { ps.setPoolable(false); System.out.println("UnImplemented Exception not thrown in code"); } catch(SQLException e) { if(SQLState.NOT_IMPLEMENTED.equals (e.getSQLState())) { System.out.println("Unexpected SQLException"+e); ...
if (realConnection != null) SanityManager.ASSERT(realConnection.transactionIsIdle(),
if (con.realConnection != null) SanityManager.ASSERT(con.realConnection.transactionIsIdle(),
public final synchronized int prepare(Xid xid) throws XAException { checkXAActive(); // ensure immtable and correct equals method. XAXactId xid_im = new XAXactId(xid); XATransactionState tranState = getTransactionState(xid_im); if (tranState == null) { ...
conn.rollback();
public static void main (String args[]) { try { System.out.println("prepStmt Test Starts"); ij.getPropertyArg(args); conn = ij.startJBMS(); if (conn == null) { System.out.println("conn didn't work"); return; } Statement cleanstmt = conn.createStatement(); TestUtil.cleanUpTest(cleanstmt, testO...
if( storageFactory.useContextLoader) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if( cl != null && cl.getResource( path) != null) return true; } if( getClass().getResource( path) != null) { if( storageFactory.useContextLoader) storageFactory.useContextLoader = false; return true; } return false;
ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl != null) if (cl.getResource(path) != null) return true; cl = getClass().getClassLoader(); if (cl != null) { return (cl.getResource(path) != null); } else { return ClassLoader.getSystemResource(path) != null; }
public boolean exists() { if( storageFactory.useContextLoader) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if( cl != null && cl.getResource( path) != null) return true; } if( getClass().getResource( path) != null) { ...
InputStream is = null; if( storageFactory.useContextLoader) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); is = cl.getResourceAsStream( path); if( is != null) return is; } is = getClass().getResourceAsStream( path); if( is != null && storageFactory.useContextLoader) storageFactory.useContextLoader =...
InputStream is = null; ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl != null) is = cl.getResourceAsStream(path); if (is == null) { cl = getClass().getClassLoader(); if (cl != null) is = cl.getResourceAsStream(path); else is = ClassLoader.getSystemResourceAsStream(path); } if (is == null...
public InputStream getInputStream( ) throws FileNotFoundException { InputStream is = null; if( storageFactory.useContextLoader) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); is = cl.getResourceAsStream( path); if( is != null) ...
java.util.Enumeration enum = getChildren().elements(); while (enum.hasMoreElements()){ childrenTime = childrenTime + ((RealBasicNoPutResultSetStatistics)enum.nextElement()).getTotalTime();
java.util.Enumeration e = getChildren().elements(); while (e.hasMoreElements()){ childrenTime = childrenTime + ((RealBasicNoPutResultSetStatistics)e.nextElement()).getTotalTime();
public long getChildrenTime(){ long childrenTime = 0; java.util.Enumeration enum = getChildren().elements(); while (enum.hasMoreElements()){ childrenTime = childrenTime + ((RealBasicNoPutResultSetStatistics)enum.nextElement()).getTotalTime(); }
return childrenTime; }
public long getChildrenTime(){ long childrenTime = 0; java.util.Enumeration enum = getChildren().elements(); while (enum.hasMoreElements()){ childrenTime = childrenTime + ((RealBasicNoPutResultSetStatistics)enum.nextElement()).getTotalTime(); }
this.colRef = (ColumnReference) colRef;
this.columnExpression = (ValueNode)colRef;
public void init(Object colRef) { this.colRef = (ColumnReference) colRef; }
if (colRef != null)
if (columnExpression != null)
public void printSubNodes(int depth) { if (SanityManager.DEBUG) { super.printSubNodes(depth); if (colRef != null) { printLabel(depth, "colRef: "); colRef.treePrint(depth + 1); } } }
colRef.treePrint(depth + 1);
columnExpression.treePrint(depth + 1);
public void printSubNodes(int depth) { if (SanityManager.DEBUG) { super.printSubNodes(depth); if (colRef != null) { printLabel(depth, "colRef: "); colRef.treePrint(depth + 1); } } }
SanityManager.DEBUG_SET(LogToFile.TEST_LOG_INCOMPLETE_LOG_WRITE); System.getProperties().put(LogToFile.TEST_LOG_PARTIAL_LOG_WRITE_NUM_BYTES, Integer.toString(numcol*20));
if(!checksumTest) { SanityManager.DEBUG_SET(LogToFile.TEST_LOG_INCOMPLETE_LOG_WRITE); System.getProperties().put(LogToFile.TEST_LOG_PARTIAL_LOG_WRITE_NUM_BYTES, Integer.toString(numcol*20)); } logFactory.flushAll();
protected void STest1() throws T_Fail, StandardException { Transaction t = t_util.t_startTransaction(); /////////////////////////////////////////// //// log switch without checkpoint here /// /////////////////////////////////////////// factory.checkpoint(); try { long cid = t_util.t_addContainer(t, 0); Cont...
if(checksumTest) simulateLogFileCorruption();
protected void STest1() throws T_Fail, StandardException { Transaction t = t_util.t_startTransaction(); /////////////////////////////////////////// //// log switch without checkpoint here /// /////////////////////////////////////////// factory.checkpoint(); try { long cid = t_util.t_addContainer(t, 0); Cont...
SanityManager.DEBUG_SET(LogToFile.TEST_LOG_INCOMPLETE_LOG_WRITE); System.getProperties().put(LogToFile.TEST_LOG_PARTIAL_LOG_WRITE_NUM_BYTES,Integer.toString(numcol*20));
if(!checksumTest) { SanityManager.DEBUG_SET(LogToFile.TEST_LOG_INCOMPLETE_LOG_WRITE); System.getProperties().put(LogToFile.TEST_LOG_PARTIAL_LOG_WRITE_NUM_BYTES,Integer.toString(numcol*20)); }
protected void STest2() throws T_Fail, StandardException { Transaction t = t_util.t_startTransaction(); try { long cid = t_util.t_addContainer(t, 0); ContainerHandle c = t_util.t_openContainer(t, 0, cid, true); Page page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER); // make a really big record -...
if(checksumTest) simulateLogFileCorruption();
protected void STest2() throws T_Fail, StandardException { Transaction t = t_util.t_startTransaction(); try { long cid = t_util.t_addContainer(t, 0); ContainerHandle c = t_util.t_openContainer(t, 0, cid, true); Page page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER); // make a really big record -...
SanityManager.DEBUG_SET(LogToFile.TEST_LOG_INCOMPLETE_LOG_WRITE); System.getProperties().put(LogToFile.TEST_LOG_PARTIAL_LOG_WRITE_NUM_BYTES, "200");
if(!checksumTest) { SanityManager.DEBUG_SET(LogToFile.TEST_LOG_INCOMPLETE_LOG_WRITE); System.getProperties().put(LogToFile.TEST_LOG_PARTIAL_LOG_WRITE_NUM_BYTES, "200"); } logFactory.flushAll();
protected void STest3() throws T_Fail, StandardException { int numtrans = 7; int numpages = 7; int i,j; // this is basically T_Recovery S203 with a couple of log switches try { T_TWC[] t = new T_TWC[numtrans]; for (i = 0; i < numtrans; i++) t[i] = t_util.t_startTransactionWithContext(); long[] cid = ne...
if(checksumTest) simulateLogFileCorruption();
protected void STest3() throws T_Fail, StandardException { int numtrans = 7; int numpages = 7; int i,j; // this is basically T_Recovery S203 with a couple of log switches try { T_TWC[] t = new T_TWC[numtrans]; for (i = 0; i < numtrans; i++) t[i] = t_util.t_startTransactionWithContext(); long[] cid = ne...
SanityManager.DEBUG_SET(LogToFile.TEST_LOG_INCOMPLETE_LOG_WRITE); System.getProperties().put(LogToFile.TEST_LOG_PARTIAL_LOG_WRITE_NUM_BYTES, Integer.toString(11));
if(!checksumTest) { SanityManager.DEBUG_SET(LogToFile.TEST_LOG_INCOMPLETE_LOG_WRITE); System.getProperties().put(LogToFile.TEST_LOG_PARTIAL_LOG_WRITE_NUM_BYTES, Integer.toString(11)); }
protected void STest4() throws T_Fail, StandardException { Transaction t = t_util.t_startTransaction(); try { long cid = t_util.t_addContainer(t, 0); ContainerHandle c = t_util.t_openContainer(t, 0, cid, true); Page page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER); // make a really big record -...
if(checksumTest) simulateLogFileCorruption();
protected void STest4() throws T_Fail, StandardException { Transaction t = t_util.t_startTransaction(); try { long cid = t_util.t_addContainer(t, 0); ContainerHandle c = t_util.t_openContainer(t, 0, cid, true); Page page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER); // make a really big record -...
SanityManager.DEBUG_SET(LogToFile.TEST_LOG_INCOMPLETE_LOG_WRITE); System.getProperties().put(LogToFile.TEST_LOG_PARTIAL_LOG_WRITE_NUM_BYTES, Integer.toString(3));
if(!checksumTest) { SanityManager.DEBUG_SET(LogToFile.TEST_LOG_INCOMPLETE_LOG_WRITE); System.getProperties().put(LogToFile.TEST_LOG_PARTIAL_LOG_WRITE_NUM_BYTES, Integer.toString(3)); } logFactory.flushAll();
protected void STest5() throws T_Fail, StandardException { Transaction t = t_util.t_startTransaction(); try { long cid = t_util.t_addContainer(t, 0); ContainerHandle c = t_util.t_openContainer(t, 0, cid, true); Page page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER); // make a really big record -...
if(checksumTest) simulateLogFileCorruption();
protected void STest5() throws T_Fail, StandardException { Transaction t = t_util.t_startTransaction(); try { long cid = t_util.t_addContainer(t, 0); ContainerHandle c = t_util.t_openContainer(t, 0, cid, true); Page page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER); // make a really big record -...
SanityManager.DEBUG_SET(LogToFile.TEST_LOG_INCOMPLETE_LOG_WRITE); System.getProperties().put(LogToFile.TEST_LOG_PARTIAL_LOG_WRITE_NUM_BYTES, Integer.toString((1997/2) + 16));
if(!checksumTest) { SanityManager.DEBUG_SET(LogToFile.TEST_LOG_INCOMPLETE_LOG_WRITE); System.getProperties().put(LogToFile.TEST_LOG_PARTIAL_LOG_WRITE_NUM_BYTES, Integer.toString((1997/2) + 16)); } logFactory.flushAll(); page.update(rh, bigrow.getRow(), (FormatableBitSet) null);
protected void STest6() throws T_Fail, StandardException { Transaction t = t_util.t_startTransaction(); try { long cid = t_util.t_addContainer(t, 0); ContainerHandle c = t_util.t_openContainer(t, 0, cid, true); Page page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER); // make a really big record -...
page.update(rh, bigrow.getRow(), (FormatableBitSet) null);
if(checksumTest) simulateLogFileCorruption();
protected void STest6() throws T_Fail, StandardException { Transaction t = t_util.t_startTransaction(); try { long cid = t_util.t_addContainer(t, 0); ContainerHandle c = t_util.t_openContainer(t, 0, cid, true); Page page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER); // make a really big record -...
SanityManager.DEBUG_SET(LogToFile.TEST_LOG_INCOMPLETE_LOG_WRITE); System.getProperties().put(LogToFile.TEST_LOG_PARTIAL_LOG_WRITE_NUM_BYTES, Integer.toString(1997+15));
if(!checksumTest) { SanityManager.DEBUG_SET(LogToFile.TEST_LOG_INCOMPLETE_LOG_WRITE); System.getProperties().put(LogToFile.TEST_LOG_PARTIAL_LOG_WRITE_NUM_BYTES, Integer.toString(1997+15)); } logFactory.flushAll(); page.update(rh, bigrow.getRow(), (FormatableBitSet) null);
protected void STest7() throws T_Fail, StandardException { Transaction t = t_util.t_startTransaction(); try { long cid = t_util.t_addContainer(t, 0); ContainerHandle c = t_util.t_openContainer(t, 0, cid, true); Page page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER); // make a really big record -...
page.update(rh, bigrow.getRow(), (FormatableBitSet) null);
if(checksumTest) simulateLogFileCorruption();
protected void STest7() throws T_Fail, StandardException { Transaction t = t_util.t_startTransaction(); try { long cid = t_util.t_addContainer(t, 0); ContainerHandle c = t_util.t_openContainer(t, 0, cid, true); Page page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER); // make a really big record -...
param = PropertyUtil.getSystemProperty(TEST_BAD_CHECKSUM_LOG); checksumTest = Boolean.valueOf(param).booleanValue(); if(checksumTest) { infoPath = "extinout/T_RecoverBadChecksumLog.info"; testService = "BadChecksumLogTest"; }
private void getConfig() { String param; param = PropertyUtil.getSystemProperty(TEST_BADLOG_SETUP); setup = Boolean.valueOf(param).booleanValue(); param = PropertyUtil.getSystemProperty(TEST_BADLOG1); test1 = Boolean.valueOf(param).booleanValue(); param = PropertyUtil.getSystemProperty(TEST_BADLOG2); test2 = Bo...
REPORT("\n\t\tRunning bad log test 1");
REPORT(message + " 1");
public void runTests() throws T_Fail { getConfig(); int tests = 0; if (setup) tests++; if (test1) tests++; if (test2) tests++; if (test3) tests++; if (test4) tests++; if (test5) tests++; if (test6) tests++; if (test7) tests++; if (tests != 1) throw T_Fail.testFailMsg("One & only one of the bad log recov...
REPORT("\n\t\tRunning bad log test 2");
REPORT(message + " 2");
public void runTests() throws T_Fail { getConfig(); int tests = 0; if (setup) tests++; if (test1) tests++; if (test2) tests++; if (test3) tests++; if (test4) tests++; if (test5) tests++; if (test6) tests++; if (test7) tests++; if (tests != 1) throw T_Fail.testFailMsg("One & only one of the bad log recov...
REPORT("\n\t\tRunning bad log test 3");
REPORT(message + " 3");
public void runTests() throws T_Fail { getConfig(); int tests = 0; if (setup) tests++; if (test1) tests++; if (test2) tests++; if (test3) tests++; if (test4) tests++; if (test5) tests++; if (test6) tests++; if (test7) tests++; if (tests != 1) throw T_Fail.testFailMsg("One & only one of the bad log recov...
REPORT("\n\t\tRunning bad log test 4");
REPORT(message + " 4");
public void runTests() throws T_Fail { getConfig(); int tests = 0; if (setup) tests++; if (test1) tests++; if (test2) tests++; if (test3) tests++; if (test4) tests++; if (test5) tests++; if (test6) tests++; if (test7) tests++; if (tests != 1) throw T_Fail.testFailMsg("One & only one of the bad log recov...
REPORT("\n\t\tRunning bad log test 5");
REPORT(message + " 5");
public void runTests() throws T_Fail { getConfig(); int tests = 0; if (setup) tests++; if (test1) tests++; if (test2) tests++; if (test3) tests++; if (test4) tests++; if (test5) tests++; if (test6) tests++; if (test7) tests++; if (tests != 1) throw T_Fail.testFailMsg("One & only one of the bad log recov...
REPORT("\n\t\tRunning bad log test 6");
REPORT(message + " 6");
public void runTests() throws T_Fail { getConfig(); int tests = 0; if (setup) tests++; if (test1) tests++; if (test2) tests++; if (test3) tests++; if (test4) tests++; if (test5) tests++; if (test6) tests++; if (test7) tests++; if (tests != 1) throw T_Fail.testFailMsg("One & only one of the bad log recov...
REPORT("\n\t\tRunning bad log test 7");
REPORT(message + " 7");
public void runTests() throws T_Fail { getConfig(); int tests = 0; if (setup) tests++; if (test1) tests++; if (test2) tests++; if (test3) tests++; if (test4) tests++; if (test5) tests++; if (test6) tests++; if (test7) tests++; if (tests != 1) throw T_Fail.testFailMsg("One & only one of the bad log recov...
logFactory =(LogToFile) Monitor.findServiceModule(factory, factory.getLogFactoryModule());
public void runTests() throws T_Fail { getConfig(); int tests = 0; if (setup) tests++; if (test1) tests++; if (test2) tests++; if (test3) tests++; if (test4) tests++; if (test5) tests++; if (test6) tests++; if (test7) tests++; if (tests != 1) throw T_Fail.testFailMsg("One & only one of the bad log recov...
if ( ! (rc.getExpression().isParameterNode()))
if ( ! (rc.getExpression().requiresTypeFromContext()))
int getParamColumnTypes(DataTypeDescriptor[] types, RowResultSetNode rrsn) { int numTypes = 0; /* Look for columns where we have not found a non-? yet. */ for (int i = 0; i < types.length; i++) { if (types[i] == null) { ResultColumn rc = (ResultColumn) rrsn.getResultColumns().elementAt(i); if ( ! (rc...
if (rc.getExpression().isParameterNode())
if (rc.getExpression().requiresTypeFromContext())
void setParamColumnTypes(DataTypeDescriptor[] types, RowResultSetNode rrsn) throws StandardException { /* ** Look for ? parameters in the result column list ** of each RowResultSetNode */ ResultColumnList rrcl = rrsn.getResultColumns(); int rrclSize = rrcl.size(); for (int index = 0; index < rrclSize; index...
((ParameterNode) rc.getExpression()).setDescriptor( types[index]);
rc.getExpression().setType(types[index]);
void setParamColumnTypes(DataTypeDescriptor[] types, RowResultSetNode rrsn) throws StandardException { /* ** Look for ? parameters in the result column list ** of each RowResultSetNode */ ResultColumnList rrcl = rrsn.getResultColumns(); int rrclSize = rrcl.size(); for (int index = 0; index < rrclSize; index...
if (methodParms != null) optimizeDomainValueConversion();
public JavaValueNode bindExpression( FromList fromList, SubqueryList subqueryList, Vector aggregateVector) throws StandardException { // for a function we can get called recursively if (alreadyBound) return this; bindParameters(fromList, subqueryList, aggregateVector); /* If javaClassName is null then we ...
return new TestSuite(RowIdNotImplementedTest.class, "RowIdNotImplementedTest suite");
return TestConfiguration.defaultSuite(RowIdNotImplementedTest.class);
public static Test suite() { return new TestSuite(RowIdNotImplementedTest.class, "RowIdNotImplementedTest suite"); }
TransactionController.MODE_RECORD,
TransactionController.MODE_TABLE,
public void compressConglomerate( TransactionManager xact_manager, Transaction rawtran) throws StandardException { OpenConglomerate open_conglom = null; HeapController heapcontroller = null; try { open_conglom =...
LockingPolicy.MODE_RECORD,
LockingPolicy.MODE_CONTAINER,
public void compressConglomerate( TransactionManager xact_manager, Transaction rawtran) throws StandardException { OpenConglomerate open_conglom = null; HeapController heapcontroller = null; try { open_conglom =...
public void backup(String backupDir) throws SQLException {
public void backup(String backupDir, boolean wait) throws SQLException {
public void backup(String backupDir) throws SQLException { try { af.backup(backupDir); } catch (StandardException se) { throw PublicAPI.wrapStandardException(se); } }
af.backup(backupDir);
af.backup(backupDir, wait);
public void backup(String backupDir) throws SQLException { try { af.backup(backupDir); } catch (StandardException se) { throw PublicAPI.wrapStandardException(se); } }
public void backupAndEnableLogArchiveMode(String backupDir, boolean deleteOnlineArchivedLogFiles) throws SQLException
public void backupAndEnableLogArchiveMode( String backupDir, boolean deleteOnlineArchivedLogFiles, boolean wait) throws SQLException
public void backupAndEnableLogArchiveMode(String backupDir, boolean deleteOnlineArchivedLogFiles) throws SQLException { try { af.backupAndEnableLogArchiveMode(backupDir, deleteOnlineArchivedLogFiles); } catch (StandardException se) { throw PublicAPI.wrapStandardException(se); } }
af.backupAndEnableLogArchiveMode(backupDir, deleteOnlineArchivedLogFiles);
af.backupAndEnableLogArchiveMode(backupDir, deleteOnlineArchivedLogFiles, wait);
public void backupAndEnableLogArchiveMode(String backupDir, boolean deleteOnlineArchivedLogFiles) throws SQLException { try { af.backupAndEnableLogArchiveMode(backupDir, deleteOnlineArchivedLogFiles); } catch (StandardException se) { throw PublicAPI.wrapStandardException(se); } }
rs = s_i_r.executeQuery("select * from t where 1=0"); rs.afterLast(); if (rs.isAfterLast()) { System.out.println("afterLast() on empty RS should be no-op"); } rs.beforeFirst(); if (rs.isBeforeFirst()) { System.out.println("beforeFirst() on empty RS should be no-op"); } rs.close();
static boolean scrollInsensitivePositive( Connection conn) throws SQLException { boolean passed = true; PreparedStatement ps_i_r = null; PreparedStatement ps_i_u = null; ResultSet rs; SQLWarning warning; Statement s_i_r = null; // insensitive, read only Statement s_i_u = null; // insensitive, updatable s_i_...
testStoredProcEscapeSyntax(con); testAutoCommitFailure(con); con.close();
private static void runTests(Connection con) throws Exception { testDatabaseMetaDataMethods(con); }
try { if (!met.supportsStoredFunctionsUsingCallSyntax()) { System.out.println ("FAIL: supportsStoredFunctionsUsingCallSyntax() " + "should return true"); } } catch (SQLException e) { System.out.println("supportsStoredFunctionsUsingCallSyntax():"); dumpSQLExceptions(e);
if (!met.supportsStoredFunctionsUsingCallSyntax()) { System.out.println ("FAIL: supportsStoredFunctionsUsingCallSyntax() " + "should return true");
private static void testDatabaseMetaDataMethods(Connection con) throws Exception { con.setAutoCommit(true); // make sure it is true Statement s = con.createStatement(); DatabaseMetaData met = con.getMetaData(); try { if (!met.supportsStoredFunctionsUsingCallSyntax())...
try { if (met.autoCommitFailureClosesAllResultSets()) { System.out.println ("FAIL: autoCommitFailureClosesAllResultSets() " + "should return false"); } } catch (SQLException e) { System.out.println("autoCommitFailureClosesAllResultSets():"); dumpSQLExceptions(e);
if (met.autoCommitFailureClosesAllResultSets()) { System.out.println ("FAIL: autoCommitFailureClosesAllResultSets() " + "should return false");
private static void testDatabaseMetaDataMethods(Connection con) throws Exception { con.setAutoCommit(true); // make sure it is true Statement s = con.createStatement(); DatabaseMetaData met = con.getMetaData(); try { if (!met.supportsStoredFunctionsUsingCallSyntax())...
try { if (met.providesQueryObjectGenerator()) { System.out.println ("FAIL: providesQueryObjectGenerator() should " + "return false"); } } catch (SQLException e) { System.out.println("providesQueryObjectGenerator():"); dumpSQLExceptions(e);
if (met.providesQueryObjectGenerator()) { System.out.println ("FAIL: providesQueryObjectGenerator() should " + "return false");
private static void testDatabaseMetaDataMethods(Connection con) throws Exception { con.setAutoCommit(true); // make sure it is true Statement s = con.createStatement(); DatabaseMetaData met = con.getMetaData(); try { if (!met.supportsStoredFunctionsUsingCallSyntax())...
try { RowIdLifetime lifetime = met.getRowIdLifetime(); if (lifetime != RowIdLifetime.ROWID_UNSUPPORTED) { System.out.println("FAIL: getRowIdLifetime() should return " + "ROWID_UNSUPPORTED, but got " + lifetime); } } catch (SQLException e) { System.out.println("getRowIdLifetime():"); dumpSQLExceptions(e);
RowIdLifetime lifetime = met.getRowIdLifetime(); if (lifetime != RowIdLifetime.ROWID_UNSUPPORTED) { System.out.println("FAIL: getRowIdLifetime() should return " + "ROWID_UNSUPPORTED, but got " + lifetime);
private static void testDatabaseMetaDataMethods(Connection con) throws Exception { con.setAutoCommit(true); // make sure it is true Statement s = con.createStatement(); DatabaseMetaData met = con.getMetaData(); try { if (!met.supportsStoredFunctionsUsingCallSyntax())...
con.close();
private static void testDatabaseMetaDataMethods(Connection con) throws Exception { con.setAutoCommit(true); // make sure it is true Statement s = con.createStatement(); DatabaseMetaData met = con.getMetaData(); try { if (!met.supportsStoredFunctionsUsingCallSyntax())...
checkRoutinePermissions(conn);
private void runPhase(int version, int phase) throws Exception{ System.out.println("\n\nSTART - phase " + PHASES[phase]); URLClassLoader classLoader = null; switch(version) { case OLD_RELEASE: classLoader = oldClassLoader; break; case NEW_RELEASE: classLoader = newClassLoader; break; ...
throw StandardException.newException(SQLState.LANG_INVALID_COL_REF_NON_GROUPED_SELECT_LIST, cr.getFullColumnName());
throw StandardException.newException(SQLState.LANG_INVALID_COL_REF_NON_GROUPED_SELECT_LIST, cr.getSQLColumnName());
public Visitable visit(Visitable node) throws StandardException { if (node instanceof ColumnReference) { ColumnReference cr = (ColumnReference)node; if (groupByList == null) { throw StandardException.newException(SQLState.LANG_INVALID_COL_REF_NON_GROUPED_SELECT_LIST, cr.getFullColumnName()); } if (gr...
throw StandardException.newException(SQLState.LANG_INVALID_COL_REF_GROUPED_SELECT_LIST, cr.getFullColumnName());
throw StandardException.newException(SQLState.LANG_INVALID_COL_REF_GROUPED_SELECT_LIST, cr.getSQLColumnName());
public Visitable visit(Visitable node) throws StandardException { if (node instanceof ColumnReference) { ColumnReference cr = (ColumnReference)node; if (groupByList == null) { throw StandardException.newException(SQLState.LANG_INVALID_COL_REF_NON_GROUPED_SELECT_LIST, cr.getFullColumnName()); } if (gr...
public static String fileExists(String fileName) throws Exception
public static String fileExists(String fileName) throws PrivilegedActionException
public static String fileExists(String fileName) throws Exception { File fl = new File(fileName); if(fl.exists()) { return "true"; }else { return "false"; } }
File fl = new File(fileName); if(fl.exists()) { return "true"; }else { return "false"; }
final File fl = new File(fileName); return (String) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() { if(fl.exists()) { return "true"; }else { return "false"; } } });
public static String fileExists(String fileName) throws Exception { File fl = new File(fileName); if(fl.exists()) { return "true"; }else { return "false"; } }
File src = new File(location, name); File dst = new File(location, newName); if(!src.renameTo(dst)) { throw new Exception("unable to rename File: " + src.getAbsolutePath() + " To: " + dst.getAbsolutePath()); } }
final File src = new File(location, name); final File dst = new File(location, newName); AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws Exception { if(!src.renameTo(dst)) { throw new Exception("unable to rename File: " + src.getAbsolutePath() + " To: " + dst.getAbsoluteP...
public static void renameFile(String location, String name , String newName) throws Exception { File src = new File(location, name); File dst = new File(location, newName); if(!src.renameTo(dst)) { throw new Exception("unable to rename File: " + src.getAbsolutePath() + " To: " + dst.getAbsoluteP...
((ParameterNode) operand).setDescriptor( DataTypeDescriptor.getBuiltInDataTypeDescriptor(parameterType, true,
operand.setType(DataTypeDescriptor.getBuiltInDataTypeDescriptor(parameterType, true,
void bindParameter() throws StandardException { /* ** According to the SQL standard, if XXX_length has a ? operand, ** its type is varchar with the implementation-defined maximum length ** for a varchar. */ ((ParameterNode) operand).setDescriptor( DataTypeDescriptor.getBuiltInDataTypeDescriptor(parameter...
public <T> T createQueryObject(Class<T> ifc) throws SQLException { throw new java.lang.UnsupportedOperationException();
public <T extends BaseQuery> T createQueryObject(Class<T> ifc) throws SQLException { return QueryObjectFactory.createDefaultQueryObject (ifc, this);
public <T> T createQueryObject(Class<T> ifc) throws SQLException { throw new java.lang.UnsupportedOperationException(); }
if (generatedKey == null) { throw StandardException.newException( externalKey.length() % 2 == 0 ? SQLState.ENCRYPTION_ILLEGAL_EXKEY_CHARS : SQLState.ENCRYPTION_INVALID_EXKEY_LENGTH); }
public void boot(boolean create, Properties properties) throws StandardException { boolean provider_or_algo_specified = false; boolean storeProperties = create; String externalKey = properties.getProperty(Attribute.CRYPTO_EXTERNAL_KEY); if (externalKey != null) { storeProperties = false; } cryptoP...
Integer.valueOf(beginLogFileNumber).intValue();
Long.valueOf(beginLogFileNumber).longValue();
public void recover( RawStoreFactory rsf, DataFactory df, TransactionFactory tf) throws StandardException { if (SanityManager.DEBUG) { SanityManager.ASSERT(rsf != null, "raw store factory == null"); SanityManager.ASSERT(df != null, "data factory == null"); } checkCorrupt(); rawStore...
clientMessageIds.add("J104");
static void initClientMessageIds() { // Add message ids that don't start with XJ here clientMessageIds.add(SQLState.NO_CURRENT_CONNECTION); clientMessageIds.add(SQLState.NOT_IMPLEMENTED); clientMessageIds.add(SQLState.CANNOT_CLOSE_ACTIVE_CONNECTION); clientMessageIds.add(SQLSta...
clientMessageIds.add(SQLState.CONNECTION_FAILED_ON_RESET); clientMessageIds.add(SQLState.DECIMAL_TOO_MANY_DIGITS); clientMessageIds.add(SQLState.NUMERIC_OVERFLOW); clientMessageIds.add(SQLState.UNSUPPORTED_HOLDABILITY_PROPERTY); clientMessageIds.add(SQLState.CANCEL_NOT_SUPPORTED_BY_SERVER); clientMessageIds.add(SQLStat...
static void initClientMessageIds() { // Add message ids that don't start with XJ here clientMessageIds.add(SQLState.NO_CURRENT_CONNECTION); clientMessageIds.add(SQLState.NOT_IMPLEMENTED); clientMessageIds.add(SQLState.CANNOT_CLOSE_ACTIVE_CONNECTION); clientMessageIds.add(SQLSta...
if ( messageId.startsWith("XJ") )
if ( messageId.startsWith("XJ") || messageId.startsWith("J") )
static boolean isClientMessage(String messageId) { if ( messageId.startsWith("XJ") ) { return true; } if ( clientMessageIds.contains(messageId)) { return true; } return false; }
if (!RowUtil.isRowEmpty(startKeyValue, (FormatableBitSet) null) || !RowUtil.isRowEmpty(stopKeyValue, (FormatableBitSet) null))
if (!RowUtil.isRowEmpty(startKeyValue) || !RowUtil.isRowEmpty(stopKeyValue))
public ScanManager openScan( TransactionManager xact_manager, Transaction rawtran, boolean hold, int open_mode, int lock_level, LockingPolicy locking_policy, int ...
ResultSet rs = stmt.executeQuery("select * from tab1");
ResultSet rs = stmt.executeQuery("select " + "c1," + "c2," + "c3," + "c4," + "c5," + "c6," + "c1 as c1_spare," + "c2 as c2_spare," + "c3 as c3_spare " + "from tab1");
public static void main(String[] args) { Connection conn, connreturn; Statement stmt, stmtreturn; System.out.println("Test connection20 starting"); try { // use the ij utility to read the property file and // make the initial connection. ij.getPropertyArg(args); conn = ij.startJBMS(); isDerbyNet = Te...
get_using_binary_stream(rs, i); get_using_bytes(rs, i);
get_using_binary_stream(rs, i + 6); get_using_bytes(rs, i + 6);
public static void main(String[] args) { Connection conn, connreturn; Statement stmt, stmtreturn; System.out.println("Test connection20 starting"); try { // use the ij utility to read the property file and // make the initial connection. ij.getPropertyArg(args); conn = ij.startJBMS(); isDerbyNet = Te...
rs = stmt.executeQuery("select * from tab1"); loop++;
rs = stmt.executeQuery("select " + "c1," + "c2," + "c3," + "c4," + "c5," + "c6," + "c1 as c1_spare," + "c2 as c2_spare," + "c3 as c3_spare " + "from tab1"); loop++;
public static void main(String[] args) { Connection conn, connreturn; Statement stmt, stmtreturn; System.out.println("Test connection20 starting"); try { // use the ij utility to read the property file and // make the initial connection. ij.getPropertyArg(args); conn = ij.startJBMS(); isDerbyNet = Te...
String strResult = sqlxUtil.serializeToString(itemRefs);
public XMLDataValue XMLQuery(XMLDataValue result, SqlXmlUtil sqlxUtil) throws StandardException { if (this.isNull()) { // if the context is null, we return null, // per SQL/XML[2006] 6.17:GR.1.a.ii.1. if (result == null) result = (XMLDataValue)getNewNull(); ...
result = new XML(new SQLChar(strResult)); else result.setValue(new SQLChar(strResult));
result = new XML(); String strResult = sqlxUtil.serializeToString(itemRefs, result); result.setValue(new SQLChar(strResult));
public XMLDataValue XMLQuery(XMLDataValue result, SqlXmlUtil sqlxUtil) throws StandardException { if (this.isNull()) { // if the context is null, we return null, // per SQL/XML[2006] 6.17:GR.1.a.ii.1. if (result == null) result = (XMLDataValue)getNewNull(); ...
if (this.hasTopLevelAttr()) { throw StandardException.newException( SQLState.LANG_XQUERY_SERIALIZATION_ERROR); }
public StringDataValue XMLSerialize(StringDataValue result, int targetType, int targetWidth) throws StandardException { if (result == null) { switch (targetType) { case Types.CHAR: result = new SQLChar(); break; case Types.VARCHAR: resu...
return new XML(xmlStringValue, getXType());
return new XML(xmlStringValue, getXType(), hasTopLevelAttr());
public DataValueDescriptor getClone() { return new XML(xmlStringValue, getXType()); }
if (((XMLDataValue)theValue).hasTopLevelAttr()) markAsHavingTopLevelAttr(); }
protected void setFrom(DataValueDescriptor theValue) throws StandardException { String strVal = theValue.getString(); if (strVal == null) { xmlStringValue = null; // Null is a valid value for DOCUMENT(ANY) setXType(XML_DOC_ANY); return; ...
if (xtype == XML_DOC_ANY) containsTopLevelAttr = false;
public void setXType(int xtype) { this.xType = xtype; }
if ((duplicate_value = hash_table.put(key, row)) != null)
if ((duplicate_value = hash_table.put(key, row)) == null) doSpaceAccounting( row, false); else
private void add_row_to_hash_table( Hashtable hash_table, Object key, Object[] row) throws StandardException { Object duplicate_value = null; if ((duplicate_value = hash_table.put(key, row)) != null) { if (!remove_duplicates) { Vector...
doSpaceAccounting( row, true);
private void add_row_to_hash_table( Hashtable hash_table, Object key, Object[] row) throws StandardException { Object duplicate_value = null; if ((duplicate_value = hash_table.put(key, row)) != null) { if (!remove_duplicates) { Vector...
private Object[] cloneRow(Object[] old_row)
static Object[] cloneRow(Object[] old_row)
private Object[] cloneRow(Object[] old_row) throws StandardException { Object[] new_row = new DataValueDescriptor[old_row.length]; // the only difference between getClone and cloneObject is cloneObject does // not objectify a stream. We use getClone here. Beetle 4896. for (int i = 0; i <...
if( diskHashtable != null) { diskHashtable.close(); diskHashtable = null; }
public void close() throws StandardException { hash_table = null; return; }
return(hash_table.elements());
if( diskHashtable == null) return(hash_table.elements()); return new BackingStoreHashtableEnumeration();
public Enumeration elements() throws StandardException { return(hash_table.elements()); }
return(hash_table.get(key));
Object obj = hash_table.get(key); if( diskHashtable == null || obj != null) return obj; return diskHashtable.get( key);
public Object get(Object key) throws StandardException { return(hash_table.get(key)); }
return(hash_table.remove(key));
Object obj = hash_table.remove(key); if( obj != null || diskHashtable == null) return obj; return diskHashtable.remove(key);
public Object remove( Object key) throws StandardException { return(hash_table.remove(key)); }
return(hash_table.size());
if( diskHashtable == null) return(hash_table.size()); return hash_table.size() + diskHashtable.size();
public int size() throws StandardException { return(hash_table.size()); }
classname = checkForJDBC40Implementation(classname);
public static javax.sql.ConnectionPoolDataSource getConnectionPoolDataSource(Properties attrs) { String classname = getDataSourcePrefix() + CONNECTION_POOL_DATASOURCE_STRING + "DataSource"; return (javax.sql.ConnectionPoolDataSource) getDataSourceWithReflection(classname, attrs); }
if (JVMInfo.JDK_ID >= JVMInfo.J2SE_16) { String classname40 = classname + "40"; try { Class.forName(classname40); classname = classname40; } catch (ClassNotFoundException e) {} }
classname = checkForJDBC40Implementation(classname);
public static javax.sql.DataSource getDataSource(Properties attrs) { String classname; if(HAVE_DRIVER_CLASS) { classname = getDataSourcePrefix() + REGULAR_DATASOURCE_STRING + "DataSource"; // The JDBC 4.0 implementation of the DataSource interface // is suffixed with "40". Use it if it is available and // t...