Explorar el Código

check for nulls in expressions

Nicolas Cannasse hace 14 años
padre
commit
f97c87ed33
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      std/neko/db/SpodData.hx

+ 2 - 1
std/neko/db/SpodData.hx

@@ -450,8 +450,9 @@ class SpodData {
 
 	function buildDefault( cond : Expr ) {
 		var t = try Context.typeof(cond) catch( e : Dynamic ) throw BuildError.EExpr(cond);
+		isNull = false;
 		var d = try makeType(t) catch( e : Dynamic ) try makeType(Context.follow(t)) catch( e : Dynamic ) error("Unsupported type " + Std.string(t), cond.pos);
-		return { sql : sqlQuoteValue(cond, d), t : d, n : false }; // assume values are never checked for null's
+		return { sql : sqlQuoteValue(cond, d), t : d, n : isNull };
 	}
 
 	function buildCond( cond : Expr ) {