Run Command
()
| 45 | |
| 46 | // Run Command |
| 47 | func (m *Command) Run() error { |
| 48 | //defer m.Ctx.Recover() |
| 49 | defer close(m.msgOutCh) |
| 50 | |
| 51 | if m.Ctx.Session == nil { |
| 52 | u.Warnf("no Context.Session?") |
| 53 | return fmt.Errorf("no Context.Session?") |
| 54 | } |
| 55 | |
| 56 | switch kw := m.p.Stmt.Keyword(); kw { |
| 57 | case lex.TokenSet: |
| 58 | return m.runSet() |
| 59 | case lex.TokenRollback, lex.TokenCommit: |
| 60 | u.Debugf("ignorning transaction, not implemented. %v", kw.String()) |
| 61 | return nil |
| 62 | default: |
| 63 | u.Warnf("unrecognized command: kw=%v stmt:%s", kw, m.p.Stmt) |
| 64 | } |
| 65 | return ErrNotImplemented |
| 66 | |
| 67 | } |
| 68 | func (m *Command) runSet() error { |
| 69 | |
| 70 | writeContext, ok := m.Ctx.Session.(expr.ContextWriter) |