$wpdb->insert query changes to SHOW COLUMNS query Output

For anyone else finding this question. WordPress seems to do a SHOW FULL COLUMNS query before executing the INSERT query. If it determines that the INSERT query would fail/store bad data, for example because the given data types would not fit in the column, it does not execute the insert query at all and return false.

Check:

  • Have you filled all fields that can not be null and do not have a default value
  • Does the data type for every field match the data type in the database
  • Does the data passed to the function violate any constraints? A string cannot be longer than the maximum length of the field you are trying to put it into. An integer field has a minimum and maximum value. Unsigned integers cannot contain negative values.