Skip to content

Commit acf761a

Browse files
committed
Add support for modifying expressions in IntSequenceTable
1 parent f42fc3e commit acf761a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

memory/sequence_table.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,16 @@ func (IntSequenceTable) Collation() sql.CollationID {
113113
}
114114

115115
func (s IntSequenceTable) Expressions() []sql.Expression {
116-
return []sql.Expression{}
116+
return []sql.Expression{s.Len}
117117
}
118118

119119
func (s IntSequenceTable) WithExpressions(e ...sql.Expression) (sql.Node, error) {
120-
return s, nil
120+
if len(e) != 1 {
121+
return nil, sql.ErrInvalidChildrenNumber.New(s, len(e), 1)
122+
}
123+
newSequenceTable := s
124+
newSequenceTable.Len = e[0]
125+
return newSequenceTable, nil
121126
}
122127

123128
func (s IntSequenceTable) Database() sql.Database {

0 commit comments

Comments
 (0)