The most interesting part here is the constructed polyglot:<p><pre><code> with ambiguous(j) as
(select '[' || char(9) || '721]')
select
json_valid(j, 0x1) as "RFC 8259",
json_valid(cast(j as blob), 0x8) as "JSONB"
from ambiguous;
</code></pre>
Also, this is an example of why dynamic typing is <i>never</i> safe, whether in a normal programming language or in your sql database. It turns out that the sqlite documentation has been lying for years and people assumed everything was fine.
This an incorrect title.<p>Per this comment:<p><a href="https://sqlite.org/forum/forumpost/b6f940e87dd28cf8" rel="nofollow">https://sqlite.org/forum/forumpost/b6f940e87dd28cf8</a><p>> Fix your code with CASTs instead of complaining about it. You didn't follow the documentation<p>Essentially, the person was using json incorrectly (as per documentation even prior to this release) and now this version of SQLite is causing their incorrect code to not behave as they wanted.<p>But because SQLite doesn’t want to break backward compatibility (even for a prior unknown bug), they are <i>considering</i> persisting the bug as seen here:<p><a href="https://sqlite.org/forum/forumpost/bcec95d836ad4048" rel="nofollow">https://sqlite.org/forum/forumpost/bcec95d836ad4048</a>