summaryrefslogtreecommitdiffstats
path: root/test/test_sql_indexes.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:44:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:44:55 +0000
commit5068d34c08f951a7ea6257d305a1627b09a95817 (patch)
tree08213e2be853396a3b07ce15dbe222644dcd9a89 /test/test_sql_indexes.sh
parentInitial commit. (diff)
downloadlnav-5068d34c08f951a7ea6257d305a1627b09a95817.tar.xz
lnav-5068d34c08f951a7ea6257d305a1627b09a95817.zip
Adding upstream version 0.11.1.upstream/0.11.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/test_sql_indexes.sh')
-rw-r--r--test/test_sql_indexes.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/test_sql_indexes.sh b/test/test_sql_indexes.sh
new file mode 100644
index 0000000..951c7a6
--- /dev/null
+++ b/test/test_sql_indexes.sh
@@ -0,0 +1,45 @@
+#! /bin/bash
+
+export YES_COLOR=1
+
+# XXX sqlite reports different results for the "detail" column, so we
+# have to rewrite it.
+run_cap_test ${lnav_test} -n \
+ -c ";EXPLAIN QUERY PLAN SELECT * FROM access_log WHERE log_path GLOB '*/logfile_access_log.*'" \
+ -c ";SELECT \$id, \$parent, \$notused, replace(\$detail, 'SCAN TABLE', 'SCAN')" \
+ ${test_dir}/logfile_access_log.*
+
+run_cap_test ${lnav_test} -n \
+ -c ";SELECT *,log_unique_path FROM access_log WHERE log_path GLOB '*/logfile_access_log.*'" \
+ ${test_dir}/logfile_access_log.*
+
+run_cap_test ${lnav_test} -n \
+ -c ";EXPLAIN QUERY PLAN SELECT * FROM all_logs WHERE log_format = 'access_log'" \
+ -c ";SELECT \$id, \$parent, \$notused, replace(\$detail, 'SCAN TABLE', 'SCAN')" \
+ ${test_dir}/logfile_access_log.*
+
+run_cap_test ${lnav_test} -n \
+ -c ";SELECT *,log_format FROM all_logs WHERE log_format = 'access_log'" \
+ ${test_dir}/logfile_access_log.* \
+ ${test_dir}/logfile_procstate.0
+
+run_cap_test ${lnav_test} -n \
+ -c ";EXPLAIN QUERY PLAN SELECT * FROM all_logs WHERE log_level < 'error'" \
+ -c ";SELECT \$id, \$parent, \$notused, replace(\$detail, 'SCAN TABLE', 'SCAN')" \
+ ${test_dir}/logfile_access_log.*
+
+run_cap_test ${lnav_test} -n \
+ -c ";SELECT * FROM all_logs WHERE log_level < 'error'" \
+ ${test_dir}/logfile_access_log.*
+
+run_cap_test ${lnav_test} -n \
+ -c ";SELECT * FROM all_logs WHERE log_level <= 'error'" \
+ ${test_dir}/logfile_access_log.*
+
+run_cap_test ${lnav_test} -n \
+ -c ";SELECT * FROM all_logs WHERE log_level >= 'error'" \
+ ${test_dir}/logfile_access_log.*
+
+run_cap_test ${lnav_test} -n \
+ -c ";SELECT * FROM all_logs WHERE log_level > 'error'" \
+ ${test_dir}/logfile_access_log.*