So I did some debugging, the first time for me looking deeper into SA's code. Hopefully I did not get too lost.
In the 3rd loop, when the loaded editor_id == 2 and was again assigned 2, I forced a flush and stepped into SA. Down the top levels I could see SA bearing a loaded_value == 2 and a value == 2. After a while, near when the SQL was about to be constructed, editor_id vanished and only fields with actual different values remained. -- But, the compiled SQL statement somehow still insisted on having editor_id=%(editor_id)s. And then suddenly editor_id appears again in the parameters, with a NULL value. Sorry for not being more precise. The actual places where the parameters were transformed I obviously missed. Here are some screenshots <http://parenchym.com/fridge/check_editor_id/>for illustration. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.