bug fixe with NULL columns in MySQL