diff options
author | Urban Müller | 2017-12-20 17:40:26 +0100 |
---|---|---|
committer | Urban Müller | 2017-12-20 17:40:26 +0100 |
commit | e0519c5c09f200f5a0dd49a191072cd2138b48bb (patch) | |
tree | dc37aa3172559b86ac5cec04586f269595709edd | |
parent | 1d213f44704377525aa15d254ad3b9ec10363eb6 (diff) | |
download | itools-e0519c5c09f200f5a0dd49a191072cd2138b48bb.tar.gz itools-e0519c5c09f200f5a0dd49a191072cd2138b48bb.tar.bz2 itools-e0519c5c09f200f5a0dd49a191072cd2138b48bb.zip |
configurable warning suppression
-rw-r--r-- | it_dbi.class | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/it_dbi.class b/it_dbi.class index c975f01..3166d85 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -40,6 +40,7 @@ class it_dbi 'localized_defaultlanguage' => "de", # Localize fields with this suffix, e.g. copy title_de to title on read 'throttle_writes' => 0, # sleep for 'throttle_writes' multiplied by the execution time after every write 'unbuffered' => false, # use MYSQLI_USE_RESULT (WARNING this is not at all equivalent to normal it_dbi WARNING) + 'ignoredwarnings' => "", # regex of additional mysql warnings numbers to ignore ); var $_key; # Key of currently loaded record or null (public readonly) @@ -535,7 +536,7 @@ function query($query, $p = array()) if (($warning = $this->_link->get_warnings())) { do { - if ($warning->errno != 1364 && $warning->errno != 1261) + if (!it::match(trim($this->_p['ignoredwarnings'] . "|1364|1261|1051", "|"), $warning->errno)) $messages[] = $warning->message . " [error $warning->errno]"; } while ($warning->next() && ++$checked < 20); |