SQL Custom - MySQL

Rodrigo Prazim <[email protected]> Fri, 12 Sep 2025 13:24:35 +0000
Newsgroups gmane.comp.freeradius.user
Message-ID <SN7PR12MB681554AB4B728BFD2EA00530AB08A@SN7PR12MB6815.namprd12.prod.outlook.com>
Hello,

I am attempting to create a query to retrieve the last piece of information from a REGEX:

input_circuitid {
    if ("%{reply:Packet-Type}" == 'Access-Accept') {
        "%{sql:INSERT INTO ...
                CASE \
                    WHEN '%{string:ADSL-Agent-Circuit-Id}' \
                         REGEXP '^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})/[0-9]+/[0-9]+/[A-Za-z0-9]+$' \
                    THEN SUBSTRING_INDEX('%{string:ADSL-Agent-Circuit-Id}', '/', -1) \
                    ELSE NULL \
                END \
            ) \
            ON DUPLICATE KEY UPDATE \
               ...
                sn = CASE \
                    WHEN '%{string:ADSL-Agent-Circuit-Id}' \
                         REGEXP '^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})/[0-9]+/[0-9]+/[A-Za-z0-9]+$' \
                    THEN SUBSTRING_INDEX('%{string:ADSL-Agent-Circuit-Id}', '/', -1) \
                    ELSE sn \
                END \
        }"
    }
}

However, FreeRadius interprets the curly braces "}" as the end of the statement.

 REGEXP '^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2}

Is there any way for FreeRadius to understand that this does not close the instruction?
Sincerely,

Rodrigo Prazim
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html