Skip to content

Commit b7c4543

Browse files
committed
🐛 normalize database name comparison to be case-insensitive in schema qualifier removal
1 parent 1762399 commit b7c4543

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mysql_to_sqlite3/transporter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -915,12 +915,12 @@ def _mysql_viewdef_to_sqlite(self, view_select_sql: str, view_name: str) -> str:
915915
# Remove schema qualifiers that match schema_name on tables
916916
for tbl in tree.find_all(exp.Table):
917917
db = tbl.args.get("db")
918-
if db and db.name.strip('`"') == self._mysql_database:
918+
if db and db.name.strip('`"').lower() == self._mysql_database.lower():
919919
tbl.set("db", None)
920920
# Also remove schema qualifiers on fully-qualified columns (db.table.column)
921921
for col in tree.find_all(exp.Column):
922922
db = col.args.get("db")
923-
if db and db.name.strip('`"') == self._mysql_database:
923+
if db and db.name.strip('`"').lower() == self._mysql_database.lower():
924924
col.set("db", None)
925925

926926
sqlite_select = tree.sql(dialect="sqlite")

0 commit comments

Comments
 (0)