Add test case for missing columns in SQLite datasource, using subquery. Refs #2579
This commit is contained in:
parent
07a07c6268
commit
e7cf55222c
1 changed files with 19 additions and 0 deletions
|
@ -387,6 +387,25 @@ if 'sqlite' in mapnik.DatasourceCache.plugin_names():
|
|||
eq_(ds.fields(),['rowid', 'untyped'])
|
||||
eq_(ds.field_types(),['int', 'str'])
|
||||
|
||||
def test_db_with_one_untyped_column_using_subquery():
|
||||
# form up an in-memory test db
|
||||
wkb = '010100000000000000000000000000000000000000'
|
||||
ds = mapnik.SQLite(file=':memory:',
|
||||
table='(SELECT rowid, geometry, untyped FROM test1)',
|
||||
initdb='''
|
||||
create table test1 (geometry BLOB, untyped);
|
||||
insert into test1 values (x'%s', 'untyped');
|
||||
''' % wkb,
|
||||
extent='-180,-60,180,60',
|
||||
use_spatial_index=False,
|
||||
key_field='rowid'
|
||||
)
|
||||
|
||||
# ensure the untyped column is found
|
||||
eq_(len(ds.fields()),3)
|
||||
eq_(ds.fields(),['rowid', 'untyped', 'rowid'])
|
||||
eq_(ds.field_types(),['int', 'str', 'int'])
|
||||
|
||||
|
||||
def test_that_64bit_int_fields_work():
|
||||
ds = mapnik.SQLite(file='../data/sqlite/64bit_int.sqlite',
|
||||
|
|
Loading…
Reference in a new issue