albar965 / littlenavmap

Little Navmap is a free flight planner, navigation tool, moving map, airport search and airport information system for Flight Simulator X, Microsoft Flight Simulator 2020, Prepar3D and X-Plane.
https://albar965.github.io/littlenavmap.html
GNU General Public License v3.0
1.28k stars 164 forks source link

Duplicate User waypoint crash #985

Closed dbarnea closed 1 year ago

dbarnea commented 1 year ago

abarthel-little_navmap.log

first, Edit a user point you have created. Now don't change anything, just close the edit dialog.

Next, add a new waypoint, it will remember the last values you have "edited". now change the name or ident to anything you want, you'll get the exception.

albar965 commented 1 year ago
[2023-01-15 7:20:57.348 DEBUG]: void UserdataDialog::acceptClicked() 0x27179660
[2023-01-15 7:20:57.354 CRIT ]: receiver "pushButtonUserdataAdd"
[2023-01-15 7:20:57.354 CRIT ]: event 3
[2023-01-15 7:20:57.354 CRIT ]: Caught exception in file ..\atools\src\gui\application.cpp line 83 what 
UNIQUE constraint failed: userdata.userdata_id 
Unable to fetch row. void atools::sql::SqlQuery::exec(): 
Error executing query. 
Query is "insert  into userdata (userdata_id, type, name, ident, region, description, tags, last_edit_timestamp, import_file_path, visible_from, altitude, temp, lonx, laty) 
values(:userdata_id, :type, :name, :ident, :region, :description, :tags, :last_edit_timestamp, :import_file_path, :visible_from, :altitude, :temp, :lonx, :laty)". 
Bound values are [":altitude"="52",":description"="",":ident"="PREVAZAdd",":import_file_path"="",":last_edit_timestamp"="2023-01-15T07:20:57.348",":laty"="38.9552001953125",":lonx"="20.749799728393555",":name"="PREVAZAdd",":region"="LG",":tags"="Greece",":temp"="false",":type"="Location",":userdata_id"="3220",":visible_from"="250"].

This is an error that corrupted the undo data in a past version when using bulk edit and has nothing to do with the ident. An internal id is conflicting. I thought I clear the undo data on update but either you missed the update or something is still wrong.

To avoid this issue:

Adding new points should work now.

I have to check how I can fix this.

dbarnea commented 1 year ago

Perfect, thank you .

On Mon, Jan 16, 2023 at 1:21 PM Alexander Barthel @.***> wrote:

Closed #985 https://github.com/albar965/littlenavmap/issues/985 as completed.

— Reply to this email directly, view it on GitHub https://github.com/albar965/littlenavmap/issues/985#event-8234646091, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR6GJSRF6ZMXSFDT7BYEP2DWSUVMNANCNFSM6AAAAAAT3VLQLI . You are receiving this because you authored the thread.Message ID: @.***>