Skip to content

Commit 8ee8fda

Browse files
committed
improve replication pointer reset, default AdjustColumnType false [bump]
1 parent 78e040e commit 8ee8fda

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

cmd/sling/sling_logic.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,16 +271,18 @@ func runReplication(cfgPath string) (err error) {
271271
Columns: stream.Columns,
272272
PrimaryKey: stream.PrimaryKey,
273273
UpdateKey: stream.UpdateKey,
274-
Options: stream.SourceOptions,
275274
},
276275
Target: sling.Target{
277-
Conn: replication.Target,
278-
Object: stream.Object,
279-
Options: stream.TargetOptions,
276+
Conn: replication.Target,
277+
Object: stream.Object,
280278
},
281279
Mode: stream.Mode,
282280
}
283281

282+
// so that the next stream does not retain previous pointer values
283+
g.Unmarshal(g.Marshal(stream.SourceOptions), cfg.Source.Options)
284+
g.Unmarshal(g.Marshal(stream.TargetOptions), cfg.Target.Options)
285+
284286
if stream.SQL != "" {
285287
cfg.Source.Stream = stream.SQL
286288
}

core/sling/config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,8 @@ var TargetDBOptionsDefault = TargetOptions{
719719
0,
720720
),
721721
UseBulk: g.Bool(true),
722-
AdjustColumnType: g.Bool(true),
722+
AdjustColumnType: g.Bool(false),
723+
AddNewColumns: true,
723724
DatetimeFormat: "auto",
724725
MaxDecimals: g.Int(-1),
725726
}

0 commit comments

Comments
 (0)