From: Matt S Trout <mst@shadowcat.co.uk>
Date: Sat, 14 Apr 2012 04:35:13 +0000 (+0000)
Subject: always_quote might be set with no quote chars
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=713f29aad5577b9b2def21ae437bff994c3c34b0;p=dbsrgits%2FData-Query.git

always_quote might be set with no quote chars
---

diff --git a/lib/Data/Query/Renderer/SQL/Naive.pm b/lib/Data/Query/Renderer/SQL/Naive.pm
index b8ad979..6cfce82 100644
--- a/lib/Data/Query/Renderer/SQL/Naive.pm
+++ b/lib/Data/Query/Renderer/SQL/Naive.pm
@@ -102,7 +102,7 @@ sub _render_identifier {
         $_ eq '*' # Yes, this means you can't have a column just called '*'.
           ? $_    # Yes, this is a feature. Go shoot the DBA if he disagrees.
           : ( # reserved are stored uc, quote if non-word
-              $always_quote || $res_check->{+uc} || /\W/
+              ($always_quote and $q1) || $res_check->{+uc} || /\W/
                 ? $q1.$_.$q2
                 : $_
             )