Skip to content

Commit

Permalink
feat: tweak --override & bump to 0.23.0
Browse files Browse the repository at this point in the history
Signed-off-by: xxchan <[email protected]>
  • Loading branch information
xxchan committed Nov 16, 2024
1 parent d7b814b commit c9850c7
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 11 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [0.23.0] - 2024-11-16

* Refine the behavior of `update_record_with_output` / `--override`
- runner: Previously, `query` returning 0 rows will become `statement ok`. Now it returns `statement count 0`.
- bin: Now `--override` will not change the type chars of `query <types>`, since in practice
it becomes `?`s which might cause confusion.

## [0.22.1] - 2024-11-11

* engines/bin: fix compatibility with the new tokio-postgres minor version.
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolver = "2"
members = ["sqllogictest", "sqllogictest-bin", "sqllogictest-engines", "tests"]

[workspace.package]
version = "0.22.1"
version = "0.23.0"
edition = "2021"
homepage = "https://github.com/risinglightdb/sqllogictest-rs"
keywords = ["sql", "database", "parser", "cli"]
Expand Down
4 changes: 2 additions & 2 deletions sqllogictest-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ glob = "0.3"
itertools = "0.13"
quick-junit = { version = "0.4" }
rand = "0.8"
sqllogictest = { path = "../sqllogictest", version = "0.22" }
sqllogictest-engines = { path = "../sqllogictest-engines", version = "0.22" }
sqllogictest = { path = "../sqllogictest", version = "0.23" }
sqllogictest-engines = { path = "../sqllogictest-engines", version = "0.23" }
tokio = { version = "1", features = [
"rt",
"rt-multi-thread",
Expand Down
4 changes: 2 additions & 2 deletions sqllogictest-bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use quick_junit::{NonSuccessKind, Report, TestCase, TestCaseStatus, TestSuite};
use rand::distributions::DistString;
use rand::seq::SliceRandom;
use sqllogictest::{
default_validator, strict_column_validator, update_record_with_output, AsyncDB, Injected,
default_column_validator, default_validator, update_record_with_output, AsyncDB, Injected,
MakeConnection, Record, Runner,
};

Expand Down Expand Up @@ -750,7 +750,7 @@ async fn update_record<M: MakeConnection>(
&record_output,
"\t",
default_validator,
strict_column_validator,
default_column_validator,
) {
Some(new_record) => {
writeln!(outfile, "{new_record}")?;
Expand Down
2 changes: 1 addition & 1 deletion sqllogictest-engines/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ postgres-types = { version = "0.2.5", features = ["derive", "with-chrono-0_4"] }
rust_decimal = { version = "1.30.0", features = ["tokio-pg"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sqllogictest = { path = "../sqllogictest", version = "0.22" }
sqllogictest = { path = "../sqllogictest", version = "0.23" }
thiserror = "1"
tokio = { version = "1", features = [
"rt",
Expand Down
7 changes: 5 additions & 2 deletions sqllogictest/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,9 @@ impl<D: AsyncDB, M: MakeConnection<Conn = D>> Runner<D, M> {
if matches!(record, Record::Halt { .. }) {
*halt = true;
writeln!(outfile, "{record}")?;
tracing::info!(
"halt record found, all following records will be written AS IS"
);
continue;
}
let record_output = self.apply_record(record.clone()).await;
Expand Down Expand Up @@ -1408,13 +1411,13 @@ pub fn update_record_with_output<T: ColumnType>(
connection,
expected: _,
},
RecordOutput::Statement { error: None, .. },
RecordOutput::Statement { error: None, count },
) => Some(Record::Statement {
sql,
loc,
conditions,
connection,
expected: StatementExpect::Ok,
expected: StatementExpect::Count(*count),
}),
// statement, statement
(
Expand Down

0 comments on commit c9850c7

Please sign in to comment.