1515package plan
1616
1717import (
18- "fmt"
1918 "os"
2019
2120 "github.com/dolthub/go-mysql-server/sql"
@@ -34,65 +33,6 @@ func init() {
3433 }
3534}
3635
37- // TransactionCommittingNode implements autocommit logic. It wraps relevant queries and ensures the database commits
38- // the transaction.
39- type TransactionCommittingNode struct {
40- UnaryNode
41- }
42-
43- var _ sql.Node = (* TransactionCommittingNode )(nil )
44- var _ sql.CollationCoercible = (* TransactionCommittingNode )(nil )
45-
46- // NewTransactionCommittingNode returns a TransactionCommittingNode.
47- func NewTransactionCommittingNode (child sql.Node ) * TransactionCommittingNode {
48- return & TransactionCommittingNode {UnaryNode : UnaryNode {Child : child }}
49- }
50-
51- // String implements the sql.Node interface.
52- func (t * TransactionCommittingNode ) String () string {
53- return t .Child ().String ()
54- }
55-
56- // DebugString implements the sql.DebugStringer interface.
57- func (t * TransactionCommittingNode ) DebugString () string {
58- return sql .DebugString (t .Child ())
59- }
60-
61- // Describe implements the sql.Describable interface.
62- func (t * TransactionCommittingNode ) Describe (options sql.DescribeOptions ) string {
63- return sql .Describe (t .Child (), options )
64- }
65-
66- func (t * TransactionCommittingNode ) IsReadOnly () bool {
67- return t .Child ().IsReadOnly ()
68- }
69-
70- // WithChildren implements the sql.Node interface.
71- func (t * TransactionCommittingNode ) WithChildren (children ... sql.Node ) (sql.Node , error ) {
72- if len (children ) != 1 {
73- return nil , fmt .Errorf ("ds" )
74- }
75-
76- t2 := * t
77- t2 .UnaryNode = UnaryNode {Child : children [0 ]}
78- return & t2 , nil
79- }
80-
81- // CheckPrivileges implements the sql.Node interface.
82- func (t * TransactionCommittingNode ) CheckPrivileges (ctx * sql.Context , opChecker sql.PrivilegedOperationChecker ) bool {
83- return t .Child ().CheckPrivileges (ctx , opChecker )
84- }
85-
86- // CollationCoercibility implements the interface sql.CollationCoercible.
87- func (* TransactionCommittingNode ) CollationCoercibility (ctx * sql.Context ) (collation sql.CollationID , coercibility byte ) {
88- return sql .Collation_binary , 7
89- }
90-
91- // Child implements the sql.UnaryNode interface.
92- func (t * TransactionCommittingNode ) Child () sql.Node {
93- return t .UnaryNode .Child
94- }
95-
9636// IsSessionAutocommit returns true if the current session is using implicit transaction management
9737// through autocommit.
9838func IsSessionAutocommit (ctx * sql.Context ) (bool , error ) {
0 commit comments