Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kart GPKG working copy not compatible with GlobalMapper #899

Closed
olsen232 opened this issue Aug 17, 2023 · 2 comments
Closed

Kart GPKG working copy not compatible with GlobalMapper #899

olsen232 opened this issue Aug 17, 2023 · 2 comments

Comments

@olsen232
Copy link
Collaborator

GlobalMapper fails to open Kart GPKG working copies, with an malformed-database-schema error

After some digging, turns out GlobalMapper doesn't like this trigger:

CREATE TRIGGER _mytable_upd
   AFTER UPDATE ON mytable
BEGIN
    INSERT OR REPLACE INTO gpkg_kart_track (table_name, pk)
    VALUES ('mytable', NEW.fid), ('mytable', OLD.fid);
END;

Specifically it doesn't understand this form of INSERT:
INSERT [OR REPLACE] INTO <into> VALUES <row1>, <row2>;

If one of the rows-to-insert the trigger is removed, GlobalMapper is happy.
Presumably GlobalMapper uses a very old sqlite version that doesn't understand such things.

As a workaround, Kart could create the update trigger with two insert statements that insert one row each, instead of one trigger that inserts two rows. This has no real downsides (slightly less efficient) so we may as well.

**Version Info **

  • issue is in GlobalMapper 24_1-x64 for 64 bit Windows
@rcoup
Copy link
Member

rcoup commented Aug 17, 2023

Presumably GlobalMapper uses a very old sqlite version that doesn't understand such things.

Very old being at least 10 years:

SQLite Release 3.7.11 On 2012-03-20

  1. Enhance the INSERT syntax to allow multiple rows to be inserted via the VALUES clause.

@olsen232
Copy link
Collaborator Author

This is fixed in release 0.14.1 - if you are affected by this issue, recreate your Kart working copy using Kart 0.14.1 ie
kart create-workingcopy --delete-existing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants