提交 0283009f 编写于 作者: martianzhang's avatar martianzhang

cspell check update, fix spell error

上级 22a2a71c
......@@ -46,7 +46,7 @@ SELECT country_id, last_update FROM city NATURAL LEFT JOIN country;
SELECT country_id, last_update FROM city NATURAL RIGHT JOIN country;
SELECT a.country_id, a.last_update FROM city a STRAIGHT_JOIN country b ON a.country_id=b.country_id;
SELECT d.deptno,d.dname,d.loc FROM scott.dept d WHERE d.deptno IN (SELECT e.deptno FROM scott.emp e);
SELECT visitor_id, url FROM (SELECT id FROM log WHERE ip="123.45.67.89" order by tsdesc limit 50, 10) I JOIN log ON (I.id=log.id) JOIN url ON (url.id=log.url_id) order by TS desc;
SELECT visitor_id, url FROM (SELECT id FROM log WHERE ip="123.45.67.89" order by ts desc limit 50, 10) I JOIN log ON (I.id=log.id) JOIN url ON (url.id=log.url_id) order by TS desc;
DELETE city, country FROM city INNER JOIN country using (country_id) WHERE city.city_id = 1;
DELETE city FROM city LEFT JOIN country ON city.country_id = country.country_id WHERE country.country IS NULL;
DELETE a1, a2 FROM city AS a1 INNER JOIN country AS a2 WHERE a1.country_id=a2.country_id;
......
此差异已折叠。
......@@ -456,7 +456,7 @@ SELECT
e. deptno
FROM
scott. emp e);
SELECT visitor_id, url FROM (SELECT id FROM log WHERE ip="123.45.67.89" order by tsdesc limit 50, 10) I JOIN log ON (I.id=log.id) JOIN url ON (url.id=log.url_id) order by TS desc;
SELECT visitor_id, url FROM (SELECT id FROM log WHERE ip="123.45.67.89" order by ts desc limit 50, 10) I JOIN log ON (I.id=log.id) JOIN url ON (url.id=log.url_id) order by TS desc;
SELECT
visitor_id, url
......@@ -469,7 +469,7 @@ FROM
WHERE
ip= "123.45.67.89"
ORDER BY
tsdesc
ts desc
LIMIT
50, 10) I
JOIN LOG ON (I. id= LOG. id)
......
......@@ -45,7 +45,7 @@ insert into film values(1,2,3,4,5)
insert into film(film_id, title, description, release_year, language_id) values (1, 2, 3, 4, 5)
```
## having
* **Description**:将查询的HAVING子句改写为WHERE中的查询条件
* **Description**:将查询的 HAVING 子句改写为 WHERE 中的查询条件
* **Original**:
......@@ -59,7 +59,7 @@ SELECT state, COUNT(*) FROM Drivers GROUP BY state HAVING state IN ('GA', 'TX')
select state, COUNT(*) from Drivers where state in ('GA', 'TX') group by state order by state asc
```
## orderbynull
* **Description**:如果GROUP BY语句不指定ORDER BY条件会导致无谓的排序产生,如果不需要排序建议添加ORDER BY NULL
* **Description**:如果 GROUP BY 语句不指定 ORDER BY 条件会导致无谓的排序产生,如果不需要排序建议添加 ORDER BY NULL
* **Original**:
......@@ -73,7 +73,7 @@ SELECT sum(col1) FROM tbl GROUP BY col
select sum(col1) from tbl group by col order by null
```
## unionall
* **Description**:可以接受重复的时间,使用UNION ALL替代UNION以提高查询效率
* **Description**:可以接受重复的时间,使用 UNION ALL 替代 UNION 以提高查询效率
* **Original**:
......@@ -87,7 +87,7 @@ select country_id from city union select country_id from country
select country_id from city union all select country_id from country
```
## or2in
* **Description**:将同一列不同条件的OR查询转写为IN查询
* **Description**:将同一列不同条件的 OR 查询转写为 IN 查询
* **Original**:
......@@ -101,7 +101,7 @@ select country_id from city where col1 = 1 or (col2 = 1 or col2 = 2 ) or col1 =
select country_id from city where (col2 in (1, 2)) or col1 in (1, 3);
```
## dmlorderby
* **Description**:删除DML更新操作中无意义的ORDER BY
* **Description**:删除 DML 更新操作中无意义的 ORDER BY
* **Original**:
......@@ -185,7 +185,7 @@ SELECT count(col) FROM tbl GROUP BY 1;
SELECT count(*) FROM tbl GROUP BY 1;
```
## innodb
* **Description**:建表时建议使用InnoDB引擎,非InnoDB引擎表自动转InnoDB
* **Description**:建表时建议使用InnoDB引擎,非 InnoDB 引擎表自动转 InnoDB
* **Original**:
......@@ -229,7 +229,7 @@ create table t1 (id int(20) not null auto_increment) ENGINE=InnoDB;
create table t1 (id int(10) not null auto_increment) ENGINE=InnoDB;
```
## truncate
* **Description**:不带WHERE条件的DELETE操作建议修改为TRUNCATE
* **Description**:不带 WHERE 条件的 DELETE 操作建议修改为 TRUNCATE
* **Original**:
......
......@@ -1100,7 +1100,7 @@ SELECT
e. deptno
FROM
scott. emp e);
SELECT visitor_id, url FROM (SELECT id FROM log WHERE ip="123.45.67.89" order by tsdesc limit 50, 10) I JOIN log ON (I.id=log.id) JOIN url ON (url.id=log.url_id) order by TS desc;
SELECT visitor_id, url FROM (SELECT id FROM log WHERE ip="123.45.67.89" order by ts desc limit 50, 10) I JOIN log ON (I.id=log.id) JOIN url ON (url.id=log.url_id) order by TS desc;
SELECT
visitor_id, url
......@@ -1113,7 +1113,7 @@ FROM
WHERE
ip= "123.45.67.89"
ORDER BY
tsdesc
ts desc
LIMIT
50, 10) I
JOIN LOG ON (I. id= LOG. id)
......
......@@ -41,19 +41,19 @@ func PrintPrettyStmtNode(sql, charset, collation string) {
}
}
// TiVisitor TODO
// TiVisitor TODO:
type TiVisitor struct {
EnterFunc func(node ast.Node) bool
LeaveFunc func(node ast.Node) bool
}
// Enter TODO
// Enter TODO:
func (visitor *TiVisitor) Enter(n ast.Node) (node ast.Node, skip bool) {
skip = visitor.EnterFunc(n)
return
}
// Leave TODO
// Leave TODO:
func (visitor *TiVisitor) Leave(n ast.Node) (node ast.Node, ok bool) {
ok = visitor.LeaveFunc(n)
return
......
......@@ -112,7 +112,7 @@ func TestSplitStatement(t *testing.T) {
}
buf2s := [][]byte{
[]byte("select * from test\\Ghello"),
[]byte("select 'asd\\Gfas', col from test\\Ghello"),
[]byte("select 'hello\\Gworld', col from test\\Ghello"),
[]byte("-- select * from test\\Ghello"),
[]byte("#select * from test\\Ghello"),
[]byte("select * /*comment*/from test\\Ghello"),
......
......@@ -141,7 +141,7 @@ func init() {
// Delayed Join
// https://www.percona.com/blog/2007/04/06/using-delayed-join-to-optimize-count-and-limit-queries/
`SELECT visitor_id, url FROM (SELECT id FROM log WHERE ip="123.45.67.89" order by tsdesc limit 50, 10) I JOIN log ON (I.id=log.id) JOIN url ON (url.id=log.url_id) order by TS desc;`,
`SELECT visitor_id, url FROM (SELECT id FROM log WHERE ip="123.45.67.89" order by ts desc limit 50, 10) I JOIN log ON (I.id=log.id) JOIN url ON (url.id=log.url_id) order by TS desc;`,
// DELETE
"DELETE city, country FROM city INNER JOIN country using (country_id) WHERE city.city_id = 1;",
......
......@@ -183,7 +183,7 @@ type ExplainJSONOrderingOperation struct {
Table ExplainJSONTable `json:"table"`
DuplicatesRemoval ExplainJSONDuplicatesRemoval `json:"duplicates_removal"`
GroupingOperation ExplainJSONGroupingOperation `json:"grouping_operation"`
OderbySubqueries []ExplainJSONSubqueries `json:"order_by_subqueries"`
OrderbySubqueries []ExplainJSONSubqueries `json:"order_by_subqueries"`
}
// ExplainJSONQueryBlock JSON
......@@ -1016,7 +1016,7 @@ func PrintMarkdownExplainTable(exp *ExplainInfo) string {
rows := exp.ExplainRows
// JSON 转换为 TRADITIONAL 格式
if exp.ExplainFormat == JSONFormatExplain {
buf = append(buf, fmt.Sprint("以下为JSON格式转为传统格式EXPLAIN表格", "\n\n"))
buf = append(buf, fmt.Sprint("以下为 JSON 格式转为传统格式 EXPLAIN 表格", "\n\n"))
rows = ConvertExplainJSON2Row(exp.ExplainJSON)
}
......
......@@ -45,7 +45,7 @@ insert into film values(1,2,3,4,5)
insert into film(film_id, title, description, release_year, language_id) values (1, 2, 3, 4, 5)
```
## having
* **Description**:将查询的HAVING子句改写为WHERE中的查询条件
* **Description**:将查询的 HAVING 子句改写为 WHERE 中的查询条件
* **Original**:
......@@ -59,7 +59,7 @@ SELECT state, COUNT(*) FROM Drivers GROUP BY state HAVING state IN ('GA', 'TX')
select state, COUNT(*) from Drivers where state in ('GA', 'TX') group by state order by state asc
```
## orderbynull
* **Description**:如果GROUP BY语句不指定ORDER BY条件会导致无谓的排序产生,如果不需要排序建议添加ORDER BY NULL
* **Description**:如果 GROUP BY 语句不指定 ORDER BY 条件会导致无谓的排序产生,如果不需要排序建议添加 ORDER BY NULL
* **Original**:
......@@ -73,7 +73,7 @@ SELECT sum(col1) FROM tbl GROUP BY col
select sum(col1) from tbl group by col order by null
```
## unionall
* **Description**:可以接受重复的时间,使用UNION ALL替代UNION以提高查询效率
* **Description**:可以接受重复的时间,使用 UNION ALL 替代 UNION 以提高查询效率
* **Original**:
......@@ -87,7 +87,7 @@ select country_id from city union select country_id from country
select country_id from city union all select country_id from country
```
## or2in
* **Description**:将同一列不同条件的OR查询转写为IN查询
* **Description**:将同一列不同条件的 OR 查询转写为 IN 查询
* **Original**:
......@@ -101,7 +101,7 @@ select country_id from city where col1 = 1 or (col2 = 1 or col2 = 2 ) or col1 =
select country_id from city where (col2 in (1, 2)) or col1 in (1, 3);
```
## dmlorderby
* **Description**:删除DML更新操作中无意义的ORDER BY
* **Description**:删除 DML 更新操作中无意义的 ORDER BY
* **Original**:
......@@ -185,7 +185,7 @@ SELECT count(col) FROM tbl GROUP BY 1;
SELECT count(*) FROM tbl GROUP BY 1;
```
## innodb
* **Description**:建表时建议使用InnoDB引擎,非InnoDB引擎表自动转InnoDB
* **Description**:建表时建议使用InnoDB引擎,非 InnoDB 引擎表自动转 InnoDB
* **Original**:
......@@ -229,7 +229,7 @@ create table t1 (id int(20) not null auto_increment) ENGINE=InnoDB;
create table t1 (id int(10) not null auto_increment) ENGINE=InnoDB;
```
## truncate
* **Description**:不带WHERE条件的DELETE操作建议修改为TRUNCATE
* **Description**:不带 WHERE 条件的 DELETE 操作建议修改为 TRUNCATE
* **Original**:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册