summaryrefslogtreecommitdiffstats
path: root/test/vtabdistinct.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 14:07:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 14:07:11 +0000
commit63847496f14c813a5d80efd5b7de0f1294ffe1e3 (patch)
tree01c7571c7c762ceee70638549a99834fdd7c411b /test/vtabdistinct.test
parentInitial commit. (diff)
downloadsqlite3-63847496f14c813a5d80efd5b7de0f1294ffe1e3.tar.xz
sqlite3-63847496f14c813a5d80efd5b7de0f1294ffe1e3.zip
Adding upstream version 3.45.1.upstream/3.45.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/vtabdistinct.test')
-rw-r--r--test/vtabdistinct.test41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/vtabdistinct.test b/test/vtabdistinct.test
new file mode 100644
index 0000000..e18e121
--- /dev/null
+++ b/test/vtabdistinct.test
@@ -0,0 +1,41 @@
+# 2022-01-21
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+# This file implements tests for sqlite3_vtab_distinct() interface.
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set testprefix vtabdistinct
+
+ifcapable !vtab {
+ finish_test
+ return
+}
+load_static_extension db qpvtab
+
+do_execsql_test 1.1 {
+ SELECT ix FROM qpvtab WHERE vn='sqlite3_vtab_distinct';
+} {0}
+do_execsql_test 1.2 {
+ SELECT DISTINCT ix FROM qpvtab WHERE vn='sqlite3_vtab_distinct';
+} {2}
+do_execsql_test 1.3 {
+ SELECT distinct vn, ix FROM qpvtab(3)
+ WHERE +vn IN ('sqlite3_vtab_distinct','nOrderBy');
+} {nOrderBy 2 sqlite3_vtab_distinct 2}
+do_execsql_test 1.4 {
+ SELECT vn, ix FROM qpvtab
+ GROUP BY vn
+ HAVING vn='sqlite3_vtab_distinct';
+} {sqlite3_vtab_distinct 1}
+
+finish_test