Repository navigation
[2.1] Handle failed prepare statements and oversized data in error logs - #9872
jdarwood007 wants to merge 1 commit into
Conversation
9e4f3b4 to
04283b8
Compare
|
I tested this against an installed 2.1 forum on both engines, by calling 1. The fallback to As written, the fallback also fails on both engines:
2. 3. Pooling on PostgreSQL. The unnamed statement used with
I've opened #9883 as an alternative. It keeps to the prepared statement only and keeps the bail-out when the statement cannot be prepared. Before binding, it cleans the values. On a UTF-8 forum, strings are cut with |
04283b8 to
2c96c5a
Compare
|
$smcFunc['db_insert'] tells the error logging to skip when we are inserting into some tables, one of those being the error log. It should not log. However, I added a untested loop detection. |
2c96c5a to
13527ab
Compare
13527ab to
57654a6
Compare
|
|
I re-ran the same tests against the current head (57654a6), on MySQL and PostgreSQL. Each message ran in a PHP process of its own, so that the new counter doesn't hide anything. 1. Only the first two errors of a request are logged.
2. PostgreSQL never uses the prepared statement.
3. The MySQL fallback still fails. With the prepare forced to fail (verified before each run), all 48 messages ended in the fatal "The database value you're trying to insert does not exist: ip", for every IP, including a valid IPv4. The IP is converted to hex for the prepared statement before the branch, so 4.
#9883 avoids all of these, storing 48/48 on both engines. There is no fallback and no counter. Strings are cut with |
Fixes #7831