Great news! I found a new way to break your stuff.
I'd like to back my SQL code out of the nodes themselves and reference it in external files. For instance, a file in a directory called sql off the foobar2000 directory (in a portable installation) is called tree_albumartist.sql and contains the following:
DROP VIEW IF EXISTS tree_albumartist;
CREATE VIEW tree_albumartist AS
SELECT coalesce(
[album artist]
, artist
, '{no artist}'
)
, album
FROM MediaLibrary
GROUP BY coalesce(
[album artist]
, artist
, '{no artist}'
)
, album
ORDER BY coalesce(
[album artist]
, artist
, '{no artist}'
)
, album
, discnumber
, tracknumber
Then in the batch tab of a query, I write this:
SELECT eval(readfile('sql/tree_albumartist.sql'))
This works if the query action is set to Execute SQL or Send to SQLite console. However, if the action is to send it to a playlist, foobar2000 crashes. In that case, I also have some code in the query tab:
SELECT * FROM tree_albumartist
I can work around this if there's nothing in the batch that needs to be run every time the query is refreshed by executing it in a different node, and then SELECT *… as above in the node I want to use it with.
Is there a better way to achieve this sort of thing?
Here's the crash report from a clean installation.