mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-06-02 05:48:52 -04:00
close out py3k + pg8000 bugs that are fixable for now without pg8000 decimal fix
This commit is contained in:
@@ -619,8 +619,13 @@ class PGDialect(default.DefaultDialect):
|
||||
"""
|
||||
rp = connection.execute(s)
|
||||
# what about system tables?
|
||||
# Py3K
|
||||
#schema_names = [row[0] for row in rp \
|
||||
# if not row[0].startswith('pg_')]
|
||||
# Py2K
|
||||
schema_names = [row[0].decode(self.encoding) for row in rp \
|
||||
if not row[0].startswith('pg_')]
|
||||
# end Py2K
|
||||
return schema_names
|
||||
|
||||
@reflection.cache
|
||||
@@ -644,7 +649,11 @@ class PGDialect(default.DefaultDialect):
|
||||
WHERE relkind = 'v'
|
||||
AND '%(schema)s' = (select nspname from pg_namespace n where n.oid = c.relnamespace)
|
||||
""" % dict(schema=current_schema)
|
||||
# Py3K
|
||||
#view_names = [row[0] for row in connection.execute(s)]
|
||||
# Py2K
|
||||
view_names = [row[0].decode(self.encoding) for row in connection.execute(s)]
|
||||
# end Py2K
|
||||
return view_names
|
||||
|
||||
@reflection.cache
|
||||
@@ -661,7 +670,11 @@ class PGDialect(default.DefaultDialect):
|
||||
rp = connection.execute(sql.text(s),
|
||||
view_name=view_name, schema=current_schema)
|
||||
if rp:
|
||||
# Py3K
|
||||
#view_def = rp.scalar()
|
||||
# Py2K
|
||||
view_def = rp.scalar().decode(self.encoding)
|
||||
# end Py2K
|
||||
return view_def
|
||||
|
||||
@reflection.cache
|
||||
|
||||
@@ -779,14 +779,14 @@ class ForUpdateTest(TestBase):
|
||||
iterations, thread_count = 10, 5
|
||||
threads, errors = [], []
|
||||
for i in xrange(thread_count):
|
||||
thread = threading.Thread(target=self.increment,
|
||||
thrd = threading.Thread(target=self.increment,
|
||||
args=(iterations,),
|
||||
kwargs={'errors': errors,
|
||||
'update_style': True})
|
||||
thread.start()
|
||||
threads.append(thread)
|
||||
for thread in threads:
|
||||
thread.join()
|
||||
thrd.start()
|
||||
threads.append(thrd)
|
||||
for thrd in threads:
|
||||
thrd.join()
|
||||
|
||||
for e in errors:
|
||||
sys.stdout.write("Failure: %s\n" % e)
|
||||
|
||||
Reference in New Issue
Block a user