From 946256efc3d0c61847215c803d5f0db4d0e005a0 Mon Sep 17 00:00:00 2001 From: xxchan Date: Sun, 30 Jun 2024 20:22:46 +0800 Subject: [PATCH 1/5] feat: change `sh` to `bash` Signed-off-by: xxchan --- CHANGELOG.md | 1 + sqllogictest/src/runner.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dbb430..0e7e7ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * runner: `RecordOutput` is now returned by `Runner::run` (or `Runner::run_async`). This allows users to access the output of each record, or check whether the record is skipped. * runner(substitution): add a special variable `__NOW__` which will be replaced with the current Unix timestamp in nanoseconds. * runner(substitution): for `system` commands, we do not substitute environment variables any more, because the shell can do that. It's necessary to escape like `\\` any more. `$__TEST_DIR__`, and are still supported. +* runner(system): change `sh` to `bash`. ## [0.20.6] - 2024-06-21 diff --git a/sqllogictest/src/runner.rs b/sqllogictest/src/runner.rs index 72094e6..c26ee1e 100644 --- a/sqllogictest/src/runner.rs +++ b/sqllogictest/src/runner.rs @@ -647,7 +647,7 @@ impl> Runner { cmd.arg("/C").arg(&command); cmd } else { - let mut cmd = std::process::Command::new("sh"); + let mut cmd = std::process::Command::new("bash"); cmd.arg("-c").arg(&command); cmd }; From 0db647363db5f51d58c020e95c85e9904b8b6c51 Mon Sep 17 00:00:00 2001 From: xxchan Date: Sun, 30 Jun 2024 20:49:14 +0800 Subject: [PATCH 2/5] fix test Signed-off-by: xxchan --- tests/system_command/system_command.slt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system_command/system_command.slt b/tests/system_command/system_command.slt index 7945aab..b5245b2 100644 --- a/tests/system_command/system_command.slt +++ b/tests/system_command/system_command.slt @@ -25,7 +25,7 @@ echo "114514" # Note: 1 blank line in the middle is ok, but not 2 system ok -echo "114\n\n514" +echo $'114\n\n514' ---- 114 From 7b92424dcbe83624831c7f279f0c7ead05110e3a Mon Sep 17 00:00:00 2001 From: xxchan Date: Sun, 30 Jun 2024 20:54:00 +0800 Subject: [PATCH 3/5] update date Signed-off-by: xxchan --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e7e7ea..7653a2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased -## [0.21.0] - 2024-06-28 +## [0.21.0] - 2024-06-30 **Breaking changes**: * runner: `RecordOutput` is now returned by `Runner::run` (or `Runner::run_async`). This allows users to access the output of each record, or check whether the record is skipped. From 0e9a4024695bc7d680d9ef49d33abf028cf0709d Mon Sep 17 00:00:00 2001 From: xxchan Date: Sun, 30 Jun 2024 20:55:25 +0800 Subject: [PATCH 4/5] fix README Signed-off-by: xxchan --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 41d8400..1f945f7 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ exit 1 # Check the output of the command. Same as `error`, empty lines (not consecutive) are allowed, and 2 consecutive empty lines ends the result. system ok -echo "Hello\n\nWorld" +echo $'Hello\n\nWorld' ---- Hello From e2d9938721744480941530b4604cc630c67b45a4 Mon Sep 17 00:00:00 2001 From: xxchan Date: Sun, 30 Jun 2024 20:57:40 +0800 Subject: [PATCH 5/5] fix typo Signed-off-by: xxchan --- CHANGELOG.md | 4 ++-- README.md | 4 ++-- sqllogictest/src/runner.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7653a2f..2f8efdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -102,7 +102,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.17.0] - 2023-09-19 -* Support environment variables substituion for SQL and system commands. +* Support environment variables substitution for SQL and system commands. For compatibility, this feature is by default disabled, and can be enabled by adding `control substitution on` to the test file. ``` control substitution on @@ -172,7 +172,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * We enhanced how `skipif` and `onlyif` works. Previously it checks against `DB::engine_name()`, and `sqllogictest-bin` didn't implement it. - (parser) A minor **breaking change**: Change the field names of `Condition:: OnlyIf/SkipIf`. - - (runner) Add `Runner::add_label`. Now multiple labels are supported ( `DB::engine_name()` is still included). The condition evaluates to true if *any* of the provided labels match the `skipif/onlyif `. + - (runner) Add `Runner::add_label`. Now multiple labels are supported ( `DB::engine_name()` is still included). The condition evaluates to true if *any* of the provided labels match the `skipif/onlyif