#10864 closed defect (fixed)
Syntax error, or simply wrong version?
Reported by: | Owned by: | Gasler Radu | |
---|---|---|---|
Priority: | normal | Component: | WikiReplacePlugin |
Severity: | normal | Keywords: | glob 0.12.3 syntax |
Cc: | Trac Release: | 0.12 |
Description (last modified by )
Hi, we installed WikiReplacePlugin 1.1.1
on our 0.12.3
TRAC system and got the following error when trying a replace from the Administration web page:
Trac detected an internal error:
ProgrammingError: syntax error at or near "glob" LINE 1: ... w2.max_version AND w1.name = w2.name AND w1.name glob E'Wik... ^
Is there a way of getting the plugin to work with 0.12.3
?
Attachments (1)
Change History (12)
comment:1 Changed 12 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 12 years ago by
comment:3 Changed 12 years ago by
Find: 'Locate' Replace with: 'Find' Page: 'WikiStart'
I entered these without the quotation marks, of course.
comment:4 Changed 12 years ago by
Tried again using S='Quest' - R='Pest' - P='Shareplex'
same error, attaching Python traceback & system information
comment:5 Changed 12 years ago by
Hi,
I commited a fix attempt for your problem. It might be an sql case sensitivity issue.
Please try again.
comment:6 Changed 12 years ago by
I'm not sure what to do with GLOB
, or if it will even cause a problem, but t:TracDev/DatabaseApi#GuidelinesforSQLStatements described how LIKE
should be handled for cross-db compatibility:
It would look something like this (or perhaps exactly like this if I haven't made a stupid error typing this out) :
sql = 'SELECT w1.version,w1.name,w1.text' + sqlbase + 'AND w1.name GLOB %%s AND w1.text %s %%s' % db.like()
comment:7 Changed 12 years ago by
GLOB
operator is available only on SQLite and case-sensitive. LIKE
operator on SQLite is case-insensitve.
Also, the db.like()
method generates case-insensitive LIKE
clause on all database backends. e.g. http://trac.edgewall.org/browser/trunk/trac/db/postgres_backend.py#L241.
comment:8 Changed 12 years ago by
Thank you all for the suggestions!
I've just committed this fix: [12617]
Can you please check again?
comment:11 Changed 12 years ago by
Hi, as this has now been tested successfully with TRAC 0.12.3 and PostgreSQL 8.3.3.64, wouldn't it be a good idea to tag this with a new version number...? Thanks again for the fix!
What were your find/replace/wiki pages terms?