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

Very bad SQL queries triggered by 'sold items' page #3490

Open
rbarreca opened this issue Nov 2, 2018 · 0 comments
Open

Very bad SQL queries triggered by 'sold items' page #3490

rbarreca opened this issue Nov 2, 2018 · 0 comments

Comments

@rbarreca
Copy link
Contributor

rbarreca commented Nov 2, 2018

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Log in as a Bluegrass/Ohio manager
  2. Watch your dev log for crazy SQL queries
  3. Go to http://bluegrassfoodconnection.localtest.me:3000/admin/sold_items?utf8=%E2%9C%93&q[order_order_number_cont]=&q[order_placed_at_date_gteq]=1%20Jan%202017&q[order_placed_at_date_lteq]=31%20Dec%202017&commit=Filter&q[order_market_id_in][]=&q[product_organization_id_in][]=&q[product_organization_id_in][]=4060&q[order_organization_id_in][]=&q[delivery_status_in][]=&q[order_payment_status_in][]=
  4. See nutty queries like
    SELECT DISTINCT "markets"."id", "markets"."name" FROM "markets" WHERE "markets"."id" IN (62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,

Expected behavior
Sane queries.

Error instances

@rbarreca rbarreca added this to To do in Project Board via automation Nov 2, 2018
@rbarreca rbarreca moved this from To do to Product Backlog in Project Board Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Project Board
  
Product Backlog
Development

No branches or pull requests

1 participant