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 19096,SQLInsertCompiler and DatabaseOperations.return_insert_id for non standard backends,Michael Manfre,nobody,"I ran in to a problem with SQLInsertCompiler while trying to allow django-mssql to have `can_return_id_from_insert = True`. The problem is that SQLInsertCompiler requires that an SQL fragment (returned by ops.return_insert_id) is appended to the end of the insert statement, but the fragment must also accept the full quoted table and column name. https://github.com/django/django/blob/master/django/db/models/sql/compiler.py#L900 The problem for mssql, is that the OUTPUT clause doesn't conform to these two requirements and is better served by mangling the SQL query in its own SQLInsertCompiler. To make this possible (in a backwards compatible way), the output of return_insert_id needs to be checked and ignored if r_fmt is None.",Cleanup/optimization,closed,"Database layer (models, ORM)",1.4,Normal,fixed,,,Accepted,0,0,0,0,0,0