I have a database with a column that has a set of IDs in it (db.cache):
["1", "2", "3", "4"]
And then in my query I'm trying to join from an existing table over to this caching table and then only get the rows where the id from table a is not in this list:
SELECT id
FROM a
LEFT JOIN b on b
WHERE JSON_SEARCH(b.`cache`, 'one', a.id) IS NULL
However when running this I'm getting the following:
Error Code: 3141. Invalid JSON text in argument 1 to function json_search: "Invalid value." at position 3.
If, however, I put that clause in the select, I get a listing of rows with either the JSON path or a NULL, and if I change from IS NULL to IS NOT NULL in the where clause it also works as expected.