Fix checked in at https://sqlite.org/src/info/82e5dcf5c1d500ed

On 9/22/19, Justin Ng <justin.ng.1...@outlook.com> wrote:
> Is this the appropriate place to discuss this?
>
> The below examples are expected to return 3.
> The first example returns 4, the second returns 3.
>
> It seems like LIMIT 0 is ignored by COALESCE().
> https://www.db-fiddle.com/f/7YWZ5naLUfAHgNmh93Yo44/0
> CREATE TABLE "myTable" (
>   "myColumn" INT PRIMARY KEY
> );
> INSERT INTO
>   "myTable"("myColumn")
> VALUES
>   (4);
>
> SELECT
>   COALESCE(
>     (
>       SELECT
>         "myTable"."myColumn" AS "myTable--myColumn"
>       FROM
>         "myTable"
>       LIMIT
>         0
>       OFFSET
>         0
>     ),
>     3
>   );
>
> Adding WHERE FALSE does the trick.
> https://www.db-fiddle.com/f/7YWZ5naLUfAHgNmh93Yo44/1
> CREATE TABLE "myTable" (
>   "myColumn" INT PRIMARY KEY
> );
> INSERT INTO
>   "myTable"("myColumn")
> VALUES
>   (4);
>
> SELECT
>   COALESCE(
>     (
>       SELECT
>         "myTable"."myColumn" AS "myTable--myColumn"
>       FROM
>         "myTable"
>       WHERE
>         FALSE
>       LIMIT
>         0
>       OFFSET
>         0
>     ),
>     3
>   );
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to