dh helpers: use NULL in reads from db

This commit is contained in:
Vincent Riquer 2025-11-10 15:26:13 +01:00
parent b4d65f15aa
commit b067454799
3 changed files with 4 additions and 4 deletions

View File

@ -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"
}
}

View File

@ -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"

View File

@ -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[@]}"