Skip to content

wrong check expresion parsing #92

Description

@holev45

Describe the bug
If column has check like 'CHECK(COL IN (1,2))' sql in: sqlalchemy_firebird/base.py line: 1207 cut first letter from column name and in result expresion looks like 'OL IN (1,2)' instead of 'COL IN (1,2)'
I change mentioned line for my own to:
TRIM(SUBSTRING(tr.rdb$trigger_source
FROM position('(' in tr.rdb$trigger_source) + 1
FOR (CHAR_LENGTH(tr.rdb$trigger_source) - position(')' in reverse(tr.rdb$trigger_source)) + 1)
- (position('(' in tr.rdb$trigger_source) + 1))) AS sqltext

To Reproduce
Steps to reproduce the behavior:

  1. Create new table with chek on one column
  2. Look on create statement of table after sqalchemy.metadata.reflect

Expected behavior
Proper expression parse.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions