mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser for mysql explain. for issue #1645
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
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 22/03/2017.
|
||||
*/
|
||||
public class Issue1645 extends TestCase {
|
||||
public void test_for_issue() throws Exception {
|
||||
String sql = "explain extended select * from foo";
|
||||
String formatedSql = SQLUtils.format(sql, JdbcConstants.MYSQL);
|
||||
assertEquals("EXPLAIN extended\n" +
|
||||
"SELECT *\n" +
|
||||
"FROM foo", formatedSql);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user