mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Truncate Doctrine\DBAL\Exception\DriverException message if too long #5277
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @shtrom on GitHub (Sep 28, 2016).
Originally assigned to: @Ocramius on GitHub.
Hi have an issue---triggered by ownCloud and an erroneous vCard with a duplicated
PHOTOfield---where a database insertion request into MySQL via the Doctrine DBAL fails.Essentially, the blob inserted is too big for MySQL, and it issues a
Syntax error or access violation: 1118 The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size.”which gets transformed into aDoctrine\DBAL\Exception\DriverException.The message for the exception is
An exception occurred while executing [QUERY] with params [PARAMS]. This is where the issue with Doctrine is: the blob is about 9MiB at this stage, and it is dumped verbatim as part of thePARAMSbit in the error message. This makes the Exception a bit hard to understand, as it is not concise enough, and this makes log files grow at a very very high rate.A solution to this problem would be to either
PARAMSlonger than a given threshold in the error message, e.g.,BEGIN:VCARD\r ... END:VCARD\r(line ending might or might not be a good idea to rely on)BLOB of 9MiB, orBEGIN:VCARD\r [about 9MiB of blob] END:VCARD\r.Note that my example is with ownCloud and vCards, but the problem is more generic, with any blob too big for comfortable display.
@shtrom commented on GitHub (Sep 28, 2016):
Wrong repo, see doctrine/dbal#2523; sorry about the noise.