julien-duponchelle / julien-duponchelle/python-mysql-replication

MySQL JSON field type with string should decode in python3

Open
#272 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.4k
Forks
690
PR merge metrics
No merged PRs in 30d

Description

Table:

`CREATE TABLE test (id int, value json);`

With data:

id | value
---- | ----
1 | {"string1":"string2"}

But event's values in python3 is :

`{"id":1,"value":{b"string1":b"string2"}`

And when use `json.dumps` will raise `TypeError: keys must be a string`

Contributor guide

Open the contributing guide

Research direction

The issue names no source file or test; start by reproducing the MySQL JSON column case through the replication event path in this repository. Trace how the JSON value is decoded in Python 3, then verify that string keys and values remain JSON-compatible so json.dumps succeeds.

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
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.