提交 50f8bf80 编写于 作者: martianzhang's avatar martianzhang

fix #5 && daily build update

  #5
    Go version large than 1.8 has default GOPATH.
    use `go env GOPATH` get GOPATH envirment variable.

  daily build update
    update vitess vendor package
    update document about installation and configration
上级 77b9ef47
......@@ -4,6 +4,11 @@
# $ checkmake Makefile
#
BINARY=soar
GOPATH ?= $(shell go env GOPATH)
# Ensure GOPATH is set before running build process.
ifeq "$(GOPATH)" ""
$(error Please set the environment variable GOPATH before running `make`)
endif
PATH := ${GOPATH}/bin:$(PATH)
# These are the values we want to pass for VERSION and BUILD
......
![SOAR](https://raw.githubusercontent.com/XiaoMi/soar/master/doc/images/logo.png)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/xiaomi-dba/soar) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://github.com/XiaoMi/soar/blob/master/LICENSE)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/xiaomi-dba/soar) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://github.com/XiaoMi/soar/blob/master/LICENSE) [![Go Report Card](https://goreportcard.com/badge/github.com/XiaoMi/soar)](https://goreportcard.com/report/github.com/XiaoMi/soar)
[文档](http://github.com/XiaoMi/soar/tree/master/doc) | [FAQ](http://github.com/XiaoMi/soar/blob/master/doc/FAQ.md) | [变更记录](http://github.com/XiaoMi/soar/blob/master/CHANGES.md) | [路线图](http://github.com/XiaoMi/soar/blob/master/doc/roadmap.md) | [English](http://github.com/XiaoMi/soar/blob/master/README_EN.md)
......
![SOAR](https://raw.githubusercontent.com/XiaoMi/soar/master/doc/images/logo.png)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/xiaomi-dba/soar) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://github.com/XiaoMi/soar/blob/master/LICENSE)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/xiaomi-dba/soar) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://github.com/XiaoMi/soar/blob/master/LICENSE) [![Go Report Card](https://goreportcard.com/badge/github.com/XiaoMi/soar)](https://goreportcard.com/report/github.com/XiaoMi/soar)
[Docs](http://github.com/XiaoMi/soar/tree/master/doc) | [FAQ](http://github.com/XiaoMi/soar/blob/master/doc/FAQ_en.md) | [中文](http://github.com/XiaoMi/soar/blob/master/README.md)
......
......@@ -158,7 +158,7 @@ var Config = &Configration{
SpaghettiQueryLength: 2048,
AllowDropIndex: false,
LogLevel: 3,
LogOutput: "/dev/stderr",
LogOutput: os.Stderr.Name(),
ReportType: "markdown",
ReportCSS: "",
ReportJavascript: "",
......
......@@ -2,6 +2,8 @@
配置文件为[yaml](https://en.wikipedia.org/wiki/YAML)格式。一般情况下只需要配置online-dsn, test-dsn, log-output等少数几个参数。即使不创建配置文件SOAR仍然会给出基本的启发式建议。
默认文件会按照`/etc/soar.yaml`, `./etc/soar.yaml`, `./soar.yaml`顺序加载,找到第一个后不再继续加载后面的配置文件。如需指定其他配置文件可以通过`-config`参数指定。
```text
# 线上环境配置
online-dsn:
......
......@@ -2,9 +2,10 @@
```bash
wget https://github.com/XiaoMi/soar/releases/download/${tag}/soar.linux-amd64 -O soar
chmod a+x soar
如:
wget https://github.com/XiaoMi/soar/releases/download/v0.8.0/soar.linux-amd64 -O soar
chmod a+x soar
```
## 源码安装
......
......@@ -2,9 +2,10 @@
```bash
wget https://github.com/XiaoMi/soar/releases/download/${tag}/soar.linux-amd64 -O soar
chmod a+x soar
eg.
wget https://github.com/XiaoMi/soar/releases/download/v0.8.0/soar.linux-amd64 -O soar
chmod a+x soar
```
## Build From Source
......
......@@ -1016,68 +1016,68 @@
{
"checksumSHA1": "xN9m8UZAFzUvCzxPCbai/y3N3fg=",
"path": "vitess.io/vitess",
"revision": "97d94af8696ea8b846cf75d2b1f35cf5f17a4dfe",
"revisionTime": "2018-10-18T14:55:22Z"
"revision": "8ed64fbeb8c63e4d9e9102d24c2ccf30e341005c",
"revisionTime": "2018-10-20T13:54:35Z"
},
{
"checksumSHA1": "aKn1oKcY74N8TRLm3Ayt7Q4bbI4=",
"path": "vitess.io/vitess/go/bytes2",
"revision": "97d94af8696ea8b846cf75d2b1f35cf5f17a4dfe",
"revisionTime": "2018-10-18T14:55:22Z"
"revision": "8ed64fbeb8c63e4d9e9102d24c2ccf30e341005c",
"revisionTime": "2018-10-20T13:54:35Z"
},
{
"checksumSHA1": "JVCEN4UGRmg3TofIBdzZMZ3G0Ww=",
"path": "vitess.io/vitess/go/hack",
"revision": "97d94af8696ea8b846cf75d2b1f35cf5f17a4dfe",
"revisionTime": "2018-10-18T14:55:22Z"
"revision": "8ed64fbeb8c63e4d9e9102d24c2ccf30e341005c",
"revisionTime": "2018-10-20T13:54:35Z"
},
{
"checksumSHA1": "L7ROM3XZyVXSD799Isv3bcFFhuQ=",
"path": "vitess.io/vitess/go/sqltypes",
"revision": "97d94af8696ea8b846cf75d2b1f35cf5f17a4dfe",
"revisionTime": "2018-10-18T14:55:22Z"
"revision": "8ed64fbeb8c63e4d9e9102d24c2ccf30e341005c",
"revisionTime": "2018-10-20T13:54:35Z"
},
{
"checksumSHA1": "ntFIQYkBS51G6y+FEkjFW40+HOU=",
"path": "vitess.io/vitess/go/vt/log",
"revision": "97d94af8696ea8b846cf75d2b1f35cf5f17a4dfe",
"revisionTime": "2018-10-18T14:55:22Z"
"revision": "8ed64fbeb8c63e4d9e9102d24c2ccf30e341005c",
"revisionTime": "2018-10-20T13:54:35Z"
},
{
"checksumSHA1": "+AyVYXW7XGu+R8AUNU0YY8DcE8k=",
"path": "vitess.io/vitess/go/vt/proto/query",
"revision": "97d94af8696ea8b846cf75d2b1f35cf5f17a4dfe",
"revisionTime": "2018-10-18T14:55:22Z"
"revision": "8ed64fbeb8c63e4d9e9102d24c2ccf30e341005c",
"revisionTime": "2018-10-20T13:54:35Z"
},
{
"checksumSHA1": "OnWsUHLDKcO3spwH0jD55SvKD24=",
"path": "vitess.io/vitess/go/vt/proto/topodata",
"revision": "97d94af8696ea8b846cf75d2b1f35cf5f17a4dfe",
"revisionTime": "2018-10-18T14:55:22Z"
"revision": "8ed64fbeb8c63e4d9e9102d24c2ccf30e341005c",
"revisionTime": "2018-10-20T13:54:35Z"
},
{
"checksumSHA1": "jUgYgOnOM36Zs1GMRVV+vG1hfnw=",
"path": "vitess.io/vitess/go/vt/proto/vtgate",
"revision": "97d94af8696ea8b846cf75d2b1f35cf5f17a4dfe",
"revisionTime": "2018-10-18T14:55:22Z"
"revision": "8ed64fbeb8c63e4d9e9102d24c2ccf30e341005c",
"revisionTime": "2018-10-20T13:54:35Z"
},
{
"checksumSHA1": "pLWM+SPGZs3k+IhjktE/cGUlpM0=",
"path": "vitess.io/vitess/go/vt/proto/vtrpc",
"revision": "97d94af8696ea8b846cf75d2b1f35cf5f17a4dfe",
"revisionTime": "2018-10-18T14:55:22Z"
"revision": "8ed64fbeb8c63e4d9e9102d24c2ccf30e341005c",
"revisionTime": "2018-10-20T13:54:35Z"
},
{
"checksumSHA1": "SxnOqBYDRN+csdXa9Stf4Q145ak=",
"checksumSHA1": "LDXjimRADIzASesUnWUOJ6smswg=",
"path": "vitess.io/vitess/go/vt/sqlparser",
"revision": "97d94af8696ea8b846cf75d2b1f35cf5f17a4dfe",
"revisionTime": "2018-10-18T14:55:22Z"
"revision": "8ed64fbeb8c63e4d9e9102d24c2ccf30e341005c",
"revisionTime": "2018-10-20T13:54:35Z"
},
{
"checksumSHA1": "oF4XzuOzwvj1iduX/lYqNSyY/HM=",
"path": "vitess.io/vitess/go/vt/vterrors",
"revision": "97d94af8696ea8b846cf75d2b1f35cf5f17a4dfe",
"revisionTime": "2018-10-18T14:55:22Z"
"revision": "8ed64fbeb8c63e4d9e9102d24c2ccf30e341005c",
"revisionTime": "2018-10-20T13:54:35Z"
}
],
"rootPath": "github.com/XiaoMi/soar"
......
......@@ -91,7 +91,7 @@ func Preview(sql string) int {
return StmtRollback
}
switch loweredFirstWord {
case "create", "alter", "rename", "drop", "truncate":
case "create", "alter", "rename", "drop", "truncate", "flush":
return StmtDDL
case "set":
return StmtSet
......
......@@ -739,6 +739,7 @@ const (
DropStr = "drop"
RenameStr = "rename"
TruncateStr = "truncate"
FlushStr = "flush"
CreateVindexStr = "create vindex"
AddColVindexStr = "add vindex"
DropColVindexStr = "drop vindex"
......@@ -772,6 +773,8 @@ func (node *DDL) Format(buf *TrackedBuffer) {
} else {
buf.Myprintf("%s table %v", node.Action, node.Table)
}
case FlushStr:
buf.Myprintf("%s", node.Action)
case CreateVindexStr:
buf.Myprintf("%s %v %v", node.Action, node.VindexSpec.Name, node.VindexSpec)
case AddColVindexStr:
......
......@@ -156,7 +156,7 @@ func forceEOF(yylex interface{}) {
%token <empty> JSON_EXTRACT_OP JSON_UNQUOTE_EXTRACT_OP
// DDL Tokens
%token <bytes> CREATE ALTER DROP RENAME ANALYZE ADD
%token <bytes> CREATE ALTER DROP RENAME ANALYZE ADD FLUSH
%token <bytes> SCHEMA TABLE INDEX VIEW TO IGNORE IF UNIQUE PRIMARY COLUMN SPATIAL FULLTEXT KEY_BLOCK_SIZE
%token <bytes> ACTION CASCADE CONSTRAINT FOREIGN NO REFERENCES RESTRICT
%token <bytes> SHOW DESCRIBE EXPLAIN DATE ESCAPE REPAIR OPTIMIZE TRUNCATE
......@@ -203,7 +203,7 @@ func forceEOF(yylex interface{}) {
%type <statement> command
%type <selStmt> select_statement base_select union_lhs union_rhs
%type <statement> stream_statement insert_statement update_statement delete_statement set_statement
%type <statement> create_statement alter_statement rename_statement drop_statement truncate_statement
%type <statement> create_statement alter_statement rename_statement drop_statement truncate_statement flush_statement
%type <ddl> create_table_prefix
%type <statement> analyze_statement show_statement use_statement other_statement
%type <statement> begin_statement commit_statement rollback_statement
......@@ -340,6 +340,7 @@ command:
| commit_statement
| rollback_statement
| other_statement
| flush_statement
| /*empty*/
{
setParseTree(yylex, nil)
......@@ -1692,6 +1693,11 @@ other_statement:
$$ = &OtherAdmin{}
}
flush_statement:
FLUSH force_eof
{
$$ = &DDL{Action: FlushStr}
}
comment_opt:
{
setAllowComments(yylex, true)
......@@ -3213,6 +3219,7 @@ non_reserved_keyword:
| EXPANSION
| FLOAT_TYPE
| FIELDS
| FLUSH
| FOREIGN
| FULLTEXT
| GEOMETRY
......
......@@ -179,6 +179,7 @@ var keywords = map[string]int{
"float": FLOAT_TYPE,
"float4": UNUSED,
"float8": UNUSED,
"flush": FLUSH,
"for": FOR,
"force": FORCE,
"foreign": FOREIGN,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册