Hi Michal and Django devs,
While for the most part, Jacob is correct in marking this as a usage question,
there does appear to be something buggy here.
Note how Michal is abusing the db_table setting to select a name with a
schema. He's looking for "protein_therapeutics" (<30) in "mnowotka":
> class ProteinTherapeutics(models.Model):
> #...
> class Meta:
> db_table = 'mnowotka\".\"protein_therapeutics'
This, almost worthy of being called an sql injection, can't be the right way
to achieve the goal. In fact, the Oracle backend (or even some higher, more
generic level) should have doubled those '"' characters to make them part of
the name. But -- save length issues -- the ploy succeeds:
> ...
> (SELECT (1) AS "A"
> FROM "MNOWOTKA"."PROTEIN_THERAPEFB7C") "_SUB"
> ...
This is definitely a bug. The correct output should have been
...
(SELECT (1) AS "A"
FROM "MNOWOTKA"".""PROTEIN_THERAPEFB7C") "_SUB"
...
As if this was the 'mnowotka"."protein_therapeutics' table in the current
schema (wouldn't work -- length 31), and not the protein_therapeutics table
(way shorter than 30) in the mnowotka schema, which is the intended target.
I'm not sure -- perhaps the db_tablespace option is interpreted by the Oracle
backend as schema, which would allow what Michal is trying to do with a sane
API. Otherwise, I'd advise Michal to look at Oracle's table aliases, and mark
this also as a missing feature.
But either way, not doubling quotes is a bug.
(Michal: you don't need the '\' characters; look up Python quoting).
Shai.
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.