Skip to content

Commit

Permalink
Merge #29643
Browse files Browse the repository at this point in the history
29643: sql: fix oid of collated string to match postgres r=jordanlewis a=jordanlewis

We returned unknown, Postgres returns string.

Release note (bug fix): correct the Postgres type oid returned for
collated string column types.

Co-authored-by: Jordan Lewis <[email protected]>
  • Loading branch information
craig[bot] and jordanlewis committed Sep 6, 2018
2 parents fb5922a + b2f8ab4 commit fdb1b80
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/pg_catalog
Original file line number Diff line number Diff line change
Expand Up @@ -1613,3 +1613,13 @@ query OOTT colnames
SELECT objoid, classoid, provider, label FROM pg_catalog.pg_shseclabel
----
objoid classoid provider label

subtest collated_string_type

statement ok
CREATE TABLE coltab (a STRING COLLATE en)

query OT
SELECT typ.oid, typ.typname FROM pg_attribute att JOIN pg_type typ ON atttypid=typ.oid WHERE attrelid='coltab'::regclass AND attname='a'
----
25 text
2 changes: 1 addition & 1 deletion pkg/sql/sem/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func (TCollatedString) FamilyEqual(other T) bool {
}

// Oid implements the T interface.
func (TCollatedString) Oid() oid.Oid { return oid.T_unknown }
func (TCollatedString) Oid() oid.Oid { return oid.T_text }

// SQLName implements the T interface.
func (TCollatedString) SQLName() string { return "text" }
Expand Down

0 comments on commit fdb1b80

Please sign in to comment.