192 Commits

Author SHA1 Message Date
Sandro Santilli
b33924a4b9 Fix old GDAL triggers in geopackage files
This makes changes which would otherwise fixed by done upon
opening these files with GDAL >= 3.2.2

Batch update was done using:

    ogrinfo ${F} -sql "select 1"

See
https://github.com/qgis/QGIS/issues/49033#issuecomment-1158006469

References GH-25830
2022-06-17 00:13:25 +02:00
Sandro Santilli
8c18fa28b6 Drop gpkg_metadata_reference_column_name_update trigger generated by GDAL < 2.4.0
Presence of this trigger results in QGIS dropping it whenever the file
is opened in read-write mode (as it happens with vector layer is
created from it)

See https://github.com/qgis/QGIS/issues/48937#issuecomment-1152726973
2022-06-11 01:35:14 +02:00
Nyall Dawson
a8c0a30a82 [mssql] Fix identity column types have a forced not null constraint
but not a complimentary defaultValueClause

This causes issues with any table using a identity column, as a user
is forced to populate these columns themselves in order to create
features, yet the value will be discarded when the feature is saved
to the database.

Instead correctly set the constraints, read only and a default value
clause for these column types.
2022-03-16 08:59:58 +10:00
Nyall Dawson
e33336be5c Remove DB2 Provider
This provider has been marked deprecated and hidden from the UI
for a number of QGIS releases. No maintainers have stepped up
to take over maintainance of this provider, and accordingly it
is now subject for removal.
2022-02-23 15:15:21 +10:00
Even Rouault
62eb4cd9a5 geopackage.gpkg: set journal_mode to delete 2022-02-02 08:37:34 +10:00
Sandro Mani
8bad9e0551
Merge pull request #45412 from kadas-albireo/master
Also support application/geojson as supported identify format, add tests
2021-10-06 02:46:33 +02:00
Sandro Santilli
a703d5d787 Have tests/testdata/provider/testdata_pg.sh run more checks
... and give more hints about proper setup

Also fix support for passing a database name as commandline argument
(kind of risky, for the dropdb call upfront)
2021-10-05 22:57:08 +02:00
Sandro Mani
265fd08e4a Also support application/geojson as supported identify format, add tests 2021-10-05 17:53:09 +02:00
Sandro Santilli
1006aa7b83 Allow calling testdata_pg.sh from any directory 2021-10-04 17:16:57 +02:00
Damiano Lombardi
ad17471db1 [mssql] use unique constraint info from db to set field ConstraintUnique 2021-06-21 16:36:50 +02:00
Damiano Lombardi
59be24f9fd
[mssql] use nullable info from db to set field ConstraintNotNull 2021-06-11 09:20:36 +10:00
Nyall Dawson
b635dbb7f4 Rebuild bug_21227-rename-styles.gpkg to fix test on newer GDAL versions 2021-02-08 13:23:37 +10:00
Even Rouault
b936829b3e [Postgres] Use spatial index for tables using geography type (fixes #39453) 2021-02-02 06:45:58 +10:00
speillet
c75e160255 fix discovering relation when a table has relation with several layers 2021-01-28 02:35:13 +10:00
Denis Rouzaud
fa8a45a1c2 add test for postgres hasSpatialIndex 2021-01-15 08:40:15 +01:00
Alessandro Pasotti
b1da0810c2 WFS-T 1.1.0 client implementation 2020-10-13 17:44:58 +02:00
Alessandro Pasotti
ebeb016c69
Merge pull request #39043 from elpaso/bugfix-gh39036-39025-relations-quoting
PG fix relation discovery with table/schema that require quotes
2020-10-01 22:55:51 +02:00
Alessandro Pasotti
84e204954f PG raster: support mosaics with no metadata
Fixes #39017
2020-09-26 10:31:13 +10:00
Alessandro Pasotti
5870cba39f PG fix relation discovery with table/schema that require quotes
Fixes #39036 #39025  (temptative, because I could not reproduce the
exact issue without project and data)
2020-09-25 18:43:40 +02:00
Juergen E. Fischer
b3e7230ac2 mssql provider:
* add missing support for non-integer and compound keys
* update unit tests
* unify time handling: iterator / minimumValue / maximumValue / uniqueValues
2020-09-17 08:12:14 +02:00
Alessandro Pasotti
235864fbc3 Fix test data (add SRID) 2020-09-15 19:46:42 +02:00
Even Rouault
cd04374d51 [DelimitedText provider] Avoid false positive detection of some date looking content as Time (fixes #38091) 2020-09-15 07:38:31 +10:00
Julien Cabieces
2970697d42 Add support for Oracle virtual (generated) column 2020-09-01 09:37:55 +02:00
Loïc Bartoletti
61364da358 simplify testdata_pg_releations.sql 2020-08-18 08:57:10 +10:00
Loïc Bartoletti
af14a421d5 add test with prod data 2020-08-18 08:57:10 +10:00
Nyall Dawson
c7c38e14de [wms] If an explicit CRS is not set in a layer's URI, then take the
first sensible CRS advertised by the provider's capabilities as the
layer's CRS

Avoids the messy situation where a WMS layer requires a valid CRS
to be set, yet QGIS provides no public API to retrieve the available
CRS for WMS layers. WIthout this fix it's necessary for plugins
to manually write their own capabilities parsing code in order to
retrieve the available CRSes for a service... ouch!
2020-08-11 06:35:47 +10:00
Alessandro Pasotti
6b9fb47267 PG raster: fix inverted Y data
Fixes #37968
2020-07-28 12:07:12 +02:00
José de Paula Rodrigues Neto Assis
c6824407ba Removed NUMERIC pgsql testdata. 2020-07-01 14:48:40 -03:00
José de Paula Rodrigues Neto Assis
0da7184728 Quoting floating point values on PostgreSQL provider.
This quotes floating point values on the PostgreSQL data provider, which
allows such values to be used either as stand-alone primary keys or as
components of composite primary keys on underlying tables. The
PostgreSQL session parameter extra_float_digits is explicitly set to 3
(the default on PostgreSQL 11 and older; in PostgreSQL 12 this defaults
to 1), to keep compatibility with all database versions and to avoid
round-trip errors.

In this PR, NUMERIC/DECIMAL values are no longer cast to
QVariant::Double in order to avoid loss of precision.
2020-06-23 18:08:19 -03:00
José de Paula Rodrigues Neto Assis
9469f246d7 Code review. Remove quotation of floats for PostgreSQL.
Removed quotation of floating point values after code review by Nyall
Dawson.
2020-06-18 08:34:33 +10:00
José de Paula Rodrigues Neto Assis
6a85309587 Adjusting tests to deal with floating point madness
PostgreSQL 11 and 12 handle floating point values differently; the test
originally passed on PostgreSQL 12, but not on 11 (Travis). Now, with
floating point data truncated to only 6 digits, they run on both
versions of the DBMS.
See https://www.postgresql.org/docs/12/release-12.html
2020-06-18 08:34:33 +10:00
José de Paula Rodrigues Neto Assis
617e0dbe8f PostgreSQL composite PK with bigint component
Bigint PostgreSQL fields are handled correctly if they are part of a
composite primary key. As a bonus, we always pass double values as
quoted to the DBMS (but not cast to text). With this one can work with
tables with real/double primary keys without the penalty of casting
these values to text. Fixes #37126.
2020-06-18 08:34:33 +10:00
Mathieu Pellerin
8192be7659
[delimitedtext] Fix datetime,date field type ignored (in CSVT et cie) 2020-06-10 13:38:08 +07:00
José de Paula Rodrigues Neto Assis
e16ece7541 Changed insert/update of GENERATED fields
Changed the way GENERATED fields are inserted/updated. Previously we
used the DEFAULT keyword for INSERTing; now, we expose the generating
expression to the user, but ommit the field when inserting or updating a
feature.
2020-06-03 08:40:18 +10:00
José de Paula Rodrigues Neto Assis
6378644a7e Tests for PostgreSQL 12+ GENERATED columns
These tests exercise the use of GENERATED columns, a feature which was
introduced by PostgreSQL 12+. They won't be run if the PostgreSQL server
against which we are testing is older than version 12.
2020-06-03 08:40:18 +10:00
José de Paula Rodrigues Neto Assis
3e9da5d28d Mechanism to test features on PostgreSQL 12+ 2020-06-03 08:40:18 +10:00
Alessandro Pasotti
582adf5f45 Failing tests for unique 2020-05-29 13:40:34 +02:00
Alessandro Pasotti
41e541faf3
Merge pull request #36762 from elpaso/bugfix-36689-pgraster-datatype-test
PG raster: tests and data for issue #36689
2020-05-29 10:55:50 +02:00
nirvn
317c798b56 [spatialite] Fix missing datetime/datime field type handling 2020-05-29 15:25:45 +07:00
Alessandro Pasotti
c06c209d2d Fix test data for PG raster 2020-05-28 17:47:01 +02:00
Alessandro Pasotti
efbd3ad7de PG raster: tests and data for issue #36689 2020-05-28 17:46:28 +02:00
Alessandro Pasotti
18e9bdc010 Providers: fix inconsistent behavior of OGR + tests
Fixes #36583

Add a base test to make sure all major DB providers will
behave the same way and return FALSE when a constraint violation
refuses an attribute change (in a batch with a valid one).

OGR with GPKG was the "bad guy" here.
2020-05-21 15:49:02 +02:00
Nyall Dawson
05e959febd Add provider conformance test suite using geopackage source 2020-05-14 18:58:53 +10:00
Nyall Dawson
090df69fc2 Spatialite test update 2020-05-14 18:58:53 +10:00
Nyall Dawson
d6fcac678b A stab in the dark 2020-05-14 18:58:53 +10:00
Nyall Dawson
a192e55f2d Update mssql provider tests for temporal handling 2020-05-14 18:58:53 +10:00
Nyall Dawson
9f5a82ad36 Fix postgres datetime tests 2020-05-14 18:58:53 +10:00
Nyall Dawson
36b2e21b7e Postgres date tests 2020-05-14 18:58:53 +10:00
Nyall Dawson
de2f9f8fa3 Get shapefile provider test working again 2020-05-14 18:58:53 +10:00
Nyall Dawson
a3cffc86ae Get delimited text provider passing datetime checks 2020-05-14 18:58:53 +10:00