Skip to content

Commit fbd61ef

Browse files
authored
feat: change sh to bash (#225)
1 parent 1233431 commit fbd61ef

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10-
## [0.21.0] - 2024-06-28
10+
## [0.21.0] - 2024-06-30
1111

1212
**Breaking changes**:
1313
* 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.
1414
* runner(substitution): add a special variable `__NOW__` which will be replaced with the current Unix timestamp in nanoseconds.
1515
* 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.
16+
* runner(system): change `sh` to `bash`.
1617

1718
## [0.20.6] - 2024-06-21
1819

@@ -101,7 +102,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
101102

102103
## [0.17.0] - 2023-09-19
103104

104-
* Support environment variables substituion for SQL and system commands.
105+
* Support environment variables substitution for SQL and system commands.
105106
For compatibility, this feature is by default disabled, and can be enabled by adding `control substitution on` to the test file.
106107
```
107108
control substitution on
@@ -171,7 +172,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
171172

172173
* We enhanced how `skipif` and `onlyif` works. Previously it checks against `DB::engine_name()`, and `sqllogictest-bin` didn't implement it.
173174
- (parser) A minor **breaking change**: Change the field names of `Condition:: OnlyIf/SkipIf`.
174-
- (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 <lable>`.
175+
- (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 <label>`.
175176
- (bin) Add `--label` option to specify custom labels.
176177

177178
## [0.13.2] - 2023-03-24

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ exit 1
116116
117117
# Check the output of the command. Same as `error`, empty lines (not consecutive) are allowed, and 2 consecutive empty lines ends the result.
118118
system ok
119-
echo "Hello\n\nWorld"
119+
echo $'Hello\n\nWorld'
120120
----
121121
Hello
122122
@@ -132,7 +132,7 @@ echo $USER
132132
xxchan
133133
```
134134

135-
### Extension: Environment variable substituion in query and statement
135+
### Extension: Environment variable substitution in query and statement
136136

137137
It needs to be enabled by adding `control substitution on` to the test file.
138138

@@ -168,7 +168,7 @@ echo "foo" > "$__TEST_DIR__/foo.txt"
168168

169169
> [!NOTE]
170170
>
171-
> When substitution is on, special characters need to be excaped, e.g., `\$` and `\\`.
171+
> When substitution is on, special characters need to be escaped, e.g., `\$` and `\\`.
172172
>
173173
> `system` commands don't support the advanced substitution features of the [subst](https://docs.rs/subst/latest/subst/) crate,
174174
> and excaping is also not needed.

sqllogictest/src/runner.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub trait AsyncDB {
7878

7979
/// [`Runner`] calls this function to perform sleep.
8080
///
81-
/// The default implementation is `std::thread::sleep`, which is universial to any async runtime
81+
/// The default implementation is `std::thread::sleep`, which is universal to any async runtime
8282
/// but would block the current thread. If you are running in tokio runtime, you should override
8383
/// this by `tokio::time::sleep`.
8484
async fn sleep(dur: Duration) {
@@ -87,7 +87,7 @@ pub trait AsyncDB {
8787

8888
/// [`Runner`] calls this function to run a system command.
8989
///
90-
/// The default implementation is `std::process::Command::output`, which is universial to any
90+
/// The default implementation is `std::process::Command::output`, which is universal to any
9191
/// async runtime but would block the current thread. If you are running in tokio runtime, you
9292
/// should override this by `tokio::process::Command::output`.
9393
async fn run_command(mut command: Command) -> std::io::Result<std::process::Output> {
@@ -647,7 +647,7 @@ impl<D: AsyncDB, M: MakeConnection<Conn = D>> Runner<D, M> {
647647
cmd.arg("/C").arg(&command);
648648
cmd
649649
} else {
650-
let mut cmd = std::process::Command::new("sh");
650+
let mut cmd = std::process::Command::new("bash");
651651
cmd.arg("-c").arg(&command);
652652
cmd
653653
};

tests/system_command/system_command.slt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ echo "114514"
2525

2626
# Note: 1 blank line in the middle is ok, but not 2
2727
system ok
28-
echo "114\n\n514"
28+
echo $'114\n\n514'
2929
----
3030
114
3131

0 commit comments

Comments
 (0)