Danbooru

Search order:mpixels → StatementInvalid

Posted under Bugs & Features

order:mpixels

Error
Unexpected error: ActiveRecord::StatementInvalid.

Details
ActiveRecord::StatementInvalid exception raised
app/logical/post_query_builder.rb:173:in `paginated_posts'
app/logical/post_query.rb:86:in `paginated_posts'
app/logical/post_sets/post.rb:109:in `posts'
app/controllers/posts_controller.rb:24:in `index'
app/logical/rack_server_timing.rb:18:in `call'

order:mpixels filesize:>10mb workarounds, despite not changing the result page.

Same with order:portrait and order:landscape.

"limit:1" does not help
"age:<" helps, if short enough.

What I understand happens:

What I don't understand:

  • 🐞 Obscure failure.
  • 🐞 I remember some other search passing if I added "age:<some number", even if well beyond the oldest post.

Lesson learned: limit or slice the results count with the same tag, or one related:
order:mpixels mpixels:>300 or order:mpixels filesize:>20mb
order:landscape ratio:>30 or order:landscape width:>5000
order:portrait ratio:<1/30 or order:portrait heigth:>5000

If same tag does not work, and there is none effectively related, it is probably best to slice by post ID:
order:child_count id:1..500000
order:child_count id:500000..1000000
order:child_count id:1000000..1500000

Please update the Search Timeout message accordingly.

Updated

1