Bug report #6238

The problem with MSSQL layers with bigint primary key

Added by Evgeniy Nikulin over 12 years ago. Updated over 12 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Data Provider/MSSQL
Affected QGIS version:master Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:duplicate
Crashes QGIS or corrupts data:No Copied to github as #:15546

Description

If the MSSQL layer has a bigint primary key, the attribute table is filled with the words "ERROR" (screenshot attached).

Probably the error is in the file /qgis/src/providers/mssql/qgsmssqlprovider.cpp.
Line 523:

   feature.setFeatureId( mQuery.value( col ).toInt() );

but need:
   feature.setFeatureId( mQuery.value( col ).toLongLong() );

mssql_error.png (70 KB) Evgeniy Nikulin, 2012-08-22 03:43 AM

History

#1 Updated by Alexander Bruy over 12 years ago

  • Resolution set to duplicate
  • Status changed from Open to Closed

Duplicate #6235

Also available in: Atom PDF