From 72f8eb2a0f042dc34753afa193ab512a62a83bee Mon Sep 17 00:00:00 2001 From: Dirk H Bartley Date: Thu, 26 Jul 2007 17:26:24 +0000 Subject: [PATCH] Add a sort "ORDER BY" that seemed to be helpful with mysql and uncommented the lines that executed the commands. Looks like all that processing of the 'results' of the INSERT INTO and CREATE TABLE command does nothing. Can most likely just remove. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5244 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/restore/restoretree.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bacula/src/qt-console/restore/restoretree.cpp b/bacula/src/qt-console/restore/restoretree.cpp index 6f953e95f0..8ca2f467f4 100644 --- a/bacula/src/qt-console/restore/restoretree.cpp +++ b/bacula/src/qt-console/restore/restoretree.cpp @@ -148,11 +148,12 @@ void restoreTree::populateDirectoryTree() } QString cmd = - "SELECT DISTINCT Path.Path" + "SELECT DISTINCT Path.Path AS Path" " FROM Path" " LEFT OUTER JOIN File ON (File.PathId=Path.PathId)" " LEFT OUTER JOIN Job ON (File.JobId=Job.JobId)" - " WHERE Job.Jobid IN (" + m_jobQuery + ")"; + " WHERE Job.Jobid IN (" + m_jobQuery + ")" + " ORDER BY Path"; if (mainWin->m_sqlDebug) { Pmsg1(000, "Query cmd : %s\n", cmd.toUtf8().data()); } @@ -1394,7 +1395,7 @@ void restoreTree::testButtonPushed() QString sqlcmd = "CREATE TEMPORARY TABLE " + tempTable + " (JobId INTEGER, FileIndex INTEGER)"; QStringList results; Pmsg1(000, "Query cmd : %s ;\n", sqlcmd.toUtf8().data()); - /*if (m_console->sql_cmd(sqlcmd, results)) { + if (m_console->sql_cmd(sqlcmd, results)) { QStringList fieldlist; int row = 0; foreach (QString resultline, results) { @@ -1408,7 +1409,7 @@ void restoreTree::testButtonPushed() } row++; } - }*/ + } } if (mainWin->m_rtRestore2Debug) Pmsg1(000, "Version->%i\n", fversion); @@ -1423,7 +1424,7 @@ void restoreTree::testButtonPushed() // Pmsg1(000, "Query cmd : %s ;\n", sqlcmd.toUtf8().data()); /* use printf for the moment to make pasting into psql easier. */ printf("%s ;\n", sqlcmd.toUtf8().data()); - /*if (m_console->sql_cmd(sqlcmd, results)) { + if (m_console->sql_cmd(sqlcmd, results)) { QStringList fieldlist; int row = 0; foreach (QString resultline, results) { @@ -1437,7 +1438,7 @@ void restoreTree::testButtonPushed() } row++; } - }*/ + } } /* foreach fullPathList */ doneKeys.insert(fversion,1); jobList.append(fversion); @@ -1458,7 +1459,7 @@ void restoreTree::testButtonPushed() " file=\"?" + tempTable + "\" yes"; if (mainWin->m_commandDebug) Pmsg1(000, "preRestore command \'%s\'\n", cmd.toUtf8().data()); - //consoleCommand(cmd); + consoleCommand(cmd); mainWin->resetFocus(); } } -- 2.39.5