Skip to content

mysql migration: make sure the indices sql which left-join be the same database #6424

@echoulen

Description

@echoulen

Issue type:

[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[x] mysql / mariadb
[ ] oracle
[ ] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:

[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:

Current

SELECT `s`.*
FROM `INFORMATION_SCHEMA`.`STATISTICS` `s`
         LEFT JOIN `INFORMATION_SCHEMA`.`REFERENTIAL_CONSTRAINTS` `rc`
                   ON `s`.`INDEX_NAME` = `rc`.`CONSTRAINT_NAME`

Should be

SELECT `s`.*
FROM `INFORMATION_SCHEMA`.`STATISTICS` `s`
         LEFT JOIN `INFORMATION_SCHEMA`.`REFERENTIAL_CONSTRAINTS` `rc`
                   ON `s`.`INDEX_NAME` = `rc`.`CONSTRAINT_NAME`
                   AND `s`.`TABLE_SCHEMA` = `rc`.`CONSTRAINT_SCHEMA`. # --- new condition

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions