changeset 994:f0a62a22e33c draft

FIX: Too long SQL including binary data put via heredocs.
author HIROSE Yuuji <yuuji@gentei.org>
date Sat, 15 Oct 2022 17:52:25 +0859
parents 83119d97a2f2
children 9a54ad622318
files s4-funcs.sh
diffstat 1 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/s4-funcs.sh	Fri Oct 14 23:22:48 2022 +0859
+++ b/s4-funcs.sh	Sat Oct 15 17:52:25 2022 +0859
@@ -4258,9 +4258,13 @@
 	  # Binary update line is TOO LONG to pipelining
 	  sqlfile="$tmpd/sqlf.$$"
 	  if [ -n "$transaction" ]; then
-	    printf '%s' "$sql" >> $transaction
+	    cat<<-EOF >> $transaction
+		$sql
+		EOF
 	  else
-	    printf '%s' "$sql" > $sqlfile
+	    cat<<-EOF > $sqlfile
+		$sql
+		EOF
 	    query ".read $sqlfile"
 	  fi
 	fi
@@ -4339,9 +4343,13 @@
 	  sqlfile="$tmpd/query.$$"
 	  ## err sqlfile=`ls -lF $sqlfile`
 	  if [ -n "$transaction" ]; then
-	    printf '%s' "$sql" >> $transaction
+	    cat<<-EOF >> $transaction
+		$sql
+		EOF
 	  else
-	    printf '%s' "$sql" > $sqlfile
+	    cat<<-EOF >> $sqlfile
+		$sql
+		EOF
 	    query ".read $sqlfile"
 	  fi
 	fi

yatex.org