Skip to content

Commit 7741f85

Browse files
author
Daniel Kinzler
committed
better support for pseudo-numbers
git-svn-id: https://svn.toolserver.org/svnroot/daniel/duesenstuff/trunk/gpClient@578 9f2c43bc-b3c0-43f4-b155-41619b16f219
1 parent a7b2469 commit 7741f85

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

python/gp/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1833,7 +1833,7 @@ def splitRow(s):
18331833
row = re.split(' *[;,\t] *', s)
18341834

18351835
for i, entry in enumerate(row):
1836-
if re.match('^\d+$', entry):
1836+
if re.match('^\d{1,9}$', entry): #TODO: port to python: no more than 9 chars for int conversion!
18371837
row[i] = int(entry)
18381838

18391839
row = tuple(row)

python/gp/mysql.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,9 @@ def __getattr__( self, name ):
483483
return super(MySQLGlue, self).__getattr__(name)
484484

485485
def quote_string (self, s ): #TODO: charset
486+
if type(s) not in (str, unicode):
487+
s = "%s" % s
488+
486489
return "'" + self.connection.escape_string( s ) + "'"
487490

488491
def as_list (self, values ):

0 commit comments

Comments
 (0)