Bug report #14368

MSSQL datetime field type error with memorylayer

Added by Nikolaus Batlogg almost 9 years ago. Updated over 7 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Unknown
Affected QGIS version:2.8.4 Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:22351

Description

Mssql Server fields of datetime type cannot be added to a memory layer. If QGSFIELD is a List (with members of Type QgsField), derived from a Mssql Server Table layer connected to QGIS,
the method

aMemoryLayer.QgsVectorDataProvider.addAttributes(QGSFIELD)

fails.

This is for both, tables that are connected using the MSSQL driver and tables that are connected over ODBC. However, the same procedure is successful, if the destination layer aMemoryLayer is a file based Shapefile. So it seems, that only Memory Layer Storage Types are affected by this bug.
The MSSQL Server Version is 2012.

History

#1 Updated by Nyall Dawson almost 9 years ago

  • Status changed from Open to Feedback

Fairly certain this is fixed in 2.13. Can you please download a nightly release and test?

#2 Updated by Nikolaus Batlogg almost 9 years ago

Thanks for the prompt reply! Test successful - MSSQL Server datetime fields can be added to a memory layer without any problem. Tested Version: QGIS 2.13 Codeversion fab8dc2
Will there be a similar Fix for the current Long Term Release (2.8.X) too?

#3 Updated by Nyall Dawson almost 9 years ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

The fix is quite intrusive and not suitable for backporting unfortunately.

#4 Updated by Jürgen Fischer over 7 years ago

  • Category set to Unknown

Also available in: Atom PDF