Class: PerconaAr::PtOnlineSchemaChangeExecutor

Inherits:
Object
  • Object
show all
Includes:
FileUtils
Defined in:
lib/percona_ar/pt_online_schema_change_executor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sql) ⇒ PtOnlineSchemaChangeExecutor



9
10
11
# File 'lib/percona_ar/pt_online_schema_change_executor.rb', line 9

def initialize(sql)
  @sql = sql
end

Instance Attribute Details

#sqlObject

Returns the value of attribute sql.



7
8
9
# File 'lib/percona_ar/pt_online_schema_change_executor.rb', line 7

def sql
  @sql
end

Instance Method Details

#callObject



13
14
15
16
17
# File 'lib/percona_ar/pt_online_schema_change_executor.rb', line 13

def call
  if sql =~ /^ALTER TABLE `([^`]*)` (.*)/i
    sh "#{boilerplate}#{suffix($1, $2)}"
  end
end