Changeset: 5196e22491a9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5196e22491a9
Modified Files:
clients/examples/python/basics.py
clients/examples/python/perf.py
clients/examples/python/sqlsample.py
sql/test/BugTracker-2009/Tests/bit_and.SF-2850341.py
sql/test/BugTracker-2015/Tests/concurrent-schema.Bug-3826.SQL.py
sql/test/BugTracker-2015/Tests/schemadiff.Bug-3778.SQL.py
sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.py
sql/test/BugTracker-2020/Tests/table-udf-on-remote.Bug-6971.py
sql/test/BugTracker-2021/Tests/remote-join-idxs.Bug-7165.py
sql/test/BugTracker-2021/Tests/remote-table-groupby.Bug-7110.py
sql/test/BugTracker-2021/Tests/remote-table-ranges.Bug-7089.py
sql/test/BugTracker/Tests/mapi_connect_errors_vanish.SF-1432134.py
sql/test/BugTracker/Tests/python_escape.SF-1916844.SQL.py
sql/test/concurrent/Tests/simple_select.SQL.py
sql/test/mapi/Tests/python_dec38.py
sql/test/mapi/Tests/python_int128.py
sql/test/merge-partitions/Tests/mergepart29.SQL.py
sql/test/mergetables/Tests/transaction-conflict.SQL.py
Branch: Jul2021
Log Message:
Close descriptors
diffs (233 lines):
diff --git a/clients/examples/python/basics.py
b/clients/examples/python/basics.py
--- a/clients/examples/python/basics.py
+++ b/clients/examples/python/basics.py
@@ -21,3 +21,6 @@ c.execute('select * from tables')
results = c.fetchall()
x.commit()
print(results)
+
+c.close()
+x.close()
diff --git a/clients/examples/python/perf.py b/clients/examples/python/perf.py
--- a/clients/examples/python/perf.py
+++ b/clients/examples/python/perf.py
@@ -20,3 +20,5 @@ c = x.cursor()
c.arraysize=10000
c.execute('select * from tables, tables')
results = c.fetchall()
+c.close()
+x.close()
diff --git a/clients/examples/python/sqlsample.py
b/clients/examples/python/sqlsample.py
--- a/clients/examples/python/sqlsample.py
+++ b/clients/examples/python/sqlsample.py
@@ -41,3 +41,5 @@ if cursor.executemany("insert into pytho
sys.stderr.write("2 rows inserted expected")
cursor.execute('drop table python_table;')
+cursor.close()
+dbh.close()
diff --git a/sql/test/BugTracker-2009/Tests/bit_and.SF-2850341.py
b/sql/test/BugTracker-2009/Tests/bit_and.SF-2850341.py
--- a/sql/test/BugTracker-2009/Tests/bit_and.SF-2850341.py
+++ b/sql/test/BugTracker-2009/Tests/bit_and.SF-2850341.py
@@ -21,3 +21,6 @@ if has_huge:
cur1.execute('select bit_and(3749090034127126942, 0xffffffffffffffff);')
if cur1.fetchall() != [(3749090034127126942,)]:
sys.stderr.write('[(3749090034127126942,)] expected')
+
+cur1.close()
+conn1.close()
diff --git a/sql/test/BugTracker-2015/Tests/concurrent-schema.Bug-3826.SQL.py
b/sql/test/BugTracker-2015/Tests/concurrent-schema.Bug-3826.SQL.py
--- a/sql/test/BugTracker-2015/Tests/concurrent-schema.Bug-3826.SQL.py
+++ b/sql/test/BugTracker-2015/Tests/concurrent-schema.Bug-3826.SQL.py
@@ -53,6 +53,8 @@ def monetSchema(tbl, host = os.getenv('M
else:
break
time.sleep(0.5)
+ cursor.close()
+ dbh.close()
class Client(threading.Thread):
def __init__(self, tbl, host = os.getenv('MAPIHOST', 'localhost'),
diff --git a/sql/test/BugTracker-2015/Tests/schemadiff.Bug-3778.SQL.py
b/sql/test/BugTracker-2015/Tests/schemadiff.Bug-3778.SQL.py
--- a/sql/test/BugTracker-2015/Tests/schemadiff.Bug-3778.SQL.py
+++ b/sql/test/BugTracker-2015/Tests/schemadiff.Bug-3778.SQL.py
@@ -107,11 +107,14 @@ with tempfile.TemporaryDirectory() as tm
else:
print(str(c.fetchall()))
+ c.close()
masterproc.communicate()
for worker in workers:
workerrec['proc'].communicate()
finally:
for worker in workers:
+ workerrec['conn'].close()
p = workerrec.get('proc')
if p is not None:
p.terminate()
+ masterconn.close()
diff --git a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.py
b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.py
--- a/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.py
+++ b/sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.py
@@ -72,5 +72,9 @@ with tempfile.TemporaryDirectory() as fa
if node2_cur.fetchall() != [(2, None, 1, 5, 8, 1)]:
sys.stderr.write("Just row (2, None, 1, 5, 8, 1) expected")
# cleanup: shutdown the monetdb servers and remove tempdir
+ node1_cur.close()
+ node1_conn.close()
+ node2_cur.close()
+ node2_conn.close()
node1_proc.communicate()
node2_proc.communicate()
diff --git a/sql/test/BugTracker-2020/Tests/table-udf-on-remote.Bug-6971.py
b/sql/test/BugTracker-2020/Tests/table-udf-on-remote.Bug-6971.py
--- a/sql/test/BugTracker-2020/Tests/table-udf-on-remote.Bug-6971.py
+++ b/sql/test/BugTracker-2020/Tests/table-udf-on-remote.Bug-6971.py
@@ -73,5 +73,9 @@ with tempfile.TemporaryDirectory() as fa
sys.stderr.write("Just row (0.5, 0.6) expected")
# cleanup: shutdown the monetdb servers and remove tempdir
+ node1_cur.close()
+ node1_conn.close()
+ node2_cur.close()
+ node2_conn.close()
node1_proc.communicate()
node2_proc.communicate()
diff --git a/sql/test/BugTracker-2021/Tests/remote-join-idxs.Bug-7165.py
b/sql/test/BugTracker-2021/Tests/remote-join-idxs.Bug-7165.py
--- a/sql/test/BugTracker-2021/Tests/remote-join-idxs.Bug-7165.py
+++ b/sql/test/BugTracker-2021/Tests/remote-join-idxs.Bug-7165.py
@@ -114,6 +114,12 @@ with tempfile.TemporaryDirectory() as fa
sys.stderr.write("[(0,), (0,), (3,), (3,)] expected")
# cleanup: shutdown the monetdb servers
+ node1_cur.close()
+ node1_conn.close()
+ node2_cur.close()
+ node2_conn.close()
+ node3_cur.close()
+ node3_conn.close()
out, err = node1_proc.communicate()
sys.stderr.write(err)
out, err = node2_proc.communicate()
diff --git a/sql/test/BugTracker-2021/Tests/remote-table-groupby.Bug-7110.py
b/sql/test/BugTracker-2021/Tests/remote-table-groupby.Bug-7110.py
--- a/sql/test/BugTracker-2021/Tests/remote-table-groupby.Bug-7110.py
+++ b/sql/test/BugTracker-2021/Tests/remote-table-groupby.Bug-7110.py
@@ -53,8 +53,11 @@ with tempfile.TemporaryDirectory() as fa
sys.stderr.write("[('*', 8)] expected")
# cleanup: shutdown the monetdb servers and remove tempdir
+ node1_cur.close()
+ node1_conn.close()
+ node2_cur.close()
+ node2_conn.close()
out, err = node1_proc.communicate()
sys.stderr.write(err)
-
out, err = node2_proc.communicate()
sys.stderr.write(err)
diff --git a/sql/test/BugTracker-2021/Tests/remote-table-ranges.Bug-7089.py
b/sql/test/BugTracker-2021/Tests/remote-table-ranges.Bug-7089.py
--- a/sql/test/BugTracker-2021/Tests/remote-table-ranges.Bug-7089.py
+++ b/sql/test/BugTracker-2021/Tests/remote-table-ranges.Bug-7089.py
@@ -83,5 +83,9 @@ with tempfile.TemporaryDirectory() as fa
sys.stderr.write("[('A000000014', 20201011), ('A000000013',
20201010), ('A000000012', 20201009), ('A000000011', 20201008), ('A000000010',
20201007), ('A000000009', 20201006)] expected")
# cleanup: shutdown the monetdb servers and remove tempdir
+ node1_cur.close()
+ node1_conn.close()
+ node2_cur.close()
+ node2_conn.close()
node1_proc.communicate()
node2_proc.communicate()
diff --git a/sql/test/BugTracker/Tests/mapi_connect_errors_vanish.SF-1432134.py
b/sql/test/BugTracker/Tests/mapi_connect_errors_vanish.SF-1432134.py
--- a/sql/test/BugTracker/Tests/mapi_connect_errors_vanish.SF-1432134.py
+++ b/sql/test/BugTracker/Tests/mapi_connect_errors_vanish.SF-1432134.py
@@ -7,8 +7,9 @@ db = os.getenv("TSTDB")
port = int(os.getenv("MAPIPORT"))
try:
- pymonetdb.connect(database=db, port=port, autocommit=True,
username='invalid', password='invalid')
+ conn = pymonetdb.connect(database=db, port=port, autocommit=True,
username='invalid', password='invalid')
sys.stderr.write('Exception expected')
+ conn.close()
except Exception as ex:
if 'invalid credentials for user \'invalid\'' not in str(ex):
sys.stderr.write('Expected error: invalid credentials for user
\'invalid\'')
diff --git a/sql/test/BugTracker/Tests/python_escape.SF-1916844.SQL.py
b/sql/test/BugTracker/Tests/python_escape.SF-1916844.SQL.py
--- a/sql/test/BugTracker/Tests/python_escape.SF-1916844.SQL.py
+++ b/sql/test/BugTracker/Tests/python_escape.SF-1916844.SQL.py
@@ -82,3 +82,6 @@ try:
sys.stderr.write('2 rows inserted expected')
finally:
cursor.execute('drop table python_table')
+
+cursor.close()
+dbh.close()
diff --git a/sql/test/concurrent/Tests/simple_select.SQL.py
b/sql/test/concurrent/Tests/simple_select.SQL.py
--- a/sql/test/concurrent/Tests/simple_select.SQL.py
+++ b/sql/test/concurrent/Tests/simple_select.SQL.py
@@ -10,13 +10,15 @@ class Client(threading.Thread):
self.dbh =
pymonetdb.connect(port=int(os.getenv('MAPIPORT')),hostname=os.getenv('MAPIHOST'),database=os.getenv('TSTDB'))
def run(self):
- cursor = self.dbh.cursor();
+ cursor = self.dbh.cursor()
cursor.execute(query)
self.result = cursor.fetchall()
+ cursor.close()
def output(self):
if self.result != [(1, 2)]:
sys.stderr.write('[(1, 2)] expected')
+ self.dbh.close()
def main():
C = []
diff --git a/sql/test/mapi/Tests/python_dec38.py
b/sql/test/mapi/Tests/python_dec38.py
--- a/sql/test/mapi/Tests/python_dec38.py
+++ b/sql/test/mapi/Tests/python_dec38.py
@@ -22,3 +22,5 @@ if cursor.fetchall() != [(Decimal('12345
sys.stderr.write("Result set
[(Decimal('12345678901234567899876543210987654321'),
Decimal('1234567890123456789.9876543210987654321'),
Decimal('0.12345678901234567899876543210987654321'))] expected")
cursor.execute('DROP TABLE python_dec38;')
+cursor.close()
+dbh.close()
diff --git a/sql/test/mapi/Tests/python_int128.py
b/sql/test/mapi/Tests/python_int128.py
--- a/sql/test/mapi/Tests/python_int128.py
+++ b/sql/test/mapi/Tests/python_int128.py
@@ -21,3 +21,5 @@ if cursor.fetchall() != [(12345678909876
sys.stderr.write("Result set [(123456789098765432101234567890987654321,)]
expected")
cursor.execute('DROP TABLE python_int128;')
+cursor.close()
+dbh.close()
diff --git a/sql/test/merge-partitions/Tests/mergepart29.SQL.py
b/sql/test/merge-partitions/Tests/mergepart29.SQL.py
--- a/sql/test/merge-partitions/Tests/mergepart29.SQL.py
+++ b/sql/test/merge-partitions/Tests/mergepart29.SQL.py
@@ -57,6 +57,10 @@ with tempfile.TemporaryDirectory() as fa
if node1_cur.fetchall() != [(1, 1), (2, 2), (3, 3)]:
sys.stderr.write('[(1, 1), (2, 2), (3, 3)] expected')
+ node1_cur.close()
+ node1_conn.close()
+ node2_cur.close()
+ node2_conn.close()
out2, err2 = node2_proc.communicate()
sys.stderr.write(err2)
diff --git a/sql/test/mergetables/Tests/transaction-conflict.SQL.py
b/sql/test/mergetables/Tests/transaction-conflict.SQL.py
--- a/sql/test/mergetables/Tests/transaction-conflict.SQL.py
+++ b/sql/test/mergetables/Tests/transaction-conflict.SQL.py
@@ -22,6 +22,8 @@ class MergeTableWriter(threading.Thread)
barrier2.wait()
self._wcursor.execute('ROLLBACK;')
i += 1
+ self._wcursor.close()
+ self._wconn.close()
conn = pymonetdb.connect(port = int(os.getenv('MAPIPORT', '50000')), database
= os.getenv('TSTDB', 'demo'), hostname = os.getenv('MAPIHOST', 'localhost'),
autocommit=True)
cursor = conn.cursor()
@@ -61,3 +63,5 @@ DROP TABLE "mt";
DROP TABLE "part";
COMMIT;
""")
+cursor.close()
+conn.close()
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list