zendesk / maxwell

Maxwell's daemon, a mysql-to-json kafka producer
https://maxwells-daemon.io/
Other
4.01k stars 1.01k forks source link

Why SQL_BLACKLIST is needed #2034

Closed yjant closed 1 year ago

yjant commented 1 year ago

In package com.zendesk.maxwell.schema.ddl; class SchemaChange there is a SQL_BLACKLIST set, this defines some ddl syntax that needs to be ignored, and I am very confused about the purpose of doing so. Will this not cause the program to report an error? If a new field is added to the monitored table, the insert statement will include the new field. If this field is not present in the inserted table, an error will be reported. This means that I need to read the table structure information of the inserted database and determine whether the insert statement passed in is legal. Why not synchronize these ddl statements directly, so there is no need for additional judgment. I am very confused what is the purpose of your doing this, did I overlook any details, I am very much looking forward to your answers to my doubts. Thanks a lot.

osheroff commented 1 year ago

read the code closer; we ignore TRUNCATE TABLE and other non-essential sql.