def visit_alter(self, tokens, running_scheme):
    if running_scheme and self._GetDescendants(running_scheme, 'shard'):
      self.AddError(tokens, 'ALTER should be run on all shards')

    table_spec = self._GetDescendants(tokens, 'table_spec')
    assert table_spec, 'ALTER requires at least one table_spec'

    try:
      table = self._db_schema.FindTableFromSpec(table_spec[0])
    except schema.UnknownNameException:
      self.AddError(tokens, 'ALTER on a table that does not exist')
      return
    if table.GetEngine().lower() != 'innodb':
      self.AddError(tokens, 'ALTER on %s, a non-InnoDB table' % table)
    if table.GetRows() > self._max_alter_rows:
      self.AddError(tokens,
                    'ALTER on %s, a %d+ rows table' % (table,
                                                       self._max_alter_rows))

    self.visit(tokens, table=table)
dataset/ETHPy150Open google/mysql-tools/parser_lib/validator.py/AlterChecker.visit_alter/original