Project

General

Profile

« Previous | Next » 

Revision 5075

db_xml.py: put(): Added _alt optimization that just returns the first arg if it's non-NULL

View differences:

lib/db_xml.py
133 133
            row[out_col] = sql_gen.Col(strings.remove_prefix(input_col_prefix,
134 134
                value), in_table)
135 135
    
136
    # Optimizations for structural XML functions
137
    if out_table == '_alt': # return first arg if non-NULL
138
        args = row.items()
139
        args.sort()
140
        out_col, value = min(args) # first arg
141
        if xml_dom.is_node(value): row[out_col] = value = put_(value)
142
        if not sql_gen.is_nullable(db, value): return value
143
    
136 144
    # Process values
137 145
    parent_ids_loc = None # applies to this section
138 146
    for out_col, value in row.iteritems():

Also available in: Unified diff