You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/developer/testdrive.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -933,41 +933,43 @@ a version of Materialize that is able to execute the SQL constructs contained th
933
933
934
934
```
935
935
$ skip-if
936
-
SELECT mz_version_num() < 2601;
936
+
SELECT mz_version_num() < 2600203;
937
937
```
938
938
939
+
The above example references v26.2.3
940
+
939
941
## Run an action/query conditionally on version
940
942
941
943
```
942
-
>[version>=13000] SELECT 1;
944
+
>[version>=2600203] SELECT 1;
943
945
1
944
946
```
945
947
946
-
The `[version>=13000]` property allows running the action or query only when we are connected to a Materialize instance with a compatible version. The supported comparison operators are `>`, `>=`, `=`, `<=` and `<`. The version number is the same as returned from [`mz_version_num()`](https://materialize.com/docs/sql/functions/#system-information-functions) and has the same format `XXYYYZZ`, where `XX` is the major version, `YYY` is the minor version and `ZZ` is the patch version. So in the example we are only running the `SELECT 1` query if the Materialize instance is of version `v0.130.0` or higher. For lower versions no query is run and no comparison of results is performed subsequently.
948
+
The `[version>=2600203]` property allows running the action or query only when we are connected to a Materialize instance with a compatible version. The supported comparison operators are `>`, `>=`, `=`, `<=` and `<`. The version number is the same as returned from [`mz_version_num()`](https://materialize.com/docs/sql/functions/#system-information-functions) and has the same format `XXYYYZZ`, where `XX` is the major version, `YYY` is the minor version and `ZZ` is the patch version. So in the example we are only running the `SELECT 1` query if the Materialize instance is of version `v26.2.3` or higher. For lower versions no query is run and no comparison of results is performed subsequently.
947
949
948
950
You can bound the version above and below using the following syntax:
949
951
950
952
```
951
-
>[13500<=version<14300] SELECT 1;
953
+
>[2600203<=version<2600300] SELECT 1;
952
954
1
953
955
```
954
956
955
957
You can use `<` or `<=` freely. The following are equivalent:
956
958
957
959
```
958
-
>[version>14300] SELECT 1;
960
+
>[version>2600300] SELECT 1;
959
961
1
960
-
>[14300<version] SELECT 1;
962
+
>[2600300<version] SELECT 1;
961
963
1
962
964
```
963
965
964
-
If you change the result of a query in version `v0.148.0-dev` for example, you have to keep the old version working in Platform Checks as well as Testdrive/MySQL CDC/Postgres CDC with old syntax for migration tests, since they may run the code with both an older Materialize version and the currently tested one. To do that, you can duplicate the query and version-gate it accordingly:
966
+
If you change the result of a query in version `v26.3.0-dev` for example, you have to keep the old version working in Platform Checks as well as Testdrive/MySQL CDC/Postgres CDC with old syntax for migration tests, since they may run the code with both an older Materialize version and the currently tested one. To do that, you can duplicate the query and version-gate it accordingly:
965
967
966
968
```
967
-
?[version<14800] EXPLAIN SELECT * FROM t1 AS a1, t1 AS a2 WHERE a1.f1 IS NOT NULL;
969
+
?[version<2600300] EXPLAIN SELECT * FROM t1 AS a1, t1 AS a2 WHERE a1.f1 IS NOT NULL;
968
970
[OLD QUERY PLAN HERE]
969
971
970
-
?[version>=14800] EXPLAIN SELECT * FROM t1 AS a1, t1 AS a2 WHERE a1.f1 IS NOT NULL;
972
+
?[version>=2600300] EXPLAIN SELECT * FROM t1 AS a1, t1 AS a2 WHERE a1.f1 IS NOT NULL;
0 commit comments