? .directory
? dbtuner-933958.patch
Index: dbtuner.explain.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/dbtuner/Attic/dbtuner.explain.inc,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 dbtuner.explain.inc
--- dbtuner.explain.inc	16 Aug 2010 23:18:04 -0000	1.1.2.2
+++ dbtuner.explain.inc	6 Oct 2010 21:48:35 -0000
@@ -95,10 +95,14 @@ function dbtuner_explain_get_views() {
 
       // Add hash to query incase something goes wrong; you can figure out what view caused the error.
       $query .= ' /* ' . $hash . '*/';
-      $explain = db_query('EXPLAIN ' . $query, $query_args);
+      $explain = db_query('EXPLAIN EXTENDED ' . $query, $query_args);
+      $warnings = db_query("SHOW warnings");
       while($value = db_fetch_array($explain)) {
         $data[$hash][] = $value;
       }
+      while($value = db_fetch_array($warnings)) {
+        $data[$hash]['warnings'][] = $value;
+      }
     }
   }
 
Index: dbtuner.views.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/dbtuner/Attic/dbtuner.views.inc,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 dbtuner.views.inc
--- dbtuner.views.inc	27 May 2010 17:08:34 -0000	1.1.2.3
+++ dbtuner.views.inc	6 Oct 2010 21:48:35 -0000
@@ -5,9 +5,10 @@
  * Implementation of hook_views_preview_info_alter.
  */
 function dbtuner_views_preview_info_alter(&$rows, $view) {
-  $replacements = module_invoke_all('views_query_substitutions', $view); 
+  $replacements = module_invoke_all('views_query_substitutions', $view);
   $query = str_replace(array_keys($replacements), $replacements, $view->build_info['query']);
-  $results = db_query("EXPLAIN " . $query, $view->build_info['query_args']);
+  $results = db_query("EXPLAIN EXTENDED " . $query, $view->build_info['query_args']);
+  $warnings = db_query("SHOW warnings");
 
   while ($explain = db_fetch_array($results)) {
     // Only populate $headers on the first iteration.
@@ -17,6 +18,13 @@ function dbtuner_views_preview_info_alte
     $explain_rows[] = array_values($explain);
   }
   $rows[] = array(array('data' => '<strong>Explain</strong>' . theme('table', $explain_headers, $explain_rows), 'colspan' => 2));
-}
-
 
+  while ($value = db_fetch_array($warnings)) {
+    // Only populate $headers on the first iteration.
+    if (empty($warnings_headers)) {
+      $warnings_headers = array_map('ucfirst', array_keys($value));
+    }
+    $warnings_rows[] = array_values($value);
+  }
+  $rows[] = array(array('data' => '<strong>Warnings</strong>' . theme('table', $warnings_headers, $warnings_rows), 'colspan' => 2));
+}
