Ticket #13475: 0003-Fix-typo-in-SQL-statement-of-class-Video.patch

File 0003-Fix-typo-in-SQL-statement-of-class-Video.patch, 1.3 KB (added by rcrdnalor, 4 years ago)

Late patch 0003

  • mythtv/bindings/python/MythTV/dataheap.py

    From 6201c89cc0213df99072102c0a84206db14def81 Mon Sep 17 00:00:00 2001
    From: Roland Ernst <rcrernst@gmail.com>
    Date: Mon, 23 Dec 2019 16:12:39 +0100
    Subject: [PATCH 3/4] Fix typo in SQL statement of class 'Video'
    
    Pythons MySQLdb expects a list of paramters, even there is only one,
    otherwise on get:
    
    MythTV.exceptions.MythDBError: MySQL error: not all arguments converted
                                   during string formatting
    
    See python PEP 0249 for details.
    ---
     mythtv/bindings/python/MythTV/dataheap.py | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/mythtv/bindings/python/MythTV/dataheap.py b/mythtv/bindings/python/MythTV/dataheap.py
    index 7cbd9925a1..a50c762734 100644
    a b class Video( CMPVideo, VideoSchema, DBDataWrite ): 
    966966                self.hash = self.getHash()
    967967            with self._db as cursor:
    968968                if cursor.execute("""SELECT intid FROM videometadata
    969                                      WHERE hash=%s""", self.hash) > 0:
     969                                     WHERE hash=%s""", (self.hash, )) > 0:
    970970                    id = cursor.fetchone()[0]
    971971                    self._evalwheredat([id])
    972972                    self._pull()