@@ -103,103 +103,3 @@ func (t *TriggerExecutor) CheckPrivileges(ctx *sql.Context, opChecker sql.Privil
103103func (t * TriggerExecutor ) CollationCoercibility (ctx * sql.Context ) (collation sql.CollationID , coercibility byte ) {
104104 return sql .GetCoercibility (ctx , t .left )
105105}
106-
107- // TriggerRollback is a node that wraps the entire tree iff it contains a trigger, creates a savepoint, and performs a
108- // rollback if something went wrong during execution
109- type TriggerRollback struct {
110- UnaryNode
111- }
112-
113- var _ sql.Node = (* TriggerRollback )(nil )
114- var _ sql.CollationCoercible = (* TriggerRollback )(nil )
115-
116- func NewTriggerRollback (child sql.Node ) * TriggerRollback {
117- return & TriggerRollback {
118- UnaryNode : UnaryNode {Child : child },
119- }
120- }
121-
122- func (t * TriggerRollback ) WithChildren (children ... sql.Node ) (sql.Node , error ) {
123- if len (children ) != 1 {
124- return nil , sql .ErrInvalidChildrenNumber .New (t , len (children ), 1 )
125- }
126-
127- return NewTriggerRollback (children [0 ]), nil
128- }
129-
130- // CheckPrivileges implements the interface sql.Node.
131- func (t * TriggerRollback ) CheckPrivileges (ctx * sql.Context , opChecker sql.PrivilegedOperationChecker ) bool {
132- return t .Child .CheckPrivileges (ctx , opChecker )
133- }
134-
135- // CollationCoercibility implements the interface sql.CollationCoercible.
136- func (t * TriggerRollback ) CollationCoercibility (ctx * sql.Context ) (collation sql.CollationID , coercibility byte ) {
137- return sql .GetCoercibility (ctx , t .Child )
138- }
139-
140- func (t * TriggerRollback ) IsReadOnly () bool {
141- return t .Child .IsReadOnly ()
142- }
143-
144- func (t * TriggerRollback ) String () string {
145- pr := sql .NewTreePrinter ()
146- _ = pr .WriteNode ("TriggerRollback()" )
147- _ = pr .WriteChildren (t .Child .String ())
148- return pr .String ()
149- }
150-
151- func (t * TriggerRollback ) DebugString () string {
152- pr := sql .NewTreePrinter ()
153- _ = pr .WriteNode ("TriggerRollback" )
154- _ = pr .WriteChildren (sql .DebugString (t .Child ))
155- return pr .String ()
156- }
157-
158- type NoopTriggerRollback struct {
159- UnaryNode
160- }
161-
162- var _ sql.Node = (* NoopTriggerRollback )(nil )
163- var _ sql.CollationCoercible = (* NoopTriggerRollback )(nil )
164-
165- func NewNoopTriggerRollback (child sql.Node ) * NoopTriggerRollback {
166- return & NoopTriggerRollback {
167- UnaryNode : UnaryNode {Child : child },
168- }
169- }
170-
171- func (t * NoopTriggerRollback ) WithChildren (children ... sql.Node ) (sql.Node , error ) {
172- if len (children ) != 1 {
173- return nil , sql .ErrInvalidChildrenNumber .New (t , len (children ), 1 )
174- }
175-
176- return NewNoopTriggerRollback (children [0 ]), nil
177- }
178-
179- // CheckPrivileges implements the interface sql.Node.
180- func (t * NoopTriggerRollback ) CheckPrivileges (ctx * sql.Context , opChecker sql.PrivilegedOperationChecker ) bool {
181- return t .Child .CheckPrivileges (ctx , opChecker )
182- }
183-
184- // CollationCoercibility implements the interface sql.CollationCoercible.
185- func (t * NoopTriggerRollback ) CollationCoercibility (ctx * sql.Context ) (collation sql.CollationID , coercibility byte ) {
186- return sql .GetCoercibility (ctx , t .Child )
187- }
188-
189- func (t * NoopTriggerRollback ) IsReadOnly () bool {
190- return true
191- }
192-
193- func (t * NoopTriggerRollback ) String () string {
194- pr := sql .NewTreePrinter ()
195- _ = pr .WriteNode ("TriggerRollback()" )
196- _ = pr .WriteChildren (t .Child .String ())
197- return pr .String ()
198- }
199-
200- func (t * NoopTriggerRollback ) DebugString () string {
201- pr := sql .NewTreePrinter ()
202- _ = pr .WriteNode ("TriggerRollback" )
203- _ = pr .WriteChildren (sql .DebugString (t .Child ))
204- return pr .String ()
205- }
0 commit comments