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

'nil'-Error when deparsing certain queries #124

Closed
primeapple opened this issue Jan 15, 2019 · 1 comment
Closed

'nil'-Error when deparsing certain queries #124

primeapple opened this issue Jan 15, 2019 · 1 comment

Comments

@primeapple
Copy link

primeapple commented Jan 15, 2019

Also I found another bug:

When trying to deparse:

select array[]::text[] from x

I get an the following error:

Traceback (most recent call last):
       16: from /home/user/.gem/ruby/2.6.0/gems/pg_query-1.1.0/lib/pg_query/deparse.rb:6:in `deparse'
       15: from /home/user/.gem/ruby/2.6.0/gems/pg_query-1.1.0/lib/pg_query/deparse.rb:6:in `map'
       14: from /home/user/.gem/ruby/2.6.0/gems/pg_query-1.1.0/lib/pg_query/deparse.rb:7:in `block in deparse'
       13: from /home/user/.gem/ruby/2.6.0/gems/pg_query-1.1.0/lib/pg_query/deparse.rb:18:in `from'
       12: from /home/user/.gem/ruby/2.6.0/gems/pg_query-1.1.0/lib/pg_query/deparse.rb:130:in `deparse_item'
       11: from /home/user/.gem/ruby/2.6.0/gems/pg_query-1.1.0/lib/pg_query/deparse.rb:200:in `deparse_raw_stmt'
       10: from /home/user/.gem/ruby/2.6.0/gems/pg_query-1.1.0/lib/pg_query/deparse.rb:138:in `deparse_item'
        9: from /home/user/.gem/ruby/2.6.0/gems/pg_query-1.1.0/lib/pg_query/deparse.rb:784:in `deparse_select'
        8: from /home/user/.gem/ruby/2.6.0/gems/pg_query-1.1.0/lib/pg_query/deparse.rb:784:in `map'
        7: from /home/user/.gem/ruby/2.6.0/gems/pg_query-1.1.0/lib/pg_query/deparse.rb:785:in `block in deparse_select'
        6: from /home/user/.gem/ruby/2.6.0/gems/pg_query-1.1.0/lib/pg_query/deparse.rb:134:in `deparse_item'
        5: from /home/user/.gem/ruby/2.6.0/gems/pg_query-1.1.0/lib/pg_query/deparse.rb:297:in `deparse_restarget'
        4: from /home/user/.gem/ruby/2.6.0/gems/pg_query-1.1.0/lib/pg_query/deparse.rb:148:in `deparse_item'
        3: from /home/user/.gem/ruby/2.6.0/gems/pg_query-1.1.0/lib/pg_query/deparse.rb:923:in `deparse_typecast'
        2: from /home/user/.gem/ruby/2.6.0/gems/pg_query-1.1.0/lib/pg_query/deparse.rb:55:in `deparse_item'
        1: from /home/user/.gem/ruby/2.6.0/gems/pg_query-1.1.0/lib/pg_query/deparse.rb:226:in `deparse_a_arrayexp'
NoMethodError (undefined method `map' for nil:NilClass)

I think this definitely is a bug and should be fixed because something is nil, that certainly shouldn't be null. (bad bad guy, dynamic typing in ruby :-) )

@lfittl
Copy link
Member

lfittl commented Jul 1, 2019

This should be fixed by 823155c

@lfittl lfittl closed this as completed Jul 1, 2019
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

2 participants