Sha256: f6fbbfccd2956fc158b1ac88184d72ccb0d159a2aa83a6e4e0b74351a8d2dfc9

Contents?: true

Size: 734 Bytes

Versions: 5

Compression:

Stored size: 734 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
          { table_name: table_name, query: record["query"] }
        end
      end
    end
  end
end

end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
flydata-0.7.14 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.7.13 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.7.12 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.7.11 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb
flydata-0.7.10 lib/flydata/source_mysql/plugin_support/drop_table_query_handler.rb