1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-08 10:53:13 +02:00

- tiny changes

git-svn-id: file:///svn/phpbb/trunk@7773 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M
2007-06-18 12:05:58 +00:00
parent eda4a35760
commit eaed6d806e
3 changed files with 12 additions and 56 deletions

View File

@ -372,35 +372,22 @@ class dbal_mssql extends dbal
switch ($mode) switch ($mode)
{ {
case 'start': case 'start':
$explain_query = $query; $html_table = false;
if (preg_match('/UPDATE ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) @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]; @mssql_next_result($result);
} while ($row = @mssql_fetch_row($result))
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); $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
while ($row = @mssql_fetch_row($result))
{
$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) if ($html_table)
{ {
$this->html_hold .= '</table>'; $this->html_hold .= '</table>';
}
} }
break; break;

View File

@ -359,36 +359,6 @@ class dbal_mssql_odbc extends dbal
switch ($mode) switch ($mode)
{ {
case 'start': 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; break;
case 'fromcache': case 'fromcache':

View File

@ -408,7 +408,6 @@ class dbal_mysqli extends dbal
break; break;
} }
@mysqli_query($this->db_connect_id, "SET profiling = 0;");
} }
} }