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

    new_spec, old_spec = self._GetDescendants(tokens, 'table_spec')
    try:
      old_table = self._db_schema.FindTableFromSpec(old_spec)
    except schema.UnknownNameException:
      self.AddError(tokens, 'Unknown table %s' % old_spec)
      return

    try:
      new_table = self._db_schema.FindTableFromSpec(new_spec)
      self.AddError(tokens, 'Table %s already exists' % new_table)
    except schema.UnknownNameException:
      db = self._db_schema.FindDatabaseFromSpec(new_spec)
      new_table = db.AddTable(new_spec['table'][0],
                              char_set=old_table.GetCharacterSet())
      new_table.SetEngine(old_table.GetEngine())
      for column_name, column in old_table.GetColumns().iteritems():
        new_table.AddColumn(
            column_name, column.GetType(), column.GetCharacterSet())
dataset/ETHPy150Open google/mysql-tools/parser_lib/validator.py/CreateTableChecker.visit_create_table_like/original