提交 b04995eb authored 作者: Owner's avatar Owner

Removed debugging prints

上级 d802024e
......@@ -5224,8 +5224,8 @@ public class Parser {
String[] cols = null;
Database db = targetSession.getDatabase();
System.out.println("systemSessionId="+database.getSystemSession().getId());
System.out.println("sessionId="+session.getId());
//System.out.println("systemSessionId="+database.getSystemSession().getId());
//System.out.println("sessionId="+session.getId());
// column names are now optional - they can be inferred from the named
// query, if not supplied by user
......@@ -5257,7 +5257,7 @@ public class Parser {
cteViewName);
}
if(isPersistent){
System.out.println("parseSingleCommonTableExpression removeSchemaObject "+oldViewFound.getName());
//System.out.println("parseSingleCommonTableExpression removeSchemaObject "+oldViewFound.getName());
oldViewFound.lock(targetSession, true, true);
targetSession.getDatabase().removeSchemaObject(targetSession, oldViewFound);
......
......@@ -84,9 +84,9 @@ public class DropView extends SchemaCommand {
for( Table childTable: copyOfDependencies){
if(TableType.VIEW == childTable.getTableType()){
TableView childTableView = (TableView) childTable;
System.out.println("considering dep "+childTableView.getName());
//System.out.println("considering dep "+childTableView.getName());
if(childTableView.isTableExpression() && childTableView.getName()!=null){
System.out.println("removing "+childTableView.getName());
//System.out.println("removing "+childTableView.getName());
session.getDatabase().removeSchemaObject(session, childTableView);
}
}
......
......@@ -764,12 +764,12 @@ public class Database implements DataHandler {
MetaRecord rec = new MetaRecord(cursor.get());
objectIds.set(rec.getId());
records.add(rec);
System.out.println("Loaded:"+rec.toString());
//System.out.println("Loaded:"+rec.toString());
}
Collections.sort(records);
synchronized (systemSession) {
for (MetaRecord rec : records) {
System.out.println("Executing:"+rec.toString());
//System.out.println("Executing:"+rec.toString());
rec.execute(this, systemSession, eventListener);
}
}
......@@ -1071,7 +1071,7 @@ public class Database implements DataHandler {
* @param obj the object to add
*/
public void addSchemaObject(Session session, SchemaObject obj) {
System.out.println("addSchemaObject="+obj.getName()+",sessionId="+session.getId()+",obj="+obj);
//System.out.println("addSchemaObject="+obj.getName()+",sessionId="+session.getId()+",obj="+obj);
int id = obj.getId();
if (id > 0 && !starting) {
......@@ -1939,7 +1939,7 @@ public class Database implements DataHandler {
return false;
}
synchronized (this) {
String savedName = obj.getName();
//String savedName = obj.getName();
Comment comment = findComment(obj);
if (comment != null) {
removeDatabaseObject(session, comment);
......@@ -1957,12 +1957,10 @@ public class Database implements DataHandler {
}
else{
System.out.println("Starting database detected");
}
System.out.println("Removing db object id - also remove meta lock from session and session lock from meta, id="+id+",sessionId="+session.getId()+",name="+savedName+",obj="+obj);
if("TREE_CTE".equals(savedName)){
new RuntimeException("TREE_CTE distruction").printStackTrace();
//System.out.println("Starting database detected");
}
//System.out.println("Removing db object id - also remove meta lock from session and session lock from meta, id="+id+",sessionId="+session.getId()+",name="+savedName+",obj="+obj);
removeMeta(session, id);
flushDeferredRemoveSchemaObject();
......@@ -1979,15 +1977,15 @@ public class Database implements DataHandler {
while(i.hasNext()){
Entry<SchemaObject, Session> pair = i.next();
i.remove();
System.out.println("re-attempting deferred removal="+pair.getKey().getName()+",size="+removeSchemaObjectQueue.size());
//System.out.println("re-attempting deferred removal="+pair.getKey().getName()+",size="+removeSchemaObjectQueue.size());
progress = removeSchemaObject(pair.getValue(),pair.getKey());
if(progress){
System.out.println("completed deferred removal="+pair.getKey().getName()+",size="+removeSchemaObjectQueue.size());
//System.out.println("completed deferred removal="+pair.getKey().getName()+",size="+removeSchemaObjectQueue.size());
unlockMeta(pair.getValue());
}
}
}
System.out.println("flushDeferredRemoveSchemaObject.remove_q_size="+removeSchemaObjectQueue.size());
//System.out.println("flushDeferredRemoveSchemaObject.remove_q_size="+removeSchemaObjectQueue.size());
if(removeSchemaObjectQueue.size()!=0){
traceLock();
}
......
......@@ -428,13 +428,13 @@ public class MVTable extends TableBase {
public boolean isLockedExclusivelyBy(Session session) {
Session localSession = lockExclusiveSession;
if(localSession!=null){
System.out.println("Meta was locked by "+localSession.getId()+" tested for "+session.getId());
//System.out.println("Meta was locked by "+localSession.getId()+" tested for "+session.getId());
if(lockExclusiveSessionStackTrace!=null){
lockExclusiveSessionStackTrace.printStackTrace();
}
}
else{
System.out.println("Meta was not locked by anyone, tested for "+session.getId());
//System.out.println("Meta was not locked by anyone, tested for "+session.getId());
}
return localSession == session;
}
......
......@@ -529,7 +529,7 @@ public abstract class Table extends SchemaObjectBase {
public void removeChildrenAndResources(Session session) {
while (dependentViews.size() > 0) {
TableView view = dependentViews.get(0);
System.out.println("removeChildrenAndResources.dependentViews:"+view.getName());
//System.out.println("removeChildrenAndResources.dependentViews:"+view.getName());
dependentViews.remove(0);
database.removeSchemaObject(session, view);
}
......@@ -841,9 +841,9 @@ public abstract class Table extends SchemaObjectBase {
* @param view the view to remove
*/
public void removeDependentView(TableView view) {
System.out.println("removeDependentView(Before):"+dependentViews.toString());
//System.out.println("removeDependentView(Before):"+dependentViews.toString());
dependentViews.remove(view);
System.out.println("removeDependentView(Left):"+dependentViews.toString());
//System.out.println("removeDependentView(Left):"+dependentViews.toString());
}
/**
......
......@@ -11,7 +11,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import org.h2.api.ErrorCode;
import org.h2.command.Parser;
import org.h2.command.Prepared;
import org.h2.command.dml.Query;
import org.h2.engine.Constants;
......@@ -514,7 +513,7 @@ public class TableView extends Table {
private void removeCurrentViewFromOtherTables() {
if (tables != null) {
for (Table t : tables) {
System.out.println("removeCurrentViewFromOtherTables:"+t.getName());
//System.out.println("removeCurrentViewFromOtherTables:"+t.getName());
t.removeDependentView(this);
}
tables.clear();
......@@ -714,19 +713,21 @@ public class TableView extends Table {
TableView view = new TableView(schema, id, name, querySQL,
parameters, columnTemplates, session,
true/* try recursive */, literalsChecked, isTableExpression );
System.out.println("create recursive view:"+view);
//System.out.println("create recursive view:"+view);
//if(shadowTable!=null){
// Parser.destroyShadowTableForRecursiveExpression(isPersistent, session, shadowTable);
//}
System.out.println("view.isRecursiveQueryDetected()="+view.isRecursiveQueryDetected());
//System.out.println("view.isRecursiveQueryDetected()="+view.isRecursiveQueryDetected());
// is not recursion detected ? if so - recreate it without recursion flag
if (!view.isRecursiveQueryDetected()) {
if(isPersistent){
db.addSchemaObject(session, view);
view.lock(session, true, true);
session.getDatabase().removeSchemaObject(session, view);
// during database startup - this method does not normally get called - and it needs to be
// to correctly un-register the table which the table expression uses...
view.removeChildrenAndResources(session);
}else{
session.removeLocalTempTable(view);
......@@ -734,7 +735,7 @@ public class TableView extends Table {
view = new TableView(schema, id, name, querySQL, parameters,
columnTemplates, session,
false/* detected not recursive */, literalsChecked, isTableExpression);
System.out.println("create nr view:"+view);
//System.out.println("create nr view:"+view);
}
return view;
......
......@@ -622,7 +622,7 @@ public class TestGeneralCommonTableQueries extends TestBase {
for(int queryRunTries=1;queryRunTries<=maxRetries;queryRunTries++){
System.out.println("==================================== Iteration #"+queryRunTries);
//System.out.println("==================================== Iteration #"+queryRunTries);
Statement stat = conn.createStatement();
stat.execute(SETUP_SQL);
......@@ -630,12 +630,12 @@ public class TestGeneralCommonTableQueries extends TestBase {
// close and re-open connection for one iteration to make sure the query work between connections
if(queryRunTries==closeAndReopenDatabaseConnectionOnIteration){
System.out.println("Reconnecting to database on iteration#"+queryRunTries+" of "+maxRetries);
//System.out.println("Reconnecting to database on iteration#"+queryRunTries+" of "+maxRetries);
conn.close();
conn = getConnection("commonTableExpressionQueries");
}
System.out.println("=========== test with query");
//System.out.println("=========== test with query");
prep = conn.prepareStatement(WITH_QUERY);
rs = prep.executeQuery();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论