From 1f317383cd5ed9faaa32a142187701bf743d506e Mon Sep 17 00:00:00 2001 From: "shaojin.wensj" Date: Sun, 24 Feb 2019 15:16:31 +0800 Subject: [PATCH] fixed testcase --- .../sql/PagerUtilsTest_Limit_SQLServer_4.java | 2 +- .../druid/bvt/sql/postgresql/PGSetTest4.java | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/test/java/com/alibaba/druid/bvt/sql/postgresql/PGSetTest4.java diff --git a/src/test/java/com/alibaba/druid/bvt/sql/PagerUtilsTest_Limit_SQLServer_4.java b/src/test/java/com/alibaba/druid/bvt/sql/PagerUtilsTest_Limit_SQLServer_4.java index a6e6148aea..ab10d03f28 100644 --- a/src/test/java/com/alibaba/druid/bvt/sql/PagerUtilsTest_Limit_SQLServer_4.java +++ b/src/test/java/com/alibaba/druid/bvt/sql/PagerUtilsTest_Limit_SQLServer_4.java @@ -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" + diff --git a/src/test/java/com/alibaba/druid/bvt/sql/postgresql/PGSetTest4.java b/src/test/java/com/alibaba/druid/bvt/sql/postgresql/PGSetTest4.java new file mode 100644 index 0000000000..c7522b8b70 --- /dev/null +++ b/src/test/java/com/alibaba/druid/bvt/sql/postgresql/PGSetTest4.java @@ -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()); + } +}