Quick workaround for BLOB as TEXT problem (#2247) #2248

Open
kashikoibumi wants to merge 3 commits from kashikoibumi/strict-blob into v0.6
3 changed files with 4 additions and 4 deletions
Showing only changes of commit 07953592aa - Show all commits

View File

@ -1467,10 +1467,10 @@ class BMRPCDispatcher(object):
# Stream Number length
readPosition += decodeVarint(
payload[readPosition:readPosition + 10])[1]
t = (payload[readPosition:readPosition + 32], sqlite3.Binary(hash01))
t = (sqlite3.Binary(payload[readPosition:readPosition + 32]), sqlite3.Binary(hash01))
_, rowcount = sql.execute("UPDATE inventory SET tag=? WHERE hash=?", *t)
if rowcount < 1:
t = (payload[readPosition:readPosition + 32], hash01)
t = (sqlite3.Binary(payload[readPosition:readPosition + 32]), hash01)
sql.execute("UPDATE inventory SET tag=? WHERE hash=CAST(? AS TEXT)", *t)
queryreturn = sqlQuery(

View File

@ -3277,7 +3277,7 @@ class MyForm(settingsmixin.SMainWindow):
if total_row_count < 1:
sqlExecuteChunked(
"UPDATE inbox SET folder='inbox' WHERE msgid IN({0})",
True, idCount, *inventoryHashesToTrash, as_text=True)
True, idCount, *inventoryHashesToTrash)
tableWidget.selectRow(0 if currentRow == 0 else currentRow - 1)
tableWidget.setUpdatesEnabled(True)
self.propagateUnreadCount()

View File

@ -357,7 +357,7 @@ class TestCore(unittest.TestCase):
if len(column_type) < 1:
column_type = sqlQuery(
'''select typeof(msgid) from sent where ackdata=CAST(? AS TEXT)''', result)
self.assertEqual(column_type[0][0] if column_type else '', 'text')
self.assertEqual(column_type[0][0] if column_type else '', 'blob')
@unittest.skipIf(frozen, 'not packed test_pattern into the bundle')
def test_old_knownnodes_pickle(self):