cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

sql: panic in EXPLAIN when applied to subscripted expressions

Open a6802739 opened this issue 9 years ago • 5 comments

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

a6802739 avatar Feb 27 '17 04:02 a6802739

@knz @andreimatei

a-robinson avatar Feb 28 '17 13:02 a-robinson

Thanks, the error appears to be in SHOW COLUMNS specifically. I'm investigating this.

knz avatar Feb 28 '17 18:02 knz

Simpler query to reproduce: SELECT x[1] FROM (SELECT ARRAY[1, 2, 3]) AS t(x);

knz avatar Feb 28 '17 19:02 knz

The error occurs because the indirection expression is not really an expression and thus doesn't have a type suitable for printing out.

knz avatar Feb 28 '17 19:02 knz

even without high verbosity the following crashes a node: EXPLAIN(TYPES) SELECT x[1] FROM (SELECT ARRAY[1, 2, 3]) AS t(x)

knz avatar Feb 28 '17 19:02 knz