From 32bc799c8540ed7848ceb6d919ff0abe4f962f37 Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Wed, 1 Nov 2023 19:19:50 +0800 Subject: [PATCH 1/2] fix: fix parallel testing db name duplication, for the lib Signed-off-by: Richard Chien --- sqllogictest/src/runner.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sqllogictest/src/runner.rs b/sqllogictest/src/runner.rs index 67252ec..b327b7c 100644 --- a/sqllogictest/src/runner.rs +++ b/sqllogictest/src/runner.rs @@ -1023,11 +1023,9 @@ impl> Runner { // for every slt file, we create a database against table conflict let file = file.unwrap(); let db_name = file - .file_name() - .expect("not a valid filename") .to_str() - .expect("not a UTF-8 filename"); - let db_name = db_name.replace([' ', '.', '-'], "_"); + .ok_or_else(|| anyhow!("not a UTF-8 filename"))?; + let db_name = db_name.replace([' ', '.', '-', '/'], "_"); self.conn .run_default(&format!("CREATE DATABASE {db_name};")) From 746714c554c26fea01a51a7a2bc000439b8a5a45 Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Wed, 1 Nov 2023 19:31:09 +0800 Subject: [PATCH 2/2] fix Signed-off-by: Richard Chien --- sqllogictest/src/runner.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sqllogictest/src/runner.rs b/sqllogictest/src/runner.rs index b327b7c..adbfc3d 100644 --- a/sqllogictest/src/runner.rs +++ b/sqllogictest/src/runner.rs @@ -1022,9 +1022,7 @@ impl> Runner { for (idx, file) in files.enumerate() { // for every slt file, we create a database against table conflict let file = file.unwrap(); - let db_name = file - .to_str() - .ok_or_else(|| anyhow!("not a UTF-8 filename"))?; + let db_name = file.to_str().expect("not a UTF-8 filename"); let db_name = db_name.replace([' ', '.', '-', '/'], "_"); self.conn