Bug report #11993

Node editing SQL server table causes crash

Added by Dave Morgan over 4 years ago. Updated over 4 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:-
Category:Data Provider/MSSQL
Affected QGIS version:2.6.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:20199

Description

Using the node tool to edit a sql server table with topological editing enabled causes QGIS to crash . There are no problems when the reshape tool is used instead, and no problem if the node tool is used with topological editing disabled.

QGIS 2.6.1, Windows XP and 7

Associated revisions

Revision b48e7fd3
Added by Nathan Woodrow over 4 years ago

Fix #11993 - Fix crash with node tool and sql server

Funded By Digital Mapping Solutions

History

#1 Updated by Giovanni Manghi over 4 years ago

  • Category set to Data Provider/MSSQL
  • Status changed from Open to Feedback
  • Priority changed from Normal to High

I assume that you mean "MS SQL" here. Does it happens also with previous QGIS releases?

#2 Updated by Dave Morgan over 4 years ago

Hi Giovanni

Yes Microsoft SQL Server.

Problem is the same on 2.4 but not 2.2 and 2.0 (node editing with topological editing enabled works OK in these versions)

Thanks
Dave

#3 Updated by Giovanni Manghi over 4 years ago

  • Target version set to Version 2.8
  • Priority changed from High to Severe/Regression
  • Status changed from Feedback to Open

#4 Updated by Martin Dobias over 4 years ago

When does it crash? When committing the changed features - or when doing the edits? In case of the latter, the problem is likely unrelated to MS SQL. Could you try to save the layer in a different format (e.g. shapefile) and see if it would still crash when editing? If yes please also upload the layer so we can replicate the problem.

#5 Updated by Martin Dobias over 4 years ago

  • Status changed from Open to Feedback

#6 Updated by Dave Morgan over 4 years ago

The crash happens when doing the edits. Activate the node edit tool, click the line to make the nodes active, then click on a node and drag to move. The node doesn't move, and a few seconds later QGIS displays the crash dump message and closes.
The table I discovered this on consists of overlapping features of three types ususally loaded with a filter to return a single type, but loading & editing my simple test polygon layer also causes the crash. The crash happens even when there are no coincident nodes to move. If I save the test polygon table as a shapefile, that will node edit without a problem. The connection to the db is a trusted connection using Windows authentication.
Below is the create table tsql script for the test table, generated in SQL server management studio. The sql server version is 2008 Standard edition.

Dave
USE [PCCMAPS]
GO

/****** Object: Table [Test].[tblTestPolygon] Script Date: 02/10/2015 11:33:01 **/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [Test].[tblTestPolygon](
[PolygonID] [bigint] IDENTITY NOT NULL,
[PolygonName] [varchar](50) NULL,
[PolygonGeom] [geometry] NULL,
[MI_STYLE] [varchar](254) NULL,
[QGISField] [varchar](20) NULL,
[SQLSMSField] [varchar](50) NULL,
[NewField] [varchar](25) NULL,
CONSTRAINT [PK_tblTestPolygon] PRIMARY KEY CLUSTERED
(
[PolygonID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

#7 Updated by Martin Dobias over 4 years ago

Thanks Dave for more details. Could you try to simplify your test case even more: have a MS SQL layer with just one polygon with three vertices. Would QGIS still crash?

Are there any other layers in your project that could interfere? What is your snapping configuration?

#8 Updated by Dave Morgan over 4 years ago

Hi Martin

Sorry I didn't get back to you yesterday, I was away from the office all afternoon. I've just created a new table (create statement below), loaded into an otherwise empty project, and digitised a single three vertex polygon. I the toggled out of editing mode and saved my changes. I then toggle editing back on, selected the node edit tool, clicked the polygon activated a node and tried to move it, causing the crash. Snapping options were set to snap to the table and enable topological editing, avoid intersections was not checked, snapping tolerance is 10 pixels (though the crash still happens if I reduce this to 5 pixels and if I turn snapping off). Trying to add a node with the node edit tool also causes the crash. The same crash happens if I try node editing as a user with read only permission on the db.

CRS is British National Grid (EPSG:27700)
Crash happens on Windows XP and 7 PCs

Dave

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [Test].[tblTestPolygon2](
[UniqueID] [int] IDENTITY NOT NULL,
[FeatureNo] [int] NULL,
[FeatureName] [varchar](20) NULL,
[GEOMETRY] [geometry] NULL,
CONSTRAINT [PK_tblTestPolygon2] PRIMARY KEY CLUSTERED
(
[UniqueID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

#9 Updated by Anonymous over 4 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF