Skip to content

Commit

Permalink
ODBC-33 Release mode build fails due to debug code
Browse files Browse the repository at this point in the history
Some debug tracing was added recently ("DUMPTREE") that caused the
release build to break. This PR makes that trace code only enabled
during debug builds

Signed-off-by: Russ Whitehead <[email protected]>
  • Loading branch information
RussWhitehead committed Jun 4, 2015
1 parent 50527dd commit e76e45b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
4 changes: 0 additions & 4 deletions src/hpcc_drv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,7 @@ int OAIP_execute(IP_HDBC hdbc,
if (DAM_SUCCESS == iRetCode && szSqlBuffer[0])
sqlBuff.set(szSqlBuffer);
}
#ifdef _DEBUG
DUMP(sqlBuff.get());
#endif

//-----------------------------------
//execute the SELECT query
Expand Down Expand Up @@ -639,9 +637,7 @@ int OAIP_procedure(IP_HDBC hdbc, DAM_HSTMT hstmt, int iType, int *pi
}
if (iNumInputs)
sqlBuff.append(");");
#ifdef _DEBUG
DUMP(sqlBuff.str());
#endif

//----------------------------------------------------------
//Call HPCC to execute the stored procedure (Deployed Query)
Expand Down
2 changes: 0 additions & 2 deletions src/hpcc_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ int hpcc_exec(const char * sqlQuery, const char * targetQuerySet, HP
bool bRowAvail = pHPCCdb->ReadFirstRow(&pRow);
while (bRowAvail)
{
#ifdef _DEBUG
DUMPPTREE(pRow);
#endif
hrow = dam_allocRow(pStmtDA->dam_hstmt);//allocate a new row
aindex_t iNumColumns = pHPCCdb->queryOutputColumnDescriptorCount();
for (aindex_t col = 0; col < iNumColumns; col++)//iterate over each column in this row
Expand Down
8 changes: 0 additions & 8 deletions src/hpccdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,17 +616,13 @@ bool HPCCdb::executeSQL(const char * sql, const char * targetQuerySet, StringBuf
//-----------------
const char * resultXML = resp->getResult();

#ifdef _DEBUG
DUMP(resultXML);
#endif
Owned<IPropertyTree> resultsTree;
{
Owned<IPTreeMaker> maker = createRootLessPTreeMaker(ipt_ordered);
resultsTree.setown(createPTreeFromXMLString(resultXML, ipt_none, (PTreeReaderOptions)(ptr_noRoot | ptr_ignoreWhiteSpace), maker));
}
#ifdef _DEBUG
DUMPPTREE(resultsTree);
#endif
Owned<IPropertyTreeIterator> datasetIterator;
datasetIterator.setown(resultsTree->getElements("Dataset"));
ForEach(*datasetIterator)
Expand Down Expand Up @@ -808,17 +804,13 @@ bool HPCCdb::getMoreResults(const char * _wuid, const char * _dsName, aindex_t _
//-----------------
const char * resultXML = resp->getResult();

#ifdef _DEBUG
DUMP(resultXML);
#endif
Owned<IPropertyTree> resultsTree;
{
Owned<IPTreeMaker> maker = createRootLessPTreeMaker();
resultsTree.setown(createPTreeFromXMLString(resultXML, ipt_none, (PTreeReaderOptions)(ptr_noRoot | ptr_ignoreWhiteSpace), maker));
}
#ifdef _DEBUG
DUMPPTREE(resultsTree);
#endif
Owned<IPropertyTreeIterator> datasetIterator;
datasetIterator.setown(resultsTree->getElements("Dataset"));
ForEach(*datasetIterator)
Expand Down
3 changes: 3 additions & 0 deletions src/hpccdb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
#ifdef _DEBUG
#define DUMPPTREE(pt) {StringBuffer sb;toXML(pt,sb);OutputDebugString("\n");OutputDebugString(sb.str());OutputDebugString("\n");}
#define DUMP(s) {OutputDebugString("\n");OutputDebugString(s);OutputDebugString("\n");}
#else
#define DUMPPTREE(pt) {}
#define DUMP(s) {}
#endif

//---------------------------------------------
Expand Down

0 comments on commit e76e45b

Please sign in to comment.