Browse Source

fix conversion of STimeStamp to Date, fix conversion String like types (e.g.STinyText) to String instead of Bytes

frabbit 10 years ago
parent
commit
dc332e556d
1 changed files with 6 additions and 1 deletions
  1. 6 1
      std/php/db/PDO.hx

+ 6 - 1
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)", "tiny":
 				return "bool";
 				return "bool";
 			case "int", "int24", "int32", "long", "longlong", "short":
 			case "int", "int24", "int32", "long", "longlong", "short":
 				return "int";
 				return "int";
+			case _ if (pdo_type == pdo_type_str):
+			 	return "string";
 			case "blob":
 			case "blob":
 				return "blob";
 				return "blob";
 			default:
 			default: