|
在主服务器(linux)上通过hibernate update 一条记录时产生二进制日志文件记录信息,但是二进制日志文件记录信息是将update语句中字段(包括数值类型)的值都以字符串形式转为十六进制的值;在从服务(linux)上执行二进制日志文件记录信息时,先判断字段类型,如果要赋值字段是数值类型,将十六进制的值转换为十进制(而不是字符串形式)进行赋值,这样就造成同步复制遇到数值类型时值就不对或者溢出.其它类型字段都正常.在主从服务器window环境下,不存在以上那种情况,window环境下二进制日志文件记录信息中update语句中字段(包括数值类型)的值都以字符串形式进行传输.
附上日志文件内容如下,留意红色字体
linux环境下生成的二进制日志文件内容片段:
DELIMITER /*!*/;
# at 4841
#090301 18:52:26 server id 1 end_log_pos 5362 Query thread_id=30 exec_time=0 error_code=0
use pospdb/*!*/;
SET TIMESTAMP=1235904746/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
SET @@session.sql_mode=0/*!*/;
/*!\C gbk *//*!*/;
SET @@session.character_set_client=28,@@session.collation_connection=28,@@session.collation_server=28/*!*/;
update pospdb.sys_parameter_tbl set totalUpperLimit=0x33303030302E3030, commPeriod=NULL, checkingTime=0x30302030302033202A202A203F, SendsettleUpTime=NULL, serviceSettleUpTime=NULL, codeVersion=0x303031, dataClearPeriod=NULL, checkDateInt=2, settleUpTime=NULL, createSettleUpTime=NULL, uploadQccTime=0x3030203030203133202A202A203F, uploadJJTime=NULL, uploadotherTime=NULL, sendTransactionTime=0x3020302F3133202A202A202A203F, sendErrorMsgTime=NULL where id=1
/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET [email=COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/]COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/[/email];
window环境下生成的二进制日志文件内容片段:
BEGIN;
# at 168
#090228 16:13:10 server id 1 end_log_pos 469 Query thread_id=2 exec_time=0 error_code=0
SET TIMESTAMP=1235808790;
update pospdb.sys_parameter_tbl set totalUpperLimit='30000.00', commPeriod=NULL, checkingTime='00 00 3 * * ?', SendsettleUpTime=NULL, serviceSettleUpTime=NULL, codeVersion='001', dataClearPeriod=NULL, checkDateInt=2, settleUpTime=NULL, createSettleUpTime=NULL, uploadQccTime='00 00 13 * * ?', uploadJJTime=NULL, uploadotherTime=NULL, sendTransactionTime='0 0/59 * * * ?', sendErrorMsgTime=NULL where id=1;
# at 637
#090228 16:13:10 server id 1 end_log_pos 664 Xid = 109
COMMIT;
还留意一点,这种情况可能跟hibernater在linux环境下生成的sql语句有关,因为在在服务上直接执行update语句时不存在以上那情况.生成的日志文件传输字段值都以字符串形式.请路过朋友帮忙看一下,谢谢了. |
|