Commit 8e18b655 authored by cznic's avatar cznic

Fix nil deref. Closes #207.

parent d287cb66
......@@ -1635,6 +1635,10 @@ func (db *DB) info() (r *DbInfo, err error) {
}
for _, k := range a {
x := t.indices2[k]
if x == nil {
continue
}
a = a[:0]
for _, e := range x.exprList {
a = append(a, e.String())
......
......@@ -8467,3 +8467,8 @@ SELECT DISTINCT a FROM t WHERE a NOT IN (SELECT a FROM t WHERE b == 9;);
┌Compute distinct rows
└Output field names [a]
---- 1358
SELECT * FROM t;
┌Iterate all rows of table "t"
└Output field names ["a" "b" "c"]
......@@ -15785,3 +15785,12 @@ SELECT DISTINCT a FROM t WHERE a NOT IN (SELECT a FROM t WHERE b = 9)
|"a"
[0]
[1]
-- 1358 // https://github.com/cznic/ql/issues/207
BEGIN TRANSACTION;
CREATE TABLE t (a int not null, b int not null, c int not null);
CREATE INDEX t_a_b on t (a, b);
CREATE INDEX t_a_b_c on t (a, b, c);
COMMIT;
SELECT * FROM t;
|"a", "b", "c"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment