Project

General

Profile

« Previous | Next » 

Revision 3538

sql_io.py: func_wrapper_exception_handler(): Use new sql_gen.merge_not_null() to try to ensure that NULL values are not folded (which would cause the concatenated values not to match up with the concatenated column names). Note that this adds a dependency on the db object, which callers must now provide.

View differences:

lib/sql_io.py
128 128
    
129 129
    return sql_gen.FunctionCall(function, col)
130 130

  
131
def func_wrapper_exception_handler(return_, args, errors_table):
131
def func_wrapper_exception_handler(db, return_, args, errors_table):
132 132
    '''Handles a function call's data_exceptions.
133 133
    Supports PL/Python functions.
134 134
    @param return_ See data_exception_handler()
......
138 138
    args = filter(sql_gen.has_srcs, args)
139 139
    
140 140
    srcs = sql_gen.cross_join_srcs(args)
141
    value = sql_gen.ArrayMerge(',', args)
141
    value = sql_gen.merge_not_null(db, ',', args)
142 142
    return sql_gen.NestedExcHandler(
143 143
        data_exception_handler(return_, srcs, errors_table, value)
144 144
        , sql_gen.plpythonu_error_handler
......
459 459
                def mk_return(result):
460 460
                    return sql_gen.ReturnQuery(sql.mk_select(db,
461 461
                        fields=[in_pkey_var, result], explain=False))
462
                exc_handler = func_wrapper_exception_handler(mk_return(None),
463
                    args.values(), errors_table_)
462
                exc_handler = func_wrapper_exception_handler(db,
463
                    mk_return(None), args.values(), errors_table_)
464 464
                
465 465
                sql.define_func(db, sql_gen.FunctionDef(wrapper,
466 466
                    sql_gen.SetOf(into),

Also available in: Unified diff