Fix duplicate columns in initialize-table-information#140
Merged
tamurashingo merged 1 commit intodevelopfrom Jan 28, 2026
Merged
Conversation
Add table_schema condition to information_schema.columns queries to prevent fetching duplicate columns from multiple databases/schemas. - MySQL: Add 'table_schema = database()' condition - PostgreSQL: Add 'table_schema = current_schema()' condition This ensures only columns from the currently connected database/schema are retrieved. Fixes issue where columns were duplicated when multiple databases (e.g., dev and test) exist on the same database instance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixed the issue where
initialize-table-informationfunction retrieves duplicate column information when fetching table metadata.Problem
When querying
information_schema.columnswith onlytable_namecondition, it searches for tables with the same name across all databases (development, test, etc.) on the same MySQL instance, resulting in duplicate column information.
Observed Symptoms
performance_schemaare also includedChanges
MySQL (
src/model/impl/mysql.lisp)Added
table_schema = database()condition to SQL queries infetch-columns-and-types-implandfetch-columns-and-types-plist-implmethods.Before:
After:
PostgreSQL (
src/model/impl/postgresql.lisp)Added
table_schema = current_schema()condition to SQL queries infetch-columns-and-types-implandfetch-columns-and-types-plist-implmethods.Before:
After:
Impact Scope
Testing
Related Issue
fix #139