REFRESH MATERIALIZED VIEW command in PL block hitting Assert - Mailing list pgsql-hackers

From Jeevan Chalke
Subject REFRESH MATERIALIZED VIEW command in PL block hitting Assert
Date
Msg-id CAM2+6=XaeLBLH1a-8-4SbjKySX90YQvTQ=0WJozyoGLKrpSnow@mail.gmail.com
Whole thread Raw
Responses Re: REFRESH MATERIALIZED VIEW command in PL block hitting Assert
List pgsql-hackers
Hi,

I have observed that following sequence is causing server crash.

CREATE MATERIALIZED VIEW temp_class_mv AS
  SELECT * FROM pg_class
  WITH NO DATA;

CREATE OR REPLACE FUNCTION test_refresh_mv()
RETURNS int
AS $$
BEGIN
 REFRESH MATERIALIZED VIEW temp_class_mv;
 return 1;
END; $$ LANGUAGE plpgsql;

SELECT test_refresh_mv();



I had a quick look over the crash and it is hitting following Assert in spi.c:

                else if (IsA(stmt, RefreshMatViewStmt))
                {
                    Assert(strncmp(completionTag,
                                   "REFRESH MATERIALIZED VIEW ", 23) == 0);
                    _SPI_current->processed = strtoul(completionTag + 23,
                                                      NULL, 10);
                }

It seems like we are missing expected value for completionTag in ExecRefreshMatView()

Thanks

--
Jeevan B Chalke
Senior Software Engineer, R&D
EnterpriseDB Corporation
The Enterprise PostgreSQL Company

Phone: +91 20 30589500

Website: www.enterprisedb.com
EnterpriseDB Blog: http://blogs.enterprisedb.com/
Follow us on Twitter: http://www.twitter.com/enterprisedb

This e-mail message (and any attachment) is intended for the use of the individual or entity to whom it is addressed. This message contains information from EnterpriseDB Corporation that may be privileged, confidential, or exempt from disclosure under applicable law. If you are not the intended recipient or authorized to receive this for the intended recipient, any use, dissemination, distribution, retention, archiving, or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and delete this message.

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Fast promotion, loose ends
Next
From: Andres Freund
Date:
Subject: Re: REFRESH MATERIALIZED VIEW command in PL block hitting Assert