Changeset: caecdaabcf82 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=caecdaabcf82
Modified Files:
testing/mktest.py
testing/sqllogictest.py
Branch: mtest
Log Message:
Fix handling of blobs.
blob data should be converted to a list of hex digits, not some Python
string representation with b prefix and backslash escapes.
diffs (48 lines):
diff --git a/testing/mktest.py b/testing/mktest.py
--- a/testing/mktest.py
+++ b/testing/mktest.py
@@ -103,11 +103,16 @@ def convertresult(columns, data):
nrow.append('(empty)')
else:
nval = []
- for c in str(row[i]):
- if ' ' <= c <= '~':
+ if isinstance(row[i], bytes):
+ for c in row[i]:
+ c = '%02X' % c
nval.append(c)
- else:
- nval.append('@')
+ else:
+ for c in str(row[i]):
+ if ' ' <= c <= '~':
+ nval.append(c)
+ else:
+ nval.append('@')
nrow.append(''.join(nval))
elif columns[i] == 'R':
nrow.append('%.3f' % row[i])
diff --git a/testing/sqllogictest.py b/testing/sqllogictest.py
--- a/testing/sqllogictest.py
+++ b/testing/sqllogictest.py
@@ -135,11 +135,16 @@ class SQLLogic:
nrow.append('(empty)')
else:
nval = []
- for c in str(row[i]):
- if ' ' <= c <= '~':
+ if isinstance(row[i], bytes):
+ for c in row[i]:
+ c = '%02X' % c
nval.append(c)
- else:
- nval.append('@')
+ else:
+ for c in str(row[i]):
+ if ' ' <= c <= '~':
+ nval.append(c)
+ else:
+ nval.append('@')
nrow.append(''.join(nval))
elif columns[i] == 'R':
nrow.append('%.3f' % row[i])
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list