Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add dummy select case #618

Merged
merged 3 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions tests/cases/standalone/select/dummy.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
select 1;

+--------------------------+
| Int64(1), #Field, #Int64 |
+--------------------------+
| 1 |
+--------------------------+

select 2 + 3;

+----------------------------------------+
| Int64(2) Plus Int64(3), #Field, #Int64 |
+----------------------------------------+
| 5 |
+----------------------------------------+

select 4 + 0.5;

+----------------------------------------------+
| Int64(4) Plus Float64(0.5), #Field, #Float64 |
+----------------------------------------------+
| 4.5 |
+----------------------------------------------+

select "a";
waynexia marked this conversation as resolved.
Show resolved Hide resolved

Failed to execute, error: Datanode { code: 3000, msg: "Failed to execute sql, source: Cannot plan SQL: SELECT \"a\", source: Error during planning: Invalid identifier '#a' for schema fields:[], metadata:{}" }

select "A";

Failed to execute, error: Datanode { code: 3000, msg: "Failed to execute sql, source: Cannot plan SQL: SELECT \"A\", source: Error during planning: Invalid identifier '#A' for schema fields:[], metadata:{}" }

select * where "a" = "A";

Failed to execute, error: Datanode { code: 3000, msg: "Failed to execute sql, source: Cannot plan SQL: SELECT * WHERE \"a\" = \"A\", source: Error during planning: Invalid identifier '#a' for schema fields:[], metadata:{}" }

11 changes: 11 additions & 0 deletions tests/cases/standalone/select/dummy.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
select 1;

select 2 + 3;

select 4 + 0.5;

select "a";

select "A";

select * where "a" = "A";
8 changes: 4 additions & 4 deletions tests/runner/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ impl Environment for Env {

async fn start(&self, mode: &str, _config: Option<String>) -> Self::DB {
match mode {
"local" => Self::start_local().await,
"remote" => Self::start_remote().await,
"standalone" => Self::start_standalone().await,
"distributed" => Self::start_distributed().await,
_ => panic!("Unexpected mode: {}", mode),
}
}
Expand All @@ -48,7 +48,7 @@ impl Environment for Env {
}

impl Env {
pub async fn start_local() -> GreptimeDB {
pub async fn start_standalone() -> GreptimeDB {
let server_process = Command::new("cargo")
.current_dir("../")
.args(["run", "--", "standalone", "start"])
Expand All @@ -67,7 +67,7 @@ impl Env {
}
}

pub async fn start_remote() -> GreptimeDB {
pub async fn start_distributed() -> GreptimeDB {
todo!()
}
}
Expand Down