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

Crash when doing "is (not) null" checks on JSON fields #38

Closed
e-gineer opened this issue Mar 19, 2021 · 0 comments
Closed

Crash when doing "is (not) null" checks on JSON fields #38

e-gineer opened this issue Mar 19, 2021 · 0 comments

Comments

@e-gineer
Copy link
Contributor

Describe the bug

There is a crash when doing null checks against JSON fields:

> select name, tags from aws_s3_bucket where tags is null
+---------------------------+--------+
| name                      | tags   |
+---------------------------+--------+
| turbot-example-us-east-2  | <null> |
+---------------------------+--------+
> 
> select name, tags from aws_s3_bucket where tags->>'Collective' = 'brooklyn'
+----------------------------+------------------------------------------------------------------------------+
| name                       | tags                                                                         |
+----------------------------+------------------------------------------------------------------------------+
| brooklyn-example-us-east-2 | {"Collective":"brooklyn","Drone":"primary","Name":"turbot.brooklyn.primary"} |
+----------------------------+------------------------------------------------------------------------------+
> 
> select name, tags from aws_s3_bucket where tags->>'Collective' is not null
Error: runtime error: invalid memory address or nil pointer dereference
> 
> select name, tags from aws_s3_bucket where tags->>'Collective' is null
Error: runtime error: invalid memory address or nil pointer dereference
> 
> 

Steampipe version (steampipe -v)

v0.3.0

To reproduce

See above

Expected behavior

Should match against the query (not crash).

Additional context

From the log:

2021-03-19 15:31:44.729 EDT [6791] LOG:  statement: select * from aws_s3_bucket
2021-03-19 15:31:48.243 EDT [6791] LOG:  duration: 3514.316 ms
2021-03-19 15:32:05.649 EDT [6791] LOG:  statement: select name, tags from aws_s3_bucket
2021-03-19 15:32:17.806 EDT [6791] LOG:  statement: select name, tags from aws_s3_bucket where tags->'Collective' is null
2021-03-19T15:32:17.806-0400 [WARN]  hub: goFdwBeginForeignScan failed with panic: runtime error: invalid memory address or nil pointer dereference
2021-03-19 15:32:17.806 EDT [6791] ERROR:  runtime error: invalid memory address or nil pointer dereference
@kaidaguerre kaidaguerre transferred this issue from turbot/steampipe Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant