File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,11 @@ private class MySqlSanitizer implements Sanitizer {
29
29
if (Std .is (v , Bool )) return v ? ' true' : ' false' ;
30
30
if (v == null || Std .is (v , Int )) return ' $v ' ;
31
31
if (Std .is (v , Bytes )) v = (cast v : Bytes ).toString ();
32
- if (Std .is (v , Date )) return ' DATE_ADD(FROM_UNIXTIME(0), INTERVAL ${(v : Date ).getTime ()/ 1000 } SECOND)' ;
32
+
33
+ if (Std .is (v , Date )) return
34
+ #if mysql_session_timezone string ((v : Date ).toString ())
35
+ #else ' DATE_ADD(FROM_UNIXTIME(0), INTERVAL ${(v : Date ).getTime () / 1000 } SECOND)' #end;
36
+
33
37
return string (' $v ' );
34
38
}
35
39
Original file line number Diff line number Diff line change @@ -137,8 +137,9 @@ class MySqlConnection<Db> implements Connection<Db> implements Sanitizer {
137
137
}
138
138
139
139
public function value (v : Any ): String {
140
- if (Std .is (v , Date ))
141
- return ' DATE_ADD(FROM_UNIXTIME(0), INTERVAL ${(v : Date ).getTime () / 1000 } SECOND)' ;
140
+ if (Std .is (v , Date )) return
141
+ #if mysql_session_timezone NativeDriver .escape ((v : Date ).toString ())
142
+ #else ' DATE_ADD(FROM_UNIXTIME(0), INTERVAL ${(v : Date ).getTime () / 1000 } SECOND)' #end;
142
143
143
144
if (Int64 .isInt64 (v ))
144
145
return Int64 .toStr (v );
You can’t perform that action at this time.
0 commit comments