|
17 | 17 | from lib.core.common import randomStr |
18 | 18 | from lib.core.common import safeSQLIdentificatorNaming |
19 | 19 | from lib.core.common import singleTimeWarnMessage |
| 20 | +from lib.core.common import splitFields |
20 | 21 | from lib.core.common import unArrayizeValue |
21 | 22 | from lib.core.common import zeroDepthSearch |
22 | 23 | from lib.core.data import conf |
@@ -384,11 +385,7 @@ def nullCastConcatFields(self, fields): |
384 | 385 | if fields.startswith("(CASE") or fields.startswith("(IIF") or fields.startswith("SUBSTR") or fields.startswith("MID(") or re.search(r"\A'[^']+'\Z", fields): |
385 | 386 | nulledCastedConcatFields = fields |
386 | 387 | else: |
387 | | - fields = fields.replace(", ", ',') |
388 | | - commas = [-1, len(fields)] |
389 | | - commas.extend(zeroDepthSearch(fields, ',')) |
390 | | - commas = sorted(commas) |
391 | | - fieldsSplitted = [fields[x + 1:y] for (x, y) in zip(commas, commas[1:])] |
| 388 | + fieldsSplitted = splitFields(fields) |
392 | 389 | dbmsDelimiter = queries[Backend.getIdentifiedDbms()].delimiter.query |
393 | 390 | nulledCastedFields = [] |
394 | 391 |
|
@@ -453,8 +450,7 @@ def getFields(self, query): |
453 | 450 | if re.search("\A\w+\(.*\)", fieldsToCastStr, re.I) or (fieldsSelectCase and "WHEN use" not in query) or fieldsSubstr: |
454 | 451 | fieldsToCastList = [fieldsToCastStr] |
455 | 452 | else: |
456 | | - fieldsToCastList = fieldsToCastStr.replace(", ", ',') |
457 | | - fieldsToCastList = fieldsToCastList.split(',') |
| 453 | + fieldsToCastList = splitFields(fieldsToCastStr) |
458 | 454 |
|
459 | 455 | return fieldsSelectFrom, fieldsSelect, fieldsNoSelect, fieldsSelectTop, fieldsSelectCase, fieldsToCastList, fieldsToCastStr, fieldsExists |
460 | 456 |
|
|
0 commit comments