~olly/yoyo#101: 
cx_oracle list_tables invalid binding

the method list_tables in base.py assumes to pass to the query execution the database name in a dict, but in the query executed there is not requested any parameters.

I've a traceback: yoyo/internalmigrations/init.py", line 45, in get_current_version tables = set(backend.list_tables()) File "/opt/omcgc_env/lib/python3.7/site-packages/yoyo/backends/base.py", line 254, in list_tables dict({"database": self.uri.database}, **kwargs), File "/opt/omcgc_env/lib/python3.7/site-packages/yoyo/backends/base.py", line 390, in execute cursor.execute(sql, params) cx_Oracle.DatabaseError: ORA-01036: illegal variable name/number

I fixed inserting into backends/contrib/oracle.py the method override

def list_tables(self, **kwargs):
    """
    Return a list of tables present in the backend.
    This is used by the test suite to clean up tables
    generated during testing
    """
    cursor = self.execute(
        self.list_tables_sql,
        dict(**kwargs),
    )
    return [row[0] for row in cursor.fetchall()]
Status
RESOLVED FIXED
Submitter
~ralcini
Assigned to
No-one
Submitted
8 months ago
Updated
8 months ago
Labels
No labels applied.

~olly REPORTED FIXED 8 months ago

Fixed in a95324d91091

Register here or Log in to comment, or comment via email.