From b067454799738b132b4ce303d6f21b115958d5b2 Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Mon, 10 Nov 2025 15:26:13 +0100 Subject: [PATCH] dh helpers: use NULL in reads from db --- lib/database/Insert | 2 +- lib/database/Select | 2 +- lib/database/upgradedatabase_1_2 | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/database/Insert b/lib/database/Insert index 32d09be..8c75650 100644 --- a/lib/database/Insert +++ b/lib/database/Insert @@ -36,7 +36,7 @@ Insert() { "( $insert_values );" >&3 (( no_id )) || { echo 'SELECT LAST_INSERT_ROWID();' >&3 - read -u 4 results + read -u 4 -d$'\0' results echo "$results" } } diff --git a/lib/database/Select b/lib/database/Select index b096953..d2715d3 100644 --- a/lib/database/Select +++ b/lib/database/Select @@ -26,7 +26,7 @@ Select() { "WHERE ${where_statement[@]})" \ ",'SQL::Select:not found'" \ ");" >&3 - read -u 4 results + read -u 4 -d$'\0' results if ! [[ $results == "SQL::Select:not found" ]] then echo "$results" diff --git a/lib/database/upgradedatabase_1_2 b/lib/database/upgradedatabase_1_2 index 0985774..d3268eb 100644 --- a/lib/database/upgradedatabase_1_2 +++ b/lib/database/upgradedatabase_1_2 @@ -18,11 +18,11 @@ FROM destination_files; SELECT "AtOM::NoMoreData";' >&3 - read -u4 data + read -u4 -d$'\0' data while [[ $data != AtOM::NoMoreData ]] do datas+=( "$data" ) - read -u4 data + read -u4 -d$'\0' data done echo 'BEGIN TRANSACTION;' >&3 for data in "${datas[@]}"