Question Details

No question body available.

Tags

mariadb liquibase

Answers (3)

July 6, 2026 Score: 3 Rep: 526,893 Quality: Low Completeness: 40%

I don't normally see the syntax LANGUAGE SQL in stored procedure or function definitions on MySQL or MariaDB. Try removing it:

CREATE FUNCTION fnGetLevel ( pNodeKey VARCHAR(1000) ) RETURNS INT DETERMINISTIC NO SQL BEGIN RETURN LENGTH(pNodeKey) - LENGTH(REPLACE(pNodeKey, '/', '')) - 1; END;
July 6, 2026 Score: 3 Rep: 183,024 Quality: Low Completeness: 60%

Hypothesis: Incorrect parsing of multi statement DDL. You can try to use function without BEGIN END block so there is only single ;:

CREATE FUNCTION fnGetLevel(pNodeKey VARCHAR(1000))
RETURNS INT
LANGUAGE SQL
RETURN LENGTH(pNodeKey) - LENGTH(REPLACE(pNodeKey, '/', '')) - 1;

dbfiddle demo

July 6, 2026 Score: -1 Rep: 1 Quality: Low Completeness: 50%

If the same function works on MariaDB 10.6 but fails on the 11.8 server at RETURNS, I'd first verify that the UAT server is actually running MariaDB (SELECT VERSION();) and not MySQL or another compatible database. Also check that Liquibase is sending the function as a single statement. As a quick test, try removing LANGUAGE SQL and use DETERMINISTIC NO SQL instead. If it still fails, the issue is likely with the server/environment rather than a MariaDB 11 syntax change. Posting the exact SELECT VERSION(); output and full error message would help pinpoint the cause.