Mysql migration from 5.7 to 8 leads to a string and integer comparison issues in Stored Procedure

82 views Asked by At

Mysql migration from 5.7 to 8 leads to a string and integer comparison issues in Stored Procedure.

for eg :

if @tran <>0 or @tran <> '' then
    set Message = 'SUCCESS';
else
    set Message = 'FAIL in tran';
    rollback;
end if;

The @tran will have either "success" or 0 ( integer zero )

While it returns success it leads to error - 1292Truncated incorrect DOUBLE value: 'SUCCESS'

Kindly suggest what to do without changing the SPS because same syntax is used in many places which takes huge time to change.

0

There are 0 answers