
Description
If a null value is passed as a column value in an INSERT or UPDATE statement when a function call to query is made and that column is defined to have a DEFAULT value, then that default value should be applied to the column on the the row insert/update operation. This is the standard behavior for MySQL.
But, the mysql module returns the response "ER_BAD_NULL_ERROR: Column '[column_name]' cannot be null". The NPM doc for mysql states that "undefined / null are converted to NULL" under the Escaping Query Values section (https://www.npmjs.com/package/mysql#escaping-query-values). If JavaScript null is passed and converted to MySQL NULL, then the mysql module should process it like a regular SQL query that has NULL value passed, in which the column's DEFAULT value is applied.
This issue is related to the feature request #559. However, I am not suggesting js undefined should act like MySQL NULL in regards to applying the column default value. I'm saying there is a bug on SQL statement execution: the mysql module does not properly behave when MySQL NULL is passed after (correctly being converted from) a js null value.