Sha256: ae8691d5a8a220d3cf52ce365973c6dde89c0a23a5836b2758192cdb39cf9423

Contents?: true

Size: 532 Bytes

Versions: 38

Compression:

Stored size: 532 Bytes

Contents

require_relative 'binlog_query_handler'

module Mysql

class DdlQueryHandler < BinlogQueryHandler
  DDL_TABLE_QUERY = /^(?:(?:ALTER|CREATE|DROP|RENAME) +(?:\w+ +)*TABLE +([^ ]+)|TRUNCATE +(?:TABLE +)?([^ ]+))/i

  def acceptable_db?(record)
    db_name = record["db_name"]
    if DDL_TABLE_QUERY =~ record["query"]
      table_name_in_query = $1 ? $1 : $2

      if (idx = table_name_in_query.index("."))
        db_name = table_name_in_query[0...idx].tr("`", "")
      end
    end

    supported_database == db_name
  end
end

end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
flydata-0.3.5 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.3.4 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.3.3 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.3.2 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.3.1 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.3.0 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.2.30 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.2.29 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.2.28 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.2.27 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.2.26 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.2.25 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.2.24 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.2.23 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.2.22 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.2.21 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.2.20 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.2.19 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.2.18 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb
flydata-0.2.17 lib/flydata/fluent-plugins/mysql/ddl_query_handler.rb