sql: panic in EXPLAIN when applied to subscripted expressions
BUG REPORT
after I set verbosity=3 for the start command of cockroach cluster, when I send a request
to the arbitrary node of the cluster, the node will crash down.
the crash info is:
panic: unresolved names ought to be replaced before this point [recovered]
panic: SHOW COLUMNS FROM system.descriptor; SHOW INDEX FROM system.descriptor; SHOW GRANTS ON TABLE system.descriptor; SHOW CREATE TABLE system.descriptor;: unresolved names ought to be replaced before this point
panic: txn: unexpected leftover memory: 164833 bytes
my cockroach version is :
[[email protected] bin]# ./cockroach version
Build Tag: beta-20170216
Build Time: 2017/02/16 13:45:12
Distribution: CCL
Platform: linux amd64
Go Version: go1.7.5
C Compiler: gcc 4.9.3
Build SHA-1: 019eeb7b64386a9d751d2055d2af52f24a93ab3d
Build Type: release
@knz @andreimatei
Thanks, the error appears to be in SHOW COLUMNS specifically. I'm investigating this.
Simpler query to reproduce: SELECT x[1] FROM (SELECT ARRAY[1, 2, 3]) AS t(x);
The error occurs because the indirection expression is not really an expression and thus doesn't have a type suitable for printing out.
even without high verbosity the following crashes a node: EXPLAIN(TYPES) SELECT x[1] FROM (SELECT ARRAY[1, 2, 3]) AS t(x)