Sha256: e451799dcb1898bb80bcb3c1c5163e27d7d6732280e2677d15435b4e6824b1d4

Contents?: true

Size: 863 Bytes

Versions: 19

Compression:

Stored size: 863 Bytes

Contents

require 'flydata/source_mysql/plugin_support/ddl_query_handler'

module Flydata
module SourceMysql

module PluginSupport
  class DropTableQueryHandler < TableDdlQueryHandler
    PATTERN = /^DROP TABLE/i

    def initialize(context)
      super
    end

    def pattern
      PATTERN
    end

    def process(record)
      if acceptable_db?(record)
        emit_record(:drop_table, record) do |opt|
          table_name = table_info(record)[:table_name]
          $log.info "type:drop_table table_name:'#{table_name}' query:'#{record["query"]}' binlog_pos:'#{binlog_pos(record)}'"

          opt[:increment_table_rev] = true

          # Set infinity to table binlog pos to ignore following events
          opt[:set_infinity_to_table_binlog_pos] = true
          { table_name: table_name, query: record["query"] }
        end
      end
    end
  end
end

end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
flydata-0.8.10.2 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.8.10.1 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.8.9.11 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.8.10 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.8.9 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.8.8 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.8.7 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.8.6 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.8.5 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.8.4 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.8.3 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.8.2 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.8.1 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.8.0 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.7.19 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.7.18 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.7.17 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.7.16 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.7.15 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb