Revision 2468
Added by Aaron Marcuse-Kubitza over 12 years ago
sql.py | ||
---|---|---|
423 | 423 |
kw_args['recover'] = True |
424 | 424 |
kw_args.setdefault('log_ignore_excs', (DuplicateTableException,)) |
425 | 425 |
|
426 |
temp = not db.debug # tables are created as permanent in debug mode
|
|
426 |
temp = not db.autocommit # tables are permanent in autocommit mode
|
|
427 | 427 |
# "temporary tables cannot specify a schema name", so remove schema |
428 | 428 |
if temp: into.schema = None |
429 | 429 |
|
... | ... | |
563 | 563 |
while True: |
564 | 564 |
try: |
565 | 565 |
func_schema = None |
566 |
if not db.debug: func_schema = 'pg_temp'
|
|
566 |
if not db.autocommit: func_schema = 'pg_temp'
|
|
567 | 567 |
function = sql_gen.Table(function_name, func_schema).to_str(db) |
568 | 568 |
|
569 | 569 |
function_query = '''\ |
Also available in: Unified diff
sql.py: Create temp items as permanent in autocommit mode rather than in debug mode so that temp items are only permanent if actually committing result. This ensures that the generated SQL in test mode matches what would actually get run in regular commit mode, and the SQL is only altered to make the temp items visible if actually debugging (autocommit mode).