diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 20325c5ac..d49f21d76 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -32,9 +32,24 @@ jobs: run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - run: wasm-pack build --target nodejs bindings/wasm - test-compat: + test-limbo: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Test run: make test + + test-sqlite: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install + run: | + set -euo pipefail + mkdir download && cd download + # apt contains an old version of sqlite3 that does not support e.g. string_agg(), so we download 3.46.0 manually + wget https://www.sqlite.org/2024/sqlite-tools-linux-x64-3460000.zip + unzip sqlite-tools-linux-x64-3460000.zip + + - name: Test + run: SQLITE_EXEC="$(pwd)/download/sqlite3" make test diff --git a/cli/main.rs b/cli/main.rs index dfd13ad57..9816b43a6 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -223,7 +223,7 @@ fn query( print!("|"); } match value { - Value::Null => print!("NULL"), + Value::Null => print!(""), Value::Integer(i) => print!("{}", i), Value::Float(f) => print!("{:?}", f), Value::Text(s) => print!("{}", s), @@ -247,7 +247,7 @@ fn query( row.values .iter() .map(|value| match value { - Value::Null => "NULL".cell(), + Value::Null => "".cell(), Value::Integer(i) => i.to_string().cell(), Value::Float(f) => f.to_string().cell(), Value::Text(s) => s.cell(), diff --git a/core/translate.rs b/core/translate.rs index 74ac0f0dd..405d824eb 100644 --- a/core/translate.rs +++ b/core/translate.rs @@ -348,9 +348,7 @@ fn translate_conditions( } } } - (None, None) => { - Ok(None) - } + (None, None) => Ok(None), (Some(where_clause), None) => { let label = program.allocate_label(); translate_condition_expr(program, select, where_clause, label)?; diff --git a/testing/all.test b/testing/all.test index ccde0c24b..f376f70a8 100755 --- a/testing/all.test +++ b/testing/all.test @@ -135,7 +135,7 @@ do_execsql_test coalesce-2 { do_execsql_test coalesce-null { select coalesce(NULL, NULL, NULL); -} {NULL} +} {} do_execsql_test coalesce-first { select coalesce(1, 2, 3); @@ -183,9 +183,10 @@ do_execsql_test inner-join-self-with-where { select u1.first_name as user_name, u2.first_name as neighbor_name from users u1 join users as u2 on u1.id = u2.id + 1 where u1.id = 5 limit 1; } {Edward|Jennifer} -do_execsql_test inner-join-with-where-2 { - select u.first_name from users u join products as p on u.first_name != p.name where u.last_name = 'Williams' limit 1; -} {Laura} +# Uncomment this test when it works. Sqlite3 returns 'Aaron' due to the way it reorders tables in the join based on the where clause. +#do_execsql_test inner-join-with-where-2 { +# select u.first_name from users u join products as p on u.first_name != p.name where u.last_name = 'Williams' limit 1; +#} {Laura} <-- sqlite3 returns 'Aaron' do_execsql_test select-add { select u.age + 1 from users u where u.age = 91 limit 1;