// Path: src/main/java/com/elong/pb/newdda/client/router/parser/visitor/basic/mysql/MySqlSelectVisitor.java
// public class MySqlSelectVisitor extends AbstractMySqlVisitor {
// 
//     private final static Logger logger = LoggerFactory.getLogger(MySqlSelectVisitor.class);
// 
//     public void preVisit(SQLObject x) {
//         if (logger.isDebugEnabled()) {
//         }
//     }
// 
//     @Override
//     public boolean visit(final MySqlSelectQueryBlock x) {
//         if (x.getFrom() instanceof SQLExprTableSource) {
//             SQLExprTableSource tableExpr = (SQLExprTableSource) x.getFrom();
//             getSqlParserContext().setCurrentTable(tableExpr.getExpr().toString(), tableExpr.getAlias());
//         }
//         return super.visit(x);
//     }
// 
//     @Override
//     public void endVisit(final MySqlSelectQueryBlock x) {
//         super.endVisit(x);
//     }
// 
// }


import com.alibaba.druid.sql.SQLUtils;
import com.alibaba.druid.sql.ast.SQLStatement;
import com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser;
import com.elong.pb.newdda.client.router.parser.visitor.basic.mysql.MySqlSelectVisitor;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.util.List;
package com.elong.pb.newdda.client.visitor;



/**
 * mysql查询单元测试
 * Created by zhangyong on 2016/8/15.
 */
public class MySqlSelectVisitorUnitTest {

    @Test
    public void shardkeyTest() {
        String sql = "select a.member_name , a.member_id , b.destination , b.start_place  FROM t_scd_order a , t_scd_order_detail b  where a.id = b.order_id and a.id = 1";

        MySqlStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> statementList = parser.parseStatementList();
        SQLStatement statement = statementList.get(0);

// Path: src/main/java/com/elong/pb/newdda/client/router/parser/visitor/basic/mysql/MySqlSelectVisitor.java
// public class MySqlSelectVisitor extends AbstractMySqlVisitor {
// 
//     private final static Logger logger = LoggerFactory.getLogger(MySqlSelectVisitor.class);
// 
//     public void preVisit(SQLObject x) {
//         if (logger.isDebugEnabled()) {
//         }
//     }
// 
//     @Override
//     public boolean visit(final MySqlSelectQueryBlock x) {
//         if (x.getFrom() instanceof SQLExprTableSource) {
//             SQLExprTableSource tableExpr = (SQLExprTableSource) x.getFrom();
//             getSqlParserContext().setCurrentTable(tableExpr.getExpr().toString(), tableExpr.getAlias());
//         }
//         return super.visit(x);
//     }
// 
//     @Override
//     public void endVisit(final MySqlSelectQueryBlock x) {
//         super.endVisit(x);
//     }
// 
// }


// Path: src/test/java/com/elong/pb/newdda/client/visitor/MySqlSelectVisitorUnitTest.java
import com.alibaba.druid.sql.SQLUtils;
import com.alibaba.druid.sql.ast.SQLStatement;
import com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser;
import com.elong.pb.newdda.client.router.parser.visitor.basic.mysql.MySqlSelectVisitor;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.util.List;

package com.elong.pb.newdda.client.visitor;



/**
 * mysql查询单元测试
 * Created by zhangyong on 2016/8/15.
 */
public class MySqlSelectVisitorUnitTest {

    @Test
    public void shardkeyTest() {
        String sql = "select a.member_name , a.member_id , b.destination , b.start_place  FROM t_scd_order a , t_scd_order_detail b  where a.id = b.order_id and a.id = 1";

        MySqlStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> statementList = parser.parseStatementList();
        SQLStatement statement = statementList.get(0);

        MySqlSelectVisitor mySqlSelectVisitor = new MySqlSelectVisitor();