Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#22715 closed Bug (fixed)

Failing tests on Oracle/Python 3

Reported by: Tim Graham Owned by: Shai Berger
Component: Python 3 Version: 1.7-beta-2
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

cx_Oracle 5.1.3 includes fixes the segfaults encountered with Python 3. There are some failing migrations tests, all of which but 1 are resolved with the attached patch.

Failing test:

======================================================================
ERROR: test_add_binaryfield (migrations.test_operations.OperationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/django/db/backends/utils.py", line 63, in execute
    return self.cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/backends/oracle/base.py", line 890, in execute
    return self.cursor.execute(query, self._param_generator(params))
cx_Oracle.DatabaseError: ORA-00984: column not allowed here


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/tim/code/django/django/test/testcases.py", line 950, in skip_wrapper
    return test_func(*args, **kwargs)
  File "/home/tim/code/django/tests/migrations/test_operations.py", line 458, in test_add_binaryfield
    models.BinaryField(default=b'"\'"'),
  File "/home/tim/code/django/tests/migrations/test_operations.py", line 32, in apply_operations
    return migration.apply(project_state, editor)
  File "/home/tim/code/django/django/db/migrations/migration.py", line 107, in apply
    operation.database_forwards(self.app_label, schema_editor, project_state, new_state)
  File "/home/tim/code/django/django/db/migrations/operations/fields.py", line 38, in database_forwards
    field,
  File "/home/tim/code/django/django/db/backends/schema.py", line 406, in add_field
    self.execute(sql, params)
  File "/home/tim/code/django/django/db/backends/schema.py", line 98, in execute
    cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/backends/utils.py", line 63, in execute
    return self.cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/tim/code/django/django/utils/six.py", line 549, in reraise
    raise value.with_traceback(tb)
  File "/home/tim/code/django/django/db/backends/utils.py", line 63, in execute
    return self.cursor.execute(sql, params)
  File "/home/tim/code/django/django/db/backends/oracle/base.py", line 890, in execute
    return self.cursor.execute(query, self._param_generator(params))
django.db.utils.DatabaseError: ORA-00984: column not allowed here

Attachments (1)

22715.diff (655 bytes ) - added by Tim Graham 11 years ago.

Download all attachments as: .zip

Change History (6)

by Tim Graham, 11 years ago

Attachment: 22715.diff added

comment:1 by Shai Berger, 11 years ago

Owner: changed from nobody to Shai Berger
Status: newassigned

comment:2 by Shai Berger <shai@…>, 11 years ago

Resolution: fixed
Status: assignedclosed

In fd427f1fe3c563d5fe0badfec0a39d6cd43454da:

Fixed #22715: Corrected sql for defaults of BinaryField on Oracle with Python3

While at it, fixed a problem in returning empty values
(still with BinaryField/Oracle/Python3).

comment:3 by Shai Berger <shai@…>, 11 years ago

In 5f135e6a0b77e76649aac48434740cc703e843ff:

[1.7.x] Fixed #22715: Corrected sql for defaults of BinaryField on Oracle with Python3

While at it, fixed a problem in returning empty values
(still with BinaryField/Oracle/Python3).

Backport of fd427f1 from master

comment:4 by Tim Graham <timograham@…>, 11 years ago

In 06c0e740a41f64a49a11569e76edee7be04770e0:

Added django.utils.six.buffer_types

and used it in the Oracle SchemaEditor. Refs #22715.

comment:5 by Tim Graham <timograham@…>, 11 years ago

In 1cb5dfe05f4e8363a7cf39d400e328f4b1c33366:

[1.7.x] Added django.utils.six.buffer_types

and used it in the Oracle SchemaEditor. Refs #22715.

Backport of 06c0e740a4 from master

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