diff --git a/pkg/sql/logictest/testdata/logic_test/txn b/pkg/sql/logictest/testdata/logic_test/txn index 8f94e09650c2..2cfe1fb54ad2 100644 --- a/pkg/sql/logictest/testdata/logic_test/txn +++ b/pkg/sql/logictest/testdata/logic_test/txn @@ -1483,13 +1483,16 @@ SET SESSION AUTHORIZATION DEFAULT statement ok BEGIN -# DECLARE and FETCH CURSOR should work in a read-only txn. +# DECLARE, FETCH, and CLOSE CURSOR should work in a read-only txn. statement ok DECLARE foo CURSOR FOR SELECT 1 statement ok FETCH 1 foo +statement ok +CLOSE foo + statement ok COMMIT diff --git a/pkg/sql/sem/tree/stmt.go b/pkg/sql/sem/tree/stmt.go index 1aecefb288c4..1dac622f451a 100644 --- a/pkg/sql/sem/tree/stmt.go +++ b/pkg/sql/sem/tree/stmt.go @@ -749,7 +749,7 @@ func (*CannedOptPlan) StatementTag() string { return "PREPARE AS OPT PLAN" } func (*CloseCursor) StatementReturnType() StatementReturnType { return Ack } // StatementType implements the Statement interface. -func (*CloseCursor) StatementType() StatementType { return TypeDCL } +func (*CloseCursor) StatementType() StatementType { return TypeDML } // StatementTag returns a short string identifying the type of statement. func (*CloseCursor) StatementTag() string { return "CLOSE" }