When calling executeQuery($query) function with $query containing spaces and/or newlines after the last ";" in $query string, the function will return "Query was empty" error. To make the function more user friendly, especially in cases when $query contains multiple sql statements, propose to add a line in executeQuery function as follows:
...
$DML->setRowLocks($this->row_locks);
$query = trim($query); // added this line to solve unexpected "Query was empty" error
$result = $DML->multiQuery($this->dbname_server, $this->tablename, $query);
...