fixed testcase

This commit is contained in:
shaojin.wensj
2019-02-24 15:16:31 +08:00
parent fe502e2d4a
commit 1f317383cd
2 changed files with 29 additions and 1 deletions
@@ -14,7 +14,7 @@ public class PagerUtilsTest_Limit_SQLServer_4 extends TestCase {
String result = PagerUtils.limit(sql, JdbcConstants.SQL_SERVER, 100, 10);
Assert.assertEquals("SELECT *\n" +
"FROM (\n" +
"\tSELECT *, ROW_NUMBER() OVER () AS ROWNUM\n" +
"\tSELECT *, ROW_NUMBER() AS ROWNUM\n" +
"\tFROM t1\n" +
"\tWHERE id > 1\n" +
") XX\n" +
@@ -0,0 +1,28 @@
/*
* Copyright 1999-2017 Alibaba Group Holding Ltd.
*
* 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.
*/
package com.alibaba.druid.bvt.sql.postgresql;
import com.alibaba.druid.sql.SQLUtils;
import com.alibaba.druid.sql.ast.SQLStatement;
import com.alibaba.druid.util.JdbcConstants;
import junit.framework.TestCase;
public class PGSetTest4 extends TestCase {
public void testSet() throws Exception {
SQLStatement stmt = SQLUtils.parseSingleStatement("SET ROLE 'postgres'", JdbcConstants.POSTGRESQL);
assertEquals("SET ROLE TO 'postgres'", stmt.toString());
}
}