From a2199ee575c5a1f6df14e5d03e8d47db8007cddd Mon Sep 17 00:00:00 2001 From: Daniel Blankenberg Date: Fri, 23 Aug 2019 11:29:36 -0400 Subject: [PATCH] Update scripts/interactivetools/key_type_token_mapping.py Co-Authored-By: Nicola Soranzo --- scripts/interactivetools/key_type_token_mapping.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/interactivetools/key_type_token_mapping.py b/scripts/interactivetools/key_type_token_mapping.py index b466c799e27..fa096dfbd60 100644 --- a/scripts/interactivetools/key_type_token_mapping.py +++ b/scripts/interactivetools/key_type_token_mapping.py @@ -72,7 +72,7 @@ def key_type_token_mapper(key, key_type, token, route_extra, url): for i in range(2): # Order by rowid gives us the last row added try: - row = db_conn.execute("select host, port from %s where key=? and key_type=? and token=? order by rowid desc limit 1" % (DATABASE_TABLE_NAME), (key, key_type, token)).fetchone() + row = db_conn.execute("SELECT host, port FROM %s WHERE key=? AND key_type=? AND token=? ORDER BY rowid DESC LIMIT 1" % (DATABASE_TABLE_NAME), (key, key_type, token)).fetchone() if row: rval = '%s:%s' % (tuple(row)) return rval.encode()