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

Fix processing (unreported) : Merge vector layer algorithm fail in the case a field name already but with different length or precision #60842

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ValentinBuira
Copy link
Contributor

@ValentinBuira ValentinBuira commented Mar 4, 2025

Description

This PR fix an error in the Merge vector layer algorithm

If we try to merge Layer A with a field length of 8 with Layer B with a field of the same name but with the length of 10

it would fail with the error:

Feature could not be written to Merged_761c063e_bb88_4f02_b5a2_edd2765227ac: Could not store attribute "FIELDNAME2": String of length 10 exceeds maximum field length (8)
Could not write feature into OUTPUT

But if we inverted the order of layers it would work

For the precision it would not crash but if the second layer and field name have a higher precision the information in the second layer would be in a lost

We warm the users about the transformation on the field just in case

Before / After
image

@github-actions github-actions bot added this to the 3.44.0 milestone Mar 4, 2025
Copy link

github-actions bot commented Mar 4, 2025

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit a29921e)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit a29921e)

@ptitjano
Copy link
Collaborator

ptitjano commented Mar 4, 2025

Thanks for working on this. Could you please add a unit test?

Update feedback comment

Co-authored-by: Nyall Dawson <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants