Difference between revisions of "Issue:Ignorecase=yes broken in MediaWiki 1.17.0"

From FollowTheScore
Jump to: navigation, search
(Created page with "{{Issue |Type = Bug |Extension = DPL |Version = 1.8.9 |Description = ignorecase=true causes DPL to report "WARNING: No results" |Status = open }} == Probl...")
 
 
(One intermediate revision by the same user not shown)
Line 12: Line 12:
  
 
== Reply ==
 
== Reply ==
 +
 +
Thanks for finding this bug!
 +
 +
But I really have no idea what is wrong ...
 +
 +
To me the SQL query looks o.k. - but it does not deliver any results ...
 +
This is the version without ignorecase:
 +
 +
SELECT DISTINCT `page`.page_namespace as page_namespace,`page`.page_title as page_title,`page`.page_id as page_id,
 +
pl.pl_title as sel_title, pl.pl_namespace as sel_ns, `page`.page_title as sortkey FROM `pagelinks` as pl, `page`
 +
WHERE 1=1 AND `page`.page_is_redirect=0 AND `page`.page_id=pl.pl_from AND ( (pl.pl_namespace=0 AND
 +
pl.pl_title LIKE 'Abc')) ORDER BY page_title ASC LIMIT 0, 500
 +
 +
And here the version with ignorecase=yes:
 +
Do you have an idea what could be wrong with the "LOWER" statements?
 +
 +
SELECT DISTINCT `page`.page_namespace as page_namespace,`page`.page_title as page_title,`page`.page_id as page_id,
 +
pl.pl_title as sel_title, pl.pl_namespace as sel_ns, `page`.page_title as sortkey FROM `pagelinks` as pl, `page`
 +
WHERE 1=1 AND `page`.page_is_redirect=0 AND `page`.page_id=pl.pl_from AND ( (pl.pl_namespace=0 AND
 +
LOWER(pl.pl_title) LIKE LOWER('Abc'))) ORDER BY page_title ASC LIMIT 0, 500
 +
 +
[[User:Gero|Gero]] 17:09, 14 August 2011 (CEST)
 +
 +
=== Problem identified ===
 +
 +
After some search I found out that Mediawiki changed the column format for several fields form varchar to varbinary.
 +
 +
So, instead of LOWER(x) one must now write LOWER(CAST(x as char)).
 +
 +
I added this fix to DPL (not yet published) and sent you a mail (@oreilly.com) with that version for verification.
 +
 +
I hope that this change is DOWNWARD compatible, i.e. the modified DPL should also work with older versions of MediaWiki.
 +
 +
 +
[[User:Gero|Gero]] 18:30, 14 August 2011 (CEST)

Latest revision as of 17:30, 14 August 2011

Description: ignorecase=true causes DPL to report "WARNING: No results"
Extension / Version: DPL   /   1.8.9
Type / Status: Bug   /   open

Problem

Try your Test ignorecase example on MediaWiki 1.17.0. The first test (without ignorecase) produces correct results. The second test (with ignorecase=yes) produces Extension:DynamicPageList (DPL), version 1.8.9 : WARNING: No results.

Reply

Thanks for finding this bug!

But I really have no idea what is wrong ...

To me the SQL query looks o.k. - but it does not deliver any results ... This is the version without ignorecase:

SELECT DISTINCT `page`.page_namespace as page_namespace,`page`.page_title as page_title,`page`.page_id as page_id,
pl.pl_title as sel_title, pl.pl_namespace as sel_ns, `page`.page_title as sortkey FROM `pagelinks` as pl, `page`
WHERE 1=1 AND `page`.page_is_redirect=0 AND `page`.page_id=pl.pl_from AND ( (pl.pl_namespace=0 AND
pl.pl_title LIKE 'Abc')) ORDER BY page_title ASC LIMIT 0, 500

And here the version with ignorecase=yes: Do you have an idea what could be wrong with the "LOWER" statements?

SELECT DISTINCT `page`.page_namespace as page_namespace,`page`.page_title as page_title,`page`.page_id as page_id,
pl.pl_title as sel_title, pl.pl_namespace as sel_ns, `page`.page_title as sortkey FROM `pagelinks` as pl, `page`
WHERE 1=1 AND `page`.page_is_redirect=0 AND `page`.page_id=pl.pl_from AND ( (pl.pl_namespace=0 AND
LOWER(pl.pl_title) LIKE LOWER('Abc'))) ORDER BY page_title ASC LIMIT 0, 500

Gero 17:09, 14 August 2011 (CEST)

Problem identified

After some search I found out that Mediawiki changed the column format for several fields form varchar to varbinary.

So, instead of LOWER(x) one must now write LOWER(CAST(x as char)).

I added this fix to DPL (not yet published) and sent you a mail (@oreilly.com) with that version for verification.

I hope that this change is DOWNWARD compatible, i.e. the modified DPL should also work with older versions of MediaWiki.


Gero 18:30, 14 August 2011 (CEST)