Fix busted Assert for CREATE MATVIEW ... WITH NO DATA.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 11 Aug 2016 15:22:25 +0000 (11:22 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 11 Aug 2016 15:22:25 +0000 (11:22 -0400)
commit894993ffee387383b371ebc515b5e8ea156f9574
tree0ab5cdca8d9e1815a521c88da909f146a21ec6fb
parenta470858078e129641de24f5d090632f76b055cd8
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>
src/backend/executor/spi.c
src/test/regress/expected/matview.out
src/test/regress/sql/matview.sql