Revision 2989
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql_gen.py | ||
---|---|---|
208 | 208 |
self.name = name |
209 | 209 |
self.table = table |
210 | 210 |
|
211 |
def to_str(self, db, use_concat=False):
|
|
211 |
def to_str(self, db, for_str=False):
|
|
212 | 212 |
str_ = db.esc_name(self.name) |
213 |
if for_str: str_ = clean_name(str_) |
|
213 | 214 |
if self.table != None: |
214 |
str_ = '.'+str_ |
|
215 |
table_str = self.table.to_Table().to_str(db) |
|
216 |
if use_concat: str_ = concat(table_str, str_) |
|
217 |
else: str_ = table_str+str_ |
|
215 |
table = self.table.to_Table() |
|
216 |
if for_str: str_ = concat(str(table), '.'+str_) |
|
217 |
else: str_ = table.to_str(db)+'.'+str_ |
|
218 | 218 |
return str_ |
219 | 219 |
|
220 |
def __str__(self): return clean_name(self.to_str(mockDb, use_concat=True))
|
|
220 |
def __str__(self): return self.to_str(mockDb, for_str=True)
|
|
221 | 221 |
|
222 | 222 |
def to_Col(self): return self |
223 | 223 |
|
Also available in: Unified diff
sql_gen.py: Col.to_str(): Take for_str param which does both concat() and str()/clean_name() instead of use_concat param which doesn't remove quotes from the strings before concatenating, causing strings to be incorrectly truncated