MySQL does not thinks 0 to be a valid integer data . Although 0 is not present in master table it allows inserting in a referencing table as though 0 == NULL . This is really funny (dangerous)
Чтобы сделать работу с сайтом удобнее, мы используем cookie и аналитический сервис «Яндекс.Метрика». Продолжая пользоваться сайтом, вы соглашаетесь с их использованием.