improved mysql parser add_index support. for issue #1645

This commit is contained in:
wenshao
2017-03-23 23:10:58 +08:00
parent c607356412
commit cd8b7dce11
3 changed files with 40 additions and 2 deletions
@@ -0,0 +1,17 @@
package com.alibaba.druid.bvt.bug;
import com.alibaba.druid.sql.SQLUtils;
import com.alibaba.druid.util.JdbcConstants;
import junit.framework.TestCase;
/**
* Created by wenshao on 23/03/2017.
*/
public class Issue1654 extends TestCase {
public void test_for_issue() throws Exception {
String sql = "ALTER TABLE db_manage.zcy_gpcatalog_node_t ADD INDEX index_code USING BTREE (code);";
String formatedSql = SQLUtils.format(sql, JdbcConstants.MYSQL);
assertEquals("ALTER TABLE db_manage.zcy_gpcatalog_node_t\n" +
"\tADD INDEX index_code USING BTREE (code);", formatedSql);
}
}