From eb291542c043219a14772f9c2feb6344c161a9df Mon Sep 17 00:00:00 2001 From: Andres Taylor Date: Tue, 19 Jan 2021 07:14:56 +0100 Subject: [PATCH 1/3] procs are supported Signed-off-by: Andres Taylor --- .../en/docs/reference/compatibility/mysql-compatibility.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/en/docs/reference/compatibility/mysql-compatibility.md b/content/en/docs/reference/compatibility/mysql-compatibility.md index 3394d9379..63032b3e9 100644 --- a/content/en/docs/reference/compatibility/mysql-compatibility.md +++ b/content/en/docs/reference/compatibility/mysql-compatibility.md @@ -32,7 +32,9 @@ Vitess supports a subset of subqueries. For example, a subquery combined with a ### Stored Procedures -Vitess does not yet support MySQL Stored Procedures. +Calling stored procedures using `CALL` is supported for unsharded keyspaces, or if you directly target a specific shard. + +`CREATE PROCEDURE` however is not supported - you have to create the procedure directly on the underlying MySQL servers and not through Vitess. ### Window Functions and CTEs From c78339312bb3b0faf976a295c16fe4938e15f8e2 Mon Sep 17 00:00:00 2001 From: Andres Taylor Date: Tue, 19 Jan 2021 15:29:01 +0100 Subject: [PATCH 2/3] added blurb about multiple results and OUT variables Signed-off-by: Andres Taylor --- .../en/docs/reference/compatibility/mysql-compatibility.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/en/docs/reference/compatibility/mysql-compatibility.md b/content/en/docs/reference/compatibility/mysql-compatibility.md index 63032b3e9..1565bd0fe 100644 --- a/content/en/docs/reference/compatibility/mysql-compatibility.md +++ b/content/en/docs/reference/compatibility/mysql-compatibility.md @@ -32,7 +32,9 @@ Vitess supports a subset of subqueries. For example, a subquery combined with a ### Stored Procedures -Calling stored procedures using `CALL` is supported for unsharded keyspaces, or if you directly target a specific shard. +Calling stored procedures using `CALL` is supported for unsharded keyspaces, or if you directly target a specific shard. This includes returning multiple results from a single. + +OUT variables are not yet supported. `CREATE PROCEDURE` however is not supported - you have to create the procedure directly on the underlying MySQL servers and not through Vitess. From 20645f3bda0f410641ab027f679ee8f185fbe499 Mon Sep 17 00:00:00 2001 From: Andres Taylor Date: Tue, 26 Jan 2021 19:27:03 +0100 Subject: [PATCH 3/3] few updates - @@version and CALL limitations Signed-off-by: Andres Taylor --- content/en/docs/concepts/query-rewriting.md | 3 +++ .../reference/compatibility/mysql-compatibility.md | 10 +++++++--- content/en/docs/troubleshoot/_index.md | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/content/en/docs/concepts/query-rewriting.md b/content/en/docs/concepts/query-rewriting.md index 9d8d87bfb..d74c70e1a 100644 --- a/content/en/docs/concepts/query-rewriting.md +++ b/content/en/docs/concepts/query-rewriting.md @@ -66,6 +66,9 @@ Vitess handles system variables in one of four different ways: * *Vitess aware*. These are settings that change Vitess' behaviour, and are not sent down to MySQL * *Reserved connection*. For some settings, it makes sense to allow them to be set, but it also means that we can't use a shared connection for this user. What this means is that every connection done on this users behalf will need to first have these system variables set, and then keep the connection dedicated. Connection pooling is important for the performance of Vitess, and reserved connections can't be pooled, so this should not be the normal way to run applications on Vitess. Just make sure that the global variable is set to the same value the application will set it to, and Vitess can use connection pooling. +In addition to this, Vitess makes sure that @@version includes both the emulated MySQL version and the Vitess version, such as: `5.7.9-vitess-10.0.0-SNAPSHOT`. This value can be changed by using the vtgate flag `-mysql_server_version`. + + ### Special functions There are a few special functions that Vitess handles without delegating to MySQL. diff --git a/content/en/docs/reference/compatibility/mysql-compatibility.md b/content/en/docs/reference/compatibility/mysql-compatibility.md index 1565bd0fe..e5ab5120f 100644 --- a/content/en/docs/reference/compatibility/mysql-compatibility.md +++ b/content/en/docs/reference/compatibility/mysql-compatibility.md @@ -32,11 +32,15 @@ Vitess supports a subset of subqueries. For example, a subquery combined with a ### Stored Procedures -Calling stored procedures using `CALL` is supported for unsharded keyspaces, or if you directly target a specific shard. This includes returning multiple results from a single. +Calling stored procedures using `CALL` is supported for unsharded keyspaces, or if you directly target a specific shard. They can return no results. -OUT variables are not yet supported. +Only IN parameters are supported. -`CREATE PROCEDURE` however is not supported - you have to create the procedure directly on the underlying MySQL servers and not through Vitess. +If you use transactions, the transaction state cannot change between calls - if there is a transaction open at the beginning of the CALL, a transaction must still be open after the procedure has run. + +Likewise, if there is no transaction open, the procedure should not leave an open transaction after itself. + +`CREATE PROCEDURE` is not supported - you have to create the procedure directly on the underlying MySQL servers and not through Vitess. ### Window Functions and CTEs diff --git a/content/en/docs/troubleshoot/_index.md b/content/en/docs/troubleshoot/_index.md index 9cb6d54c9..e99a70149 100644 --- a/content/en/docs/troubleshoot/_index.md +++ b/content/en/docs/troubleshoot/_index.md @@ -16,5 +16,5 @@ When an alert fires, you have the following sources of information to perform yo ### Find Vitess build running ``` -select @@vitess_version; +select @@version; ```