changeset 953:93c38e425c85 draft

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 wrap: on
line diff
--- a/s4-funcs.sh	Mon Nov 08 18:15:52 2021 +0900
+++ b/s4-funcs.sh	Mon Nov 08 18:16:33 2021 +0900
@@ -4304,7 +4304,10 @@
 	esac
 	## err p2t: "replace into $tb2 values($pval, \"$col\", $type, $val, bin...);"
 	#query "replace into $tb2 values($pval, \"$col\", $type, $val, $bin);"
-	sql="replace into $tb2 values($pval, \"$col\", $type, $val, $bin);"
+	if [ x"$val" = x"NULL" -a x"$bin" = x"NULL" ]; then
+	  continue	# Do not insert completely NULL record 2021-11-08
+	fi
+	sql="REPLACE into $tb2 values($pval, \"$col\", $type, $val, $bin);"
 	if [ x"$bin" = x"NULL" ]; then
 	  ## err Normal-query: `echo $sql`
 	  if [ -n "$transaction" ]; then

yatex.org