Hi,
I label this as feature request, but should be considered as “error”.
First off: I’m still stuck trying to deploy a kanboard 1.2.25 with a sqlserver database, and creating a gazillion hotfixes that I will share in the future. For both core and plugins (this ones doesn’t even have a database creation script for sqlserver). So, I start with “sorry if this was previously fixed and I missed that”.
Well, I was experimenting 40001 errors (concurrency error) for a while, when i noticed those were followed by an 22018 error (cannot cast int to text). I tried to fix the concurrency error, assuming that the problem was my database configuration. Well, seems it was not.
After a ton of days, I’ve discovered that sometimes, the function execute() on database.php receives some integers (numers, or equivalent), casted to string. This seems not to be a problem with “soft” cast databases like mysql or picodb, but creates a chain crash on transactions on sqlserver (and my bet is that will crush oracle, too, or even postgres in certain scenarios).
I’m going to try to fix this in my laboratory, if I can, but I want to share it before it hits someone else. The problem can be reproduced launching a loop over the parameters. This should be included INSIDE function execute, from database.php:
error_log($sql);
foreach ($values as $v)
{
error_log($v.”-”-$gettype($v));
}
error_log(“end of parameters”);
Error 22018 always raise on sqlserver queries with form “where id=”, as sometimes param comes as “string” according to the previous statement.
As I understand that those parameters may come from elsewere, I’m focusing on making an integer cast conversion previous to the return $this→ statementhandler that uses the $values variable.
It hits several queries and tables, including tasks, subtasks and projects, and its kinda tricky to catch.
To sum up: as far as I can see ,kanboard is sending string parameters to integer fieds and the databases are silently casting them to integers.
Hope this helps.