Thread: JSON_POPULATE_RECORDSET empty array bug

JSON_POPULATE_RECORDSET empty array bug

From
Vladimír Houba ml.
Date:
Hello,

the following command works as expected
SELECT * FROM JSON_POPULATE_RECORDSET(NULL::information_schema.columns, '[{}]')

but the following command crashes the backend
SELECT * FROM JSON_POPULATE_RECORDSET(NULL::information_schema.columns, '[]')

server log
2018-12-21 15:34:11.710 CET [581] LOG:  server process (PID 26654) was terminated by signal 11: Segmentation fault
2018-12-21 15:34:11.710 CET [581] DETAIL:  Failed process was running:  DECLARE OmniDB_a6dd10a962824e70961053e6809c61fc CURSOR WITH HOLD FOR SELECT * FROM JSON_POPULATE_RECORDSET(NULL::information_schema.columns, '[]'::JSON)
2018-12-21 15:34:11.710 CET [581] LOG:  terminating any other active server processes
2018-12-21 15:34:11.710 CET [26488] WARNING:  terminating connection because of crash of another server process
2018-12-21 15:34:11.710 CET [26488] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2018-12-21 15:34:11.710 CET [26488] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2018-12-21 15:34:11.711 CET [26626] rekre@rekre WARNING:  terminating connection because of crash of another server process
2018-12-21 15:34:11.711 CET [26626] rekre@rekre DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2018-12-21 15:34:11.711 CET [26626] rekre@rekre HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2018-12-21 15:34:11.714 CET [581] LOG:  all server processes terminated; reinitializing
2018-12-21 15:34:11.737 CET [26655] LOG:  database system was interrupted; last known up at 2018-12-21 15:33:26 CET
2018-12-21 15:34:11.829 CET [26655] LOG:  database system was not properly shut down; automatic recovery in progress
2018-12-21 15:34:11.831 CET [26655] LOG:  redo starts at 24/E1C64E90
2018-12-21 15:34:11.831 CET [26655] LOG:  invalid record length at 24/E1C64EC8: wanted 24, got 0
2018-12-21 15:34:11.831 CET [26655] LOG:  redo done at 24/E1C64E90
2018-12-21 15:34:11.844 CET [581] LOG:  database system is ready to accept connections

Re: JSON_POPULATE_RECORDSET empty array bug

From
Tom Lane
Date:
=?UTF-8?Q?Vladim=C3=ADr_Houba_ml=2E?= <vladojr@prosoft.sk> writes:
> but the following command crashes the backend
> SELECT * FROM JSON_POPULATE_RECORDSET(NULL::information_schema.columns,
> '[]')

Hm, works for me.  What version are you testing?

[ digs in commit log... ]  If that's 11.0 or 11.1, I think this was
resolved by commit 595220a3a.

            regards, tom lane


Re: JSON_POPULATE_RECORDSET empty array bug

From
Vladimír Houba ml.
Date:
Hi Tom,

Im running

PostgreSQL 11.0 (Ubuntu 11.0-1.pgdg18.04+2) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0, 64-bit

Okay, I will check again after 11.2 is released.

Thanks


On Fri, Dec 21, 2018 at 4:49 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Vladimír Houba ml. <vladojr@prosoft.sk> writes:
> but the following command crashes the backend
> SELECT * FROM JSON_POPULATE_RECORDSET(NULL::information_schema.columns,
> '[]')

Hm, works for me.  What version are you testing?

[ digs in commit log... ]  If that's 11.0 or 11.1, I think this was
resolved by commit 595220a3a.

                        regards, tom lane



--
S pozdravom / Best regards
Vladimír Houba jr.
Prosoft, Slovakia
+421 915 708 171