forked from xelabs/go-mysqlstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkill.go
More file actions
40 lines (32 loc) · 780 Bytes
/
kill.go
File metadata and controls
40 lines (32 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2012, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package sqlparser
import (
"strconv"
)
// NumVal represents numval tuple.
type NumVal struct {
raw string
}
// AsUint64 returns uint64 value.
func (exp *NumVal) AsUint64() uint64 {
v, err := strconv.ParseUint(exp.raw, 10, 64)
if err != nil {
return 1<<63 - 1
}
return v
}
func (*Kill) iStatement() {}
// Kill represents a KILL statement.
type Kill struct {
QueryID *NumVal
}
// Format formats the node.
func (node *Kill) Format(buf *TrackedBuffer) {
buf.Myprintf("kill %s", node.QueryID.raw)
}
// WalkSubtree walks the nodes of the subtree.
func (node *Kill) WalkSubtree(visit Visit) error {
return nil
}