blob: 6d9b5bbcdcd71dba828c988c4af38699d1731ce6 [file] [log] [blame]
dan1c305122017-08-25 09:17:14 +00001# 2017 August 25
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 regression tests for SQLite library.
12#
13# This file implements tests for the PRAGMA command. Specifically,
drhcc3f3d12019-08-17 15:27:58 +000014# those pragmas that are not disabled at build time by setting:
dan1c305122017-08-25 09:17:14 +000015#
drhcc3f3d12019-08-17 15:27:58 +000016# -DSQLITE_OMIT_INTROSPECTION_PRAGMAS
dan1c305122017-08-25 09:17:14 +000017#
18
19set testdir [file dirname $argv0]
20source $testdir/tester.tcl
21set testprefix pragma5
22
23if { [catch {db one "SELECT count(*) FROM pragma_function_list"}] } {
24 finish_test
25 return
26}
27
28db function external external
29
30do_execsql_test 1.0 {
31 PRAGMA table_info(pragma_function_list)
32} {
33 0 name {} 0 {} 0
34 1 builtin {} 0 {} 0
drh79d5bc82020-01-04 01:43:02 +000035 2 type {} 0 {} 0
36 3 enc {} 0 {} 0
37 4 narg {} 0 {} 0
38 5 flags {} 0 {} 0
dan1c305122017-08-25 09:17:14 +000039}
40do_execsql_test 1.1 {
drh79d5bc82020-01-04 01:43:02 +000041 SELECT DISTINCT name, builtin
42 FROM pragma_function_list WHERE name='upper' AND builtin
dan1c305122017-08-25 09:17:14 +000043} {upper 1}
44do_execsql_test 1.2 {
drh79d5bc82020-01-04 01:43:02 +000045 SELECT DISTINCT name, builtin
46 FROM pragma_function_list WHERE name LIKE 'exter%';
dan1c305122017-08-25 09:17:14 +000047} {external 0}
48
49ifcapable fts5 {
50 do_execsql_test 2.0 {
51 PRAGMA table_info(pragma_module_list)
52 } {
53 0 name {} 0 {} 0
54 }
55 do_execsql_test 2.1 {
56 SELECT * FROM pragma_module_list WHERE name='fts5'
57 } {fts5}
58}
59
60do_execsql_test 3.0 {
61 PRAGMA table_info(pragma_pragma_list)
62} {
63 0 name {} 0 {} 0
64}
65do_execsql_test 3.1 {
66 SELECT * FROM pragma_pragma_list WHERE name='pragma_list'
67} {pragma_list}
68
69
70finish_test