*: support query block syntax (#11761)
This commit is contained in:
2
go.mod
2
go.mod
@ -41,7 +41,7 @@ require (
|
||||
github.com/pingcap/goleveldb v0.0.0-20171020122428-b9ff6c35079e
|
||||
github.com/pingcap/kvproto v0.0.0-20190724165112-ec9df5f208a7
|
||||
github.com/pingcap/log v0.0.0-20190307075452-bd41d9273596
|
||||
github.com/pingcap/parser v0.0.0-20190819021501-c5d6ce829420
|
||||
github.com/pingcap/parser v0.0.0-20190822024127-41d48df05864
|
||||
github.com/pingcap/pd v0.0.0-20190712044914-75a1f9f3062b
|
||||
github.com/pingcap/tidb-tools v2.1.3-0.20190321065848-1e8b48f5c168+incompatible
|
||||
github.com/pingcap/tipb v0.0.0-20190806070524-16909e03435e
|
||||
|
||||
4
go.sum
4
go.sum
@ -165,8 +165,8 @@ github.com/pingcap/kvproto v0.0.0-20190724165112-ec9df5f208a7/go.mod h1:QMdbTAXC
|
||||
github.com/pingcap/log v0.0.0-20190214045112-b37da76f67a7/go.mod h1:xsfkWVaFVV5B8e1K9seWfyJWFrIhbtUTAD8NV1Pq3+w=
|
||||
github.com/pingcap/log v0.0.0-20190307075452-bd41d9273596 h1:t2OQTpPJnrPDGlvA+3FwJptMTt6MEPdzK1Wt99oaefQ=
|
||||
github.com/pingcap/log v0.0.0-20190307075452-bd41d9273596/go.mod h1:WpHUKhNZ18v116SvGrmjkA9CBhYmuUTKL+p8JC9ANEw=
|
||||
github.com/pingcap/parser v0.0.0-20190819021501-c5d6ce829420 h1:3+QbxWfVvG2aRleHzPZeCPdufmpNtVQtXPsYr4z21cs=
|
||||
github.com/pingcap/parser v0.0.0-20190819021501-c5d6ce829420/go.mod h1:1FNvfp9+J0wvc4kl8eGNh7Rqrxveg15jJoWo/a0uHwA=
|
||||
github.com/pingcap/parser v0.0.0-20190822024127-41d48df05864 h1:ohPZBjGBLoRaaJi9UFYSgDs2dTty9YEyF+TWs7DBo58=
|
||||
github.com/pingcap/parser v0.0.0-20190822024127-41d48df05864/go.mod h1:1FNvfp9+J0wvc4kl8eGNh7Rqrxveg15jJoWo/a0uHwA=
|
||||
github.com/pingcap/pd v0.0.0-20190712044914-75a1f9f3062b h1:oS9PftxQqgcRouKhhdaB52tXhVLEP7Ng3Qqsd6Z18iY=
|
||||
github.com/pingcap/pd v0.0.0-20190712044914-75a1f9f3062b/go.mod h1:3DlDlFT7EF64A1bmb/tulZb6wbPSagm5G4p1AlhaEDs=
|
||||
github.com/pingcap/tidb-tools v2.1.3-0.20190321065848-1e8b48f5c168+incompatible h1:MkWCxgZpJBgY2f4HtwWMMFzSBb3+JPzeJgF3VrXE/bU=
|
||||
|
||||
@ -1620,18 +1620,18 @@ func (s *testPlanSuite) TestAggregationHints(c *C) {
|
||||
},
|
||||
// with Aggregation hints
|
||||
{
|
||||
sql: "select /*+ HASH_AGG */ count(*) from t t1, t t2 where t1.a = t2.b",
|
||||
sql: "select /*+ HASH_AGG() */ count(*) from t t1, t t2 where t1.a = t2.b",
|
||||
best: "LeftHashJoin{TableReader(Table(t))->TableReader(Table(t))}(test.t1.a,test.t2.b)->HashAgg",
|
||||
warning: "",
|
||||
},
|
||||
{
|
||||
sql: "select /*+ STREAM_AGG */ count(t1.a) from t t1, t t2 where t1.a = t2.a*2 group by t1.a",
|
||||
sql: "select /*+ STREAM_AGG() */ count(t1.a) from t t1, t t2 where t1.a = t2.a*2 group by t1.a",
|
||||
best: "LeftHashJoin{TableReader(Table(t))->TableReader(Table(t))->Projection}(test.t1.a,mul(test.t2.a, 2))->Sort->StreamAgg",
|
||||
warning: "",
|
||||
},
|
||||
// test conflict warning
|
||||
{
|
||||
sql: "select /*+ HASH_AGG STREAM_AGG */ count(*) from t t1, t t2 where t1.a = t2.b",
|
||||
sql: "select /*+ HASH_AGG() STREAM_AGG() */ count(*) from t t1, t t2 where t1.a = t2.b",
|
||||
best: "LeftHashJoin{TableReader(Table(t))->TableReader(Table(t))}(test.t1.a,test.t2.b)->StreamAgg",
|
||||
warning: "[planner:1815]Optimizer aggregation hints are conflicted",
|
||||
},
|
||||
|
||||
@ -66,15 +66,15 @@ type hintTableInfo struct {
|
||||
matched bool
|
||||
}
|
||||
|
||||
func tableNames2HintTableInfo(tableNames []model.CIStr) []hintTableInfo {
|
||||
if len(tableNames) == 0 {
|
||||
func tableNames2HintTableInfo(hintTables []ast.HintTable) []hintTableInfo {
|
||||
if len(hintTables) == 0 {
|
||||
return nil
|
||||
}
|
||||
hintTables := make([]hintTableInfo, len(tableNames))
|
||||
for i, tableName := range tableNames {
|
||||
hintTables[i] = hintTableInfo{name: tableName}
|
||||
hintTableInfos := make([]hintTableInfo, len(hintTables))
|
||||
for i, hintTable := range hintTables {
|
||||
hintTableInfos[i] = hintTableInfo{name: hintTable.TableName}
|
||||
}
|
||||
return hintTables
|
||||
return hintTableInfos
|
||||
}
|
||||
|
||||
func (info *tableHintInfo) ifPreferMergeJoin(tableNames ...*model.CIStr) bool {
|
||||
|
||||
Reference in New Issue
Block a user