Index: trunk/FACT++/src/rootifysql.cc
===================================================================
--- trunk/FACT++/src/rootifysql.cc	(revision 19099)
+++ trunk/FACT++/src/rootifysql.cc	(revision 19100)
@@ -38,5 +38,5 @@
         ("no-fill",       po_switch(),                 "Do not fill events into the root file (mainly for debugging purposes, e.g. performance studies)")
         ("delimiter",     var<string>(""),             "The delimiter used if contents are displayed with --display (default=\\t)")
-        ("explain",       po_switch(),                 "Requests an EXPLAIN from the server (shows the serveroptimized query)")
+        ("explain",       po_switch(),                 "Requests an EXPLAIN from the server (shows the server optimized query)\nsee also https://dev.mysql.com/doc/refman/explain-output.html")
         ("profiling",     po_switch(),                 "Turn on profiling and print profile")
         ("var.*",         var<string>(),               "Predefined SQL user variables (@VAR)")
@@ -391,5 +391,5 @@
 
     if (verbose>0)
-        cout << "\n--------------------- Rootify SQL ----------------------" << endl;
+        cout << "\n------------------------ Rootify SQL -------------------------" << endl;
 
     string query  = conf.Get<string>("query");
@@ -800,5 +800,29 @@
         cout << "File closed.\n";
         cout << "Execution time: " << Time().UnixTime()-start.UnixTime() << "s\n";
-        cout << "--------------------------------------------------------" << endl;
+        cout << "--------------------------------------------------------------" << endl;
+
+        try
+        {
+            const auto resw =
+                connection.query("SHOW WARNINGS").store();
+
+            if (resw.num_rows()>0)
+                cout << "\nWARNINGS:\n\n";
+
+            for (size_t i=0; i<resw.num_rows(); i++)
+            {
+                const mysqlpp::Row &roww = resw[i];
+
+                cout << roww["Level"] << '[' << roww["Code"] << "]: ";
+                cout << roww["Message"] << '\n' << endl;
+            }
+
+        }
+        catch (const exception &e)
+        {
+            cerr << "\nSHOW WARNINGS\n\n";
+            cerr << "SQL query failed:\n" << e.what() << endl;
+            return 6;
+        }
     }
 
@@ -807,15 +831,18 @@
         try
         {
+            const auto N =
+                connection.query("SHOW PROFILES").store().num_rows();
+
             const auto resp =
-                connection.query("SHOW PROFILE ALL").store();
+                connection.query("SHOW PROFILE ALL FOR QUERY "+to_string(verbose?N-1:N)).store();
 
             cout << '\n';
             cout << left;
-            cout << setw(20) << "Status"     << ' ';
+            cout << setw(26) << "Status"     << ' ';
             cout << right;
             cout << setw(11) << "Duration"   << ' ';
             cout << setw(11) << "CPU User"   << ' ';
             cout << setw(11) << "CPU System" << '\n';
-            cout << "--------------------------------------------------------\n";
+            cout << "--------------------------------------------------------------\n";
             for (size_t i=0; i<resp.num_rows(); i++)
             {
@@ -823,5 +850,5 @@
 
                 cout << left;
-                cout << setw(20) << rowp["Status"] << ' ';
+                cout << setw(26) << rowp["Status"] << ' ';
                 cout << right;
                 cout << setw(11) << rowp["Duration"] << ' ';
@@ -829,5 +856,5 @@
                 cout << setw(11) << rowp["CPU_system"] << '\n';
             }
-            cout << "--------------------------------------------------------\n";
+            cout << "--------------------------------------------------------------\n";
             cout << endl;
         }
