Bug 18156 - 'INSERT OR IGNORE INTO' wrong?
: 'INSERT OR IGNORE INTO' wrong?
Status: UNCONFIRMED
Product: Logitech Media Server
Classification: Unclassified
Component: Scanner
: 7.9.x
: PC Ubuntu Linux
: -- normal (vote)
: ---
Assigned To: Michael Herger
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-09-08 22:06 UTC by maweber
Modified: 2017-10-23 07:56 UTC (History)
1 user (show)

See Also:
Category: Bug


Attachments
Use SQL engine specific "INSERT INTO" command (6.36 KB, patch)
2017-10-23 07:56 UTC, Michael Herger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description maweber 2017-09-08 22:06:26 UTC
hi devs

my scans make an error with this SQL syntax.
shouldn't it be 'INSERT IGNORE INTO'?

My friend Google couldn't find any reference to this OR.

I have:

root@bananapi:/etc/openvpn# grep -r 'INSERT OR IGNORE INTO' /usr/share/perl5/
/usr/share/perl5/Slim/Plugin/ExtendedBrowseModes/Libraries.pm:				INSERT OR IGNORE INTO library_track (library, track)
/usr/share/perl5/Slim/Plugin/LibraryDemo/Plugin.pm:			INSERT OR IGNORE INTO library_track (library, track)
/usr/share/perl5/Slim/Plugin/LibraryDemo/Plugin.pm:			INSERT OR IGNORE INTO library_track (library, track)
/usr/share/perl5/Slim/Plugin/LibraryDemo/Plugin.pm:			INSERT OR IGNORE INTO library_track (library, track)
/usr/share/perl5/Slim/Plugin/LibraryDemo/Plugin.pm:				INSERT OR IGNORE INTO library_track (library, track)
/usr/share/perl5/Slim/Plugin/LibraryDemo/Plugin.pm:				INSERT OR IGNORE INTO library_track (library, track)
/usr/share/perl5/Slim/Music/VirtualLibraries.pm:			INSERT OR IGNORE INTO library_track (library, track)
/usr/share/perl5/Slim/Music/VirtualLibraries.pm:			$args->{sql} = "INSERT OR IGNORE INTO library_track (library, track) SELECT '%s', id FROM (" . $args->{sql} . ")";
/usr/share/perl5/Slim/Music/VirtualLibraries.pm:			$args->{sql} = 'INSERT OR IGNORE INTO library_track (library, track) ' . $args->{sql};
/usr/share/perl5/Slim/Music/VirtualLibraries.pm:			INSERT OR IGNORE INTO library_album (library, album) 
/usr/share/perl5/Slim/Music/VirtualLibraries.pm:			INSERT OR IGNORE INTO library_contributor (library, contributor) 
/usr/share/perl5/Slim/Music/VirtualLibraries.pm:			INSERT OR IGNORE INTO library_genre (library, genre) 


I'm using the mysql backend though, maybe thats why.
best
manu


ps:
root@bananapi:/etc/openvpn# uname -a
Linux bananapi 3.4.39-BPI-M3-Kernel #1 SMP PREEMPT Tue May 3 13:47:01 UTC 2016 armv7l GNU/Linux

...and
Logitech Media Server Version: 7.9.1 - 1504317335 @ Mon Sep 4 09:02:45 UTC 2017
Comment 1 Michael Herger 2017-10-21 10:46:46 UTC
Ok, some SQLite specific SQL slipped in. Until this is fixed (pull requests are very welcome ;-)) disable the LibraryDemo plugin. Or don't use MySQL :-).
Comment 2 Michael Herger 2017-10-23 07:56:32 UTC
Created attachment 7763 [details]
Use SQL engine specific "INSERT INTO" command

Could you please try to apply the attached patch and see whether this fixes this issue for you?