Skip to content

Use default schema if $tableName has no namespace. #5765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 19, 2022

Conversation

kitloong
Copy link
Contributor

@kitloong kitloong commented Oct 16, 2022

Q A
Type bug

Summary

When 2 same name tables exist in difference schema, eg: public.table and another.table, $this->schemaManager->listTableColumns('table') will list and mix columns from both tables.

I have confirmed listTableColumns is working correctly before #5586.
This PR fixes the column issue while respecting #5586 listTables fix.

Steps to reproduce
create table public."table"
(
    id   integer not null,
    name text    not null
);

create table another."table"
(
    id    text not null,
    email text not null
);

Run $this->schemaManager->listTableColumns('table')

Actual

List table columns mixed from public and another schema.

[
   'id', // text, override by another."table"
   'name', // text
   'email', // text, merged from another."table"
]
Expected

List table columns from the public schema only.

[
   'id', // integer
   'name', // text
]

@morozov morozov merged commit 9ee6f6a into doctrine:3.4.x Oct 19, 2022
@morozov
Copy link
Member

morozov commented Oct 19, 2022

Thanks, @kitloong.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants