From 6191f32be96c32cd5b8c311f02630a9b71b1add5 Mon Sep 17 00:00:00 2001
From: Angus Mak <angus.mak@lullabot.com>
Date: Sun, 9 Sep 2012 21:17:31 -0400
Subject: [PATCH] Issue #1768672 by makangus: Fixed PostgreSQL/SQLite issue
 with binary collation syntax, use binary column

---
 shurly.install |    1 +
 shurly.module  |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/shurly.install b/shurly.install
index be0dae9..22c9814 100644
--- a/shurly.install
+++ b/shurly.install
@@ -29,6 +29,7 @@ function shurly_schema() {
         'type' => 'varchar',
         'length' => '255',
         'not null' => TRUE,
+        'binary' => TRUE,
       ),
       'destination' => array(
         'description' => t('redirect URL'),
diff --git a/shurly.module b/shurly.module
index eec6ae9..695a624 100644
--- a/shurly.module
+++ b/shurly.module
@@ -176,7 +176,7 @@ function shurly_boot() {
   // if the path has any unallowed characters in it (such as slashes),
   // it's not a short URL, so we can bail out and save ourselves a database call
   if (isset($_GET['q']) && shurly_validate_custom($_GET['q'])) {
-    $row = db_query("SELECT rid, destination FROM {shurly} WHERE BINARY source = :q AND active = 1", array(':q' => $_GET['q']))->fetchObject();
+    $row = db_query("SELECT rid, destination FROM {shurly} WHERE source = :q AND active = 1", array(':q' => $_GET['q']))->fetchObject();
     if ($row) {
       shurly_goto($row);
     }
-- 
1.7.9.6 (Apple Git-31.1)

