Sha256: 6b52e0f36dab98ac50162c2ea92dfb280804679ac2535ed7e28b0ee77b891b8b
Contents?: true
Size: 609 Bytes
Versions: 1
Compression:
Stored size: 609 Bytes
Contents
module MysqlReplicationHelper class ErrorHandler def initialize(options = nil) @options = options || { } end def sql_to_recover_from(error) case (error) when /^Error 'Unknown database '([^\']+)'' on query/ [ "CREATE DATABASE `#{$1}`", "START SLAVE" ] when /^Error 'There is no '([^\']+)'@'([^\']+)' registered' on query. Default database: '([^\']+)'./ [ "CREATE USER `#{$1}`@`#{$2}`", "GRANT ALL PRIVILEGES ON `#{$3}`.* TO `#{$1}`@`#{$2}`", "START SLAVE" ] end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
theworkinggroup-mysql-replication-helper-0.0.1 | lib/mysql_replication_helper/error_handler.rb |