Modify

Opened 19 months ago

Closed 19 months ago

Last modified 18 months ago

#10864 closed defect (fixed)

Syntax error, or simply wrong version?

Reported by: hopfrog@… Owned by: miezuit
Priority: normal Component: WikiReplacePlugin
Severity: normal Keywords: glob 0.12.3 syntax
Cc: Trac Release: 0.12

Description (last modified by rjollos)

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)

error.txt (9.9 KB) - added by hopfrog@… 19 months ago.
Python trackback & system information

Download all attachments as: .zip

Change History (12)

comment:1 Changed 19 months ago by rjollos

  • Description modified (diff)

comment:2 Changed 19 months ago by rjollos

What were your find/replace/wiki pages terms?

comment:3 Changed 19 months ago by hopfrog@…

Find: 'Locate'
Replace with: 'Find'
Page: 'WikiStart'

I entered these without the quotation marks, of course.

Changed 19 months ago by hopfrog@…

Python trackback & system information

comment:4 Changed 19 months ago by hopfrog@…

Tried again using S='Quest' - R='Pest' - P='Shareplex'

same error, attaching Python traceback & system information

comment:5 Changed 19 months ago by miezuit

Hi,

I commited a fix attempt for your problem. It might be an sql case sensitivity issue.

Please try again.

comment:6 Changed 19 months ago by rjollos

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 19 months ago by jun66j5

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 19 months ago by miezuit

Thank you all for the suggestions!

I've just committed this fix: [12617]

Can you please check again?

comment:9 Changed 19 months ago by miezuit

  • Resolution set to fixed
  • Status changed from new to closed

Fixed with [12617].

comment:10 Changed 19 months ago by hopfrog@…

Tested successfully - thank you very much!

comment:11 Changed 18 months ago by hopfrog@…

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!

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.