From: Andrew Ruthven Date: Thu, 18 Jun 2009 10:37:24 +0000 (+1000) Subject: Remove double quotes from SQL to make it portable. X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d820be417ede20510a019d5b876818a6a491e957;p=whoisi.git Remove double quotes from SQL to make it portable. --- diff --git a/services/command/htmlscrape.py b/services/command/htmlscrape.py index 1bf7015..3c5db77 100644 --- a/services/command/htmlscrape.py +++ b/services/command/htmlscrape.py @@ -88,7 +88,7 @@ class StateFeedToDatabaseCommand(BaseCommand): id = state["id"] print(" url %s id %s" % (url, id)) q = """ - UPDATE new_site SET status = "got_url", data = %s where id = %s + UPDATE new_site SET status = 'got_url', data = %s where id = %s """ return self.dcm.runQuery(q, (simplejson.dumps(url), id)) diff --git a/services/command/newsite.py b/services/command/newsite.py index d8f5be4..87a8592 100644 --- a/services/command/newsite.py +++ b/services/command/newsite.py @@ -542,7 +542,7 @@ class NewSiteDone(BaseCommand): self.state = state q = """ - UPDATE new_site SET status = "done", site_id = %s where id = %s + UPDATE new_site SET status = 'done', site_id = %s where id = %s """ d = self.dcm.runQuery(q, (state["site_id"], state["id"])) d.addCallback(self.done) @@ -572,7 +572,7 @@ class NewSiteError: if failure.check(NeedsFeedPickError): data = failure.value.data q = """ - UPDATE new_site SET status = "pick_url", data = %s WHERE id = %s + UPDATE new_site SET status = 'pick_url', data = %s WHERE id = %s """ d = self.dcm.runQuery(q, (data, id)) @@ -580,7 +580,7 @@ class NewSiteError: else: q = """ - UPDATE new_site SET status = "error", error = %s where id = %s + UPDATE new_site SET status = 'error', error = %s where id = %s """ if failure.check(PageNotFoundError): diff --git a/services/command/previewsite.py b/services/command/previewsite.py index bad7d13..7b4db59 100644 --- a/services/command/previewsite.py +++ b/services/command/previewsite.py @@ -67,7 +67,7 @@ class PreviewSiteDone(BaseCommand): data = simplejson.dumps(dict(feed=feed, current=current, type=state["type"])) q = """ - UPDATE new_site SET status = "preview_done", data = %s where id = %s + UPDATE new_site SET status = 'preview_done', data = %s where id = %s """ d = self.dcm.runQuery(q, (data, state["id"])) diff --git a/services/master/database.py b/services/master/database.py index 38264d6..83f4260 100644 --- a/services/master/database.py +++ b/services/master/database.py @@ -127,7 +127,7 @@ class DatabaseManager: self.new_site_in_progress = True q = """ - SELECT id, url FROM new_site WHERE status = "new" and id > %s + SELECT id, url FROM new_site WHERE status = 'new' and id > %s """ d = self.runQuery(q, self.new_site_last_id) d.addCallback(self.gotNewSites) @@ -164,7 +164,7 @@ class DatabaseManager: self.picked_site_in_progress = True q = """ - SELECT id, url FROM new_site WHERE status = "url_picked" and id > %s + SELECT id, url FROM new_site WHERE status = 'url_picked' and id > %s """ d = self.runQuery(q, self.picked_site_last_id) d.addErrback(self.errorHandler) @@ -198,7 +198,7 @@ class DatabaseManager: q = """ SELECT site_refresh.id, site_refresh.site_id, site.type FROM site_refresh, site WHERE - site_refresh.site_id = site.id and site_refresh.status = "new" and site_refresh.id > %s + site_refresh.site_id = site.id and site_refresh.status = 'new' and site_refresh.id > %s """ d = self.runQuery(q, self.refresh_last_id) d.addCallback(self.gotRefresh) @@ -278,7 +278,7 @@ class DatabaseManager: self.preview_site_in_progress = True q = """ - SELECT id, url FROM new_site WHERE status = "preview" and id > %s + SELECT id, url FROM new_site WHERE status = 'preview' and id > %s """ d = self.runQuery(q, self.preview_site_last_id)