[mythtv-commits] [MythTV/mythtv] 26804b: No NULL strings in SQL query for Gallery.

kmdewaal noreply at github.com
Tue Oct 11 20:12:48 UTC 2022


  Branch: refs/heads/master
  Home:   https://github.com/MythTV/mythtv
  Commit: 26804b7c612a92e1e725a05a821c3ac7cb140835
      https://github.com/MythTV/mythtv/commit/26804b7c612a92e1e725a05a821c3ac7cb140835
  Author: Klaas de Waal <klaas at kldo.nl>
  Date:   2022-10-11 (Tue, 11 Oct 2022)

  Changed paths:
    M mythtv/libs/libmythmetadata/imagemanager.cpp

  Log Message:
  -----------
  No NULL strings in SQL query for Gallery.

String fields filename, name, path (comment) and extension in database table gallery_files cannot be NULL.
Scanning the storage group for pictures can result in a database error like this:
2022-10-11 21:56:11.606192 E  Original query failed, but resend with empty strings in place of NULL strings worked.
DB Error (MSqlQuery):
Query was:
INSERT INTO gallery_files (file_id, filename, name, dir_id, type, modtime, size, extension, date, hidden, orientation, angle, path, zoom) VALUES (0, ?, ?,      ?, ?,   ?, ?,     ?, ?,   ?, ?, ?,    ?,   ?);
Bindings were:
:COMMENT="", :COVER=0, :DATE=1665518171, :EXTENSION=NULL, :FILEPATH="", :FS=0,
:HIDDEN=false, :MODTIME=1665518171, :NAME="", :ORIENT=0, :PARENT=0, :SIZE=0,
:TYPE=1
Driver error was [2/1048]:
QMYSQL3: Unable to execute statement
Database error was:
Column 'extension' cannot be null
This is fixed for all four string fields by using the bindValueNoNull function to bind the value.




More information about the mythtv-commits mailing list