()
| 66 | |
| 67 | } |
| 68 | func (m *Command) runSet() error { |
| 69 | |
| 70 | writeContext, ok := m.Ctx.Session.(expr.ContextWriter) |
| 71 | if !ok || writeContext == nil { |
| 72 | u.Warnf("expected context writer but no for %T", m.Ctx.Session) |
| 73 | return fmt.Errorf("No write context?") |
| 74 | } |
| 75 | |
| 76 | //u.Debugf("running set? %v", m.p.Stmt.String()) |
| 77 | for _, col := range m.p.Stmt.Columns { |
| 78 | err := evalSetExpression(col, m.Ctx.Session, col.Expr) |
| 79 | if err != nil { |
| 80 | u.Warnf("Could not evaluate [%s] err=%v", col.Expr, err) |
| 81 | return err |
| 82 | } |
| 83 | } |
| 84 | // for k, v := range m.Ctx.Session.Row() { |
| 85 | // u.Infof("%p session? %s: %v", m.Ctx.Session, k, v.Value()) |
| 86 | // } |
| 87 | return nil |
| 88 | } |
| 89 | |
| 90 | func evalSetExpression(col *rel.CommandColumn, ctx expr.ContextReadWriter, arg expr.Node) error { |
| 91 |
no test coverage detected