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

fix(session): fix PROMPT_SQL unwrap #445

Merged
merged 3 commits into from
Jul 4, 2024
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
4 changes: 2 additions & 2 deletions cli/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ impl Session {
let rows = conn.query_iter(PROMPT_SQL).await;
match rows {
Ok(mut rows) => {
while let Some(row) = rows.next().await {
let name: (String,) = row.unwrap().try_into().unwrap();
while let Some(Ok(row)) = rows.next().await {
let name: (String,) = row.try_into().unwrap();
keywords.push(name.0);
}
}
Expand Down
1 change: 1 addition & 0 deletions cli/tests/http/05-stream.result
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
27 changes: 27 additions & 0 deletions cli/tests/http/05-stream.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
## uncomment these when QUERY_DATABEND_ENTERPRISE_LICENSE env is set
everpcpc marked this conversation as resolved.
Show resolved Hide resolved

# cat <<SQL | ${BENDSQL}
# CREATE DATABASE IF NOT EXISTS stream_test;

# CREATE OR REPLACE TABLE stream_test.abc
# (
# title VARCHAR,
# author VARCHAR,
# date VARCHAR
# );

# CREATE OR REPLACE STREAM stream_test.s on table stream_test.abc;
# SQL

# cat <<SQL | ${BENDSQL} -D stream_test
# DROP TABLE abc
# SQL

cat <<SQL | ${BENDSQL} -D stream_test
select 1;
SQL

cat <<SQL | ${BENDSQL}
DROP DATABASE IF EXISTS stream_test;
SQL