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

distsql: add remaining seq fns to blacklist #28114

Merged
merged 1 commit into from
Aug 1, 2018
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
1 change: 1 addition & 0 deletions pkg/sql/distsqlrun/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ func (ds *ServerImpl) setupFlow(
var haveSequences bool
for _, seq := range req.EvalContext.SeqState.Seqs {
evalCtx.SessionData.SequenceState.RecordValue(seq.SeqID, seq.LatestVal)
haveSequences = true
}
if haveSequences {
evalCtx.SessionData.SequenceState.SetLastSequenceIncremented(
Expand Down
9 changes: 4 additions & 5 deletions pkg/sql/logictest/testdata/logic_test/sequences_distsql
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ SELECT c, lastval() FROM t
----
1 10

# Restore this query when #24130 is fixed:
# query II
# SELECT c, currval('distsql_test') FROM t
# ----
# 1, 1
query II
SELECT c, currval('distsql_test') FROM t
----
1 10
15 changes: 9 additions & 6 deletions pkg/sql/sem/builtins/builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -1433,8 +1433,9 @@ CockroachDB supports the following flags:

"nextval": makeBuiltin(
tree.FunctionProperties{
Category: categorySequences,
Impure: true,
Category: categorySequences,
DistsqlBlacklist: true,
Impure: true,
},
tree.Overload{
Types: tree.ArgTypes{{"sequence_name", types.String}},
Expand All @@ -1457,8 +1458,9 @@ CockroachDB supports the following flags:

"currval": makeBuiltin(
tree.FunctionProperties{
Category: categorySequences,
Impure: true,
Category: categorySequences,
DistsqlBlacklist: true,
Impure: true,
},
tree.Overload{
Types: tree.ArgTypes{{"sequence_name", types.String}},
Expand Down Expand Up @@ -1502,8 +1504,9 @@ CockroachDB supports the following flags:
// See https://github.com/cockroachdb/cockroach/issues/21564
"setval": makeBuiltin(
tree.FunctionProperties{
Category: categorySequences,
Impure: true,
Category: categorySequences,
DistsqlBlacklist: true,
Impure: true,
},
tree.Overload{
Types: tree.ArgTypes{{"sequence_name", types.String}, {"value", types.Int}},
Expand Down