aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/mysql.php
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2008-01-03 17:00:40 +0000
committerDavid M <davidmj@users.sourceforge.net>2008-01-03 17:00:40 +0000
commit85055ac97fa57ca339924cef719115d85bdf6c2e (patch)
tree1e19230af2689c3837356c0f7947719c0cdf67ef /phpBB/includes/db/mysql.php
parent0f26ffbadea13d97b841dfe56b21da7a5479000a (diff)
downloadforums-85055ac97fa57ca339924cef719115d85bdf6c2e.tar
forums-85055ac97fa57ca339924cef719115d85bdf6c2e.tar.gz
forums-85055ac97fa57ca339924cef719115d85bdf6c2e.tar.bz2
forums-85055ac97fa57ca339924cef719115d85bdf6c2e.tar.xz
forums-85055ac97fa57ca339924cef719115d85bdf6c2e.zip
oh boy...
- Migrate code base to PHP 5.1+ git-svn-id: file:///svn/phpbb/trunk@8295 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/db/mysql.php')
-rw-r--r--phpBB/includes/db/mysql.php31
1 files changed, 29 insertions, 2 deletions
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php
index 2d689f86f9..840d40b03d 100644
--- a/phpBB/includes/db/mysql.php
+++ b/phpBB/includes/db/mysql.php
@@ -362,11 +362,12 @@ class dbal_mysql extends dbal
function _sql_report($mode, $query = '')
{
static $test_prof;
+ static $test_extend;
// current detection method, might just switch to see the existance of INFORMATION_SCHEMA.PROFILING
if ($test_prof === null)
{
- $test_prof = false;
+ $test_prof = $test_extend = false;
if (strpos($this->mysql_version, 'community') !== false)
{
$ver = substr($this->mysql_version, 0, strpos($this->mysql_version, '-'));
@@ -375,6 +376,11 @@ class dbal_mysql extends dbal
$test_prof = true;
}
}
+
+ if (version_compare($ver, '4.1.1', '>='))
+ {
+ $test_extend = true;
+ }
}
switch ($mode)
@@ -401,7 +407,7 @@ class dbal_mysql extends dbal
@mysql_query('SET profiling = 1;', $this->db_connect_id);
}
- if ($result = @mysql_query("EXPLAIN $explain_query", $this->db_connect_id))
+ if ($result = @mysql_query('EXPLAIN ' . (($test_extend) ? 'EXTENDED ' : '') . "$explain_query", $this->db_connect_id))
{
while ($row = @mysql_fetch_assoc($result))
{
@@ -415,6 +421,27 @@ class dbal_mysql extends dbal
$this->html_hold .= '</table>';
}
+ if ($test_extend)
+ {
+ $html_table = false;
+
+ if ($result = @mysql_query('SHOW WARNINGS', $this->db_connect_id))
+ {
+ $this->html_hold .= '<br />';
+ while ($row = @mysql_fetch_assoc($result))
+ {
+ $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
+ }
+ }
+ @mysql_free_result($result);
+
+ if ($html_table)
+ {
+ $this->html_hold .= '</table>';
+ }
+ }
+
+
if ($test_prof)
{
$html_table = false;