Fix with regression test for ticket #14019: SQLInsertCompiler.as_sql() failure