System.Data.SQLite
Check-in [d1b6742e1e]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add more tests pursuant to ticket [baf42ee135].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d1b6742e1ecc086c9ecd6ef897d2841d9a281d92
User & Date: mistachkin 2018-03-09 17:25:29
Context
2018-03-09
17:27
Add GetMasterTableName method for use by the SQLiteConnection class. check-in: f5b88735be user: mistachkin tags: trunk
17:25
Add more tests pursuant to ticket [baf42ee135]. check-in: d1b6742e1e user: mistachkin tags: trunk
2018-03-08
20:50
Internal enhancements to the native memory allocation wrapper. check-in: fcac33cc7a user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Tests/tkt-baf42ee135.eagle.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
..
43
44
45
46
47
48
49
50
51
52











































































































































































53
54
###############################################################################

package require System.Data.SQLite.Test
runSQLiteTestPrologue

###############################################################################

runTest {test tkt-baf42ee135-1.1 {base catalog/table name not set} -setup {
  setupDb [set fileName tkt-baf42ee135-1.1.db]
} -body {
  sql execute $db {
    CREATE TABLE ""(x);
  }

  set dataReader [sql execute -execute reader -format datareader \
................................................................................
System.Data.SQLite} -result {{{ColumnName x} {ColumnOrdinal 0} {ColumnSize\
2147483647} NumericPrecision NumericScale {IsUnique False} {IsKey False}\
BaseServerName {BaseCatalogName main} {BaseColumnName x} {BaseSchemaName\
sqlite_default_schema} BaseTableName {DataType System.Object} {AllowDBNull\
True} {ProviderType 13} {IsAliased False} {IsExpression False} {IsAutoIncrement\
False} {IsRowVersion False} {IsHidden False} {IsLong False} {IsReadOnly False}\
ProviderSpecificDataType DefaultValue DataTypeName {CollationType BINARY}}}}

###############################################################################












































































































































































runSQLiteTestEpilogue
runTestEpilogue







|







 










>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
..
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
###############################################################################

package require System.Data.SQLite.Test
runSQLiteTestPrologue

###############################################################################

runTest {test tkt-baf42ee135-1.1 {GetSchemaTable, empty table name} -setup {
  setupDb [set fileName tkt-baf42ee135-1.1.db]
} -body {
  sql execute $db {
    CREATE TABLE ""(x);
  }

  set dataReader [sql execute -execute reader -format datareader \
................................................................................
System.Data.SQLite} -result {{{ColumnName x} {ColumnOrdinal 0} {ColumnSize\
2147483647} NumericPrecision NumericScale {IsUnique False} {IsKey False}\
BaseServerName {BaseCatalogName main} {BaseColumnName x} {BaseSchemaName\
sqlite_default_schema} BaseTableName {DataType System.Object} {AllowDBNull\
True} {ProviderType 13} {IsAliased False} {IsExpression False} {IsAutoIncrement\
False} {IsRowVersion False} {IsHidden False} {IsLong False} {IsReadOnly False}\
ProviderSpecificDataType DefaultValue DataTypeName {CollationType BINARY}}}}

###############################################################################

runTest {test tkt-baf42ee135-1.2 {GetSchemaTable, via VIEW} -setup {
  setupDb [set fileName tkt-baf42ee135-1.2.db]
} -body {
  sql execute $db {
    CREATE TABLE t1(x);
    CREATE VIEW v1 AS SELECT * FROM t1;
  }

  set dataReader [sql execute -execute reader -format datareader \
      -alias $db "SELECT * FROM v1;"]

  set dataTable [$dataReader -alias GetSchemaTable]

  getRowsFromDataTable $dataTable
} -cleanup {
  unset -nocomplain dataTable dataReader

  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {{{ColumnName x} {ColumnOrdinal 0} {ColumnSize\
2147483647} NumericPrecision NumericScale {IsUnique False} {IsKey False}\
BaseServerName {BaseCatalogName main} {BaseColumnName x} {BaseSchemaName\
sqlite_default_schema} {BaseTableName t1} {DataType System.Object} {AllowDBNull\
True} {ProviderType 13} {IsAliased False} {IsExpression False} {IsAutoIncrement\
False} {IsRowVersion False} {IsHidden False} {IsLong False} {IsReadOnly False}\
ProviderSpecificDataType DefaultValue DataTypeName {CollationType BINARY}}}}

###############################################################################

runTest {test tkt-baf42ee135-1.3 {GetSchemaTable, via VIEW} -setup {
  setupDb [set fileName tkt-baf42ee135-1.3.db]
} -body {
  sql execute $db {
    CREATE TABLE t1(x);
    CREATE VIEW v1 AS SELECT * FROM t1;
  }

  set connection [getDbConnection]

  set dataTable(1) [$connection -alias GetSchema COLUMNS]
  set dataTable(2) [$connection -alias GetSchema VIEWCOLUMNS]

  list [getRowsFromDataTable $dataTable(1)] \
     [getRowsFromDataTable $dataTable(2)]
} -cleanup {
  unset -nocomplain dataTable

  cleanupDb $fileName

  freeDbConnection

  unset -nocomplain connection db fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {{{{TABLE_CATALOG main} {TABLE_SCHEMA\
sqlite_default_schema} {TABLE_NAME t1} {COLUMN_NAME x} COLUMN_GUID\
COLUMN_PROPID {ORDINAL_POSITION 0} {COLUMN_HASDEFAULT False} COLUMN_DEFAULT\
COLUMN_FLAGS {IS_NULLABLE True} {DATA_TYPE {}} TYPE_GUID\
{CHARACTER_MAXIMUM_LENGTH 2147483647} CHARACTER_OCTET_LENGTH NUMERIC_PRECISION\
NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_CATALOG CHARACTER_SET_SCHEMA\
CHARACTER_SET_NAME COLLATION_CATALOG COLLATION_SCHEMA {COLLATION_NAME BINARY}\
DOMAIN_CATALOG DOMAIN_NAME DESCRIPTION {PRIMARY_KEY False} {EDM_TYPE {}}\
{AUTOINCREMENT False} {UNIQUE False}} {{TABLE_CATALOG main} {TABLE_SCHEMA\
sqlite_default_schema} {TABLE_NAME v1} {COLUMN_NAME x} COLUMN_GUID\
COLUMN_PROPID {ORDINAL_POSITION 0} {COLUMN_HASDEFAULT False} COLUMN_DEFAULT\
COLUMN_FLAGS {IS_NULLABLE True} {DATA_TYPE {}} TYPE_GUID\
{CHARACTER_MAXIMUM_LENGTH 2147483647} CHARACTER_OCTET_LENGTH NUMERIC_PRECISION\
NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_CATALOG CHARACTER_SET_SCHEMA\
CHARACTER_SET_NAME COLLATION_CATALOG COLLATION_SCHEMA {COLLATION_NAME BINARY}\
DOMAIN_CATALOG DOMAIN_NAME DESCRIPTION {PRIMARY_KEY False} {EDM_TYPE {}}\
{AUTOINCREMENT False} {UNIQUE False}}} {{{VIEW_CATALOG main} VIEW_SCHEMA\
{VIEW_NAME v1} {VIEW_COLUMN_NAME x} {TABLE_CATALOG main} {TABLE_SCHEMA\
sqlite_default_schema} {TABLE_NAME t1} {COLUMN_NAME x} {ORDINAL_POSITION 0}\
{COLUMN_HASDEFAULT False} COLUMN_DEFAULT COLUMN_FLAGS {IS_NULLABLE True}\
DATA_TYPE {CHARACTER_MAXIMUM_LENGTH 2147483647} NUMERIC_PRECISION NUMERIC_SCALE\
DATETIME_PRECISION CHARACTER_SET_CATALOG CHARACTER_SET_SCHEMA\
CHARACTER_SET_NAME COLLATION_CATALOG COLLATION_SCHEMA {COLLATION_NAME BINARY}\
{PRIMARY_KEY False} {EDM_TYPE {}} {AUTOINCREMENT False} {UNIQUE False}}}}}

###############################################################################

runTest {test tkt-baf42ee135-1.4 {GetSchemaTable, recursive CTE} -setup {
  setupDb [set fileName tkt-baf42ee135-1.4.db]
} -body {
  sql execute $db {
    CREATE TABLE t1(
      c1 TEXT NOT NULL, c2 INTEGER NOT NULL, c3 INTEGER NOT NULL
    );

    CREATE VIEW v1 AS WITH RECURSIVE t2 AS(
      SELECT c2, c3, c1 FROM t1 UNION ALL
      SELECT c2 + 1, c3, c1 FROM t2 WHERE c2 < c3
    ) SELECT DISTINCT c1 AS c1, c2 AS c4 FROM t2;
  }

  set connection [getDbConnection]

  set dataTable(1) [$connection -alias GetSchema COLUMNS]
  set dataTable(2) [$connection -alias GetSchema VIEWCOLUMNS]

  list [getRowsFromDataTable $dataTable(1)] \
      [getRowsFromDataTable $dataTable(2)]
} -cleanup {
  unset -nocomplain dataTable

  cleanupDb $fileName

  freeDbConnection

  unset -nocomplain connection db fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {{{{TABLE_CATALOG main} {TABLE_SCHEMA\
sqlite_default_schema} {TABLE_NAME t1} {COLUMN_NAME c1} COLUMN_GUID\
COLUMN_PROPID {ORDINAL_POSITION 0} {COLUMN_HASDEFAULT False} COLUMN_DEFAULT\
COLUMN_FLAGS {IS_NULLABLE False} {DATA_TYPE text} TYPE_GUID\
{CHARACTER_MAXIMUM_LENGTH 2147483647} CHARACTER_OCTET_LENGTH NUMERIC_PRECISION\
NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_CATALOG CHARACTER_SET_SCHEMA\
CHARACTER_SET_NAME COLLATION_CATALOG COLLATION_SCHEMA {COLLATION_NAME BINARY}\
DOMAIN_CATALOG DOMAIN_NAME DESCRIPTION {PRIMARY_KEY False} {EDM_TYPE nvarchar}\
{AUTOINCREMENT False} {UNIQUE False}} {{TABLE_CATALOG main} {TABLE_SCHEMA\
sqlite_default_schema} {TABLE_NAME t1} {COLUMN_NAME c2} COLUMN_GUID\
COLUMN_PROPID {ORDINAL_POSITION 1} {COLUMN_HASDEFAULT False} COLUMN_DEFAULT\
COLUMN_FLAGS {IS_NULLABLE False} {DATA_TYPE integer} TYPE_GUID\
{CHARACTER_MAXIMUM_LENGTH 8} CHARACTER_OCTET_LENGTH {NUMERIC_PRECISION 19}\
{NUMERIC_SCALE 0} DATETIME_PRECISION CHARACTER_SET_CATALOG CHARACTER_SET_SCHEMA\
CHARACTER_SET_NAME COLLATION_CATALOG COLLATION_SCHEMA {COLLATION_NAME BINARY}\
DOMAIN_CATALOG DOMAIN_NAME DESCRIPTION {PRIMARY_KEY False} {EDM_TYPE integer}\
{AUTOINCREMENT False} {UNIQUE False}} {{TABLE_CATALOG main} {TABLE_SCHEMA\
sqlite_default_schema} {TABLE_NAME t1} {COLUMN_NAME c3} COLUMN_GUID\
COLUMN_PROPID {ORDINAL_POSITION 2} {COLUMN_HASDEFAULT False} COLUMN_DEFAULT\
COLUMN_FLAGS {IS_NULLABLE False} {DATA_TYPE integer} TYPE_GUID\
{CHARACTER_MAXIMUM_LENGTH 8} CHARACTER_OCTET_LENGTH {NUMERIC_PRECISION 19}\
{NUMERIC_SCALE 0} DATETIME_PRECISION CHARACTER_SET_CATALOG CHARACTER_SET_SCHEMA\
CHARACTER_SET_NAME COLLATION_CATALOG COLLATION_SCHEMA {COLLATION_NAME BINARY}\
DOMAIN_CATALOG DOMAIN_NAME DESCRIPTION {PRIMARY_KEY False} {EDM_TYPE integer}\
{AUTOINCREMENT False} {UNIQUE False}} {{TABLE_CATALOG main} {TABLE_SCHEMA\
sqlite_default_schema} {TABLE_NAME v1} {COLUMN_NAME c1} COLUMN_GUID\
COLUMN_PROPID {ORDINAL_POSITION 0} {COLUMN_HASDEFAULT False} COLUMN_DEFAULT\
COLUMN_FLAGS {IS_NULLABLE True} {DATA_TYPE text} TYPE_GUID\
{CHARACTER_MAXIMUM_LENGTH 2147483647} CHARACTER_OCTET_LENGTH NUMERIC_PRECISION\
NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_CATALOG CHARACTER_SET_SCHEMA\
CHARACTER_SET_NAME COLLATION_CATALOG COLLATION_SCHEMA COLLATION_NAME\
DOMAIN_CATALOG DOMAIN_NAME DESCRIPTION {PRIMARY_KEY False} {EDM_TYPE nvarchar}\
{AUTOINCREMENT False} {UNIQUE False}} {{TABLE_CATALOG main} {TABLE_SCHEMA\
sqlite_default_schema} {TABLE_NAME v1} {COLUMN_NAME c4} COLUMN_GUID\
COLUMN_PROPID {ORDINAL_POSITION 1} {COLUMN_HASDEFAULT False} COLUMN_DEFAULT\
COLUMN_FLAGS {IS_NULLABLE True} {DATA_TYPE {}} TYPE_GUID\
{CHARACTER_MAXIMUM_LENGTH 2147483647} CHARACTER_OCTET_LENGTH NUMERIC_PRECISION\
NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_CATALOG CHARACTER_SET_SCHEMA\
CHARACTER_SET_NAME COLLATION_CATALOG COLLATION_SCHEMA COLLATION_NAME\
DOMAIN_CATALOG DOMAIN_NAME DESCRIPTION {PRIMARY_KEY False} {EDM_TYPE {}}\
{AUTOINCREMENT False} {UNIQUE False}}} {{{VIEW_CATALOG main} VIEW_SCHEMA\
{VIEW_NAME v1} {VIEW_COLUMN_NAME c1} {TABLE_CATALOG main} {TABLE_SCHEMA\
sqlite_default_schema} {TABLE_NAME t2} {COLUMN_NAME c1} {ORDINAL_POSITION 0}\
{COLUMN_HASDEFAULT False} COLUMN_DEFAULT COLUMN_FLAGS {IS_NULLABLE True}\
{DATA_TYPE TEXT} {CHARACTER_MAXIMUM_LENGTH 2147483647} NUMERIC_PRECISION\
NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_CATALOG CHARACTER_SET_SCHEMA\
CHARACTER_SET_NAME COLLATION_CATALOG COLLATION_SCHEMA COLLATION_NAME\
{PRIMARY_KEY False} {EDM_TYPE nvarchar} {AUTOINCREMENT False} {UNIQUE False}}\
{{VIEW_CATALOG main} VIEW_SCHEMA {VIEW_NAME v1} {VIEW_COLUMN_NAME c4}\
{TABLE_CATALOG main} {TABLE_SCHEMA sqlite_default_schema} TABLE_NAME\
COLUMN_NAME {ORDINAL_POSITION 1} {COLUMN_HASDEFAULT False} COLUMN_DEFAULT\
COLUMN_FLAGS {IS_NULLABLE True} DATA_TYPE {CHARACTER_MAXIMUM_LENGTH 2147483647}\
NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_CATALOG\
CHARACTER_SET_SCHEMA CHARACTER_SET_NAME COLLATION_CATALOG COLLATION_SCHEMA\
COLLATION_NAME {PRIMARY_KEY False} {EDM_TYPE {}} {AUTOINCREMENT False} {UNIQUE\
False}}}}}

###############################################################################

runSQLiteTestEpilogue
runTestEpilogue