You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5cd609b
Browse filesBrowse the repository at this point in the historyBrowse files
fix: end the transaction when transCommit() returns false after 1213
The restart BEGIN ran outside the query try block, after the restart flag
was cleared. If the connection dropped after errno 1213, query(), ping()
and reconnect() threw a raw mysqli_sql_exception, even with DBDebug false,
and the next write skipped BEGIN. BEGIN now runs inside the try, and the
restart stays pending until it succeeds.
transCommit() returned false and left transDepth at 1 with the restarted
server transaction open. A caller that retried without transRollback()
nested inside it, got true from transCommit(), and nothing was committed.
transCommit() now rolls that transaction back before returning false.
The guide and changelog now limit the fix to query(), simpleQuery() and
the Query Builder. Prepared queries are not covered.
The deadlock test records the probe table before recreating it, so
teardown drops it.
Refs #10649
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: user_guide_src/source/changelogs/v4.7.6.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ Bugs Fixed
36
36
37
37
- **CLI:** Fixed a bug where ``CLI::promptByMultipleKeys()`` accepted a key missing from the options when it was below the last key, returning an empty selection, rejected a key above the last one when the options were not in key order, and offered ``0`` as the default when the first key was not ``0``.
38
38
- **Commands:** Fixed a bug where generator commands did not sort the imports of a template with CRLF line endings.
39
-
- **Database:** Fixed MySQLi errno 1213 (``ER_LOCK_DEADLOCK``) so a following write on the victim connection does not autocommit, and ``transCommit()`` does not return true after InnoDB has rolled the victim transaction back. Errno 1205 is unchanged. See `#10649 <https://github.com/codeigniter4/CodeIgniter4/issues/10649>`_.
39
+
- **Database:** Fixed MySQLi errno 1213 (``ER_LOCK_DEADLOCK``) so a following write through ``query()``, ``simpleQuery()`` or the Query Builder on the victim connection does not autocommit, and ``transCommit()`` rolls back and returns false after InnoDB has rolled the victim transaction back. Prepared queries and errno 1205 are unchanged. See `#10649 <https://github.com/codeigniter4/CodeIgniter4/issues/10649>`_.
40
40
- **Format:** Fixed ``XMLFormatter`` so that an array key that becomes empty after sanitization no longer triggers a ``ValueError``; the fallback tag name ``item`` is used instead. Values that cannot be converted to a string, such as objects not implementing ``Stringable``, now throw a ``FormatException`` instead of a fatal ``Error``.
41
41
- **Helpers:** Fixed a regression in v4.7.5 where ``set_value()`` threw a ``TypeError`` when the default value was not a string or an array, such as an integer, a float, ``null``, or a ``Stringable`` object. Such values are now converted to a string.
42
42
- **HTTP:** Fixed a bug in ``ContentSecurityPolicy::setDefaultSrc()`` where passing an array of URIs resulted in an invalid ``'Array'`` directive.
0 commit comments