mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
show correct SQL error message if failed during a transaction...
git-svn-id: file:///svn/phpbb/trunk@4788 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
40931f12ba
commit
129218286b
8 changed files with 45 additions and 37 deletions
|
@ -428,15 +428,16 @@ class sql_db
|
||||||
{
|
{
|
||||||
if (!$this->return_on_error)
|
if (!$this->return_on_error)
|
||||||
{
|
{
|
||||||
|
$this_page =(!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
||||||
|
$this_page .= '&' .((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
||||||
|
|
||||||
|
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @ibase_errmsg() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . $this_page .(($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
||||||
|
|
||||||
if ($this->transaction)
|
if ($this->transaction)
|
||||||
{
|
{
|
||||||
$this->sql_transaction('rollback');
|
$this->sql_transaction('rollback');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this_page =(!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
|
||||||
$this_page .= '&' .((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
|
||||||
|
|
||||||
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @ibase_errmsg() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . $this_page .(($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
|
||||||
trigger_error($message, E_USER_ERROR);
|
trigger_error($message, E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -386,15 +386,16 @@ class sql_db
|
||||||
{
|
{
|
||||||
if (!$this->return_on_error)
|
if (!$this->return_on_error)
|
||||||
{
|
{
|
||||||
|
$this_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
||||||
|
$this_page .= '&' . ((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
||||||
|
|
||||||
|
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @odbc_errormsg() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
||||||
|
|
||||||
if ($this->transaction)
|
if ($this->transaction)
|
||||||
{
|
{
|
||||||
$this->sql_transaction('rollback');
|
$this->sql_transaction('rollback');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
|
||||||
$this_page .= '&' . ((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
|
||||||
|
|
||||||
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @odbc_errormsg() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
|
||||||
trigger_error($message, E_USER_ERROR);
|
trigger_error($message, E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -384,15 +384,16 @@ class sql_db
|
||||||
{
|
{
|
||||||
if (!$this->return_on_error)
|
if (!$this->return_on_error)
|
||||||
{
|
{
|
||||||
|
$this_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
||||||
|
$this_page .= '&' . ((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
||||||
|
|
||||||
|
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @odbc_errormsg() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
||||||
|
|
||||||
if ($this->transaction)
|
if ($this->transaction)
|
||||||
{
|
{
|
||||||
$this->sql_transaction('rollback');
|
$this->sql_transaction('rollback');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
|
||||||
$this_page .= '&' . ((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
|
||||||
|
|
||||||
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @odbc_errormsg() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
|
||||||
trigger_error($message, E_USER_ERROR);
|
trigger_error($message, E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -419,15 +419,16 @@ class sql_db
|
||||||
{
|
{
|
||||||
if (!$this->return_on_error)
|
if (!$this->return_on_error)
|
||||||
{
|
{
|
||||||
if ($this->transaction)
|
|
||||||
{
|
|
||||||
$this->sql_transaction('rollback');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
$this_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
||||||
$this_page .= '&' . ((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
$this_page .= '&' . ((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
||||||
|
|
||||||
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @mssql_get_last_message() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @mssql_get_last_message() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
||||||
|
|
||||||
|
if ($this->transaction)
|
||||||
|
{
|
||||||
|
$this->sql_transaction('rollback');
|
||||||
|
}
|
||||||
|
|
||||||
trigger_error($message, E_USER_ERROR);
|
trigger_error($message, E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -357,15 +357,16 @@ class sql_db
|
||||||
{
|
{
|
||||||
if (!$this->return_on_error)
|
if (!$this->return_on_error)
|
||||||
{
|
{
|
||||||
if ($this->transaction)
|
|
||||||
{
|
|
||||||
$this->sql_transaction('rollback');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
$this_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
||||||
$this_page .= '&' . ((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
$this_page .= '&' . ((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
||||||
|
|
||||||
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @mysql_error() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @mysql_error() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
||||||
|
|
||||||
|
if ($this->transaction)
|
||||||
|
{
|
||||||
|
$this->sql_transaction('rollback');
|
||||||
|
}
|
||||||
|
|
||||||
trigger_error($message, E_USER_ERROR);
|
trigger_error($message, E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -357,15 +357,16 @@ class sql_db
|
||||||
{
|
{
|
||||||
if (!$this->return_on_error)
|
if (!$this->return_on_error)
|
||||||
{
|
{
|
||||||
if ($this->transaction)
|
|
||||||
{
|
|
||||||
$this->sql_transaction('rollback');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
$this_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
||||||
$this_page .= '&' . ((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
$this_page .= '&' . ((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
||||||
|
|
||||||
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @mysql_error() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @mysql_error() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
||||||
|
|
||||||
|
if ($this->transaction)
|
||||||
|
{
|
||||||
|
$this->sql_transaction('rollback');
|
||||||
|
}
|
||||||
|
|
||||||
trigger_error($message, E_USER_ERROR);
|
trigger_error($message, E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -362,15 +362,16 @@ class sql_db
|
||||||
{
|
{
|
||||||
if (!$this->return_on_error)
|
if (!$this->return_on_error)
|
||||||
{
|
{
|
||||||
if ($this->transaction)
|
|
||||||
{
|
|
||||||
$this->sql_transaction('rollback');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
$this_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
||||||
$this_page .= '&' . ((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
$this_page .= '&' . ((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
||||||
|
|
||||||
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @pg_errormessage() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @pg_errormessage() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
||||||
|
|
||||||
|
if ($this->transaction)
|
||||||
|
{
|
||||||
|
$this->sql_transaction('rollback');
|
||||||
|
}
|
||||||
|
|
||||||
trigger_error($message, E_USER_ERROR);
|
trigger_error($message, E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -363,15 +363,16 @@ class sql_db
|
||||||
{
|
{
|
||||||
if (!$this->return_on_error)
|
if (!$this->return_on_error)
|
||||||
{
|
{
|
||||||
if ($this->transaction)
|
|
||||||
{
|
|
||||||
$this->sql_transaction('rollback');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
$this_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
||||||
$this_page .= '&' . ((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
$this_page .= '&' . ((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']);
|
||||||
|
|
||||||
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @sqlite_error_string(@sqlite_last_error($this->db_connect_id)) . '<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @sqlite_error_string(@sqlite_last_error($this->db_connect_id)) . '<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
||||||
|
|
||||||
|
if ($this->transaction)
|
||||||
|
{
|
||||||
|
$this->sql_transaction('rollback');
|
||||||
|
}
|
||||||
|
|
||||||
trigger_error($message, E_USER_ERROR);
|
trigger_error($message, E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue