You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I work mainly with Oracle databases and I've found that the MapServer expression parser isn't so good.
I've found that the best workaround for the missing right parenthesis is to write the FILTER expression with extra parenthesis around it, like:
FILTER (('[field'] =* 'Value'))
If the expression is like '[field]' =* 'Value' MapServer converts it to REGEXP_LIKE( "FIELD", '^Value$','i' , without the closing parenthesis.
This kind of workaround works for every expression the uses like/regex operators.
My patch fixes some issues, but it doesn't always work and may introduce some other error in the conversion.
The best thing is to revise/refactor the expression parser, maybe using yacc or similar tools. I don't think they will introduce major slowdowns, and expressions would always be analyzed correctly.
Maybe the parser works as the Oracle parser with the FILTER directive in map files ...
I work with different databases at the same time (Oracle, PostgreSQL, MySQL and MongoDB) but I have never tested a similar use case, I need to do some testing.
I think it's okay to revert the patch (it's mine), it doesn't always work.
But as I wrote above, there are problems in the entire expression parser, in some cases (with operators with regular expressions) I am forced to add extra parentheses to ensure that they are translated correctly.
I suppose the current implementation was designed to be fast, but perhaps a traditional parser, implemented with yacc or similar tools, could be fast enough and would make the code more maintainable and correct.
Activity
jmckenna commentedon Oct 15, 2025
sorry for the hassle @pelord I now reopened that other issue
jmckenna commentedon Nov 7, 2025
@pelord does PR #7379 also solve your issue here?
jmckenna commentedon Nov 10, 2025
@pelord any luck in finding the fix for this?
pelord commentedon Nov 11, 2025
This afternoon :)
jmckenna commentedon Nov 11, 2025
that would be good timing, thanks again.
pelord commentedon Nov 11, 2025
I compile it tomorrow morning and I give you some feedback in the morning. Sorry for the delay!
pelord commentedon Nov 11, 2025
seem to be related to this change
a468ec9
pelord commentedon Nov 11, 2025
@mikitex70 Any test / use case for your change?
pelord commentedon Nov 11, 2025
It's look like your change trigger this problem and if I remove your change, your will get your problem back! :(
mikitex70 commentedon Nov 12, 2025
I work mainly with Oracle databases and I've found that the MapServer expression parser isn't so good.
I've found that the best workaround for the missing right parenthesis is to write the
FILTERexpression with extra parenthesis around it, like:If the expression is like
'[field]' =* 'Value'MapServer converts it toREGEXP_LIKE( "FIELD", '^Value$','i', without the closing parenthesis.This kind of workaround works for every expression the uses
like/regexoperators.My patch fixes some issues, but it doesn't always work and may introduce some other error in the conversion.
The best thing is to revise/refactor the expression parser, maybe using
yaccor similar tools. I don't think they will introduce major slowdowns, and expressions would always be analyzed correctly.pelord commentedon Nov 12, 2025
But could you provide me an use case, how to trigger your syntax.
in my case, i've used
mikitex70 commentedon Nov 12, 2025
Try
Maybe the parser works as the Oracle parser with the
FILTERdirective in map files ...I work with different databases at the same time (Oracle, PostgreSQL, MySQL and MongoDB) but I have never tested a similar use case, I need to do some testing.
pelord commentedon Dec 16, 2025
My local fix is working properly. But it's a kind of revert of the previous commit...
a468ec9
Any advice/opinion how to resolve issue? How to reconciliate these issues?
mikitex70 commentedon Dec 16, 2025
I think it's okay to revert the patch (it's mine), it doesn't always work.
But as I wrote above, there are problems in the entire expression parser, in some cases (with operators with regular expressions) I am forced to add extra parentheses to ensure that they are translated correctly.
I suppose the current implementation was designed to be fast, but perhaps a traditional parser, implemented with yacc or similar tools, could be fast enough and would make the code more maintainable and correct.