Quellcode durchsuchen

update set nullable

zjh vor 1 Woche
Ursprung
Commit
b1a7777f01
1 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
  1. 5 1
      src/Driver/Traits/SQL.php

+ 5 - 1
src/Driver/Traits/SQL.php

@@ -746,7 +746,11 @@ trait SQL
                 return $this;
             }
         }
-        $val = $this->handleFieldAlias($field) ."='". $this->setQuote($value) . "'";
+        if($value == null){
+            $val = $this->handleFieldAlias($field) ." = null";
+        }else{
+            $val = $this->handleFieldAlias($field) ."='". $this->setQuote($value) . "'";
+        }
         $this->sets = $this->sets != null ? $this->sets . ', '. $val : $val;
         return $this;
     }