IN OH 2.5.11 I had a few rules using mysql directly from rule with old Syntax off CommandLine:
var String sql_query = "/bin/sh@@-c@@mysql -h localhost -u OHSQLUSER -pPASSWORD - e "SELECT…; -D "openhab2"
var String mysql = executeCommandLine(sql_query, 5000)
This works fine in OH 2.5 getting the result table in the String
During Migration I changed the Syntax as mentioned in migration-guidelines to
var String mysql = "executeCommandLine(Duration.ofSeconds(5), sql_query)
But this doesn’t work with mysql (Other .sh-Scripts the change in Syntax works, but not with mysql)
openhab.log
2021-01-10 01:29:00.513 [INFO ] [ab.core.model.script.SQL-Maintenance] - Check Amount of mysql-Data
2021-01-10 01:29:00.516 [WARN ] [rg.openhab.core.io.net.exec.ExecUtil] - Failed to execute commandLine ‘[/bin/sh@@-c@@mysql -h localhost -u USER -pPASSWORD -e “SELECT sum(TABLE_ROWS) AS Data FROM information_schema.TABLES where TABLE_SCHEMA like ‘openhab2’;” -D openhab2]’
2021-01-10 01:29:00.517 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID ‘98_Smarthome_Status-9’ failed: cannot invoke method public java.lang.String java.lang.String.split(java.lang.String) on null in 98_Smarthome_Status
First INFO comes from Rule,
WARN is the error I didnt get solved
ERROR is only because the String is null due to problem with executeCommandLine
Any idea, what I did wront with executeCommandLine? Or how to solve?