alibaba / druid

阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
https://github.com/alibaba/druid/wiki
Apache License 2.0
27.98k stars 8.59k forks source link

MySqlStatementParser解析带中划线的库名会丢失中划线后的信息 #4113

Open KaimingWan opened 3 years ago

KaimingWan commented 3 years ago

写了个单元测试可复现问题:


    @Test
    public void parse() {
        String sql = "create database pudding-test";
        MySqlStatementParser parser = new MySqlStatementParser(sql, SQLParserFeature.IgnoreNameQuotes);
        SQLStatement sqlStatement = parser.parseStatement();
        Assert.assertEquals(sqlStatement.toString().toLowerCase(),sql);
    }
lawenyuan commented 3 years ago

create database pudding-test