diff --git a/CHANGELOG.md b/CHANGELOG.md index 680f650..55d36e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 `, 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. diff --git a/Cargo.lock b/Cargo.lock index e9da7ca..cbc272b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1900,7 +1900,7 @@ dependencies = [ [[package]] name = "sqllogictest" -version = "0.22.0" +version = "0.23.0" dependencies = [ "async-trait", "educe", @@ -1923,7 +1923,7 @@ dependencies = [ [[package]] name = "sqllogictest-bin" -version = "0.22.0" +version = "0.23.0" dependencies = [ "anyhow", "async-trait", @@ -1945,7 +1945,7 @@ dependencies = [ [[package]] name = "sqllogictest-engines" -version = "0.22.0" +version = "0.23.0" dependencies = [ "async-trait", "bytes", diff --git a/Cargo.toml b/Cargo.toml index 905cdc1..6a7df83 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] diff --git a/sqllogictest-bin/Cargo.toml b/sqllogictest-bin/Cargo.toml index 51a0c7c..5c9f428 100644 --- a/sqllogictest-bin/Cargo.toml +++ b/sqllogictest-bin/Cargo.toml @@ -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", diff --git a/sqllogictest-bin/src/main.rs b/sqllogictest-bin/src/main.rs index 0398c84..564f0de 100644 --- a/sqllogictest-bin/src/main.rs +++ b/sqllogictest-bin/src/main.rs @@ -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, }; @@ -750,7 +750,7 @@ async fn update_record( &record_output, "\t", default_validator, - strict_column_validator, + default_column_validator, ) { Some(new_record) => { writeln!(outfile, "{new_record}")?; diff --git a/sqllogictest-engines/Cargo.toml b/sqllogictest-engines/Cargo.toml index 1e3ad75..7ed5384 100644 --- a/sqllogictest-engines/Cargo.toml +++ b/sqllogictest-engines/Cargo.toml @@ -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", diff --git a/sqllogictest/src/runner.rs b/sqllogictest/src/runner.rs index 8386b90..1e651c8 100644 --- a/sqllogictest/src/runner.rs +++ b/sqllogictest/src/runner.rs @@ -1332,6 +1332,9 @@ impl> Runner { 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; @@ -1408,13 +1411,13 @@ pub fn update_record_with_output( 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 (