Hi, please try this:
echo MYSQLI_TYPE_TINY . " " . MYSQLI_TYPE_CHAR;
On my server (client lib 4.1.12) I get 1 1
This means I cannot detect correctly a TINYINT, leading to a weird $primary_key condition that thinks it has to convert a string.
Marc