121214 11:54:30 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. Statement: update db_ds_pax p
set p.mbp_id = 8861912, updated_ts = now()
where p.flight_id = 2506912
and p.logically_deleted = 0
and (
exists (
select * from db_bkg_passenger bkgp
where bkgp.bkg_pax_id = p.bkg_pax_id
and bkgp.ticket_num = '2202326623256'
and bkgp.logically_deleted = 0 )
or exists (
select * from db_dcs_pax dcsp
where dcsp.dcs_pax_id = p.dcs_pax_id
and dcsp.ticket_num = '2202326623256'
and dcsp.logically_deleted = 0 ))
このステートメントで安全でないのはどれですか? 何も挿入するのではなく、更新するだけです。実際、更新に使用するものを選択していません。
左結合を使用して書き直そうとしましたが、それでも問題が発生します。私も犯人だと思っupdated_ts = now()
て固定時間に設定しましたが、それでも同じ警告です。
サーバーは Oracle の 5.5.27 です