From 32bc799c8540ed7848ceb6d919ff0abe4f962f37 Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Wed, 1 Nov 2023 19:19:50 +0800 Subject: [PATCH] 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};"))