[Django] #27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a literal "%s"

17 views
Skip to first unread message

Django

unread,
Nov 7, 2016, 12:55:49 PM11/7/16
to django-...@googlegroups.com
#27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a
literal "%s"
-------------------------------------+-------------------------------------
Reporter: Gabriel | Owner: nobody
Canto de Souza |
Type: Bug | Status: new
Component: Database | Version: 1.10
layer (models, ORM) |
Severity: Normal | Keywords: cx_oracle ora-00911
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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'

{{{
#!div style="font-size: 80%"
models.py:
{{{#!python
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"'
}}}
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27458>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 7, 2016, 12:56:12 PM11/7/16
to django-...@googlegroups.com
#27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a
literal "%s"
-------------------------------------+-------------------------------------
Reporter: Gabriel Canto de | Owner: nobody

Souza |
Type: Bug | Status: new
Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution:

Keywords: cx_oracle ora-00911 | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Gabriel Canto de Souza):

* Attachment "DatabaseError at
_admin_cadastro_djangotestdocumento_add_.htm" added.

Debug page

Django

unread,
Nov 7, 2016, 4:30:20 PM11/7/16
to django-...@googlegroups.com
#27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a
literal "%s"
-------------------------------------+-------------------------------------
Reporter: Gabriel Canto de | Owner: nobody

Souza |
Type: Bug | Status: new
Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution:
Keywords: Oracle | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* keywords: cx_oracle ora-00911 => Oracle
* cc: felisiak.mariusz@… (added)
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/27458#comment:1>

Django

unread,
Nov 8, 2016, 9:43:19 AM11/8/16
to django-...@googlegroups.com
#27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a
literal "%s"
-------------------------------------+-------------------------------------
Reporter: Gabriel Canto de | Owner: nobody

Souza |
Type: Bug | Status: new
Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution:
Keywords: Oracle | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by felixxm):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/27458#comment:2>

Django

unread,
Nov 8, 2016, 1:57:45 PM11/8/16
to django-...@googlegroups.com
#27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a
literal "%s"
-------------------------------------+-------------------------------------
Reporter: Gabriel Canto de | Owner: nobody

Souza |
Type: Bug | Status: new
Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution:
Keywords: Oracle | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Andrew Nester):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/27458#comment:3>

Django

unread,
Nov 9, 2016, 5:43:59 AM11/9/16
to django-...@googlegroups.com
#27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a
literal "%s"
-------------------------------------+-------------------------------------
Reporter: Gabriel Canto de | Owner: Andrew
Souza | Nester
Type: Bug | Status: assigned

Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution:
Keywords: Oracle | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Andrew Nester):

* owner: nobody => Andrew Nester
* status: new => assigned
* has_patch: 0 => 1


Comment:

Just created pull request for this ticket
[https://github.com/django/django/pull/7532 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/27458#comment:4>

Django

unread,
Nov 9, 2016, 9:52:34 AM11/9/16
to django-...@googlegroups.com
#27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a
literal "%s"
-------------------------------------+-------------------------------------
Reporter: Gabriel Canto de | Owner: Andrew
Souza | Nester
Type: Bug | Status: assigned
Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution:
Keywords: Oracle | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/27458#comment:5>

Django

unread,
Nov 11, 2016, 6:31:58 AM11/11/16
to django-...@googlegroups.com
#27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a
literal "%s"
-------------------------------------+-------------------------------------
Reporter: Gabriel Canto de | Owner: Andrew
Souza | Nester
Type: Bug | Status: assigned
Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution:
Keywords: Oracle | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Andrew Nester):

* needs_better_patch: 1 => 0


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/27458#comment:6>

Django

unread,
Dec 21, 2016, 10:02:06 AM12/21/16
to django-...@googlegroups.com
#27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a
literal "%s"
-------------------------------------+-------------------------------------
Reporter: Gabriel Canto de | Owner: Andrew
Souza | Nester
Type: Bug | Status: assigned
Component: Database layer | Version: master

(models, ORM) |
Severity: Normal | Resolution:
Keywords: Oracle | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* cc: Simon Charette (added)
* version: 1.10 => master
* stage: Accepted => Ready for checkin


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/27458#comment:7>

Django

unread,
Dec 21, 2016, 3:32:55 PM12/21/16
to django-...@googlegroups.com
#27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a
literal "%s"
-------------------------------------+-------------------------------------
Reporter: Gabriel Canto de | Owner: Andrew
Souza | Nester
Type: Bug | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: Oracle | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_better_patch: 0 => 1

* stage: Ready for checkin => Accepted


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/27458#comment:8>

Django

unread,
Dec 30, 2016, 1:36:01 PM12/30/16
to django-...@googlegroups.com
#27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a
literal "%s"
-------------------------------------+-------------------------------------
Reporter: Gabriel Canto de | Owner: Andrew
Souza | Nester
Type: Bug | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: Oracle | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_better_patch: 1 => 0


* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/27458#comment:9>

Django

unread,
Dec 30, 2016, 5:11:23 PM12/30/16
to django-...@googlegroups.com
#27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a
literal "%s"
-------------------------------------+-------------------------------------
Reporter: Gabriel Canto de | Owner: Andrew
Souza | Nester
Type: Bug | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: Oracle | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"69b7d4b116e3b70b250c77829e11038d5d55c2a8" 69b7d4b1]:
{{{
#!CommitTicketReference repository=""
revision="69b7d4b116e3b70b250c77829e11038d5d55c2a8"
Fixed #27458 -- Fixed invalid sequence/index names when using
"USER"."TABLE" db_table on Oracle.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27458#comment:10>

Django

unread,
Jan 27, 2017, 10:19:26 AM1/27/17
to django-...@googlegroups.com
#27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a
literal "%s"
-------------------------------------+-------------------------------------
Reporter: Gabriel Canto de | Owner: Andrew
Souza | Nester
Type: Bug | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: Oracle | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Gabriel Canto de Souza:

Old description:

New description:

--

--
Ticket URL: <https://code.djangoproject.com/ticket/27458#comment:11>

Django

unread,
Jan 27, 2017, 10:27:57 AM1/27/17
to django-...@googlegroups.com
#27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a
literal "%s"
-------------------------------------+-------------------------------------
Reporter: Gabriel Canto de | Owner: Andrew
Souza | Nester
Type: Bug | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: Oracle | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Gabriel Canto de Souza):

Replying to [comment:10 Tim Graham <timograham@…>]:


> In [changeset:"69b7d4b116e3b70b250c77829e11038d5d55c2a8" 69b7d4b1]:
> {{{
> #!CommitTicketReference repository=""
revision="69b7d4b116e3b70b250c77829e11038d5d55c2a8"
> Fixed #27458 -- Fixed invalid sequence/index names when using
"USER"."TABLE" db_table on Oracle.
> }}}

Is it possible to remove attachments or delete this ticket? I aciddentaly
posted sensible data from my company and they are asking that it is
removed immediately

--
Ticket URL: <https://code.djangoproject.com/ticket/27458#comment:12>

Django

unread,
Nov 14, 2017, 9:53:49 PM11/14/17
to django-...@googlegroups.com
#27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a
literal "%s"
-------------------------------------+-------------------------------------
Reporter: Gabriel Canto de | Owner: Andrew
Souza | Nester
Type: Bug | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: Oracle | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Simon Charette <charette.s@…>):

In [changeset:"ee85ef8315db839e5723dea19d8b971420a2ebb4" ee85ef8]:
{{{
#!CommitTicketReference repository=""
revision="ee85ef8315db839e5723dea19d8b971420a2ebb4"
Fixed #28792 -- Fixed index name truncation of namespaced tables.

Refs #27458, #27843.

Thanks Tim and Mariusz for the review.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27458#comment:11>

Django

unread,
Nov 14, 2017, 10:07:30 PM11/14/17
to django-...@googlegroups.com
#27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a
literal "%s"
-------------------------------------+-------------------------------------
Reporter: Gabriel Canto de | Owner: Andrew
Souza | Nester
Type: Bug | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: Oracle | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Simon Charette <charette.s@…>):

In [changeset:"a35ab95ed4eec5c62fa19bdc69ecfe0eff3e1fca" a35ab95e]:
{{{
#!CommitTicketReference repository=""
revision="a35ab95ed4eec5c62fa19bdc69ecfe0eff3e1fca"
[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
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27458#comment:12>

Django

unread,
Nov 15, 2017, 8:32:00 AM11/15/17
to django-...@googlegroups.com
#27458: Oracle backend giving ORA-00911 : Invalid Character, querying with a
literal "%s"
-------------------------------------+-------------------------------------
Reporter: Gabriel Canto de | Owner: Andrew
Souza | Nester
Type: Bug | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: Oracle | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"0696edbc6a724ceaba86a977b6d21e57647cb2ac" 0696edbc]:
{{{
#!CommitTicketReference repository=""
revision="0696edbc6a724ceaba86a977b6d21e57647cb2ac"
[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
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27458#comment:13>

Reply all
Reply to author
Forward
0 new messages