s4

changeset 953:93c38e425c85

Do not insert null new record.
author HIROSE Yuuji <yuuji@gentei.org>
date Mon, 08 Nov 2021 18:16:33 +0900
parents d5e87825195f
children ab78a6e229a6
files s4-funcs.sh
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/s4-funcs.sh	Mon Nov 08 18:15:52 2021 +0900
     1.2 +++ b/s4-funcs.sh	Mon Nov 08 18:16:33 2021 +0900
     1.3 @@ -4304,7 +4304,10 @@
     1.4  	esac
     1.5  	## err p2t: "replace into $tb2 values($pval, \"$col\", $type, $val, bin...);"
     1.6  	#query "replace into $tb2 values($pval, \"$col\", $type, $val, $bin);"
     1.7 -	sql="replace into $tb2 values($pval, \"$col\", $type, $val, $bin);"
     1.8 +	if [ x"$val" = x"NULL" -a x"$bin" = x"NULL" ]; then
     1.9 +	  continue	# Do not insert completely NULL record 2021-11-08
    1.10 +	fi
    1.11 +	sql="REPLACE into $tb2 values($pval, \"$col\", $type, $val, $bin);"
    1.12  	if [ x"$bin" = x"NULL" ]; then
    1.13  	  ## err Normal-query: `echo $sql`
    1.14  	  if [ -n "$transaction" ]; then