Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: Refactoring structured.proto. Renaming ColumnType Kind enum to SemanticType. #16606

Merged
merged 1 commit into from
Jun 20, 2017
Merged
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 docs/RFCS/array_encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ enforce the specified dimensionality of the arrays.
### Column Type protobuf encoding

The column type protobuf will be modified to include an `ARRAY` value for
the `Kind`, and a nullable field indicating the element type if the type is
the `SemanticType`, and a nullable field indicating the element type if the type is
an array. The existing `array_dimensions` field will be replaced with an int
field denoting the number of dimensions in the array.

Expand Down Expand Up @@ -163,7 +163,7 @@ This was deemed wasteful as arrays are restricted to 64MB to begin
with, and it is expected that the common case is that arrays do not contain
any `NULL`s (and thus the bitmap can be omitted).
* The protobuf changes could alternatively be implemented by having the
existing `Kind` denote the element type, with no special cases required, as
existing `SemanticType` denote the element type, with no special cases required, as
a 0-dimensional array can be interpreted as a scalar. This option is
attractive but it was rejected on the grounds that it overly-centralizes the
concept of column types around arrays and makes scalar datum types the special
Expand Down
4 changes: 2 additions & 2 deletions docs/RFCS/typing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2019,9 +2019,9 @@ retain exact precision.

Next, during type checking, ``NumVals`` will be evalutated as their
logical `Datum` types. Here, they will be converted `int`, `float` or
`decimal`, based on their `Value.Kind()` (e.g. using
`decimal`, based on their `Value.SemanticType()` (e.g. using
[Int64Val](https://golang.org/pkg/go/constant/#Int64Val) or
`decimal.SetString(Value.String())`. Some Kinds will result in a
`decimal.SetString(Value.String())`. Some Semantic Types will result in a
panic because they should not be possible based on our
parser. However, we could eventually introduce Complex literals using
this approach.
Expand Down
32 changes: 16 additions & 16 deletions pkg/sql/analyze_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ func testTableDesc() *sqlbase.TableDescriptor {
ID: 1001,
ParentID: 1000,
Columns: []sqlbase.ColumnDescriptor{
{Name: "a", Type: sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT}},
{Name: "b", Type: sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT}},
{Name: "c", Type: sqlbase.ColumnType{Kind: sqlbase.ColumnType_BOOL}},
{Name: "d", Type: sqlbase.ColumnType{Kind: sqlbase.ColumnType_BOOL}},
{Name: "e", Type: sqlbase.ColumnType{Kind: sqlbase.ColumnType_BOOL}},
{Name: "f", Type: sqlbase.ColumnType{Kind: sqlbase.ColumnType_BOOL}},
{Name: "g", Type: sqlbase.ColumnType{Kind: sqlbase.ColumnType_BOOL}},
{Name: "h", Type: sqlbase.ColumnType{Kind: sqlbase.ColumnType_FLOAT}},
{Name: "i", Type: sqlbase.ColumnType{Kind: sqlbase.ColumnType_STRING}},
{Name: "j", Type: sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT}},
{Name: "k", Type: sqlbase.ColumnType{Kind: sqlbase.ColumnType_BYTES}},
{Name: "l", Type: sqlbase.ColumnType{Kind: sqlbase.ColumnType_DECIMAL}},
{Name: "m", Type: sqlbase.ColumnType{Kind: sqlbase.ColumnType_DECIMAL}},
{Name: "n", Type: sqlbase.ColumnType{Kind: sqlbase.ColumnType_DATE}},
{Name: "o", Type: sqlbase.ColumnType{Kind: sqlbase.ColumnType_TIMESTAMP}},
{Name: "p", Type: sqlbase.ColumnType{Kind: sqlbase.ColumnType_TIMESTAMPTZ}},
{Name: "a", Type: sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT}},
{Name: "b", Type: sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT}},
{Name: "c", Type: sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_BOOL}},
{Name: "d", Type: sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_BOOL}},
{Name: "e", Type: sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_BOOL}},
{Name: "f", Type: sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_BOOL}},
{Name: "g", Type: sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_BOOL}},
{Name: "h", Type: sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_FLOAT}},
{Name: "i", Type: sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_STRING}},
{Name: "j", Type: sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT}},
{Name: "k", Type: sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_BYTES}},
{Name: "l", Type: sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_DECIMAL}},
{Name: "m", Type: sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_DECIMAL}},
{Name: "n", Type: sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_DATE}},
{Name: "o", Type: sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_TIMESTAMP}},
{Name: "p", Type: sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_TIMESTAMPTZ}},
},
PrimaryIndex: sqlbase.IndexDescriptor{
Name: "primary", Unique: true, ColumnNames: []string{"a"},
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/copy_in_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func TestCopyRandom(t *testing.T) {
}

rng := rand.New(rand.NewSource(0))
types := []sqlbase.ColumnType_Kind{
types := []sqlbase.ColumnType_SemanticType{
sqlbase.ColumnType_BOOL,
sqlbase.ColumnType_INT,
sqlbase.ColumnType_FLOAT,
Expand All @@ -189,7 +189,7 @@ func TestCopyRandom(t *testing.T) {

row[1] = d.String()
for j, t := range types {
d := sqlbase.RandDatum(rng, sqlbase.ColumnType{Kind: t}, false)
d := sqlbase.RandDatum(rng, sqlbase.ColumnType{SemanticType: t}, false)
ds := parser.AsStringWithFlags(d, parser.FmtBareStrings)
switch t {
case sqlbase.ColumnType_DECIMAL:
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -851,9 +851,9 @@ func resolveFK(
}

for i := range srcCols {
if s, t := srcCols[i], targetCols[i]; s.Type.Kind != t.Type.Kind {
if s, t := srcCols[i], targetCols[i]; s.Type.SemanticType != t.Type.SemanticType {
return fmt.Errorf("type of %q (%s) does not match foreign key %q.%q (%s)",
s.Name, s.Type.Kind, target.Name, t.Name, t.Type.Kind)
s.Name, s.Type.SemanticType, target.Name, t.Name, t.Type.SemanticType)
}
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/sql/distsqlplan/aggregator_funcs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,11 @@ func TestDistAggregationTable(t *testing.T) {
return []parser.Datum{
parser.NewDInt(parser.DInt(row)),
parser.NewDInt(parser.DInt(rng.Intn(numRows))),
sqlbase.RandDatum(rng, sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT}, true),
sqlbase.RandDatum(rng, sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT}, true),
parser.MakeDBool(parser.DBool(rng.Intn(10) == 0)),
parser.MakeDBool(parser.DBool(rng.Intn(10) != 0)),
sqlbase.RandDatum(rng, sqlbase.ColumnType{Kind: sqlbase.ColumnType_DECIMAL}, false),
sqlbase.RandDatum(rng, sqlbase.ColumnType{Kind: sqlbase.ColumnType_DECIMAL}, true),
sqlbase.RandDatum(rng, sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_DECIMAL}, false),
sqlbase.RandDatum(rng, sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_DECIMAL}, true),
parser.NewDBytes(parser.DBytes(randutil.RandBytes(rng, 10))),
}
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/distsqlrun/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func newAggregator(
if col >= uint32(len(inputTypes)) {
return nil, errors.Errorf("FilterColIdx out of range (%d)", col)
}
t := inputTypes[col].Kind
t := inputTypes[col].SemanticType
if t != sqlbase.ColumnType_BOOL && t != sqlbase.ColumnType_NULL {
return nil, errors.Errorf(
"filter column %d must be of boolean type, not %s", *aggInfo.FilterColIdx, t,
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/distsqlrun/aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ import (
func TestAggregator(t *testing.T) {
defer leaktest.AfterTest(t)()

columnTypeInt := sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT}
columnTypeInt := sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT}
v := [15]sqlbase.EncDatum{}
null := sqlbase.EncDatum{Datum: parser.DNull}
for i := range v {
v[i] = sqlbase.DatumToEncDatum(columnTypeInt, parser.NewDInt(parser.DInt(i)))
}

columnTypeBool := sqlbase.ColumnType{Kind: sqlbase.ColumnType_BOOL}
columnTypeBool := sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_BOOL}
boolTrue := sqlbase.DatumToEncDatum(columnTypeBool, parser.DBoolTrue)
boolFalse := sqlbase.DatumToEncDatum(columnTypeBool, parser.DBoolFalse)
boolNULL := sqlbase.DatumToEncDatum(columnTypeBool, parser.DNull)
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/distsqlrun/algebraic_set_op.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ func newAlgebraicSetOp(
len(lt), len(rt))
}
for i := 0; i < len(lt); i++ {
if lt[i].Kind != rt[i].Kind {
if lt[i].SemanticType != rt[i].SemanticType {
return nil, errors.Errorf(
"Left column index %d (%s) is not the same as right column index %d (%s)",
i, lt[i].Kind, i, rt[i].Kind)
i, lt[i].SemanticType, i, rt[i].SemanticType)
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/distsqlrun/algebraic_set_op_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type testInputs struct {
func initTestData() testInputs {
v := [15]sqlbase.EncDatum{}
for i := range v {
v[i] = sqlbase.DatumToEncDatum(sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT},
v[i] = sqlbase.DatumToEncDatum(sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT},
parser.NewDInt(parser.DInt(i)))
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/distsqlrun/distinct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestDistinct(t *testing.T) {

v := [15]sqlbase.EncDatum{}
for i := range v {
v[i] = sqlbase.DatumToEncDatum(sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT},
v[i] = sqlbase.DatumToEncDatum(sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT},
parser.NewDInt(parser.DInt(i)))
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/sql/distsqlrun/hashjoiner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
func TestHashJoiner(t *testing.T) {
defer leaktest.AfterTest(t)()

columnTypeInt := sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT}
columnTypeInt := sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT}
v := [10]sqlbase.EncDatum{}
for i := range v {
v[i] = sqlbase.DatumToEncDatum(columnTypeInt, parser.NewDInt(parser.DInt(i)))
Expand Down Expand Up @@ -576,7 +576,7 @@ func checkExpectedRows(expectedRows sqlbase.EncDatumRows, results *RowBuffer) er
// the consumer is draining.
func TestHashJoinerDrain(t *testing.T) {
defer leaktest.AfterTest(t)()
columnTypeInt := sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT}
columnTypeInt := sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT}
v := [10]sqlbase.EncDatum{}
for i := range v {
v[i] = sqlbase.DatumToEncDatum(columnTypeInt, parser.NewDInt(parser.DInt(i)))
Expand Down Expand Up @@ -665,7 +665,7 @@ func TestHashJoinerDrain(t *testing.T) {
func TestHashJoinerDrainAfterBuildPhaseError(t *testing.T) {
defer leaktest.AfterTest(t)()

columnTypeInt := sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT}
columnTypeInt := sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT}
v := [10]sqlbase.EncDatum{}
for i := range v {
v[i] = sqlbase.DatumToEncDatum(columnTypeInt, parser.NewDInt(parser.DInt(i)))
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/distsqlrun/input_sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
func TestOrderedSync(t *testing.T) {
defer leaktest.AfterTest(t)()

columnTypeInt := &sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT}
columnTypeInt := &sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT}
v := [6]sqlbase.EncDatum{}
for i := range v {
v[i] = sqlbase.DatumToEncDatum(*columnTypeInt, parser.NewDInt(parser.DInt(i)))
Expand Down Expand Up @@ -144,7 +144,7 @@ func TestOrderedSync(t *testing.T) {
func TestUnorderedSync(t *testing.T) {
defer leaktest.AfterTest(t)()

columnTypeInt := sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT}
columnTypeInt := sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT}
mrc := &MultiplexedRowChannel{}
mrc.Init(5, []sqlbase.ColumnType{columnTypeInt})
producerErr := make(chan error, 100)
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/distsqlrun/joinreader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func TestJoinReader(t *testing.T) {
for _, row := range c.input {
encRow := make(sqlbase.EncDatumRow, len(row))
for i, d := range row {
encRow[i] = sqlbase.DatumToEncDatum(sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT}, d)
encRow[i] = sqlbase.DatumToEncDatum(sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT}, d)
}
if status := in.Push(encRow, ProducerMetadata{}); status != NeedMoreRows {
t.Fatalf("unexpected response: %d", status)
Expand Down Expand Up @@ -183,7 +183,7 @@ func TestJoinReaderDrain(t *testing.T) {

encRow := make(sqlbase.EncDatumRow, 1)
encRow[0] = sqlbase.DatumToEncDatum(
sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT},
sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT},
parser.NewDInt(1),
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/distsqlrun/mergejoiner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
func TestMergeJoiner(t *testing.T) {
defer leaktest.AfterTest(t)()

columnTypeInt := sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT}
columnTypeInt := sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT}
v := [10]sqlbase.EncDatum{}
for i := range v {
v[i] = sqlbase.DatumToEncDatum(columnTypeInt, parser.NewDInt(parser.DInt(i)))
Expand Down
6 changes: 3 additions & 3 deletions pkg/sql/distsqlrun/outbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestOutbox(t *testing.T) {
producerC <- func() error {
row := sqlbase.EncDatumRow{
sqlbase.DatumToEncDatum(
sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT},
sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT},
parser.NewDInt(parser.DInt(0))),
}
if consumerStatus := outbox.Push(row, ProducerMetadata{}); consumerStatus != NeedMoreRows {
Expand All @@ -84,7 +84,7 @@ func TestOutbox(t *testing.T) {
for {
row = sqlbase.EncDatumRow{
sqlbase.DatumToEncDatum(
sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT},
sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT},
parser.NewDInt(parser.DInt(-1))),
}
consumerStatus := outbox.Push(row, ProducerMetadata{})
Expand All @@ -99,7 +99,7 @@ func TestOutbox(t *testing.T) {
// Now send another row that the outbox will discard.
row = sqlbase.EncDatumRow{
sqlbase.DatumToEncDatum(
sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT},
sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT},
parser.NewDInt(parser.DInt(2))),
}
if consumerStatus := outbox.Push(row, ProducerMetadata{}); consumerStatus != DrainRequested {
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/distsqlrun/processors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
func TestPostProcess(t *testing.T) {
defer leaktest.AfterTest(t)()

columnTypeInt := sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT}
columnTypeInt := sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT}
v := [10]sqlbase.EncDatum{}
for i := range v {
v[i] = sqlbase.DatumToEncDatum(columnTypeInt, parser.NewDInt(parser.DInt(i)))
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/distsqlrun/sorter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
func TestSorter(t *testing.T) {
defer leaktest.AfterTest(t)()

columnTypeInt := sqlbase.ColumnType{Kind: sqlbase.ColumnType_INT}
columnTypeInt := sqlbase.ColumnType{SemanticType: sqlbase.ColumnType_INT}
v := [6]sqlbase.EncDatum{}
for i := range v {
v[i] = sqlbase.DatumToEncDatum(columnTypeInt, parser.NewDInt(parser.DInt(i)))
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/distsqlrun/stream_encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (se *StreamEncoder) AddRow(row sqlbase.EncDatumRow) error {
if !ok {
enc = preferredEncoding
}
if enc != sqlbase.DatumEncoding_VALUE && sqlbase.HasCompositeKeyEncoding(row[i].Type.Kind) {
if enc != sqlbase.DatumEncoding_VALUE && sqlbase.HasCompositeKeyEncoding(row[i].Type.SemanticType) {
// Force VALUE encoding for composite types (key encodings may lose data).
enc = sqlbase.DatumEncoding_VALUE
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/parser/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func (expr *NumVal) ResolveAsType(ctx *SemaContext, typ Type) (Datum, error) {
return nil, err
}
oid := NewDOid(*d.(*DInt))
oid.kind = oidTypeToColType(typ)
oid.symanticType = oidTypeToColType(typ)
return oid, nil
default:
return nil, fmt.Errorf("could not resolve %T %v into a %T", expr, expr, typ)
Expand Down
20 changes: 10 additions & 10 deletions pkg/sql/parser/datum.go
Original file line number Diff line number Diff line change
Expand Up @@ -2241,16 +2241,16 @@ func (*DTable) Size() uintptr { return unsafe.Sizeof(DTable{}) }
type DOid struct {
// A DOid embeds a DInt, the underlying integer OID for this OID datum.
DInt
// kind indicates the particular variety of OID this datum is, whether raw
// symanticType indicates the particular variety of OID this datum is, whether raw
// oid or a reg* type.
kind *OidColType
symanticType *OidColType
// name is set to the resolved name of this OID, if available.
name string
}

// MakeDOid is a helper routine to create a DOid initialized from a DInt.
func MakeDOid(d DInt) DOid {
return DOid{DInt: d, kind: oidColTypeOid, name: ""}
return DOid{DInt: d, symanticType: oidColTypeOid, name: ""}
}

// NewDOid is a helper routine to create a *DOid initialized from a DInt.
Expand All @@ -2263,7 +2263,7 @@ func NewDOid(d DInt) *DOid {
// returns it.
func (d *DOid) AsRegProc(name string) *DOid {
d.name = name
d.kind = oidColTypeRegProc
d.symanticType = oidColTypeRegProc
return d
}

Expand Down Expand Up @@ -2291,7 +2291,7 @@ func (d *DOid) Compare(ctx *EvalContext, other Datum) int {

// Format implements the Datum interface.
func (d *DOid) Format(buf *bytes.Buffer, f FmtFlags) {
if d.kind == oidColTypeOid || d.name == "" {
if d.symanticType == oidColTypeOid || d.name == "" {
FormatNode(buf, f, &d.DInt)
} else {
encodeSQLStringWithFlags(buf, d.name, FmtBareStrings)
Expand All @@ -2307,18 +2307,18 @@ func (d *DOid) IsMin() bool { return d.DInt.IsMin() }
// Next implements the Datum interface.
func (d *DOid) Next() (Datum, bool) {
next, ok := d.DInt.Next()
return &DOid{*next.(*DInt), d.kind, ""}, ok
return &DOid{*next.(*DInt), d.symanticType, ""}, ok
}

// Prev implements the Datum interface.
func (d *DOid) Prev() (Datum, bool) {
prev, ok := d.DInt.Prev()
return &DOid{*prev.(*DInt), d.kind, ""}, ok
return &DOid{*prev.(*DInt), d.symanticType, ""}, ok
}

// ResolvedType implements the Datum interface.
func (d *DOid) ResolvedType() Type {
return oidColTypeToType(d.kind)
return oidColTypeToType(d.symanticType)
}

// Size implements the Datum interface.
Expand All @@ -2327,13 +2327,13 @@ func (d *DOid) Size() uintptr { return unsafe.Sizeof(*d) }
// max implements the Datum interface.
func (d *DOid) max() (Datum, bool) {
max, ok := d.DInt.max()
return &DOid{*max.(*DInt), d.kind, ""}, ok
return &DOid{*max.(*DInt), d.symanticType, ""}, ok
}

// min implements the Datum interface.
func (d *DOid) min() (Datum, bool) {
min, ok := d.DInt.min()
return &DOid{*min.(*DInt), d.kind, ""}, ok
return &DOid{*min.(*DInt), d.symanticType, ""}, ok
}

// DOidWrapper is a Datum implementation which is a wrapper around a Datum, allowing
Expand Down
Loading