Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Wrong condition in checkCircularReference method #433

@sephrouse

Description

@sephrouse

There is a check method as follows in BaseTable.kt. Suppose the condition schema == root.catalog is a mistake. From my understanding, it should be schema == root.schema.

Please check out and fix it if it was wrong.

private fun checkCircularReference(root: BaseTable<*>, stack: LinkedList<String> = LinkedList()) {
        stack.push(root.toString(withAlias = false))

        if (tableName == root.tableName && catalog == root.catalog && schema == root.catalog) {
            throw IllegalStateException(
                "Circular reference detected, current table: '$this', reference route: ${stack.asReversed()}"
            )
        }

        for (column in root.columns) {
            val ref = column.referenceTable
            if (ref != null) {
                checkCircularReference(ref, stack)
            }
        }

        stack.pop()
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions