From eaed6d806eb98abb9e16829ef223b25a8dae72f7 Mon Sep 17 00:00:00 2001 From: David M Date: Mon, 18 Jun 2007 12:05:58 +0000 Subject: - tiny changes git-svn-id: file:///svn/phpbb/trunk@7773 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/mssql.php | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) (limited to 'phpBB/includes/db/mssql.php') 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 .= ''; - } + if ($html_table) + { + $this->html_hold .= ''; } break; -- cgit v1.2.1