xref: /sqlite-3.40.0/test/hidden.test (revision d1ce65fc)
1# 2015 November 18
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#
12# Test the __hidden__ hack.
13#
14
15set testdir [file dirname $argv0]
16source $testdir/tester.tcl
17set testprefix hidden
18
19do_execsql_test 1.1 {
20  CREATE TABLE t1(__hidden__a, b);
21  INSERT INTO t1 VALUES('1');
22  INSERT INTO t1(__hidden__a, b) VALUES('x', 'y');
23} {}
24
25do_execsql_test 1.2 {
26  SELECT * FROM t1;
27} {1 y}
28
29do_execsql_test 1.3 {
30  SELECT __hidden__a, * FROM t1;
31} {{} 1 x y}
32
33#do_execsql_test 2.1 {
34  #CREATE TABLE x1(a, b, c);
35  #INSERT INTO x1 VALUES(1, 2, 3);
36  #CREATE VIEW v1(a, b, __hidden__c) AS SELECT a, b, c FROM x1;
37  #SELECT * FROM v1;
38#} {1 2}
39
40do_execsql_test 2.2 {
41  PRAGMA table_info(v1);
42} {
430 a {} 0 {} 0
441 b {} 0 {} 0
452 __hidden__c {} 0 {} 0
46}
47
48
49
50
51finish_test
52