-
Shishir Jaiswal authored
UPGRADE DESCRIPTION =========== When doing an in-place upgrade using 'mysql_upgrade' utility (from 5.6/lower to 5.7) followed by export done through mysqlpump, we get the following error while importing this dump. "Invalid default value for {date_field}" ANALYSIS ======== The default SQL mode in v5.7 includes NO_ZERO_DATE as a result of which '0000-00-00' (if any) is not permitted in datetime fields. One of the ways to allow this is to temporarily suppress the above mode while importing the data. FIX === Sql_formatter::format_dump_start() has the code which sets the configuration variables at the top of the dump file generated through mysqlpump. Added the code to override the above mode (one of the default sql modes) with "NO_AUTO_VALUE_ON_ZERO" by setting this value in session variable 'SQL_MODE'. Resetting to its default value in Sql_formatter::format_dump_end()
Shishir Jaiswal authoredUPGRADE DESCRIPTION =========== When doing an in-place upgrade using 'mysql_upgrade' utility (from 5.6/lower to 5.7) followed by export done through mysqlpump, we get the following error while importing this dump. "Invalid default value for {date_field}" ANALYSIS ======== The default SQL mode in v5.7 includes NO_ZERO_DATE as a result of which '0000-00-00' (if any) is not permitted in datetime fields. One of the ways to allow this is to temporarily suppress the above mode while importing the data. FIX === Sql_formatter::format_dump_start() has the code which sets the configuration variables at the top of the dump file generated through mysqlpump. Added the code to override the above mode (one of the default sql modes) with "NO_AUTO_VALUE_ON_ZERO" by setting this value in session variable 'SQL_MODE'. Resetting to its default value in Sql_formatter::format_dump_end()
Loading