Skip to content

Commit 0cb0dfe

Browse files
author
James Cor
committed
debug
1 parent 373ed67 commit 0cb0dfe

File tree

5 files changed

+23
-0
lines changed

5 files changed

+23
-0
lines changed

sql/analyzer/fix_exec_indexes.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,13 @@ func fixExprToScope(e sql.Expression, scopes ...*idxScope) sql.Expression {
667667
// this error for the case of DEFAULT in a `plan.Values`, since we analyze the insert source in isolation (we
668668
// don't have the destination schema, and column references in default values are determined in the build phase)
669669

670+
if e.Name() == "v1" {
671+
print()
672+
}
673+
if e.Name() == "vv1" {
674+
print()
675+
}
676+
670677
idx, _ := newScope.getIdxId(e.Id(), e.String())
671678
if idx >= 0 {
672679
return e.WithIndex(idx), transform.NewTree, nil

sql/analyzer/stored_procedures.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ func applyProcedures(ctx *sql.Context, a *Analyzer, n sql.Node, scope *plan.Scop
166166
if !ok {
167167
return n, transform.SameTree, nil
168168
}
169+
if call.Procedure.Name == "add_entry" {
170+
print()
171+
}
172+
if call.Procedure.Name == "back_up" {
173+
print()
174+
}
169175
if scope.IsEmpty() {
170176
scope = scope.WithProcedureCache(plan.NewProcedureCache())
171177
}

sql/analyzer/triggers.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ func applyTriggers(ctx *sql.Context, a *Analyzer, n sql.Node, scope *plan.Scope,
291291
func applyTrigger(ctx *sql.Context, a *Analyzer, originalNode, n sql.Node, scope *plan.Scope, trigger *plan.CreateTrigger, qFlags *sql.QueryFlags) (sql.Node, transform.TreeIdentity, error) {
292292
qFlags.Set(sql.QFlagRelSubquery)
293293

294+
if trigger.TriggerName == "trig" {
295+
print()
296+
}
297+
294298
triggerLogic, err := getTriggerLogic(ctx, a, originalNode, scope, trigger, qFlags)
295299
if err != nil {
296300
return nil, transform.SameTree, err

sql/core.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,9 @@ func DebugString(nodeOrExpression interface{}) string {
394394
if s, ok := nodeOrExpression.(fmt.Stringer); ok {
395395
return s.String()
396396
}
397+
if nodeOrExpression == nil {
398+
return ""
399+
}
397400
panic(fmt.Sprintf("Expected sql.DebugString or fmt.Stringer for %T", nodeOrExpression))
398401
}
399402

sql/plan/insert.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ var _ DisjointedChildrenNode = (*InsertInto)(nil)
8282

8383
// NewInsertInto creates an InsertInto node.
8484
func NewInsertInto(db sql.Database, dst, src sql.Node, isReplace bool, cols []string, onDupExprs []sql.Expression, ignore bool) *InsertInto {
85+
if d, ok := dst.(*InsertDestination); ok && d.DestinationName == "t1" {
86+
print()
87+
}
8588
return &InsertInto{
8689
db: db,
8790
Destination: dst,

0 commit comments

Comments
 (0)