Skip to content

Commit

Permalink
Dont store . in prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
karolisg committed Jan 24, 2024
1 parent 628b7df commit 5a95e7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions dozer-ingestion/mysql/src/binlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub async fn get_master_binlog_position(
})?;

Ok((
format!("{prefix}."),
prefix.to_string(),
BinlogPosition {
binlog_id,
position,
Expand Down Expand Up @@ -140,8 +140,10 @@ impl BinlogIngestor<'_, '_, '_> {
}

async fn open_binlog(&mut self) -> Result<(), MySQLConnectorError> {
let filename_formatted =
format!("{}{:0>6}", self.binlog_prefix, self.next_position.binlog_id);
let filename_formatted = format!(
"{}.{:0>6}",
self.binlog_prefix, self.next_position.binlog_id
);
let filename = filename_formatted.as_bytes();
let binlog_stream = self
.connect()
Expand Down Expand Up @@ -249,7 +251,7 @@ impl BinlogIngestor<'_, '_, '_> {
seq_no: 0,
};

self.binlog_prefix = format!("{prefix}.");
self.binlog_prefix = prefix.to_string();
self.open_binlog().await?;
}

Expand Down
2 changes: 1 addition & 1 deletion dozer-ingestion/mysql/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ impl MySQLConnector {
return Err(MySQLConnectorError::MultipleBinlogsWithSameSuffix);
}

prefix = Some(binlog_id[..(binlog_id.len() - 6)].to_string());
prefix = Some(binlog_id[..(binlog_id.len() - 7)].to_string());
}
}

Expand Down

0 comments on commit 5a95e7e

Please sign in to comment.