Revision 3001
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql_gen.py | ||
---|---|---|
582 | 582 |
Cast(type_, null_sentinels[type_])) |
583 | 583 |
|
584 | 584 |
self.type = type_ |
585 |
|
|
586 |
def to_str(self, db): |
|
587 |
col = self.args[0] |
|
588 |
index_col_ = index_col(col) |
|
589 |
if index_col_ != None: return index_col_.to_str(db) |
|
590 |
return FunctionCall.to_str(self, db) |
|
585 | 591 |
|
586 | 592 |
##### Table exprs |
587 | 593 |
|
Also available in: Unified diff
sql_gen.py: EnsureNotNull: Added to_str() which uses the column's index col if available. This works around a PostgreSQL bug where indexes on expressions are sometimes not used, but indexes on plain columns are used.