Răsfoiți Sursa

Merge pull request #3992 from HaxeFoundation/php-pdo-fix

fix conversion of STimeStamp to Date, fix conversion String like types (...
frabbit 10 ani în urmă
părinte
comite
992fd00448
1 a modificat fișierele cu 8 adăugiri și 3 ștergeri
  1. 8 3
      std/php/db/PDO.hx

+ 8 - 3
std/php/db/PDO.hx

@@ -217,18 +217,23 @@ private class PHPNativeStrategy extends TypeStrategy {
 			} else
 			} else
 				return "string";
 				return "string";
 		}
 		}
+		var pdo_type_str:Int = untyped __php__("PDO::PARAM_STR");
+		var pdo_type : Int = untyped data["pdo_type"];
+
 		var type : String = untyped data[KEY];
 		var type : String = untyped data[KEY];
 		type = type.toLowerCase();
 		type = type.toLowerCase();
 		switch(type)
 		switch(type)
 		{
 		{
 			case "float", "decimal", "double", "newdecimal":
 			case "float", "decimal", "double", "newdecimal":
 				return "float";
 				return "float";
-			case "date", "datetime":
+			case "date", "datetime", "timestamp":
 				return "date";
 				return "date";
-			case "bool", "tinyint(1)", "tiny":
+			case "bool", "tinyint(1)":
 				return "bool";
 				return "bool";
-			case "int", "int24", "int32", "long", "longlong", "short":
+			case "int", "int24", "int32", "long", "longlong", "short", "tiny":
 				return "int";
 				return "int";
+			case "blob" if (pdo_type == pdo_type_str):
+			 	return "string";
 			case "blob":
 			case "blob":
 				return "blob";
 				return "blob";
 			default:
 			default: