Skip to content
Snippets Groups Projects
  • gmantele's avatar
    66304427
    [ADQL] Fix nasty infinite loop when wrapping matches with SimpleReplaceHandler. · 66304427
    gmantele authored
    This infinite loop occured only when the replacement object is just
    a wrapping of the matching object ; after replacement, the new object was
    inspected for matching objects.
    
    Example: infinite loop if we want to wrap all foo(...) functions with
             the function ROUND in the following query:
        SELECT foo(foo(123)) FROM myTable
    	     Expected result:
        SELECT ROUND(foo(ROUND(foo(123)))) FROM myTable
    	     But generated result was:
        SELECT ROUND(ROUND(ROUND(......foo(foo(123))))) FROM myTable
    66304427
    History
    [ADQL] Fix nasty infinite loop when wrapping matches with SimpleReplaceHandler.
    gmantele authored
    This infinite loop occured only when the replacement object is just
    a wrapping of the matching object ; after replacement, the new object was
    inspected for matching objects.
    
    Example: infinite loop if we want to wrap all foo(...) functions with
             the function ROUND in the following query:
        SELECT foo(foo(123)) FROM myTable
    	     Expected result:
        SELECT ROUND(foo(ROUND(foo(123)))) FROM myTable
    	     But generated result was:
        SELECT ROUND(ROUND(ROUND(......foo(foo(123))))) FROM myTable