Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information