Bug #105855 同步模型时JSON字段未正确识别
Submitted: 10 Dec 2021 5:22 Modified: 10 Dec 2021 6:26
Reporter: xg peng Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:8.0.27 OS:MacOS (macOS 11.2.x Big Sur x86_64)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[10 Dec 2021 5:22] xg peng
Description:
----[For better reports, please attach the log file after submitting. You can find it in /Users/pengxianggui/Library/Application Support/MySQL/Workbench/log/wb.log]

当我将模型同步至数据库时,我发现,对于模型中类型为JSON的字段,似乎并未正确识别。看上去,mysql workbench 总是会认为我更新了JSON字段,因此会尝试重新创建此json字段,然而实际上我并没有变更过这些json字段。我也对比了他们和mysql datasource,它们并无区别。我认为没有改动过的字段,不应该被mysql workbench再次同步。

When I synchronized the model to the database, I found that fields of type JSON in the model did not seem to be correctly recognized. It seems that mysql Workbench always thinks I updated the JSON field and will try to recreate it, when in fact I didn't change the JSON field. I also compared them to the mysql datasource and they are no different. I don't think fields that haven't changed should be synchronized by mysql Workbench again.

How to repeat:
创建一个含有json字段,并且它允许为空的模型。然后同步到数据库。什么都不改,然后再次同步,你应该可以发现,mysql workbench生成的sql中会重新创建这个字段。

Create a model that contains JSON fields that are allowed to be null. Then synchronize to the database. Leave nothing changed, then synchronize again, and you should see that the SQL generated by mysql Workbench recreates this field.

Suggested fix:
针对json字段正确比对差异。

Correct comparison of differences against JSON fields.
[10 Dec 2021 6:26] MySQL Verification Team
Hello xg peng,

Thank you for the report and feedback.
Verified as described.

regards,
Umesh