Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/tables/pgcatalog/pg_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ var pgIndexSchema = sql.Schema{
{Name: "indkey", Type: pgtypes.Int16Array, Default: nil, Nullable: false, Source: PgIndexName}, // TODO: type int2vector
{Name: "indcollation", Type: pgtypes.OidArray, Default: nil, Nullable: false, Source: PgIndexName}, // TODO: type oidvector
{Name: "indclass", Type: pgtypes.OidArray, Default: nil, Nullable: false, Source: PgIndexName}, // TODO: type oidvector
{Name: "indoption", Type: pgtypes.Text, Default: nil, Nullable: false, Source: PgIndexName}, // TODO: type int2vector. Declared as the serialized form so it can be read by clients expecting text, but this is a hacky temp solution
{Name: "indoption", Type: pgtypes.Int16Array, Default: nil, Nullable: false, Source: PgIndexName}, // TODO: type int2vector. Declared as the serialized form so it can be read by clients expecting text, but this is a hacky temp solution
{Name: "indexprs", Type: pgtypes.Text, Default: nil, Nullable: true, Source: PgIndexName}, // TODO: type pg_node_tree, collation C
{Name: "indpred", Type: pgtypes.Text, Default: nil, Nullable: true, Source: PgIndexName}, // TODO: type pg_node_tree, collation C
}
Expand Down Expand Up @@ -275,7 +275,7 @@ func pgIndexToRow(index *pgIndex) sql.Row {
index.indkey, // indkey
[]any{}, // indcollation
[]any{}, // indclass
"0", // indoption
[]any{int16(0)}, // indoption
nil, // indexprs
nil, // indpred
}
Expand Down
12 changes: 8 additions & 4 deletions testing/go/pgcatalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1515,9 +1515,9 @@ func TestPgIndex(t *testing.T) {
"WHERE n.nspname = 'testschema' and left(c.relname, 5) <> 'dolt_' " +
"ORDER BY 1;",
Expected: []sql.Row{
{1067629180, 3120782595, 1, 0, "t", "f", "t", "f", "f", "f", "t", "f", "t", "t", "f", "{1}", "{}", "{}", "0", nil, nil},
{1322775662, 3120782595, 1, 0, "t", "f", "f", "f", "f", "f", "t", "f", "t", "t", "f", "{2}", "{}", "{}", "0", nil, nil},
{3185790121, 1784425749, 2, 0, "t", "f", "t", "f", "f", "f", "t", "f", "t", "t", "f", "{1,2}", "{}", "{}", "0", nil, nil},
{1067629180, 3120782595, 1, 0, "t", "f", "t", "f", "f", "f", "t", "f", "t", "t", "f", "{1}", "{}", "{}", "{0}", nil, nil},
{1322775662, 3120782595, 1, 0, "t", "f", "f", "f", "f", "f", "t", "f", "t", "t", "f", "{2}", "{}", "{}", "{0}", nil, nil},
{3185790121, 1784425749, 2, 0, "t", "f", "t", "f", "f", "f", "t", "f", "t", "t", "f", "{1,2}", "{}", "{}", "{0}", nil, nil},
},
},
{ // Different cases and quoted, so it fails
Expand Down Expand Up @@ -1548,6 +1548,10 @@ func TestPgIndex(t *testing.T) {
{3185790121, 1784425749, "testing2_pkey", "testing2"},
},
},
{
Query: "SELECT unnest(indoption) FROM pg_index LIMIT 1;",
Expected: []sql.Row{{0}},
},
},
},
})
Expand Down Expand Up @@ -5666,7 +5670,7 @@ FROM pg_catalog.pg_index
WHERE pg_catalog.pg_index.indrelid IN (select oid from pg_class where relname='t2')
AND NOT pg_catalog.pg_index.indisprimary ORDER BY pg_catalog.pg_index.indrelid, cls_idx.relname`,
Expected: []sql.Row{
{1496157034, "b", "f", "f", "0", nil, "btree", nil, 0, "f", "{b}", "{f}"},
{1496157034, "b", "f", "f", "{0}", nil, "btree", nil, 0, "f", "{b}", "{f}"},
},
},
},
Expand Down
Loading