Skip to content
This repository has been archived by the owner on Jun 4, 2020. It is now read-only.

Spatialite checkout bug #55

Closed
Sameme opened this issue Mar 30, 2017 · 21 comments
Closed

Spatialite checkout bug #55

Sameme opened this issue Mar 30, 2017 · 21 comments

Comments

@Sameme
Copy link

Sameme commented Mar 30, 2017

This bug issue occurs when you do a spatialite checkout and edit your file. Once you commit the changes in your spatiliate checkout to the master, all edited information in fields with string data type are abbreviated to the first alphabet of whatever you inputted.

@vmora
Copy link
Contributor

vmora commented Apr 7, 2017

Can you give me examples of fields names that are abbreviated ? I'll make a unit test to roproduce (If I can because it be be fixed in new gdal versions)

@Sameme
Copy link
Author

Sameme commented Apr 7, 2017

I noticed this on fields with data type string or text.

Find screenshot

string issue

@vmora
Copy link
Contributor

vmora commented Apr 7, 2017

I added a unit test with a very long name, and the checkout, edit, commit without reproducing.

Are you able to run the test in the qgis python console ?

@Sameme
Copy link
Author

Sameme commented Apr 7, 2017

Tested with QGIS 2.14 and 2.18 with this result..13/13 failed. See screenshot below
test

@Sameme
Copy link
Author

Sameme commented Apr 7, 2017

Also on QGIS 2.14, the filtered checkout came out with both the points and polygon filtered layer. But when I inserted, on point layer the string field input was not abbreviated anymore but on the polygon layer, it is still abbreviating string to the First letter.

@vmora
Copy link
Contributor

vmora commented Apr 7, 2017

@Sameme can you send me your data (pg_dump yourbase > yourbase.sql and the .sqlite file before commit) ?

Because this bug seem to be really specific and if I cannot reproduce it, I cannot fix it.

@Sameme
Copy link
Author

Sameme commented Apr 7, 2017

OK. will share that with you.

@vmora
Copy link
Contributor

vmora commented Apr 7, 2017

Thank a lot, you have a place to upload indicated in my PM an instant ago

@Sameme
Copy link
Author

Sameme commented Apr 7, 2017

Files uploaded now.

@vmora
Copy link
Contributor

vmora commented Apr 7, 2017

@Sameme could you plz re-run the test with the new plugin (more output)

@Sameme
Copy link
Author

Sameme commented Apr 7, 2017

The latest that I downloaded from pydio I got this ....see attachment
new

@vmora
Copy link
Contributor

vmora commented Apr 7, 2017

@Sameme sorry, wrong action (no need to retest yet).

It would work if you define ane environment variable PYTHONPATH to your .qg2/python/plugins directory

I'll change the test to avoid that requirement, but could you define this variable and run the test in plain windows command line:

cd c:\Progra~1\QGIS2~1.14\bin
set PYTHONPATH=C:\your_user_directory\.qgis2\python\plugins
python -m qgis_versioning.test

since I'm already testing for the bugs, it would help to know if the tests pass on your system.

in the meantime I restored the database you sent (it was not simple as the revision table and the rev_head schema were missing). and it would be nice if you could give me the 'ogc_fid' of a feature that has truncated value.

@vmora
Copy link
Contributor

vmora commented Apr 7, 2017

@Sameme ok, using the revision, I'm able to reproduce the trunctation bug.

@vmora
Copy link
Contributor

vmora commented Apr 7, 2017

found the bug in column casting in postgres when integrating data from _diff schema to table.

@vmora
Copy link
Contributor

vmora commented Apr 7, 2017

@Sameme the bug is fixed. It was caused by the cast to the postgis type (in this case caharcter(256)) wich did not take into account the size, so was casting to character.

You'll find the fixed plugin .zip in the same place you found the previous.

@Sameme
Copy link
Author

Sameme commented Apr 7, 2017

Thanks Vincent for the hard work. My apology for not adding the revision table. My database is huge so I decided to backup my most important tables (point and polygon) forgetting to add the revision table along.

I am happy you finally found the bug. I will go through your instruction now and test.

@vmora
Copy link
Contributor

vmora commented Apr 7, 2017

@Sameme the revision table is really light, and really painfull to recreate, also contains real data (commit msg and authors)

Same thing for the trunk_rev_head views, that are necessary for working with the plugin, and I've had to hack the create_branch function to restore this view (I think the create view function doen't work with head, we could fix that to solve this particular problem).

I what you sent me is your backup, them I'd recommend you try to actually try a restore from backup + resume working. If it was just meant for me, then no problem, I eventually managed.

@Sameme
Copy link
Author

Sameme commented Apr 7, 2017

@vmora Would still like me to re-backup with the revision table and re-share with you?

@Sameme
Copy link
Author

Sameme commented Apr 7, 2017

@vmora The test is still failing on the cmd. I will continue with checkout test later in the night or tomorrow morning when I rest a bit
cmd

@Sameme
Copy link
Author

Sameme commented Apr 9, 2017

@vmora Also had some test with the new download, working fine now. I will carryout more test Monday morning.

@vmora
Copy link
Contributor

vmora commented Apr 10, 2017

Would still like me to re-backup with the revision table and re-share with you?

No, thanks, I'm able to reproduce #61 with what you gave me before.

The test is still failing on the cmd

You shoud be able to run one tes that fail to have more detail, e.g. :

python -m qgis_versionning.test.history_creation_tes

From what I see in your output, youe environment variabes PYTHONPATH and PYTHONHOME are not configured properly.

@vmora vmora closed this as completed in 59ca6ca Apr 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants