Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sqlite/blob/master/test/widetab1.test # sqlite [Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `sqlite / test / widetab1.test` 156 lines ยท 5356 bytes Raw Blame History 1 # 2022-10-24 2 # 3 # The author disclaims copyright to this source code. In place of 4 # a legal notice, here is a blessing: 5 # 6 # May you do good and not evil. 7 # May you find forgiveness for yourself and forgive others. 8 # May you share freely, never taking more than you give. 9 # 10 #*********************************************************************** 11 # This file implements test cases for wide table (tables with more than 12 # 64 columns) and indexes that reference columns beyond the 63rd or 64th 13 # column. 14 # 15 16 set testdir [file dirname $argv0] 17 source $testdir/tester.tcl 18 set testprefix widetab1 19 20 21 # In order to pick the better index in the following query, SQLite needs to 22 # be able to detect when an index that references later columns in a wide 23 # table is a covering index. 24 # 25 do_execsql_test 100 { 26 CREATE TABLE a( 27 a00, a01, a02, a03, a04, a05, a06, a07, a08, a09, 28 a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, 29 a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, 30 a30, a31, a32, a33, a34, a35, a36, a37, a38, a39, 31 a40, a41, a42, a43, a44, a45, a46, a47, a48, a49, 32 a50, a51, a52, a53, a54, a55, a56, a57, a58, a59, 33 pd, bn, vb, bc, cn, ie, qm); 34 CREATE INDEX a1 on a(pd, bn, vb, bc, cn); -- preferred index 35 CREATE INDEX a2 on a(pd, bc, ie, qm); -- suboptimal index 36 CREATE TABLE b(bg, bc, bn, iv, ln, mg); 37 CREATE INDEX b1 on b(bn, iv, bg); 38 } 39 do_eqp_test 110 { 40 SELECT dc, count(cn) 41 FROM (SELECT coalesce(b.bg, a.bc) as dc, cn 42 FROM a LEFT JOIN b 43 ON a.bn = b.bn 44 AND CASE WHEN a.vb IS NOT NULL THEN 1 ELSE 0 END = b.iv 45 WHERE pd BETWEEN 0 AND 10) 46 GROUP BY dc; 47 } { 48 QUERY PLAN 49 |--SEARCH a USING COVERING INDEX a1 (pd>? AND pd