Thanks Brian Ibbotson for the report.
Regression in 7414704e88d73dafbcfbb85f9bc54cb6111439d3.
Backport of 1570ef02f34037d32218d463342592debccf915c from main.
CAST() must be wrapped in parentheses to be recognized as an expression on SQLite.
Regression in 7414704e88d73dafbcfbb85f9bc54cb6111439d3.
Backport of 797957fb48f63760442d3d4c8985fd94f8602d5e from main
Special thanks to Hannes Ljungberg for finding multiple implementation
gaps.
Thanks also to Simon Charette, Adam Johnson, and Mariusz Felisiak for
reviews.