CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
78 lines
2.0 KiB
Plaintext
78 lines
2.0 KiB
Plaintext
# 2014-04-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.
|
|
#
|
|
#*************************************************************************
|
|
#
|
|
# Test that ticket [b75a9ca6b0] has been fixed.
|
|
#
|
|
# Ticket [b75a9ca6b0] concerns queries that have both a GROUP BY
|
|
# and an ORDER BY. This code verifies that SQLite is able to
|
|
# optimize out the ORDER BY in some circumstances, but retains the
|
|
# ORDER BY when necessary.
|
|
#
|
|
|
|
set testdir [file dirname $argv0]
|
|
source $testdir/tester.tcl
|
|
set testprefix tkt-b75a9ca6b0
|
|
|
|
do_execsql_test 1 {
|
|
CREATE TABLE t1 (x, y);
|
|
INSERT INTO t1 VALUES (1, 3);
|
|
INSERT INTO t1 VALUES (2, 2);
|
|
INSERT INTO t1 VALUES (3, 1);
|
|
}
|
|
|
|
do_execsql_test 1.1 {
|
|
CREATE INDEX i1 ON t1(x, y);
|
|
}
|
|
|
|
set idxscan {SCAN t1 USING COVERING INDEX i1}
|
|
set tblscan {SCAN t1}
|
|
set grpsort {USE TEMP B-TREE FOR GROUP BY}
|
|
set sort {USE TEMP B-TREE FOR ORDER BY}
|
|
|
|
foreach {tn q res eqp} [subst -nocommands {
|
|
1 "SELECT * FROM t1 GROUP BY x, y ORDER BY x,y"
|
|
{1 3 2 2 3 1} {$idxscan}
|
|
|
|
2 "SELECT * FROM t1 GROUP BY x, y ORDER BY x"
|
|
{1 3 2 2 3 1} {$idxscan*$sort}
|
|
|
|
3 "SELECT * FROM t1 GROUP BY y, x ORDER BY y, x"
|
|
{3 1 2 2 1 3} {$idxscan*$sort}
|
|
|
|
4 "SELECT * FROM t1 GROUP BY x ORDER BY x"
|
|
{1 3 2 2 3 1} {$idxscan}
|
|
|
|
5 "SELECT * FROM t1 GROUP BY y ORDER BY y"
|
|
{3 1 2 2 1 3} {$tblscan*$grpsort}
|
|
|
|
6 "SELECT * FROM t1 GROUP BY y ORDER BY x"
|
|
{1 3 2 2 3 1} {$tblscan*$grpsort*$sort}
|
|
|
|
7 "SELECT * FROM t1 GROUP BY x, y ORDER BY x, y DESC"
|
|
{1 3 2 2 3 1} {$idxscan*$sort}
|
|
|
|
8 "SELECT * FROM t1 GROUP BY x, y ORDER BY x DESC, y DESC"
|
|
{3 1 2 2 1 3} {$idxscan}
|
|
|
|
9 "SELECT * FROM t1 GROUP BY x, y ORDER BY x ASC, y ASC"
|
|
{1 3 2 2 3 1} {$idxscan}
|
|
|
|
10 "SELECT * FROM t1 GROUP BY x, y ORDER BY x COLLATE nocase, y"
|
|
{1 3 2 2 3 1} {$idxscan*$sort}
|
|
|
|
}] {
|
|
do_execsql_test 1.$tn.1 $q $res
|
|
do_eqp_test 1.$tn.2 $q $eqp
|
|
}
|
|
|
|
|
|
finish_test
|