Menu

#193 SQL strict mode compatibility

1.3.1
open
nobody
2019-10-07
2016-10-13
No

In opendmarc-import we should never set values to NULL (or anywhere else for that matter).

$dbi_s = $dbi_h->prepare("UPDATE requests SET repuri = NULL WHERE id = ?");

Should be

$dbi_s = $dbi_h->prepare("UPDATE requests SET repuri = '' WHERE id = ?");

Could not find any other locations (didn't dig very deep), however we should always ensure we NEVER set a value to null as to ensure strict mode compatibility and ensure matching on empty records remains sane.

Discussion

  • Juri Haberland

    Juri Haberland - 2016-11-08

    The attached patch fixes the incompatibility with MySQL's strict mode. It obsoletes also ticket #192.

     
  • Michiel Hazelhof

    Looks good to me, don't forget to run aclocal and automake if your system doesn't have automake-1.13 anymore.

     
  • Adam Williamson

    Adam Williamson - 2019-10-04

    Why was this never merged?

     
  • Michiel Hazelhof

    afaik '= NULL' should at least be 'IS NULL' with mysql/mariadb in order to work as intended

     

Log in to post a comment.