When using a query with LOAD DATA LOCAL INFILE the MariaDB driver validates the file path has not changed before sending the data for the file to the database. The driver does the same thing for LOAD XML LOCAL INFILE as well, but always checks specifically for the word DATA, which causes this validation to fail any time LOAD XML LOCAL INFILE is used.
Links to offending code:
The query is checked to verify the filename: https://github.com/mariadb-corporation/mariadb-connector-j/blob/9536ba7afbb29226be7f89724178f4e548ad01be/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1738
The incorrect regex which only checks for DATA: https://github.com/mariadb-corporation/mariadb-connector-j/blob/9536ba7afbb29226be7f89724178f4e548ad01be/src/main/java/org/mariadb/jdbc/internal/util/Utils.java#L1007