julien-duponchelle / julien-duponchelle/python-mysql-replication
fail when 'database' is used as connection setting
- Dominant language
- Python
- Stars
- 2.4k
- Forks
- 690
- PR merge metrics
- No merged PRs in 30d
Description
Connecting with _'database'_ as a connection setting (instead of _'db'_), will raise an error down the streaming line
``` python
settings = {
'host': 'localhost',
'port': 3306,
'user': 'root',
'passwd': '',
'database': 'stuff',
}
stream = BinLogStreamReader(connection_settings=settings, server_id=42)
for event in stream:
event.dump()
```
Will raise the following error in _TableMapEvent_
**pymysql.err.ProgrammingError: (1146, u"Table 'stuff.columns' doesn't exist")**
It seems that _'db'_ is overwritten internaly, but PyMysql will favor _'database'_ when present
Contributor guide
Research direction
Start at BinLogStreamReader and follow the connection settings into TableMapEvent, using the reported example as the reproduction. Check how the 'db' and 'database' settings are handled by PyMySQL and the replication code. Done means the example connects with 'database' and processes events without the TableMapEvent lookup error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, python
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100