diff --git a/tests/src/python/test_provider_ogr_gpkg.py b/tests/src/python/test_provider_ogr_gpkg.py index a37f5c99fc5..ee8cccd5273 100644 --- a/tests/src/python/test_provider_ogr_gpkg.py +++ b/tests/src/python/test_provider_ogr_gpkg.py @@ -280,6 +280,17 @@ class TestPyQgsOGRProviderGpkg(unittest.TestCase): got = [feat for feat in vl.getFeatures()] self.assertEqual(len(got), 1) + testdata_path = unitTestDataPath('provider') + gpkg = os.path.join(testdata_path, 'bug_19826.gpkg') + vl = QgsVectorLayer('{}|layerid=0'.format(gpkg, 'test', 'ogr')) + vl.setSubsetString("name = 'two'") + got = [feat for feat in vl.getFeatures()] + self.assertEqual(len(got), 1) + + attributes = got[0].attributes() + self.assertEqual(attributes[0], 2) + self.assertEqual(attributes[1], 'two') + def testStyle(self): # First test with invalid URI diff --git a/tests/testdata/provider/bug_19826.gpkg b/tests/testdata/provider/bug_19826.gpkg new file mode 100644 index 00000000000..8833c80aeb3 Binary files /dev/null and b/tests/testdata/provider/bug_19826.gpkg differ