﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31689	Warn that bulk_create()'s ignore_conflicts option ignores not only duplicate keys on MySQL.	Tobias Krönke	Tobias Krönke	"We were caught off guard that MySQL e.g. changes a not nullable date field into `0000-00-00` when trying to bulk insert with `ignore_conflicts=True` and `None` as the value for the column. You can read about that behavior here:

- https://www.mysqltutorial.org/mysql-insert-ignore/
- https://dev.mysql.com/doc/refman/8.0/en/insert.html


{{{
With IGNORE, invalid values are adjusted to the closest values and inserted;
}}}

Of course, you're encouraged to activate strict mode in MySQL (https://django-mysql.readthedocs.io/en/latest/checks.html), but this will not help in this specific case:

https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sql-mode-strict
{{{
If strict mode is enabled, dates with zero parts are not permitted and inserts produce an error, unless IGNORE is given as well. For INSERT IGNORE and UPDATE IGNORE, dates with zero parts are inserted as '0000-00-00'
}}}
"	Cleanup/optimization	closed	Documentation	3.0	Normal	fixed			Ready for checkin	1	0	0	0	0	0
