In TKO, don't quote fields involving SQL functions.  This was causing a bug 
when drilling down on function fields, introduced with recent changes to quote 
all fields when constructing the WHERE clause.

This approach is a bit of a hack, but doing a proper fix would be a lot of 
effort, and hopefully the whole mechanism of passing direct SQL conditions will 
be obsolete soon enough, making this whole thing moot.

Signed-off-by: Steve Howard <[email protected]>

--- autotest/frontend/client/src/autotest/tko/HeaderField.java  2010-01-19 
11:32:40.000000000 -0800
+++ autotest/frontend/client/src/autotest/tko/HeaderField.java  2010-01-19 
11:32:40.000000000 -0800
@@ -70,7 +70,12 @@
      * Get a quoted version of getSqlName() safe for use directly in SQL.
      */
     public String getQuotedSqlName() {
-        return "`" + getSqlName() + "`";
+        String sqlName = getSqlName();
+        if (sqlName.matches(".+\\(.+\\)")) {
+            // don't quote fields involving SQL functions
+            return sqlName;
+        }
+        return "`" + sqlName + "`";
     }
 
     @Override
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to