Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#27458 closed Bug (fixed)

Oracle backend giving ORA-00911 : Invalid Character, querying with a literal "%s"

Reported by: Gabriel Canto de Souza Owned by: Andrew Nester
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords: Oracle
Cc: felisiak.mariusz@…, Simon Charette Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This happened after trying to create a new object in the Django Admin interface which has a many to many field with another class, the full html debug page is attached to the ticket

The last query before the error was raised is this :

'SELECT "GEO"."DJANGO_PESSOA"."OBJECTID" FROM "GEO"."DJANGO_PESSOA" INNER '
'JOIN "GEO"."DJANGO_DOCUMENTO"_PF951 ON ("GEO"."DJANGO_PESSOA"."OBJECTID" = '
'"GEO"."DJANGO_DOCUMENTO"_PF951."DJANGOTESTPESSOA_ID") WHERE '
'"GEO"."DJANGO_DOCUMENTO"_PF951."DJANGOTESTDOCUMENTO_ID" = %s'

models.py:

from __future__ import unicode_literals
from django.db import models

class DjangoTestPessoa(models.Model):
    objectid = models.BigIntegerField(primary_key=True,unique=True)
    nome = models.CharField(max_length=150, blank=True, null=True)

    class Meta:
        db_table = '"GEO"."DJANGO_PESSOA"'


class DjangoTestDocumento(models.Model):
    objectid = models.BigIntegerField(primary_key=True,unique=True)
    numero = models.CharField(max_length=150, blank=True, null=True)
    pessoas = models.ManyToManyField(DjangoTestPessoa)
    
    class Meta:
        db_table = '"GEO"."DJANGO_DOCUMENTO"'

Change History (13)

comment:1 by Mariusz Felisiak, 8 years ago

Cc: felisiak.mariusz@… added
Keywords: Oracle added; cx_oracle ora-00911 removed
Triage Stage: UnreviewedAccepted

comment:2 by Mariusz Felisiak, 8 years ago

Would you like to prepare PR? If not, assign it to me.

comment:3 by Andrew Nester, 8 years ago

@felixxm I would like to take care of it if you don't mind

comment:4 by Andrew Nester, 8 years ago

Has patch: set
Owner: changed from nobody to Andrew Nester
Status: newassigned

Just created pull request for this ticket PR

comment:5 by Mariusz Felisiak, 8 years ago

Patch needs improvement: set

comment:6 by Andrew Nester, 8 years ago

Patch needs improvement: unset

I've updated pull request, that's why Patch needs improvement set to No

comment:7 by Simon Charette, 8 years ago

Cc: Simon Charette added
Triage Stage: AcceptedReady for checkin
Version: 1.10master

LGTM pending a final docstring review of the strip_trailing_quotes function from a native speaker.

comment:8 by Tim Graham, 8 years ago

Patch needs improvement: set
Triage Stage: Ready for checkinAccepted

I left some comments for improvement on the PR and closed #18514 as a duplicate.

comment:9 by Tim Graham, 8 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:10 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In 69b7d4b1:

Fixed #27458 -- Fixed invalid sequence/index names when using "USER"."TABLE" db_table on Oracle.

comment:11 by Simon Charette <charette.s@…>, 7 years ago

In ee85ef8:

Fixed #28792 -- Fixed index name truncation of namespaced tables.

Refs #27458, #27843.

Thanks Tim and Mariusz for the review.

comment:12 by Simon Charette <charette.s@…>, 7 years ago

In a35ab95e:

[1.11.x] Fixed #28792 -- Fixed index name truncation of namespaced tables.

Refs #27458, #27843.

Thanks Tim and Mariusz for the review.

Backport of ee85ef8315db839e5723dea19d8b971420a2ebb4 from master

comment:13 by Tim Graham <timograham@…>, 7 years ago

In 0696edbc:

[2.0.x] Fixed #28792 -- Fixed index name truncation of namespaced tables.

Refs #27458, #27843.

Thanks Tim and Mariusz for the review.

Backport of ee85ef8315db839e5723dea19d8b971420a2ebb4 from master

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