Skip to content

Commit

Permalink
handle escape sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
imor committed Dec 7, 2024
1 parent 77aa95f commit 523102f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pg_replicate/src/conversions/table_row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ impl TableRowConverter {
let mut values = Vec::with_capacity(column_schemas.len());

let row_str = str::from_utf8(row)?;
tracing::info!("ROW_STR: {row_str:#?}");
let mut column_schemas_iter = column_schemas.iter();
let mut chars = row_str.chars();
let mut val_str = String::with_capacity(10);
Expand All @@ -62,8 +63,22 @@ impl TableRowConverter {
c if in_escape => {
if c == 'N' {
val_str.push('\\');
val_str.push(c);
} else if c == 'b' {
val_str.push(8 as char);
} else if c == 'f' {
val_str.push(12 as char);
} else if c == 'n' {
val_str.push('\n');
} else if c == 'r' {
val_str.push('\r');
} else if c == 't' {
val_str.push('\t');
} else if c == 'v' {
val_str.push(11 as char)
} else {
val_str.push(c);
}
val_str.push(c);
in_escape = false;
}
'\t' => {
Expand Down

0 comments on commit 523102f

Please sign in to comment.