Skip to content

Commit 26ef41c

Browse files
author
Daniel Kinzler
committed
workaround for strange bug in MySQLdb
git-svn-id: https://svn.toolserver.org/svnroot/daniel/duesenstuff/trunk/gpClient@594 9f2c43bc-b3c0-43f4-b155-41619b16f219
1 parent 9070459 commit 26ef41c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

python/gp/mysql.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,13 @@ def make_temp_table (self, spec ):
569569

570570
return MySQLTable(table, spec.get_fields())
571571

572+
def mysql_select_db ( self, db ):
573+
#NOTE: the native select_db "sometimes" triggers an InterfaceError.
574+
# This is a strange issue with MySQLdb
575+
576+
sql = "USE %s" % re.sub('[^\w]', '', db) #TODO: apply real identifier quoting!
577+
578+
self.mysql_update( sql )
572579

573580
def mysql_query_value (self, sql ):
574581
r = self.mysql_query_record( sql )

0 commit comments

Comments
 (0)