Project

General

Profile

« Previous | Next » 

Revision 2988

sql_gen.py: EnsureNotNull: Cast the null sentinel to the type it's the sentinel for, so that COALESCE returns the same type as the provided type, instead of potentially incorrectly assuming the constant's type. This fixes a bug where COALESCE returned an incorrect type.

View differences:

lib/sql_gen.py
563 563
class EnsureNotNull(FunctionCall):
564 564
    def __init__(self, value, type_):
565 565
        FunctionCall.__init__(self, InternalFunction('COALESCE'), as_Col(value),
566
            null_sentinels[type_])
566
            Cast(type_, null_sentinels[type_]))
567 567
        
568 568
        self.type = type_
569 569

  

Also available in: Unified diff