[glom] Field::sql_find(): Do not quote the string.



commit c5a5446004931e748e39a365e0b9bbc4fa6b42a0
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Jun 23 21:45:50 2011 +0200

    Field::sql_find(): Do not quote the string.
    
    * glom/libglom/data_structure/field.cc: SqlBuilder already takes
    care of quoting so this just changed the actual value.
    This makes Quick Find work again.

 ChangeLog                            |    8 ++++++++
 glom/libglom/data_structure/field.cc |    2 +-
 2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 04e7882..d654c9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2011-06-23  Murray Cumming  <murrayc murrayc com>
 
+	Field::sql_find(): Do not quote the string.
+
+	* glom/libglom/data_structure/field.cc: SqlBuilder already takes 
+	care of quoting so this just changed the actual value.
+	This makes Quick Find work again.
+
+2011-06-23  Murray Cumming  <murrayc murrayc com>
+
 	Find: Use backend-specific LIKE or ILIKE operator instead of =.
 
 	* glom/libglom/connectionpool.[h|cc]:
diff --git a/glom/libglom/data_structure/field.cc b/glom/libglom/data_structure/field.cc
index cdb0525..3a52f47 100644
--- a/glom/libglom/data_structure/field.cc
+++ b/glom/libglom/data_structure/field.cc
@@ -375,7 +375,7 @@ Glib::ustring Field::sql_find(const Gnome::Gda::Value& value) const
       if(value.is_null())
         return "''"; //We want to ignore the concept of NULL strings, and deal only with empty strings.
       else
-        return ("'%" + value.to_string() + "%'"); //Add single-quotes. TODO: Actually escape it.
+        return ("%" + value.to_string() + "%"); //TODO: Escape it before adding "%", but then prevent SqlBuilder from re-escaping it.
         
       break;
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]