diff --git a/Gopkg.lock b/Gopkg.lock index 86f2a15f1..c6dff68ee 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -663,7 +663,7 @@ version = "v4.8.1" [[projects]] - digest = "1:645ff53a5db024d2380dd2512de6f68ffbdf1c9f45235eafce7a2389a0531461" + digest = "1:5ca66c5e97c9416cbc987566baa52f838fec2fc78cfccba2b5a690171921030b" name = "gopkg.in/src-d/go-mysql-server.v0" packages = [ ".", @@ -682,7 +682,7 @@ "sql/plan", ] pruneopts = "NT" - revision = "92013a1dbd15542b712192abdd32dfe0d2518f4d" + revision = "5a9075414ef5cc7799a551289f81cd6d34242eaf" [[projects]] digest = "1:f995136b53497081f1b3f29b99e78a597da6afb2bc6f22908382559a863df4ea" diff --git a/Gopkg.toml b/Gopkg.toml index da51ce449..722ba77c6 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -1,6 +1,6 @@ [[constraint]] name = "gopkg.in/src-d/go-mysql-server.v0" - revision = "92013a1dbd15542b712192abdd32dfe0d2518f4d" + revision = "5a9075414ef5cc7799a551289f81cd6d34242eaf" [[constraint]] name = "github.com/jessevdk/go-flags" diff --git a/docs/using-gitbase/functions.md b/docs/using-gitbase/functions.md index f0271ff1b..1f4456904 100644 --- a/docs/using-gitbase/functions.md +++ b/docs/using-gitbase/functions.md @@ -95,4 +95,4 @@ Also, if you want to retrieve values from a non common property, you can pass it ## Standard functions -You can check standard functions in [`go-mysql-server` documentation](https://github.com/src-d/go-mysql-server/tree/92013a1dbd15542b712192abdd32dfe0d2518f4d#custom-functions). +You can check standard functions in [`go-mysql-server` documentation](https://github.com/src-d/go-mysql-server/tree/5a9075414ef5cc7799a551289f81cd6d34242eaf#custom-functions). diff --git a/docs/using-gitbase/indexes.md b/docs/using-gitbase/indexes.md index 8efb06bb3..e07cb8404 100644 --- a/docs/using-gitbase/indexes.md +++ b/docs/using-gitbase/indexes.md @@ -26,4 +26,4 @@ and for the second query also two indexes will be used and the result will be a You can find some more examples in the [examples](./examples.md#create-an-index-for-columns-on-a-table) section. -See [go-mysql-server](https://github.com/src-d/go-mysql-server/tree/92013a1dbd15542b712192abdd32dfe0d2518f4d#indexes) documentation for more details +See [go-mysql-server](https://github.com/src-d/go-mysql-server/tree/5a9075414ef5cc7799a551289f81cd6d34242eaf#indexes) documentation for more details diff --git a/docs/using-gitbase/supported-clients.md b/docs/using-gitbase/supported-clients.md index ca87cb0b0..ae0c868b9 100644 --- a/docs/using-gitbase/supported-clients.md +++ b/docs/using-gitbase/supported-clients.md @@ -1,3 +1,3 @@ ## Supported clients -To see the supported MySQL clients and examples about how to use them, take a look [here](https://github.com/src-d/go-mysql-server/blob/92013a1dbd15542b712192abdd32dfe0d2518f4d/SUPPORTED_CLIENTS.md). +To see the supported MySQL clients and examples about how to use them, take a look [here](https://github.com/src-d/go-mysql-server/blob/5a9075414ef5cc7799a551289f81cd6d34242eaf/SUPPORTED_CLIENTS.md). diff --git a/docs/using-gitbase/supported-syntax.md b/docs/using-gitbase/supported-syntax.md index 90c5b44eb..08a10b28f 100644 --- a/docs/using-gitbase/supported-syntax.md +++ b/docs/using-gitbase/supported-syntax.md @@ -1,3 +1,3 @@ ## Supported syntax -To see the SQL subset currently supported take a look at [this list](https://github.com/src-d/go-mysql-server/blob/92013a1dbd15542b712192abdd32dfe0d2518f4d/SUPPORTED.md) from [src-d/go-mysql-server](https://github.com/src-d/go-mysql-server). +To see the SQL subset currently supported take a look at [this list](https://github.com/src-d/go-mysql-server/blob/5a9075414ef5cc7799a551289f81cd6d34242eaf/SUPPORTED.md) from [src-d/go-mysql-server](https://github.com/src-d/go-mysql-server). diff --git a/vendor/gopkg.in/src-d/go-mysql-server.v0/sql/analyzer/process.go b/vendor/gopkg.in/src-d/go-mysql-server.v0/sql/analyzer/process.go index 84a87c43d..5d486acc2 100644 --- a/vendor/gopkg.in/src-d/go-mysql-server.v0/sql/analyzer/process.go +++ b/vendor/gopkg.in/src-d/go-mysql-server.v0/sql/analyzer/process.go @@ -71,5 +71,19 @@ func trackProcess(ctx *sql.Context, a *Analyzer, n sql.Node) (sql.Node, error) { return n, nil } - return plan.NewQueryProcess(n, func() { processList.Done(ctx.Pid()) }), nil + // Remove QueryProcess nodes from the subqueries. Otherwise, the process + // will be marked as done as soon as a subquery finishes. + node, err := n.TransformUp(func(n sql.Node) (sql.Node, error) { + if sq, ok := n.(*plan.SubqueryAlias); ok { + if qp, ok := sq.Child.(*plan.QueryProcess); ok { + return plan.NewSubqueryAlias(sq.Name(), qp.Child), nil + } + } + return n, nil + }) + if err != nil { + return nil, err + } + + return plan.NewQueryProcess(node, func() { processList.Done(ctx.Pid()) }), nil }