commit-gnue
[Top][All Lists]
Advanced

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

gnue/geas/src/oql oql.c


From: Reinhard Mueller
Subject: gnue/geas/src/oql oql.c
Date: Wed, 05 Sep 2001 00:59:41 -0700

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Reinhard Mueller <address@hidden>       01/09/05 00:59:40

Modified files:
        geas/src/oql   : oql.c 

Log message:
        Removed rtrim call as we now use varchar in postgres

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/geas/src/oql/oql.c.diff?tr1=1.66&tr2=1.67&r1=text&r2=text

Patches:
Index: gnue/geas/src/oql/oql.c
diff -u gnue/geas/src/oql/oql.c:1.66 gnue/geas/src/oql/oql.c:1.67
--- gnue/geas/src/oql/oql.c:1.66        Sat Sep  1 23:49:16 2001
+++ gnue/geas/src/oql/oql.c     Wed Sep  5 00:59:40 2001
@@ -19,7 +19,7 @@
   along with GEAS; if not, write to the Free Software Foundation, Inc.,
   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-  $Id: oql.c,v 1.66 2001/09/02 06:49:16 reinhard Exp $
+  $Id: oql.c,v 1.67 2001/09/05 07:59:40 reinhard Exp $
 */
 
 #include "config.h"
@@ -186,33 +186,18 @@
 
           g_string_append (buf, "(");
 
-          switch (db)
+          if (!c->casesensitive)
             {
-            case OQL_DBTYPE_MYSQL:
-              if (!c->casesensitive)
-                g_string_append (buf, "upper(");
-              break;
-            case OQL_DBTYPE_POSTGRESQL:
-              if (!c->casesensitive)
-                g_string_append (buf, "upper(rtrim(");
-              break;
-            default:
+              g_string_append (buf, "upper(");
             }
 
           quoted = oql_quote_column (c->targetclass, c->field, db);
           g_string_append (buf, quoted);
           g_free (quoted);
-          switch (db)
+
+          if (!c->casesensitive)
             {
-            case OQL_DBTYPE_MYSQL:
-              if (!c->casesensitive)
-                g_string_append (buf, ")");
-              break;
-            case OQL_DBTYPE_POSTGRESQL:
-              if (!c->casesensitive)
-                g_string_append (buf, ",' '))");
-              break;
-            default:
+              g_string_append (buf, ")");
             }
 
           switch (c->test)
@@ -271,33 +256,19 @@
               break;
             }
 
-          switch (db)
+          if (!c->casesensitive)
             {
-            case OQL_DBTYPE_MYSQL:
-              if (!c->casesensitive)
-                g_string_append (buf, "upper(");
-              break;
-            case OQL_DBTYPE_POSTGRESQL:
-              if (!c->casesensitive)
-                g_string_append (buf, "upper(");
-              break;
-            default:
+              g_string_append (buf, "upper(");
             }
+
           g_string_append (buf, quoted);
           g_free (quoted);
 
-          switch (db)
+          if (!c->casesensitive)
             {
-            case OQL_DBTYPE_MYSQL:
-              if (!c->casesensitive)
-                g_string_append (buf, ")");
-              break;
-            case OQL_DBTYPE_POSTGRESQL:
-              if (!c->casesensitive)
-                g_string_append (buf, ")");
-              break;
-            default:
+              g_string_append (buf, ")");
             }
+
           g_string_append (buf, ")");
 
           if (l->next)
@@ -1728,10 +1699,7 @@
       /* field */
       if (!f->casesensitive)
         {
-          if (db == OQL_DBTYPE_MYSQL)
-            g_string_append (buf, "upper(");
-          else if (db == OQL_DBTYPE_POSTGRESQL)
-            g_string_append (buf, "upper(rtrim(");
+          g_string_append (buf, "upper(");
         }
 
       quoted = oql_quote_column (classname, f->field, db);
@@ -1740,10 +1708,7 @@
 
       if (!f->casesensitive)
         {
-          if (db == OQL_DBTYPE_MYSQL)
-            g_string_append (buf, ")");
-          else if (db == OQL_DBTYPE_POSTGRESQL)
-            g_string_append (buf, ",' '))");
+          g_string_append (buf, ")");
         }
 
       /* test, and prepare 'quoted' with value, and extra characters needed by 
the test */
@@ -1823,18 +1788,13 @@
       /* add the value to test */
       if (!f->casesensitive)
         {
-          if (db == OQL_DBTYPE_MYSQL)
-            g_string_append (buf, "upper(");
-          else if (db == OQL_DBTYPE_POSTGRESQL)
-            g_string_append (buf, "upper(rtrim(");
+          g_string_append (buf, "upper(");
         }
+
       g_string_append (buf, quoted);
       if (!f->casesensitive)
         {
-          if (db == OQL_DBTYPE_MYSQL)
-            g_string_append (buf, ")");
-          else if (db == OQL_DBTYPE_POSTGRESQL)
-            g_string_append (buf, ",' '))");
+          g_string_append (buf, ")");
         }
 
       /* next */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]