From f3bf38c00be0c6f066a2751e214221af9b8c0a14 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Fri, 6 Jun 2014 10:36:15 -0400 Subject: [PATCH] Fix substring error. --- bitshift/database/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitshift/database/__init__.py b/bitshift/database/__init__.py index 5f483f3..23b190c 100644 --- a/bitshift/database/__init__.py +++ b/bitshift/database/__init__.py @@ -131,7 +131,7 @@ class Database(object): def _decompose_url(self, cursor, url): """Break up a URL into an origin (with a URL base) and a suffix.""" - query = """SELECT origin_id, SUBSTR(?, LENGTH(origin_url_base)) + query = """SELECT origin_id, SUBSTR(?, LENGTH(origin_url_base) + 1) FROM origins WHERE origin_url_base IS NOT NULL AND ? LIKE CONCAT(origin_url_base, "%")"""