Opened 6 years ago

Closed 6 years ago

Last modified 5 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 Changed 6 years ago by Mariusz Felisiak

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

comment:2 Changed 6 years ago by Mariusz Felisiak

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

comment:3 Changed 6 years ago by Andrew Nester

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

comment:4 Changed 6 years ago by Andrew Nester

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

Just created pull request for this ticket PR

comment:5 Changed 6 years ago by Mariusz Felisiak

Patch needs improvement: set

comment:6 Changed 6 years ago by Andrew Nester

Patch needs improvement: unset

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

comment:7 Changed 6 years ago by Simon Charette

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 Changed 6 years ago by Tim Graham

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 Changed 6 years ago by Tim Graham

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:10 Changed 6 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 69b7d4b1:

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

comment:11 Changed 5 years ago by Simon Charette <charette.s@…>

In ee85ef8:

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

Refs #27458, #27843.

Thanks Tim and Mariusz for the review.

comment:12 Changed 5 years ago by Simon Charette <charette.s@…>

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 Changed 5 years ago by Tim Graham <timograham@…>

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