diff options
author | David M <davidmj@users.sourceforge.net> | 2007-06-18 12:05:58 +0000 |
---|---|---|
committer | David M <davidmj@users.sourceforge.net> | 2007-06-18 12:05:58 +0000 |
commit | eaed6d806eb98abb9e16829ef223b25a8dae72f7 (patch) | |
tree | 236140579f1a0d5d38240c1ff923d39c2ce6479e /phpBB/includes/db | |
parent | eda4a3576018ea7adc589b68bd2dcfd83c0bbe7a (diff) | |
download | forums-eaed6d806eb98abb9e16829ef223b25a8dae72f7.tar forums-eaed6d806eb98abb9e16829ef223b25a8dae72f7.tar.gz forums-eaed6d806eb98abb9e16829ef223b25a8dae72f7.tar.bz2 forums-eaed6d806eb98abb9e16829ef223b25a8dae72f7.tar.xz forums-eaed6d806eb98abb9e16829ef223b25a8dae72f7.zip |
- tiny changes
git-svn-id: file:///svn/phpbb/trunk@7773 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/db')
-rw-r--r-- | phpBB/includes/db/mssql.php | 37 | ||||
-rw-r--r-- | phpBB/includes/db/mssql_odbc.php | 30 | ||||
-rw-r--r-- | phpBB/includes/db/mysqli.php | 1 |
3 files changed, 12 insertions, 56 deletions
diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php index 76aa3e2366..1077a005b8 100644 --- a/phpBB/includes/db/mssql.php +++ b/phpBB/includes/db/mssql.php @@ -372,35 +372,22 @@ class dbal_mssql extends dbal switch ($mode) { case 'start': - $explain_query = $query; - if (preg_match('/UPDATE ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) + $html_table = false; + @mssql_query('SET SHOWPLAN_TEXT ON;', $this->db_connect_id); + if ($result = @mssql_query($query, $this->db_connect_id)) { - $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; - } - else if (preg_match('/DELETE FROM ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) - { - $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; - } - - if (preg_match('/^SELECT/', $explain_query)) - { - $html_table = false; - @mssql_query('SET SHOWPLAN_TEXT ON;', $this->db_connect_id); - if ($result = @mssql_query($explain_query, $this->db_connect_id)) + @mssql_next_result($result); + while ($row = @mssql_fetch_row($result)) { - @mssql_next_result($result); - while ($row = @mssql_fetch_row($result)) - { - $html_table = $this->sql_report('add_select_row', $query, $html_table, $row); - } + $html_table = $this->sql_report('add_select_row', $query, $html_table, $row); } - @mssql_query('SET SHOWPLAN_TEXT OFF;', $this->db_connect_id); - @mssql_free_result($result); + } + @mssql_query('SET SHOWPLAN_TEXT OFF;', $this->db_connect_id); + @mssql_free_result($result); - if ($html_table) - { - $this->html_hold .= '</table>'; - } + if ($html_table) + { + $this->html_hold .= '</table>'; } break; diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php index ed64cb3f7c..7770862447 100644 --- a/phpBB/includes/db/mssql_odbc.php +++ b/phpBB/includes/db/mssql_odbc.php @@ -359,36 +359,6 @@ class dbal_mssql_odbc extends dbal switch ($mode) { case 'start': - $explain_query = $query; - if (preg_match('/UPDATE ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) - { - $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; - } - else if (preg_match('/DELETE FROM ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) - { - $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; - } - - if (preg_match('/^SELECT/', $explain_query)) - { - $html_table = false; - @odbc_exec($this->db_connect_id, 'SET SHOWPLAN_TEXT ON;'); - if ($result = @odbc_exec($this->db_connect_id, $explain_query)) - { - @odbc_next_result($result); - while ($row = @odbc_fetch_array($result)) - { - $html_table = $this->sql_report('add_select_row', $query, $html_table, $row); - } - } - @odbc_exec($this->db_connect_id, 'SET SHOWPLAN_TEXT OFF;'); - @odbc_free_result($result); - - if ($html_table) - { - $this->html_hold .= '</table>'; - } - } break; case 'fromcache': diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index 4f433a309a..42a1057970 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -408,7 +408,6 @@ class dbal_mysqli extends dbal break; } - @mysqli_query($this->db_connect_id, "SET profiling = 0;"); } } |