dh helpers: use NULL in reads from db
This commit is contained in:
parent
b4d65f15aa
commit
b067454799
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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[@]}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user