parameters wrongly in the sql's beginning
Posted: 23.10.2022, 11:47
After an exception in a previous query I am getting the following error using Zeos8.0-fixes last trunk and mormot2 with Delphi 11.2 win32:
It seems that the parameter of the query exists in the beginning of the SQL query.
I have put a log point to see where the sql is created like than and the sql squery return from ComposeRawSQLQuery in TZAbstractMySQLPreparedStatement.ExecuteQueryPrepared is returned as
Before that in TSqlDBZeosStatement.ExecutePrepared from mormot.db.sql.zeos the fStatement.GetSQL returns the correct query:
What do you propose to log in order to debug it more?
I can reproduce that in an example and for the moment I just log such a problem when it happens.
Thank you in advance
Code: Select all
Exception: 20221023 07461843 * EXC EZSQLException {Message:"SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '100804359select pid as ID from table where iid=? limit 1' at line 1
Code: 1064 SQL: select pid as ID from table where iid=? limit 1"}
[Pool9-TEslave] at 01f194c0 ZDbcMySql.pas TZMySQLConnection.HandleErrorOrWarning (1271)
ZDbcMySql.pas TZMySQLConnection.HandleErrorOrWarning (1271)
ZDbcMySqlStatement.pas ExecuteEmulated (1040)
ZDbcMySqlStatement.pas TZAbstractMySQLPreparedStatement.ExecuteQueryPrepared (1052)
mormot.db.sql.zeos.pas TSqlDBZeosStatement.ExecutePrepared (1180)
mormot.db.sql.pas TSqlDBStatement.ExecutePreparedAndFetchAllAsJson (6664)
mormot.orm.sql.pas TRestStorageExternal.EngineList (1380)
mormot.orm.server.pas TRestOrmServer.EngineList (1073)
mormot.orm.rest.pas TRestOrm.ExecuteList (1676)
mormot.orm.rest.pas TRestOrm.MultiFieldValue (977) ......
I have put a log point to see where the sql is created like than and the sql squery return from ComposeRawSQLQuery in TZAbstractMySQLPreparedStatement.ExecuteQueryPrepared is returned as
Code: Select all
100804359select pid as ID from table where iid=? limit 1
Before that in TSqlDBZeosStatement.ExecutePrepared from mormot.db.sql.zeos the fStatement.GetSQL returns the correct query:
Code: Select all
select pid as ID from patient where amka=? limit 1
I can reproduce that in an example and for the moment I just log such a problem when it happens.
Thank you in advance