/*
 * Copyright 2016-2018 shardingsphere.io.
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * </p>
 */


package io.shardingsphere.core.parsing.antlr.extractor.statement.handler.result;

import java.util.LinkedList;
import java.util.List;

import io.shardingsphere.core.parsing.antlr.sql.ddl.ColumnDefinition;
import io.shardingsphere.core.parsing.parser.sql.SQLStatement;
import lombok.Getter;
import lombok.Setter;

/**
 * Add column result.
 * 
 * @author duhongjun
 */
@Getter
@Setter
public class AddColumnExtractResult implements ExtractResult {
    
    private List<ColumnDefinition> columnDefintions = new LinkedList<>();
    
    @Override
    public void inject(final SQLStatement statement) {

    }

}

@@ -801,32 +801,189 @@
 sql.ddl.
-ColumnDefinition
+AlterTableStatement;%0Aimport io.shardingsphere.core.parsing.antlr.sql.ddl.ColumnDefinition;%0Aimport io.shardingsphere.core.parsing.antlr.sql.ddl.mysql.MySQLAlterTableStatement
 ;%0Aimport
@@ -1371,16 +1371,603 @@
 ment) %7B%0A
+        AlterTableStatement alterTableStatement = (AlterTableStatement)statement;%0A        for(ColumnDefinition each : columnDefintions) %7B%0A            if (!alterTableStatement.findColumnDefinition(each.getName()).isPresent()) %7B%0A                alterTableStatement.getAddColumns().add(each);%0A                %0A                if(null != each.getPosition()) %7B%0A                    MySQLAlterTableStatement mysqlAlterTable = (MySQLAlterTableStatement) statement;%0A                    mysqlAlterTable.getPositionChangedColumns().add(each.getPosition());%0A                %7D%0A            %7D%0A        %7D
 %0A    %7D%0A%0A

implement inject method