Browse Source

[spod] Do not use macro $v{} on RecordMacros, and fix cast to String code

Cauê Waneck 9 years ago
parent
commit
c2f16d5477
1 changed files with 2 additions and 2 deletions
  1. 2 2
      std/sys/db/RecordMacros.hx

+ 2 - 2
std/sys/db/RecordMacros.hx

@@ -640,9 +640,9 @@ class RecordMacros {
 							var ename = epath.pop();
 							var etype = TPath({ name:ename, pack:epath });
 							if (r1.n) {
-								return { sql: macro $manager.nullCompare(${r1.sql}, { var tmp = @:pos(e2.pos) (${e2} : $etype); tmp == null ? null : std.Type.enumIndex(tmp) + ''; }, $v{eq}), t : DBool, n: true };
+								return { sql: macro $manager.nullCompare(${r1.sql}, { var tmp = @:pos(e2.pos) (${e2} : $etype); tmp == null ? null : (std.Type.enumIndex(tmp) + ''); }, ${eq ? macro true : macro false}), t : DBool, n: true };
 							} else {
-								var expr = macro { @:pos(e2.pos) var tmp : $etype = $e2; (tmp == null ? null : std.Type.enumIndex(tmp)); };
+								var expr = macro { @:pos(e2.pos) var tmp : $etype = $e2; (tmp == null ? null : (std.Type.enumIndex(tmp) + '')); };
 								return { sql: makeOp(eq?" = ":" != ", r1.sql, expr, pos), t : DBool, n : r1.n };
 							}
 						}