Ticket #10864 (closed defect: fixed)

Opened 3 months ago

Last modified 3 months ago

Syntax error, or simply wrong version?

Reported by: hopfrog@gmx.net Assigned to: 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

error.txt (9.9 kB) - added by hopfrog@gmx.net on 02/13/13 07:53:24.
Python trackback & system information

Change History

02/12/13 21:46:56 changed by rjollos

  • description changed.

02/12/13 21:48:02 changed by rjollos

What were your find/replace/wiki pages terms?

02/13/13 06:10:06 changed by hopfrog@gmx.net

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

I entered these without the quotation marks, of course.

02/13/13 07:53:24 changed by hopfrog@gmx.net

  • attachment error.txt added.

Python trackback & system information

02/13/13 07:55:25 changed by hopfrog@gmx.net

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

same error, attaching Python traceback & system information

02/13/13 10:35:58 changed by miezuit

Hi,

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

Please try again.

02/13/13 19:26:23 changed 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()

02/15/13 05:36:44 changed 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.

02/15/13 19:00:22 changed by miezuit

Thank you all for the suggestions!

I've just committed this fix: [12617]

Can you please check again?

02/18/13 11:30:03 changed by miezuit

  • status changed from new to closed.
  • resolution set to fixed.

Fixed with [12617].

02/20/13 15:59:47 changed by hopfrog@gmx.net

Tested successfully - thank you very much!

02/21/13 10:09:49 changed by hopfrog@gmx.net

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/Change #10864 (Syntax error, or simply wrong version?)




Change Properties
Action