Skip to content

Commit d5e6be4

Browse files
committed
1 parent 7517e64 commit d5e6be4

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

lib/utils/pivotdumptable.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,19 @@ def pivotDumpTable(table, colList, count=None, blind=True):
6464
colList = filter(None, sorted(colList, key=lambda x: len(x) if x else MAX_INT))
6565

6666
if conf.pivotColumn:
67-
if any(re.search(r"(.+\.)?%s" % re.escape(conf.pivotColumn), _, re.I) for _ in colList):
68-
infoMsg = "using column '%s' as a pivot " % conf.pivotColumn
69-
infoMsg += "for retrieving row data"
70-
logger.info(infoMsg)
67+
for _ in colList:
68+
if re.search(r"(.+\.)?%s" % re.escape(conf.pivotColumn), _, re.I):
69+
infoMsg = "using column '%s' as a pivot " % conf.pivotColumn
70+
infoMsg += "for retrieving row data"
71+
logger.info(infoMsg)
7172

72-
validPivotValue = True
73-
colList.remove(conf.pivotColumn)
74-
colList.insert(0, conf.pivotColumn)
75-
else:
73+
colList.remove(_)
74+
colList.insert(0, _)
75+
76+
validPivotValue = True
77+
break
78+
79+
if not validPivotValue:
7680
warnMsg = "column '%s' not " % conf.pivotColumn
7781
warnMsg += "found in table '%s'" % table
7882
logger.warn(warnMsg)

0 commit comments

Comments
 (0)