Bug 23825: Koha/Object.t might fail on a backtick
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 18 Oct 2019 09:31:10 +0000 (09:31 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 13 Nov 2019 16:23:29 +0000 (16:23 +0000)
commit480afea9ddf642fbd6ec499172e5ef6400905424
treef956009ecfc969190b221bcba96a19b43cde00ba
parentd23e50f0b239603a05ddbb62591e80657f5f6cae
Bug 23825: Koha/Object.t might fail on a backtick

If the SQL error message contains a backtick instead of a regular quote,
the regex for throwing an exception did not work.
Example:
Incorrect datetime value: 'wrong_value' for column `koha_master`.`borrowers`.`lastseen`
Note the backtics where the regex contains a regular quote.

This patch makes it more flexible: it allows one \W character before the
column name, even optional.

Test plan:
Run Koha/Object.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/Object.pm