formEncoding = getEncoding("FORM"); urlEncoding = getEncoding("URL"); setEncoding("FORM", formEncoding); setEncoding("URL", urlEncoding); SELECT *, (endTime - startTime) AS executionTime FROM qEvents WHERE type = 'SqlQuery' if( cfdebug_queries.recordCount eq 1 and not len(trim(cfdebug_queries.executionTime)) ) { querySetCell(cfdebug_queries, "executionTime", "0", 1); } cfdebug_queries = queryNew('ATTRIBUTES, BODY, CACHEDQUERY, CATEGORY, DATASOURCE, ENDTIME, EXECUTIONTIME, LINE, MESSAGE, NAME, PARENT, PRIORITY, RESULT, ROWCOUNT, STACKTRACE, STARTTIME, TEMPLATE, TIMESTAMP, TYPE, URL, et'); // no longer doing template query at the top since we have tree and summary mode bFoundTemplates = cfdebugger.check("Template"); if( bFoundTemplates ) { displayDebug=true; } if ( isDefined("cfdebugger.settings.general") and cfdebugger.settings.general ) { bGeneral = true; displayDebug=true; } if (IsDefined("cfdebug_ex") AND cfdebug_ex.recordCount GT 0) { bFoundExceptions = true; displayDebug=true; } else { bFoundExceptions = false; } if (IsDefined("cfdebug_queries") AND cfdebug_queries.RecordCount GT 0) { bFoundSQLQueries = true; displayDebug=true; } else { bFoundSQLQueries = false; } if (IsDefined("cfdebug_cfoql") AND cfdebug_cfoql.RecordCount GT 0) { bFoundObjectQueries = true; displayDebug=true; } else { bFoundObjectQueries = false; } if (IsDefined("cfdebug_storedproc") AND cfdebug_storedproc.RecordCount GT 0) { bFoundStoredProc = true; displayDebug=true; } else { bFoundStoredProc = false; } if (IsDefined("cfdebug_trace") AND cfdebug_trace.recordCount GT 0) { bFoundTrace = true; displayDebug=true; } else { bFoundTrace = false; } if (IsDefined("cfdebug_timer") AND cfdebug_timer.recordCount GT 0) { bFoundTimer = true; displayDebug=true; } else { bFoundTimer = false; } if (IsDefined("cfdebug_lock") AND cfdebug_lock.recordCount GT 0) { bFoundLocking = true; displayDebug=true; } else { bFoundLocking = false; } if (IsDefined("cfdebugger") AND cfdebugger.check("Variables")) { bFoundScopeVars = true; displayDebug=true; } else { bFoundScopeVars = false; }


SQL Queries

#cfdebug_queries.name# (Datasource=#cfdebug_queries.datasource#, Time=#Max(cfdebug_queries.executionTime, 0)#ms, Records=#Max(cfdebug_queries.rowcount, 0)#, Records=#cfdebug_queries.result.recordCount#, Cached Query) in #cfdebug_queries.template# @ #TimeFormat(cfdebug_queries.timestamp, "HH:mm:ss.SSS")#
#htmleditformat(cfdebug_queries.body)#
Query Parameter Value(s) -
Parameter ###x#(#thisParam.sqlType#) = #htmleditformat(thisParam.value)#

//UDF - Handle output of complex data types. function CFDebugSerializable(variable) { var ret = ""; try { if(IsSimpleValue(variable)) { ret = xmlFormat(variable); } else { if (IsStruct(variable)) { ret = ("Struct (" & StructCount(variable) & ")"); } else if(IsArray(variable)) { ret = ("Array (" & ArrayLen(variable) & ")"); } else if(IsQuery(variable)) { ret = ("Query (" & variable.RecordCount & ")"); } else { ret = ("Complex type"); } } } catch("any" ex) { ret = "undefined"; } return ret; } // UDF - tree writing function drawNode(nTree, indent, id, highlightThreshold) { var templateOuput = ""; if( nTree[id].duration GT highlightThreshold ) { templateOutput = "(#nTree[id].duration#ms) " & nTree[id].template & " @ line " & #nTree[id].line# & "
"; } else { templateOutput = "(#nTree[id].duration#ms) " & nTree[id].template & " @ line " & #nTree[id].line# & "
"; } writeOutput(repeatString("  ·", indent + 1) & " arrowtop level " & templateOutput); return ""; } function drawTree(tree, indent, id, highlightThreshold) { var alength = 1; var i = 1; var templateOuput = ""; if( structKeyExists(tree, id) ) { // top level nodes (application.cfm,cgi.script_name,etc) have a -1 parent line number if(tree[id].line EQ -1) { if( Tree[id].duration GT highlightThreshold ) { writeoutput( "top level " & "(#Tree[id].duration#ms) " & Tree[id].template & "
" ); } else { writeoutput( "top level " & "(#Tree[id].duration#ms) " & Tree[id].template & "
" ); } } else { if( Tree[id].duration GT highlightThreshold ) { templateOutput = "(#Tree[id].duration#ms) " & Tree[id].template & " @ line " & #Tree[id].line# & "
"; } else { templateOutput = "(#Tree[id].duration#ms) " & Tree[id].template & " @ line " & #Tree[id].line# & "
"; } writeoutput( repeatString("  ·", indent + 1) & " arrowtop level " & templateOutput ); } if( isArray( tree[id].children ) and arrayLen( tree[id].children ) ) { alength = arrayLen( tree[id].children ); for( i = 1; i lte alength; i = i + 1 ) { if( isArray(tree[id].children[i].children) and arrayLen( tree[id].children[i].children ) gt 0 ) { drawTree(tree, indent + 1, tree[id].children[i].templateid, highlightThreshold); } else { drawNode(tree, indent + 1, tree[id].children[i].templateid, highlightThreshold); } } } else { // single template, no includes? //drawNode(tree, indent + 1, tree[id].template, highlightThreshold); } } return ""; }