mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/9892] Transaction support for database update sql execution function
Updates would fail before because 'begin' as generated by db_tools::sql_create_table would be executed literally. PHPBB3-9892
This commit is contained in:
parent
ef977abe59
commit
2569d7460a
1 changed files with 16 additions and 5 deletions
|
@ -534,6 +534,16 @@ function _sql($sql, &$errored, &$error_ary, $echo_dot = true)
|
|||
|
||||
$db->sql_return_on_error(true);
|
||||
|
||||
if ($sql === 'begin')
|
||||
{
|
||||
$db->sql_transaction('begin');
|
||||
}
|
||||
else if ($sql === 'commit')
|
||||
{
|
||||
$db->sql_transaction('commit');
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $db->sql_query($sql);
|
||||
if ($db->sql_error_triggered)
|
||||
{
|
||||
|
@ -541,6 +551,7 @@ function _sql($sql, &$errored, &$error_ary, $echo_dot = true)
|
|||
$error_ary['sql'][] = $db->sql_error_sql;
|
||||
$error_ary['error_code'][] = $db->sql_error_returned;
|
||||
}
|
||||
}
|
||||
|
||||
$db->sql_return_on_error(false);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue