@@ -1369,11 +1369,14 @@ def __pivotDumpTable(self, table, colList, count=None, blind=True):
13691369 validColumnList = False
13701370 validPivotValue = False
13711371
1372- if not count :
1372+ if count is None :
13731373 query = dumpNode .count % table
1374- count = inject .getValue (query , inband = False , error = False ) if blind else inject .getValue (query , blind = False )
1374+ count = inject .getValue (query , inband = False , error = False , expected = EXPECTED . INT , charsetType = CHARSET_TYPE . DIGITS ) if blind else inject .getValue (query , blind = False , expected = EXPECTED . INT )
13751375
1376- if count == "0" :
1376+ if isinstance (count , basestring ) and count .isdigit ():
1377+ count = int (count )
1378+
1379+ if count == 0 :
13771380 infoMsg = "table '%s' appears to be empty" % unsafeSQLIdentificatorNaming (table )
13781381 logger .info (infoMsg )
13791382
@@ -1400,9 +1403,9 @@ def __pivotDumpTable(self, table, colList, count=None, blind=True):
14001403 query = dumpNode .count2 % (column , table )
14011404
14021405 if blind :
1403- value = inject .getValue (query , inband = False , error = False )
1406+ value = inject .getValue (query , inband = False , error = False , expected = EXPECTED . INT , charsetType = CHARSET_TYPE . DIGITS )
14041407 else :
1405- value = inject .getValue (query , blind = False )
1408+ value = inject .getValue (query , blind = False , expected = EXPECTED . INT )
14061409
14071410 if isNumPosStrValue (value ):
14081411 validColumnList = True
@@ -1424,14 +1427,14 @@ def __pivotDumpTable(self, table, colList, count=None, blind=True):
14241427
14251428 if not validPivotValue :
14261429 warnMsg = "no proper pivot column provided (with unique values)."
1427- warnMsg += " It's not possible to retrieve all rows. "
1430+ warnMsg += " It won't be possible to retrieve all rows"
14281431 logger .warn (warnMsg )
14291432
14301433 pivotValue = " "
14311434 breakRetrieval = False
14321435
14331436 try :
1434- for i in xrange (int ( count ) ):
1437+ for i in xrange (count ):
14351438 if breakRetrieval :
14361439 break
14371440
0 commit comments