Run into something very strange while developing a plugin. $wpdb->insert (and the rest of the family) are using a fixed value for a variable that PHP is passing to them.
$wpdb->insert( $table_name, array( 'user_id' => $user_id, 'first_name' => $first_name ));
echo $user_id." | ".$wpdb->last_query;
100003685270940 | INSERT INTO 'wp_table_name'(user_id
) VALUES ('2147483647','Dave')
Notice that the $user_id printed by PHP and passed to the insert method is different from the one used by the method.
I've cleared the cache($wpdb->flush()) and also done a cache reload. What's causing this? I have no caching plugins enabled