Project

General

Profile

« Previous | Next » 

Revision 3540

sql_io.py: put_table(): is_function: Creating error handling wrapper function: Fixed bug where needed to cast NULL returned in error handler to appropriate type, because it's contained within a SELECT query which does not do implicit casts from type unknown

View differences:

sql_io.py
442 442
                # Create empty pkeys table so its row type can be used
443 443
                insert_into_pkeys(input_joins, [in_pkey_col, func_call],
444 444
                    limit=0, recover=True)
445
                result_type = db.col_info(sql_gen.Col(out_pkey, into)).type
445 446
                
446 447
                ## Create error handling wrapper function
447 448
                
......
460 461
                    return sql_gen.ReturnQuery(sql.mk_select(db,
461 462
                        fields=[in_pkey_var, result], explain=False))
462 463
                exc_handler = func_wrapper_exception_handler(db,
463
                    mk_return(None), args.values(), errors_table_)
464
                    mk_return(sql_gen.Cast(result_type, None)), args.values(),
465
                    errors_table_)
464 466
                
465 467
                sql.define_func(db, sql_gen.FunctionDef(wrapper,
466 468
                    sql_gen.SetOf(into),

Also available in: Unified diff