Re: [sqlite] COALESCE() ignores LIMIT 0 clause in subquery?

2019-09-23 Thread Richard Hipp
Fix checked in at https://sqlite.org/src/info/82e5dcf5c1d500ed

On 9/22/19, Justin Ng  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


[sqlite] COALESCE() ignores LIMIT 0 clause in subquery?

2019-09-23 Thread Justin Ng
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