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

Removed debugging prints

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