From: Dirk H Bartley Date: Fri, 5 Mar 2010 04:30:30 +0000 (-0500) Subject: This adds sql debugging to these classes that Eric wrote. X-Git-Tag: Release-5.0.2~174^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b0ee8cf2eb21e08f4866b99f2701b6570182074d;p=bacula%2Fbacula This adds sql debugging to these classes that Eric wrote. --- diff --git a/bacula/src/qt-console/mediainfo/mediainfo.cpp b/bacula/src/qt-console/mediainfo/mediainfo.cpp index 1f11f12c4f..8673d7d783 100644 --- a/bacula/src/qt-console/mediainfo/mediainfo.cpp +++ b/bacula/src/qt-console/mediainfo/mediainfo.cpp @@ -144,6 +144,9 @@ void MediaInfo::populateForm() "LEFT JOIN Location ON (Media.LocationId=Location.LocationId) " "WHERE Media.VolumeName='" + m_mediaName + "'"; + if (mainWin->m_sqlDebug) { + Pmsg1(000, "MediaInfo query cmd : %s\n",query.toUtf8().data()); + } QStringList results; if (m_console->sql_cmd(query, results)) { QString resultline; @@ -211,6 +214,9 @@ void MediaInfo::populateForm() "FROM Job JOIN JobMedia USING (JobId) JOIN Media USING (MediaId) " "WHERE Media.VolumeName = '" + m_mediaName + "'"; + if (mainWin->m_sqlDebug) { + Pmsg1(000, "MediaInfo query cmd : %s\n",query.toUtf8().data()); + } results.clear(); if (m_console->sql_cmd(query, results)) { QString resultline; diff --git a/bacula/src/qt-console/medialist/mediaview.cpp b/bacula/src/qt-console/medialist/mediaview.cpp index edcc55a1cf..b3fb58c7ee 100644 --- a/bacula/src/qt-console/medialist/mediaview.cpp +++ b/bacula/src/qt-console/medialist/mediaview.cpp @@ -287,6 +287,9 @@ void MediaView::populateTable() "WHERE VolStatus IN ('Full', 'Used') " "GROUP BY MediaType"; + if (mainWin->m_sqlDebug) { + Pmsg1(000, "MediaView query cmd : %s\n",query.toUtf8().data()); + } if (m_console->sql_cmd(query, results)) { foreach (resultline, results) { fieldlist = resultline.split("\t"); @@ -308,9 +311,11 @@ void MediaView::populateTable() + cmd + " ORDER BY VolumeName LIMIT " + m_sbLimit->cleanText(); -// Pmsg1(000, "MediaView query cmd : %s\n",query.toUtf8().data()); m_tableMedia->setSortingEnabled(false); /* Don't sort during insert */ results.clear(); + if (mainWin->m_sqlDebug) { + Pmsg1(000, "MediaView query cmd : %s\n",query.toUtf8().data()); + } if (m_console->sql_cmd(query, results)) { int row=0; filterExipired(results);