Opened 3 months ago

Closed 3 months ago

#33737 closed Bug (needsinfo)

DB queries with using() not consistent/correct

Reported by: Stephen Brown Owned by: nobody
Component: Database layer (models, ORM) Version: 3.2
Severity: Normal Keywords: using
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I've got a case where I carefully operate on a database with the ORM creating objects (using "objects.using", and in transactions with "using=" consistently set for the decorator arg) - and then querying them in the same session. When I connect with "using" set to non default - the query operations on the created objects do not return any results. It works fine when "using" is set to 'default'. The other database, to confirm it wasn't a database configuration issue, I set it so that the config for "default" pointed to that database, and again it worked fine.

I also removed transactions, to simplify any complexity, and it was still an issue.

I tested this is also an issue with 4.0.4, though I was using 3.2.13 initially.

Change History (2)

comment:1 Changed 3 months ago by Stephen Brown

I should mention the databases against which I was making operations were postgres 13.x

comment:2 Changed 3 months ago by Mariusz Felisiak

Resolution: needsinfo
Status: newclosed

Thanks for the report. Can you provide a minimal project to reproduce? (I'm not sure which methods you're reporting as affected and in what scenario.) Can you reproduce the issue with Django 4.1a1?

Note: See TracTickets for help on using tickets.
Back to Top