rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
GeneratedMethod closeCleanup,
NoPutResultSet getSetOpResultSet( NoPutResultSet leftSource, NoPutResultSet rightSource, Activation activation, int resultSetNumber, long optimizerEstimatedRowCount, ...
double optimizerEstimatedCost, GeneratedMethod closeCleanup)
double optimizerEstimatedCost)
NoPutResultSet getSortResultSet(NoPutResultSet source, boolean distinct, boolean isInSortedOrder, int orderItem, GeneratedMethod rowAllocator, int rowSize, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup) throws StandardException;
double optimizerEstimatedCost, GeneratedMethod closeCleanup)
double optimizerEstimatedCost)
NoPutResultSet getTableScanResultSet( Activation activation, long conglomId, int scociItem, GeneratedMethod resultRowAllocator, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int ...
qualify = true; currentRowIsValid = false; scanRepositioned = false;
public TableScanResultSet(long conglomId, StaticCompiledOpenConglomInfo scoci, Activation activation, GeneratedMethod resultRowAllocator, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qua...
double optimizerEstimatedCost, GeneratedMethod closeCleanup)
double optimizerEstimatedCost)
NoPutResultSet getUnionResultSet(NoPutResultSet source1, NoPutResultSet source2, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup) throws StandardException;
double optimizerEstimatedCost, GeneratedMethod closeCleanup)
double optimizerEstimatedCost)
public NoPutResultSet getVTIResultSet(Activation activation, GeneratedMethod row, int resultSetNumber, GeneratedMethod constructor, String javaClassName, Qualifier[][] pushedQualifiers, int erdNumber, boolean version2, boolean reuseablePs, int ctcNumber, ...
totalLength += partLength;
if (partLength > 0) { totalLength += partLength; }
protected InputStream materializeStream(InputStream is, String typeDesc) throws SqlException { final int GROWBY = 32 * 1024; // 32 KB ArrayList byteArrays = new ArrayList(); byte[] curBytes = new byte[GROWBY]; int totalLength = 0; int partLength = 0; // Read all ...
byteArrays.add(curBytes);
if (partLength > 0) { byteArrays.add(curBytes); }
protected InputStream materializeStream(InputStream is, String typeDesc) throws SqlException { final int GROWBY = 32 * 1024; // 32 KB ArrayList byteArrays = new ArrayList(); byte[] curBytes = new byte[GROWBY]; int totalLength = 0; int partLength = 0; // Read all ...
long tmpRemaining = length;
public ByteArrayCombinerStream(ArrayList arraysIn, long length) { this.specifiedLength = length; if (arraysIn != null && arraysIn.size() > 0) { // Copy references to the byte arrays to a new ArrayList. int arrayCount = arraysIn.size(); long tmpRemaining = length; ...
for (int i=0; i < arrayCount; i++) {
for (int i=0; i < arrayCount && tmpRemaining > 0; i++) {
public ByteArrayCombinerStream(ArrayList arraysIn, long length) { this.specifiedLength = length; if (arraysIn != null && arraysIn.size() > 0) { // Copy references to the byte arrays to a new ArrayList. int arrayCount = arraysIn.size(); long tmpRemaining = length; ...
if (tmpRemaining > 0) { throw new IllegalArgumentException("Not enough data, " + tmpRemaining + " bytes short of specified length " + length); }
public ByteArrayCombinerStream(ArrayList arraysIn, long length) { this.specifiedLength = length; if (arraysIn != null && arraysIn.size() > 0) { // Copy references to the byte arrays to a new ArrayList. int arrayCount = arraysIn.size(); long tmpRemaining = length; ...
OnlineBackup(String dbName) {
OnlineBackup(String dbName, String backupPath) {
OnlineBackup(String dbName) { this.dbName = dbName; }
this.backupPath = backupPath;
OnlineBackup(String dbName) { this.dbName = dbName; }
} catch (SQLException sqle) { org.apache.derby.tools.JDBCDisplayUtil.ShowSQLException(System.out, sqle); sqle.printStackTrace(System.out); }
} catch (Throwable error) { synchronized(this) { backupFailed = true; backupError = error; notifyAll(); } org.apache.derby.tools.JDBCDisplayUtil.ShowException(System.out, error); error.printStackTrace(System.out); }
public void run() { try { performBackup(); } catch (SQLException sqle) { org.apache.derby.tools.JDBCDisplayUtil.ShowSQLException(System.out, sqle); sqle.printStackTrace(System.out); } }
public void waitForBackupToBegin() throws InterruptedException{
public void waitForBackupToBegin() throws Exception{
public void waitForBackupToBegin() throws InterruptedException{ synchronized(this) { //wait for backup to begin while(!beginBackup) { wait(); } } }
while(!beginBackup) {
while (!beginBackup) { if (backupFailed) throw new Exception("BACKUP FAILED:" + backupError.getMessage()); else
public void waitForBackupToBegin() throws InterruptedException{ synchronized(this) { //wait for backup to begin while(!beginBackup) { wait(); } } }
public void waitForBackupToEnd() throws InterruptedException{
public void waitForBackupToEnd() throws Exception{
public void waitForBackupToEnd() throws InterruptedException{ synchronized(this) { if (!endBackup) { // check if a backup has actually started by the test if (!beginBackup) { System.out.println("BACKUP IS NOT STARTED BY THE TEST YET"); } else { //wait for backup to finish while(!endBackup) { ...
while(!endBackup) { wait();
while (!endBackup) { if (backupFailed) throw new Exception("BACKUP FAILED:" + backupError.getMessage()); else wait();
public void waitForBackupToEnd() throws InterruptedException{ synchronized(this) { if (!endBackup) { // check if a backup has actually started by the test if (!beginBackup) { System.out.println("BACKUP IS NOT STARTED BY THE TEST YET"); } else { //wait for backup to finish while(!endBackup) { ...
context.setVariable(var, result);
public void doTag(XMLOutput output) throws Exception { if (!maxRowsSpecified) { Object obj = context.getVariable("org.apache.commons.jelly.sql.maxRows"); if (obj != null) { if (obj instanceof Integer) { maxRows = ((Integer) obj).intValue(); ...
protected Tag findAncestorWithClass(Class parentClass) { return findAncestorWithClass(getParent(), parentClass);
public static Tag findAncestorWithClass(Tag from, Class tagClass) { while (from != null) { if (tagClass.isInstance(from)) { return from; } from = from.getParent(); } return null;
protected Tag findAncestorWithClass(Class parentClass) { return findAncestorWithClass(getParent(), parentClass); }
public Main(boolean trash) {
public Main() { this(null);
public Main(boolean trash) { }
public void goScript(Connection conn,
public int goScript(Connection conn,
public void goScript(Connection conn, LocalizedInput in) { JDBCDisplayUtil.showSelectCount = false; connEnv[0].addSession(conn, (String) null); fileInput = initialFileInput = !in.isStandardInput(); commandGrabber[0].ReInit(in); runScriptGuts(); }
runScriptGuts();
return runScriptGuts();
public void goScript(Connection conn, LocalizedInput in) { JDBCDisplayUtil.showSelectCount = false; connEnv[0].addSession(conn, (String) null); fileInput = initialFileInput = !in.isStandardInput(); commandGrabber[0].ReInit(in); runScriptGuts(); }
static public Connection startJBMS() throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException { return startJBMS(null,null);
static public Connection startJBMS(String defaultDriver, String defaultURL, Properties connInfo) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException { Connection con = null; String driverName; String databaseURL; driverName = util.getSystemProperty("driver"); if (driverName == ...
static public Connection startJBMS() throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException { return startJBMS(null,null); }
String jdbcProtocol = util.getSystemProperty("ij.protocol"); if (jdbcProtocol != null) util.loadDriverIfKnown(jdbcProtocol); String user = util.getSystemProperty("ij.user"); String password = util.getSystemProperty("ij.password"); databaseURL = util.getSystemProperty("database"); if (databaseURL == null) databaseURL...
static public Connection startJBMS() throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException { return startJBMS(null,null); }
getCompilerContext().addRequiredColumnPriv( columnDescriptor);
public void bindResultColumnByName(TableDescriptor tableDescriptor, int columnId) throws StandardException { ColumnDescriptor columnDescriptor; columnDescriptor = tableDescriptor.getColumnDescriptor(exposedName); if (columnDescriptor == null) { String errorString; String schemaName; errorString = ""...
private List getDependencyDescriptorList(List storedList)
private List getDependencyDescriptorList(List storedList, Provider providerForList)
private List getDependencyDescriptorList(List storedList) throws StandardException { DataDictionary dd = getDataDictionary(); if (storedList.size() != 0) { /* For each DependencyDescriptor, we need to instantiate * object descriptors of the appropriate type for both * the dependent and provider, create a...
DataDictionary dd = getDataDictionary();
private List getDependencyDescriptorList(List storedList) throws StandardException { DataDictionary dd = getDataDictionary(); if (storedList.size() != 0) { /* For each DependencyDescriptor, we need to instantiate * object descriptors of the appropriate type for both * the dependent and provider, create a...
finder = depDesc.getProviderFinder(); tempP = (Provider) finder.getDependable( depDesc.getProviderID() );
if (providerForList != null) { tempP = providerForList; if (SanityManager.DEBUG) { if (!tempP.getObjectID().equals(depDesc.getProviderID())) { SanityManager.THROWASSERT("mismatch providers"); } } } else { finder = depDesc.getProviderFinder(); tempP = (Provider) finder.getDependable( depDesc.getProviderID() ); }
private List getDependencyDescriptorList(List storedList) throws StandardException { DataDictionary dd = getDataDictionary(); if (storedList.size() != 0) { /* For each DependencyDescriptor, we need to instantiate * object descriptors of the appropriate type for both * the dependent and provider, create a...
protected List getDependents (Provider p)
private List getDependents (Provider p)
protected List getDependents (Provider p) throws StandardException { List deps = (List) providers.get(p.getObjectID()); /* If the Provider is not persistent, then we only have to * worry about in-memory dependencies. Otherwise, we have to * integrate the 2. */ if (! p.isPersistent()) { return (deps == nul...
return (deps == null? null : deps);
return deps;
protected List getDependents (Provider p) throws StandardException { List deps = (List) providers.get(p.getObjectID()); /* If the Provider is not persistent, then we only have to * worry about in-memory dependencies. Otherwise, we have to * integrate the 2. */ if (! p.isPersistent()) { return (deps == nul...
)
), p
protected List getDependents (Provider p) throws StandardException { List deps = (List) providers.get(p.getObjectID()); /* If the Provider is not persistent, then we only have to * worry about in-memory dependencies. Otherwise, we have to * integrate the 2. */ if (! p.isPersistent()) { return (deps == nul...
protected List getProviders (Dependent d) throws StandardException {
private List getProviders (Dependent d) throws StandardException {
protected List getProviders (Dependent d) throws StandardException { List deps = (List) dependents.get(d.getObjectID()); /* If the Dependent is not persistent, then we only have to * worry about in-memory dependencies. Otherwise, we have to * integrate the 2. */ if (! d.isPersistent()) { return (deps == n...
)
), (Provider) null
protected List getProviders (Dependent d) throws StandardException { List deps = (List) dependents.get(d.getObjectID()); /* If the Dependent is not persistent, then we only have to * worry about in-memory dependencies. Otherwise, we have to * integrate the 2. */ if (! d.isPersistent()) { return (deps == n...
public CompilerContext pushCompilerContext(SchemaDescriptor sd);
public CompilerContext pushCompilerContext();
public CompilerContext pushCompilerContext(SchemaDescriptor sd);
public QueryTreeNode parseStatement(String statementSQLText)
public QueryTreeNode parseStatement(String statementSQLText, Object[] paramDefaults)
public QueryTreeNode parseStatement(String statementSQLText) throws StandardException;
public BasicProviderInfo( UUID uuid, DependableFinder dFinder, String providerName) { this.uuid = uuid; this.dFinder = dFinder; this.providerName = providerName; }
public BasicProviderInfo() {}
public BasicProviderInfo( UUID uuid, DependableFinder dFinder, String providerName) { this.uuid = uuid; this.dFinder = dFinder; this.providerName = providerName; }
FileContainer myContainer)
RawTransaction ntt, FileContainer myContainer)
protected boolean compress( FileContainer myContainer) throws StandardException { boolean all_pages_compressed = false; if (SanityManager.DEBUG) SanityManager.ASSERT(isLatched(), "page is not latched"); long last_valid_page = extent.compressPages(); if (last_valid_page >= 0) { ...
long last_valid_page = extent.compressPages();
int last_valid_page = extent.compress(owner, ntt, this);
protected boolean compress( FileContainer myContainer) throws StandardException { boolean all_pages_compressed = false; if (SanityManager.DEBUG) SanityManager.ASSERT(isLatched(), "page is not latched"); long last_valid_page = extent.compressPages(); if (last_valid_page >= 0) { ...
myContainer.truncatePages(last_valid_page);
myContainer.truncatePages(extent.getPagenum(last_valid_page));
protected boolean compress( FileContainer myContainer) throws StandardException { boolean all_pages_compressed = false; if (SanityManager.DEBUG) SanityManager.ASSERT(isLatched(), "page is not latched"); long last_valid_page = extent.compressPages(); if (last_valid_page >= 0) { ...
String str = "*** Alloc page ***\n" + super.toString();
String str = "*** Alloc page ***\n" + "nextAllocPageNumber = " + nextAllocPageNumber + "\nnextAllocPageOffset = " + nextAllocPageOffset + "\nreserved1 = " + reserved1 + "\nreserved2 = " + reserved2 + "\nreserved3 = " + reserved3 + "\nrese...
public String toString() { if (SanityManager.DEBUG) { String str = "*** Alloc page ***\n" + super.toString(); return str; } else return null; }
}
public String toString() { if (SanityManager.DEBUG) { String str = "*** Alloc page ***\n" + super.toString(); return str; } else return null; }
protected abstract void truncatePages(long lastValidPagenum);
protected abstract void truncatePages(long lastValidPagenum) throws StandardException;
protected abstract void truncatePages(long lastValidPagenum);
initSlotTable();
initSlotTable(newIdentity);
protected void initFromData( FileContainer myContainer, PageKey newIdentity) throws StandardException { if (myContainer != null) { // read in info about page stored once in the container header. spareSpace = myContainer.getSpareSpace(); minimumRecordSize = myContainer.ge...
RemoveFileOperation(String name, long generationId, boolean removeAtOnce)
public RemoveFileOperation()
RemoveFileOperation(String name, long generationId, boolean removeAtOnce) { this.name = name; this.generationId = generationId; this.removeAtOnce = removeAtOnce; }
this.name = name; this.generationId = generationId; this.removeAtOnce = removeAtOnce;
RemoveFileOperation(String name, long generationId, boolean removeAtOnce) { this.name = name; this.generationId = generationId; this.removeAtOnce = removeAtOnce; }
if(phase == PH_HARD_UPGRADE) {
passed = caseNegValueSupportedLogRecord(conn, phase) && passed; if(phase == PH_HARD_UPGRADE) {
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; ...
protected static String findCodeBase(boolean[] isJar)
public static String findCodeBase(boolean[] isJar)
protected static String findCodeBase(boolean[] isJar) { String classpath = System.getProperty("java.class.path"); char sep = '/'; ZipInfoProperties zip[]= org.apache.derby.impl.tools.sysinfo.Main.getAllInfo (classpath); for (int i = 0; i < zip.length; i++) { // it's a url so should just have forward slashes ...
if (SanityManager.DEBUG) { if (constantAction instanceof DDLConstantAction) SanityManager.THROWASSERT("DDL NOT SUPPORTED IN TRIGGER");
if (constantAction instanceof DDLConstantAction) { throw StandardException.newException(SQLState.LANG_NO_DDL_IN_TRIGGER, triggerd.getName(), constantAction.toString());
public void validateStatement(ConstantAction constantAction) throws StandardException { if (SanityManager.DEBUG) { if (constantAction instanceof DDLConstantAction) SanityManager.THROWASSERT("DDL NOT SUPPORTED IN TRIGGER"); } /* ** No INSERT/UPDATE/DELETE on trigger table ** for a before trigger. */ else ...
** No INSERT/UPDATE/DELETE on trigger table ** for a before trigger.
** No INSERT/UPDATE/DELETE for a before trigger.
public void validateStatement(ConstantAction constantAction) throws StandardException { if (SanityManager.DEBUG) { if (constantAction instanceof DDLConstantAction) SanityManager.THROWASSERT("DDL NOT SUPPORTED IN TRIGGER"); } /* ** No INSERT/UPDATE/DELETE on trigger table ** for a before trigger. */ else ...
if (constantAction.modifiesTableId(targetTableId)) { throw StandardException.newException(SQLState.LANG_NO_DML_IN_TRIGGER, triggerd.getName(), targetTableName); }
throw StandardException.newException(SQLState.LANG_NO_DML_IN_TRIGGER, triggerd.getName(), targetTableName);
public void validateStatement(ConstantAction constantAction) throws StandardException { if (SanityManager.DEBUG) { if (constantAction instanceof DDLConstantAction) SanityManager.THROWASSERT("DDL NOT SUPPORTED IN TRIGGER"); } /* ** No INSERT/UPDATE/DELETE on trigger table ** for a before trigger. */ else ...
* result columns are either grouping columns or valid * grouped aggregate expressions - the only column references allowed * outside of an aggregage are columns in the group by list.
* result columns are either grouping expressions or valid * grouped aggregate expressions - the only column references * allowed outside of an aggregate are columns in expressions in * the group by list.
public void bindExpressions(FromList fromListParam) throws StandardException { int fromListParamSize = fromListParam.size(); int fromListSize = fromList.size(); int numDistinctAggs; if (SanityManager.DEBUG) SanityManager.ASSERT(fromList != null && resultColumns != null, "Both fromList and resultColumns are ...
if (groupByList != null) { groupByList.preprocess(numTables, fromList, whereSubquerys, wherePredicates); }
public ResultSetNode preprocess(int numTables, GroupByList gbl, FromList fl) throws StandardException { ResultSetNode newTop = this; /* Put the expression trees in conjunctive normal form. * NOTE - This needs to occur before we preprocess the subqueries * because the subquery transformatio...
t_wrapper();
public void startTestConnectionMethods_Embedded() { t_createClob(); t_createBlob(); t_createNClob(); t_createSQLXML(); t_isValid_Embed(); t_setClientInfo1(); t_setClientInfo2(); t_getClientInfo1(); t_getClientInfo2(); }
this.userSuppliedOptimizerOverrides = userSuppliedOptimizerOverrides;
public RealTableScanStatistics(int numOpens, int rowsSeen, int rowsFiltered, long constructorTime, long openTime, long nextTime, long closeTime, int resultSetNumber, String tableName, String indexName, boolean isConstraint, Stri...
String header;
String header = "";
public String getStatementExecutionPlanText(int depth) { String header; String isolationString = null; initFormatInfo(depth); if (indexName != null) { header = indent + MessageService.getTextMessage( SQLState.RTS_IS_RS_USING, tableName, MessageService.getTextMessage( ...
header =
header = header +
public String getStatementExecutionPlanText(int depth) { String header; String isolationString = null; initFormatInfo(depth); if (indexName != null) { header = indent + MessageService.getTextMessage( SQLState.RTS_IS_RS_USING, tableName, MessageService.getTextMessage( ...
public static String sortProperties( Properties list, String indent )
public static String sortProperties( Properties list )
public static String sortProperties( Properties list, String indent ) { int size = list == null ? 0 : list.size(); int count = 0; String[] array = new String[size]; String key; String value; StringBuffer buffer; // Calculate the number of properties in the property list and // build an array of all ...
int size = list == null ? 0 : list.size(); int count = 0; String[] array = new String[size]; String key; String value; StringBuffer buffer; if (list != null) { for (Enumeration propertyNames = list.propertyNames(); propertyNames.hasMoreElements(); ) { if (count == size) { size = size*2; String[] expand...
return sortProperties(list, null);
public static String sortProperties( Properties list, String indent ) { int size = list == null ? 0 : list.size(); int count = 0; String[] array = new String[size]; String key; String value; StringBuffer buffer; // Calculate the number of properties in the property list and // build an array of all ...
if (ref.getBeginOffset() == -1) { continue; }
private boolean bindReferencesClause(DataDictionary dd) throws StandardException { validateReferencesClause(dd); StringBuffer newText = new StringBuffer(); boolean regenNode = false; int start = 0; if (isRow) { /* ** For a row trigger, we find all column references. If ** they are referencing NEW or OLD w...
if(tn != null) { if(tn.getSchemaName() == null && correlationName == null) tn.bind(this.getDataDictionary()); }
public TableName getTableName() throws StandardException { TableName tn; tn = super.getTableName(); return (tn != null ? tn : tableName); }
row.append(new String(s.getBytes(i)));
row.append(s.getBytes(i).toString());
public static void dumpRS(ResultSet s) throws SQLException { SecurityCheck.inspect(s, "java.sql.ResultSet"); if (s == null) { System.out.println("<NULL>"); return; } ResultSetMetaData rsmd = s.getMetaData(); SecurityCheck.inspect(rsmd, "java.sql.ResultSetMetaData"); // Get the number of columns in the res...
try { statement.setQueryTimeout(timeout); } catch (SQLException e) { sqlException = e;
if (timeout > 0) { try { statement.setQueryTimeout(timeout); } catch (SQLException e) { sqlException = e; }
public StatementExecutor(PreparedStatement statement, boolean doFetch, int timeout) { this.statement = statement; this.doFetch = doFetch; this.timeout = timeout; highestRunTime = 0; sqlE...
exec(conn, "drop table " + tablePrefix + "0", ignore); exec(conn, "drop table " + tablePrefix + "1", ignore); exec(conn, "drop table " + tablePrefix + "2", ignore); exec(conn, "drop table " + tablePrefix + "3", ignore); exec(conn, "drop table " + tablePrefix + "4", ignore); exec(conn, "drop table " + tablePrefix + "5",...
exec(conn, "drop table " + tablePrefix + "_orig", ignore); exec(conn, "drop table " + tablePrefix + "_copy", ignore);
private static void dropTables(Connection conn, String tablePrefix) throws TestFailedException { Collection ignore = new HashSet(); ignore.add(SQLState.LANG_OBJECT_DOES_NOT_EXIST.substring(0,5)); exec(conn, "drop table " + tablePrefix + "0", ignore); exec(con...
PreparedStatement statement = null;
Statement statement = null;
private static void exec(Connection connection, String queryString, Collection ignoreExceptions) throws TestFailedException { PreparedStatement statement = null; try { statement = connection.prepareStatement(queryS...
statement = connection.prepareStatement(queryString); statement.execute();
statement = connection.createStatement(); statement.execute(queryString);
private static void exec(Connection connection, String queryString, Collection ignoreExceptions) throws TestFailedException { PreparedStatement statement = null; try { statement = connection.prepareStatement(queryS...
+ tablePrefix + "5 select " + tablePrefix + "3.a+" + tablePrefix + "x.a," + tablePrefix + "3.b from " + tablePrefix + "3 left join " + tablePrefix + "3 as " + tablePrefix + "x on 1=1";
+ tablePrefix + "_copy select a from " + tablePrefix + "_orig where DELAY(1,1)=1";
private static String getExecQuery(String tablePrefix) { return "insert into " + tablePrefix + "5 select " + tablePrefix + "3.a+" + tablePrefix + "x.a," + tablePrefix + "3.b from " + tablePrefix + "3 left join " + tablePrefix + "3 as " ...
return "select " + tablePrefix + "4.a+" + tablePrefix + "3.a," + tablePrefix + "4.b||" + tablePrefix + "3.b from " + tablePrefix + "4 left join " + tablePrefix + "3 on 1=1 where mod(" + tablePrefix + "4.a+" + tablePrefix + "3.a,1000)=0";
return "select a from " + tablePrefix + "_orig where mod(DELAY(1,a),3)=0";
private static String getFetchQuery(String tablePrefix) { return "select " + tablePrefix + "4.a+" + tablePrefix + "3.a," + tablePrefix + "4.b||" + tablePrefix + "3.b from " + tablePrefix + "4 left join " + tablePrefix + "3 on 1=1 where mod(...
Connection conn1 = null; Connection conn2 = null;
Connection[] connections = new Connection[CONNECTIONS]; for (int i = 0; i < connections.length; ++i) { connections[i] = null; }
public void go(String[] args) { System.out.println("Test SetQueryTimeoutTest starting"); Connection conn1 = null; Connection conn2 = null; try { // Load the JDBC Driver class // use the ij utility to read the property file and // create connect...
conn1 = ij.startJBMS(); conn2 = ij.startJBMS();
for (int i = 0; i < connections.length; ++i) { connections[i] = ij.startJBMS(); }
public void go(String[] args) { System.out.println("Test SetQueryTimeoutTest starting"); Connection conn1 = null; Connection conn2 = null; try { // Load the JDBC Driver class // use the ij utility to read the property file and // create connect...
conn1.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED); conn2.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
public void go(String[] args) { System.out.println("Test SetQueryTimeoutTest starting"); Connection conn1 = null; Connection conn2 = null; try { // Load the JDBC Driver class // use the ij utility to read the property file and // create connect...
prepareForTimedQueries(conn1); testTimeoutWithFetch(conn1, conn2); testTimeoutWithExec(conn1, conn2); testInvalidTimeoutValue(conn1);
for (int i = 0; i < connections.length; ++i) { connections[i].setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED); } prepareForTimedQueries(connections[0]); testTimeoutWithFetch(connections[0], connections[1]); testTimeoutWithExec(connections); testInvalidTimeoutValue(connections[0]);
public void go(String[] args) { System.out.println("Test SetQueryTimeoutTest starting"); Connection conn1 = null; Connection conn2 = null; try { // Load the JDBC Driver class // use the ij utility to read the property file and // create connect...
if (conn2 != null) { try { conn2.close(); } catch (SQLException ex) { printSQLException(ex); } } if (conn1 != null) { try { conn1.close(); } catch (SQLException ex) { printSQLException(ex);
for (int i = connections.length - 1; i >= 0; --i) { if (connections[i] != null) { try { connections[i].close(); } catch (SQLException ex) { printSQLException(ex); }
public void go(String[] args) { System.out.println("Test SetQueryTimeoutTest starting"); Connection conn1 = null; Connection conn2 = null; try { // Load the JDBC Driver class // use the ij utility to read the property file and // create connect...
prepareTables(conn, "u"); prepareTables(conn, "v"); prepareTables(conn, "x");
private static void prepareForTimedQueries(Connection conn) throws TestFailedException { System.out.println("Preparing for testing queries with timeout"); try { conn.setAutoCommit(true); } catch (SQLException e) { throw new TestFailedException("Should ...
"create table " + tablePrefix + "1 (a int, b char(1))");
"create table " + tablePrefix + "_orig (a int)");
private static void prepareTables(Connection conn, String tablePrefix) throws TestFailedException { System.out.println("Initializing tables with prefix " + tablePrefix); dropTables(conn, tablePrefix); exec(conn, "create table " + tablePrefix + "1 (a int,...
"create table " + tablePrefix + "2 (a int, b char(2))"); exec(conn, "create table " + tablePrefix + "3 (a int, b char(4))"); exec(conn, "create table " + tablePrefix + "4 (a int, b char(6))"); exec(conn, "create table " + tablePrefix + "5 (a int, b char(8))");
"create table " + tablePrefix + "_copy (a int)");
private static void prepareTables(Connection conn, String tablePrefix) throws TestFailedException { System.out.println("Initializing tables with prefix " + tablePrefix); dropTables(conn, tablePrefix); exec(conn, "create table " + tablePrefix + "1 (a int,...
+ tablePrefix + "1" + " values(3,'a')" + ",(7,'b')" + ",(13,'c')" + ",(37,'d')" + ",(141,'e')" + ",(1,'f')"); exec(conn, "insert into " + tablePrefix + "2 select " + tablePrefix + "1.a+" + tablePrefix + "x.a," + tablePrefix + "1.b||" + tablePrefix + "x.b from " + tablePrefix + "1 join " + tablePrefix + "1 as " + tabl...
+ tablePrefix + "_orig" + " values(0),(1),(2),(3),(4),(5),(6)");
private static void prepareTables(Connection conn, String tablePrefix) throws TestFailedException { System.out.println("Initializing tables with prefix " + tablePrefix); dropTables(conn, tablePrefix); exec(conn, "create table " + tablePrefix + "1 (a int,...
private static void testTimeoutWithExec(Connection conn1, Connection conn2)
private static void testTimeoutWithExec(Connection[] connections)
private static void testTimeoutWithExec(Connection conn1, Connection conn2) throws TestFailedException { System.out.println("Testing timeout with an execute operation"); try { conn1.setAutoCommit(true); conn2.setAuto...
try { conn1.setAutoCommit(true); conn2.setAutoCommit(true); } catch (SQLException e) { throw new TestFailedException("Should not happen", e);
for (int i = 0; i < connections.length; ++i) { try { connections[i].setAutoCommit(true); } catch (SQLException e) { throw new TestFailedException("Should not happen", e); }
private static void testTimeoutWithExec(Connection conn1, Connection conn2) throws TestFailedException { System.out.println("Testing timeout with an execute operation"); try { conn1.setAutoCommit(true); conn2.setAuto...
PreparedStatement statementA = prepare(conn1, getExecQuery("t")); PreparedStatement statementB = prepare(conn2, getExecQuery("u")); StatementExecutor exec0 = new StatementExecutor(statementA, false, TIMEOUT); StatementExecutor exec1 = new StatementExecutor(statementB, false, 0); exec1.start(); exec0.start();
PreparedStatement statements[] = new PreparedStatement[connections.length]; for (int i = 0; i < statements.length; ++i) { statements[i] = prepare(connections[i], getExecQuery("t")); }
private static void testTimeoutWithExec(Connection conn1, Connection conn2) throws TestFailedException { System.out.println("Testing timeout with an execute operation"); try { conn1.setAutoCommit(true); conn2.setAuto...
try { exec0.join(); exec1.join(); } catch (InterruptedException e) { throw new TestFailedException("Should never happen", e);
StatementExecutor[] executors = new StatementExecutor[statements.length]; for (int i = 0; i < executors.length; ++i) { int timeout = (i % 2 == 0) ? TIMEOUT : 0; executors[i] = new StatementExecutor(statements[i], false, timeout); } for (int i = 0; i < executors.length; ++i) { executors[i].start(); } for (int i = 0; i...
private static void testTimeoutWithExec(Connection conn1, Connection conn2) throws TestFailedException { System.out.println("Testing timeout with an execute operation"); try { conn1.setAutoCommit(true); conn2.setAuto...
expectException(SQLState.LANG_STATEMENT_CANCELLED_OR_TIMED_OUT, exec0.getSQLException(), "exec did not time out. Execution time: " + exec0.getHighestRunTime() + " ms"); System.out.println("Statement 0 timed out"); SQLException sqlException = exec1.getSQLException(); if (sqlException != null) { throw new TestFailedExc...
for (int i = 0; i < executors.length; ++i) { int timeout = (i % 2 == 0) ? TIMEOUT : 0; if (timeout > 0) { expectException(SQLState.LANG_STATEMENT_CANCELLED_OR_TIMED_OUT, executors[i].getSQLException(), "exec did not time out. Execution time: " + executors[i].getHighestRunTime() + " ms"); } else { SQLException sqlExcept...
private static void testTimeoutWithExec(Connection conn1, Connection conn2) throws TestFailedException { System.out.println("Testing timeout with an execute operation"); try { conn1.setAutoCommit(true); conn2.setAuto...
System.out.println("Statement 1 completed"); try { statementA.close(); statementB.close(); } catch (SQLException e) { throw new TestFailedException(e);
System.out.println("Statements that should time out timed out, and statements that should complete completed"); for (int i = 0; i < statements.length; ++i) { try { statements[i].close(); } catch (SQLException e) { throw new TestFailedException(e); }
private static void testTimeoutWithExec(Connection conn1, Connection conn2) throws TestFailedException { System.out.println("Testing timeout with an execute operation"); try { conn1.setAutoCommit(true); conn2.setAuto...
PreparedStatement statementB = prepare(conn1, getFetchQuery("u")); PreparedStatement statementC = prepare(conn2, getFetchQuery("v")); PreparedStatement statementD = prepare(conn2, getFetchQuery("x"));
PreparedStatement statementB = prepare(conn1, getFetchQuery("t")); PreparedStatement statementC = prepare(conn2, getFetchQuery("t")); PreparedStatement statementD = prepare(conn2, getFetchQuery("t"));
private static void testTimeoutWithFetch(Connection conn1, Connection conn2) throws TestFailedException { System.out.println("Testing timeout with fetch operations"); try { conn1.setAutoCommit(false); conn2.setAutoC...
if ( idString == null )
if ( connString == null )
public String toString() { if ( idString == null ) { idString = Integer.toString(getLanguageConnection().getInstanceNumber()); } return idString; }
idString = Integer.toString(getLanguageConnection().getInstanceNumber()); }
LanguageConnectionContext lcc = getLanguageConnection(); connString = this.getClass().getName() + "@" + this.hashCode() + " " + lcc.xidStr + lcc.getTransactionExecute().getTransactionIdString() + "), " + lcc.lccStr + Integer.toString(lcc.getInstanceNumber()) + "), " + lcc.dbnameStr + lcc.getDbname() + "), " + lcc.drda...
public String toString() { if ( idString == null ) { idString = Integer.toString(getLanguageConnection().getInstanceNumber()); } return idString; }
return idString;
return connString;
public String toString() { if ( idString == null ) { idString = Integer.toString(getLanguageConnection().getInstanceNumber()); } return idString; }
public static SQLWarning newEmbedSQLWarning(String messageId, Object arg) { return new EmbedSQLWarning( MessageService.getCompleteMessage(messageId, new Object[] {arg}), StandardException.getSQLStateFromIdentifier(messageId));
public static SQLWarning newEmbedSQLWarning(String messageId) { return newEmbedSQLWarning(messageId, null);
public static SQLWarning newEmbedSQLWarning(String messageId, Object arg) { return new EmbedSQLWarning( MessageService.getCompleteMessage(messageId, new Object[] {arg}), StandardException.getSQLStateFromIdentifier(messageId)); }
public FormatableBitSet bindResultColumnsByName(TableDescriptor targetTableDescriptor, DMLStatementNode statement)
public void bindResultColumnsByName(TableDescriptor targetTableDescriptor)
public FormatableBitSet bindResultColumnsByName(TableDescriptor targetTableDescriptor, DMLStatementNode statement) throws StandardException { int size = size(); FormatableBitSet columnBitSet = new FormatableBitSet( targetTableDescriptor.getNumberOfColumns()); ...
FormatableBitSet columnBitSet = new FormatableBitSet( targetTableDescriptor.getNumberOfColumns());
public FormatableBitSet bindResultColumnsByName(TableDescriptor targetTableDescriptor, DMLStatementNode statement) throws StandardException { int size = size(); FormatableBitSet columnBitSet = new FormatableBitSet( targetTableDescriptor.getNumberOfColumns()); ...
int colIdx = rc.getColumnPosition() - 1; if( SanityManager.DEBUG) SanityManager.ASSERT( colIdx >= 0 && colIdx < targetTableDescriptor.getNumberOfColumns(), "Invalid column position found for " + rc.getName()); if( statement != null && columnBitSet.isSet( colIdx)) { String colName = rc.getName(); if (statement instanc...
public FormatableBitSet bindResultColumnsByName(TableDescriptor targetTableDescriptor, DMLStatementNode statement) throws StandardException { int size = size(); FormatableBitSet columnBitSet = new FormatableBitSet( targetTableDescriptor.getNumberOfColumns()); ...
return columnBitSet; }
}
public FormatableBitSet bindResultColumnsByName(TableDescriptor targetTableDescriptor, DMLStatementNode statement) throws StandardException { int size = size(); FormatableBitSet columnBitSet = new FormatableBitSet( targetTableDescriptor.getNumberOfColumns()); ...
return newResultColumn;
if (isGroupingColumn()) newResultColumn.markAsGroupingColumn(); return newResultColumn;
ResultColumn cloneMe() throws StandardException { ResultColumn newResultColumn; ValueNode cloneExpr; /* If expression is a ColumnReference, then we want to * have the RC's clone have a clone of the ColumnReference * for it's expression. This is for the special case of * cloning the SELECT list for the HAVI...
ResultColumnDescriptor[] makeResultDescriptors(ExecutionContext ec)
public ResultColumnDescriptor[] makeResultDescriptors()
ResultColumnDescriptor[] makeResultDescriptors(ExecutionContext ec) { ResultColumnDescriptor colDescs[] = new ResultColumnDescriptor[size()]; int size = size(); for (int index = 0; index < size; index++) { // the ResultColumn nodes are descriptors, so take 'em... colDescs[index] = ec.getExecutio...
ResultColumnDescriptor colDescs[] = new ResultColumnDescriptor[size()]; int size = size(); for (int index = 0; index < size; index++) { colDescs[index] = ec.getExecutionFactory().getResultColumnDescriptor(((ResultColumnDescriptor) elementAt(index))); } return colDescs;
ExecutionContext ec = (ExecutionContext) getContextManager().getContext( ExecutionContext.CONTEXT_ID); return makeResultDescriptors(ec);
ResultColumnDescriptor[] makeResultDescriptors(ExecutionContext ec) { ResultColumnDescriptor colDescs[] = new ResultColumnDescriptor[size()]; int size = size(); for (int index = 0; index < size; index++) { // the ResultColumn nodes are descriptors, so take 'em... colDescs[index] = ec.getExecutio...
if (sqlState.startsWith("08")) {
if (sqlState.startsWith(SQLState.CONNECTIVITY_PREFIX)) {
public SQLException getSQLException(String message, String messageId, SQLException next, int severity, Throwable t, Object[] args) { String sqlState = StandardException.getSQLStateFromIdentifier(messageId); SQLException ex = new SQLException(message, sqlState, severity, t); if (sqlSt...
} else if (sqlState.startsWith("22")) {
} else if (sqlState.startsWith(SQLState.SQL_DATA_PREFIX)) {
public SQLException getSQLException(String message, String messageId, SQLException next, int severity, Throwable t, Object[] args) { String sqlState = StandardException.getSQLStateFromIdentifier(messageId); SQLException ex = new SQLException(message, sqlState, severity, t); if (sqlSt...
} else if (sqlState.startsWith("23")) {
} else if (sqlState.startsWith(SQLState.INTEGRITY_VIOLATION_PREFIX)) {
public SQLException getSQLException(String message, String messageId, SQLException next, int severity, Throwable t, Object[] args) { String sqlState = StandardException.getSQLStateFromIdentifier(messageId); SQLException ex = new SQLException(message, sqlState, severity, t); if (sqlSt...
} else if (sqlState.startsWith("28")) {
} else if (sqlState.startsWith(SQLState.AUTHORIZATION_PREFIX)) {
public SQLException getSQLException(String message, String messageId, SQLException next, int severity, Throwable t, Object[] args) { String sqlState = StandardException.getSQLStateFromIdentifier(messageId); SQLException ex = new SQLException(message, sqlState, severity, t); if (sqlSt...
else if (sqlState.startsWith("40")) {
else if (sqlState.startsWith(SQLState.TRANSACTION_PREFIX)) {
public SQLException getSQLException(String message, String messageId, SQLException next, int severity, Throwable t, Object[] args) { String sqlState = StandardException.getSQLStateFromIdentifier(messageId); SQLException ex = new SQLException(message, sqlState, severity, t); if (sqlSt...