[QGIS-Developer] Handling NULL differs in concat vs || in expressions: let's remove ||

Martin Pergler pergler at gmail.com
Tue Jan 28 05:20:21 PST 2020


Matthias Kuhn 🌍 wrote
> For what it's worth, I agree with Richard that it's often not what's 
> expected. And the worst is that on first sight it looks as if it's 
> working as expected.
> [...]
> The functionality of `||` on the other hand should be left untouched. 
> (it's useful to have e.g. `prefix || filename` produce NULL if filename 
> is NULL)
> 
> Matthias

Full +1 with Matthias (and others).
Partial +1 with Richard; you're right that it's unexpected at first. We
should make sure it's explained in help, and if space permits some clue in
the tooltip wouldn't hurt.

But I think for better or worse lots of users (those that use expressions,
that is...) will have developed code in their projects that harnesses the
nuances of ||, concat, and coalesce around NULL in specific ways. I'd be
very careful about changing or getting rid of || since it will break stuff.

No opinion on the buttons.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html


More information about the QGIS-Developer mailing list