@@ -1023,6 +1023,8 @@ func (b *BinlogReader) resolveQuery(currentSchema string, sql string,
10231023 setTable (v .Table , false )
10241024 case * ast.CreateTableStmt :
10251025 setTable (v .Table , false )
1026+ case * ast.CreateViewStmt :
1027+ result .isSkip = true
10261028 case * ast.AlterTableStmt :
10271029 setTable (v .Table , false )
10281030 case * ast.RevokeStmt , * ast.RevokeRoleStmt :
@@ -1041,27 +1043,31 @@ func (b *BinlogReader) resolveQuery(currentSchema string, sql string,
10411043 case * ast.AlterProcedureStmt :
10421044 result .isExpand = true
10431045 case * ast.DropTableStmt :
1044- var newTables []* ast.TableName
1045- for _ , t := range v .Tables {
1046- mayLowerTable (t )
1047- schema := g .StringElse (t .Schema .String (), currentSchema )
1048- if ! skipFunc (schema , t .Name .String ()) {
1049- isExtraTable := len (newTables ) > 0
1050- setTable (t , isExtraTable )
1051- newTables = append (newTables , t )
1052- b .logger .Debug ("resolveQuery. DropTableStmt. include" ,
1053- "schema" , t .Schema , "table" , t .Name , "use" , currentSchema )
1046+ if v .IsView {
1047+ result .isSkip = true
1048+ } else {
1049+ var newTables []* ast.TableName
1050+ for _ , t := range v .Tables {
1051+ mayLowerTable (t )
1052+ schema := g .StringElse (t .Schema .String (), currentSchema )
1053+ if ! skipFunc (schema , t .Name .String ()) {
1054+ isExtraTable := len (newTables ) > 0
1055+ setTable (t , isExtraTable )
1056+ newTables = append (newTables , t )
1057+ b .logger .Debug ("resolveQuery. DropTableStmt. include" ,
1058+ "schema" , t .Schema , "table" , t .Name , "use" , currentSchema )
1059+ }
10541060 }
1055- }
10561061
1057- if len (newTables ) == 0 {
1058- newTables = v .Tables [:1 ]
1059- setTable (v .Tables [0 ], false )
1060- }
1062+ if len (newTables ) == 0 {
1063+ newTables = v .Tables [:1 ]
1064+ setTable (v .Tables [0 ], false )
1065+ }
10611066
1062- if len (newTables ) != len (v .Tables ) {
1063- v .Tables = newTables
1064- rewrite = true
1067+ if len (newTables ) != len (v .Tables ) {
1068+ v .Tables = newTables
1069+ rewrite = true
1070+ }
10651071 }
10661072 case * ast.CreateUserStmt , * ast.GrantStmt , * ast.DropUserStmt , * ast.AlterUserStmt :
10671073 setTable (& ast.TableName {
0 commit comments