From c66dba2ab55998c221b30c93a145fff74879c76c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E9=93=81?= Date: Sun, 25 Oct 2020 17:24:57 +0800 Subject: [PATCH] add testcase --- .../bvt/sql/PagerUtilsTest_Limit_hive_0.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/test/java/com/alibaba/druid/bvt/sql/PagerUtilsTest_Limit_hive_0.java diff --git a/src/test/java/com/alibaba/druid/bvt/sql/PagerUtilsTest_Limit_hive_0.java b/src/test/java/com/alibaba/druid/bvt/sql/PagerUtilsTest_Limit_hive_0.java new file mode 100644 index 0000000000..ba57b89e77 --- /dev/null +++ b/src/test/java/com/alibaba/druid/bvt/sql/PagerUtilsTest_Limit_hive_0.java @@ -0,0 +1,26 @@ +package com.alibaba.druid.bvt.sql; + +import com.alibaba.druid.DbType; +import com.alibaba.druid.sql.PagerUtils; +import com.alibaba.druid.util.JdbcUtils; +import junit.framework.TestCase; +import org.junit.Assert; + +public class PagerUtilsTest_Limit_hive_0 extends TestCase { + + public void test_hive_0() throws Exception { + String result = PagerUtils.limit("SELECT * FROM test", DbType.hive, 0, 10); + System.out.println(result); + Assert.assertEquals("SELECT *\n" + + "FROM test\n" + + "LIMIT 10", result); + } + + public void test_odps_0() throws Exception { + String result = PagerUtils.limit("SELECT * FROM test", DbType.odps, 0, 10); + System.out.println(result); + Assert.assertEquals("SELECT *\n" + + "FROM test\n" + + "LIMIT 10", result); + } +} \ No newline at end of file