dtle icon indicating copy to clipboard operation
dtle copied to clipboard

oracle INTEGER, INT is converted to mysql as INT(11), but Oracle's extreme data cannot be accepted

Open asiroliu opened this issue 3 years ago • 1 comments

Steps to reproduce the issue

  1. oracle sql
CREATE TABLE TEST.INTEGER_COLUMNS(col1 INT, col2 INTEGER);
INSERT INTO TEST.INTEGER_COLUMNS VALUES (1, -9999999999999999999999999999999999999999);
INSERT INTO TEST.INTEGER_COLUMNS VALUES (2, 9999999999999999999999999999999999999999);
  1. dest dtle log
2021-12-09T17:13:44.520+0800 [ERROR] client.driver_mgr.dtle: error at exec: driver=dtle @module=dtle.ApplierOracle.ApplyBinlogEvent err="Error 1264: Out of range value for column 'COL2' at row 1" gtid=00000000-0000-0000-0000-000000000000:0 job=aaa-migration timestamp=2021-12-09T17:13:44.519+0800
2021-12-09T17:13:44.520+0800 [ERROR] client.driver_mgr.dtle: skip : apply binlog event err: driver=dtle entryCtx="map[Entry:map[Coordinates:map[GNO:0 LastCommitted:516086 LogFile: LogPos:0 OSID: SID:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] SeqenceNumber:0] Events:[map[ColumnCount:2 CurrentSchema:TEST DML:1 DatabaseName:TEST LogPos:0 NewColumnValues:map[AbstractValues:[2 9999999999999999999999999999999999999999]] Query: Table:<nil> TableName:INTEGER_COLUMNS Timestamp:0 WhereColumnValues:map[AbstractValues:[<nil> <nil>]]]] Final:false Index:0] OriginalSize:0 TableItems:[map[Columns:map[Columns:[map[Charset: ColumnType:int(11) Default: EscapedName:`COL1` IsUnsigned:false Key: Nullable:true Precision:0 RawName:COL1 Scale:0 TimezoneConversion:<nil> Type:20] map[Charset: ColumnType:int(11) Default: EscapedName:`COL2` IsUnsigned:false Key: Nullable:true Precision:0 RawName:COL2 Scale:0 TimezoneConversion:<nil> Type:20]] Ordinals:map[COL1:0 COL2:1]] PsDelete:[<nil>] PsInsert:[map[]] PsUpdate:[<nil>]]]]" err="Error 1264: Out of range value for column 'COL2' at row 1" job=aaa-migration @module=dtle.ApplierOracle timestamp=2021-12-09T17:13:44.519+0800

Output of ./dtle version:**

9.9.9.9-oracle_demo-f4bc32e

asiroliu avatar Dec 09 '21 09:12 asiroliu

Oracle INT/INTEGER类型最大数值存储可到127位数(十进制),MySQL 没有数值类型可以存储最大值。 目前使用统一INT来做类型映射。极值问题不处理

LordofAvernus avatar Dec 10 '21 03:12 LordofAvernus