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

Fix Oracle Query Failure caused by TextField on Group By Clause #337

Merged
merged 4 commits into from
Oct 6, 2020

Conversation

ahmetkucuk
Copy link
Contributor

@ahmetkucuk ahmetkucuk commented Aug 28, 2018

Annotation in Query puts sql and description into Group By clause which fails in Oracle. In Oracle, NCLOB cannot be used in group by clause. See similar issue report:

https://code.djangoproject.com/ticket/24096

Seems like there are two solution, either .defer('sql', 'description') or using prefetch and count. Former will create several extra queries when we try to reach those attributes. Implemented approach will create 1 extra query to fetch querylog_set.

TextField cannot be nullable in Oracle.

@ahmetkucuk ahmetkucuk changed the title Fix Oracle Group By Query Failure Fix Oracle Query Failure caused TextField on Group By Clause Aug 28, 2018
@ahmetkucuk ahmetkucuk changed the title Fix Oracle Query Failure caused TextField on Group By Clause Fix Oracle Query Failure caused by TextField on Group By Clause Feb 21, 2019
@marksweb
Copy link
Collaborator

marksweb commented Oct 6, 2020

@ahmetkucuk I'm just going over old PRs and this is quite old now - is this still relevant?

@ahmetkucuk
Copy link
Contributor Author

I think it is relevant because I still use the library from my own fork because of this issue.

@marksweb
Copy link
Collaborator

marksweb commented Oct 6, 2020

@ahmetkucuk thanks. I don't have any access to oracle so will merge this on the basis that you're running it successfully.

However, could you please merge master back to your fork to update this PR, because there's a 0008 migration in master which looks like it'll conflict with these changes.

@ahmetkucuk
Copy link
Contributor Author

I updated the migrations. I didn't check if there are any new Oracle issues but I will open another PR if there is.

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

Successfully merging this pull request may close these issues.

2 participants