Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#15209 closed (duplicate)

Manager.raw() allow for WITH ( ... ) SELECT

Reported by: carbonXT Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords: with, Manager.raw()
Cc: carbonXT Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: yes
Easy pickings: UI/UX:


The RawQuery object used by Manager.raw() validates input SQL to ensure that only SELECT queries can be ran through it. This is done such that SELECT queries with using a WITH (...) clause fail validation.

I propose changing the validation of the SQL such that SELECTs with these WITH clauses are ok.

The attached patch does that. It also does not weaken the validation as preceding WITH clauses can only be used with SELECT statements. Re:

Attachments (1)

with_clause_allow.diff (620 bytes) - added by carbonXT 6 years ago.

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by carbonXT

comment:1 Changed 6 years ago by russellm

  • Needs documentation set
  • Needs tests set
  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

Accepted on principle; a WITH clause is easy to identify,

However, if all backends don't support a feature, then validation should be a backend-specific feature.

In addition, the patch requires tests and documentation updates.

comment:2 Changed 5 years ago by ramiro

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #14733.

comment:3 Changed 5 years ago by jacob

  • milestone 1.4 deleted

Milestone 1.4 deleted

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