Skip to content

Commit f902f8e

Browse files
author
Daniel Kinzler
committed
fix __make_mysql_closure: re-eval self.connection on every call
git-svn-id: https://svn.toolserver.org/svnroot/daniel/duesenstuff/trunk/gpClient@597 9f2c43bc-b3c0-43f4-b155-41619b16f219
1 parent 694b13c commit f902f8e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

python/gp/mysql.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -481,15 +481,15 @@ def gp_mysql_call_handler( self, gp, params ):
481481
def __make_mysql_closure( self, name ):
482482
rc = False
483483

484-
if not self.connection:
485-
raise gpUsageException( "not connected to mysql, can't run mysql function %s" % (name,) )
486-
487-
if not hasattr(self.connection, name):
488-
raise gpUsageException( "unknown mysql function: %s, not in %s" % (name, self.connection.__class__.__name__) )
489-
490-
f = getattr(self.connection, name)
491-
492484
def call_mysql( *args ):
485+
if not self.connection:
486+
raise gpUsageException( "not connected to mysql, can't run mysql function %s" % (name,) )
487+
488+
if not hasattr(self.connection, name):
489+
raise gpUsageException( "unknown mysql function: %s, not in %s" % (name, self.connection.__class__.__name__) )
490+
491+
f = getattr(self.connection, name)
492+
493493
#try:
494494
res = f( *args ) # note: f is bound to self.connection
495495
return res

0 commit comments

Comments
 (0)