dabo Commit
Revision 5556
Date: 2009-12-17 06:13:35 -0800 (Thu, 17 Dec 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5556

Changed:
U   trunk/dabo/lib/datanav/Page.py

Log:
Got a strange error when doing a fulltext search in a datanav project with a 
MySQL backend: it generated SQL that looked like this:

SQL: select `archive`.`imsg` as `imsg`,
       `archive`.`clist` as `clist`,
       `archive`.`mtext` as `mtext`
  from `archive`
 where  match (`archive`.`mtext     `) against ("test") 
 limit 1000

Note the extra spaces in the field name for the match expression. I added code 
to fix this by stripping all the arguments to the string substitution.




Diff:
Modified: trunk/dabo/lib/datanav/Page.py
===================================================================
--- trunk/dabo/lib/datanav/Page.py      2009-12-16 15:18:02 UTC (rev 5555)
+++ trunk/dabo/lib/datanav/Page.py      2009-12-17 14:13:35 UTC (rev 5556)
@@ -286,7 +286,7 @@
                                                useStdFormat = False
                                                whrMatches = []
                                                for word in matchVal.split():
-                                                       mtch = {"table": table, 
"field": field, "value": word}
+                                                       mtch = {"table": 
table.strip(), "field": field.strip(), "value": word.strip()}
                                                        whrMatches.append( 
biz.getWordMatchFormat() % mtch )
                                                if len(whrMatches) > 0:
                                                        whr = " and 
".join(whrMatches)



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to