Skip to content

Oracle.ProgrammingError: positional and named binds cannot be intermixed (==6.4) #199

@jakereps

Description

@jakereps

Discovered in unit testing due to no version pinning in the project's Pipfile. Locally (6.3.1) remains functional, while all database set up tasks fail in our CI pipeline on cx_Oracle==6.4.

Binding errors stating that positional and named binds cannot be intermixed when there are no positional binds being used.

Answer the following questions:

  1. What is your version of Python? Is it 32-bit or 64-bit?
$ python -V
Python 3.6.5
$ python -c 'import sys; print(sys.maxsize)'
9223372036854775807  # 64bit
  1. What is your version of cx_Oracle?

Locally:

$ python -c 'import cx_Oracle; print(cx_Oracle.__version__)'
6.3.1

Remote (issue causing)

$ python -c 'import cx_Oracle; print(cx_Oracle.__version__)'
6.4
  1. What is your version of the Oracle client (e.g. Instant Client)? How was it
    installed? Where is it installed?
$ ls /opt/oracle/
instantclient_12_2
  1. What is your version of the Oracle Database?
$ docker ps
CONTAINER ID        IMAGE                                            COMMAND                  CREATED             STATUS                    PORTS                                 NAMES
ffe765d011a3        store/oracle/database-enterprise:12.2.0.1-slim   "/bin/sh -c '/bin/ba…"   29 minutes ago      Up 29 minutes (healthy)   5500/tcp, 127.0.0.1:XXXXX->1521/tcp   inspiring_shtern
  1. What is your OS and version?
$ uname -a
Darwin Jordens-MacBook-Pro.local 17.6.0 Darwin Kernel Version 17.6.0: Tue May  8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64 x86_64
$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: macOS 10.13.5 (17F77)
      Kernel Version: Darwin 17.6.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: Jorden’s MacBook Pro
      User Name: Jorden Kreps (jordenkreps)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 6 days 1:57
  1. What compiler version did you use? For example, with GCC, run
    gcc --version.
$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
  1. What environment variables did you set? How exactly did you set them?

N/A

  1. What exact command caused the problem (e.g. what command did you try to
    install with)? Who were you logged in as?
$ pytest --cov <package_name>
  1. What error(s) you are seeing?

6.3.1

...
<package_name>/tests/test_util.py ...............                            [100%]
...

6.4

...
<package_name>/tests/test_util.py EEEEEE.........                            [100%]
...

self = <sqlalchemy.dialects.oracle.cx_oracle.OracleDialect_cx_oracle object at 0x7f977ca76550>
cursor = <cx_Oracle.Cursor on <cx_Oracle.Connection to SYSTEM@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=XXXXX))(CONNECT_DATA=(SID=ORCLCDB)(SERVICE_NAME=ORCLPDB1.localdomain)))>>
statement = 'SELECT table_name FROM all_tables WHERE table_name = :name AND owner = :schema_name'
parameters = {'name': 'MYTABLE', 'schema_name': 'MYUSER'}
context = <sqlalchemy.dialects.oracle.cx_oracle.OracleExecutionContext_cx_oracle object at 0x7f977cb570b8>

    def do_execute(self, cursor, statement, parameters, context=None):
>       cursor.execute(statement, parameters)
E       cx_Oracle.ProgrammingError: positional and named binds cannot be intermixed

Pinning to 6.3.1 resolves the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions