Fix busted Assert for CREATE MATVIEW ... WITH NO DATA.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 942ff002f9ee170d276240c71400e2772458b114
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2016-08-11T15:22:25Z
Releases: 9.3.15
Fix busted Assert for CREATE MATVIEW ... WITH NO DATA.

Commit 874fe3aea changed the command tag returned for CREATE MATVIEW/CREATE
TABLE AS ... WITH NO DATA, but missed that there was code in spi.c that
expected the command tag to always be "SELECT".  Fortunately, the
consequence was only an Assert failure, so this oversight should have no
impact in production builds.

Since this code path was evidently un-exercised, add a regression test.

Per report from Shivam Saxena. Back-patch to 9.3, like the previous commit.

Michael Paquier

Report: <97218716-480B-4527-B5CD-D08D798A0C7B@dresources.com>

Files

PathChange+/−
src/backend/executor/spi.c modified +12 −4
src/test/regress/expected/matview.out modified +25 −0
src/test/regress/sql/matview.sql modified +14 −0