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

Bug: Nil pointer dereference error when querying data with kwil-cli #1195

Open
KwilLuke opened this issue Jan 3, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@KwilLuke
Copy link
Contributor

KwilLuke commented Jan 3, 2025

Version / Commit

main

Operating System

Darwin-Arm64

Configuration

I have a table created with the following query:

{luke}CREATE TABLE posts (id int primary key, name text not null)

Expected Behavior

When I run the following query, I expect to receive a sensible error message because my table_name parameter is not in quotes:

lukelamey@Lukes-MBP-2 .build % ./kwil-cli database query "SELECT * FROM info.columns WHERE table_name = posts"  

Actual Behavior

I receive this error:

lukelamey@Lukes-MBP-2 .build % ./kwil-cli database query "SELECT * FROM info.columns WHERE table_name = posts"             
error querying database: jsonrpc.Error: code = -300, message = runtime error: invalid memory address or nil pointer dereference, data = null
err code = -300, msg = runtime error: invalid memory address or nil pointer dereference

Steps to Reproduce

Create table as described above and run query.

Additional Information

If i do put the table_name in a single quote, the query works as expected. E.g.,

lukelamey@Lukes-MBP-2 .build % ./kwil-cli database query "SELECT * FROM info.columns WHERE table_name = 'posts'"
| column_name | data_type | default_value | is_nullable | is_primary_key | ordinal_position | schema_name | table_name |
+-------------+-----------+---------------+-------------+----------------+------------------+-------------+------------+
| id          | bigint    | <nil>         | false       | true           |                1 | luke        | posts      |
| name        | text      | <nil>         | false       | false          |                2 | luke        | posts      |

This bug may be related to #1194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant