Conversation started Aug 26, 2012 at 17:40.
Aug 26, 2012 17:40
getting strange results from MySQL … this is so annoying.
SELECT SQL_CALC_FOUND_ROWS  mu_4_posts.ID
    FROM mu_4_posts
    WHERE 1=1
    AND (((mu_4_posts.post_title LIKE '%furc%')
    OR (mu_4_posts.post_content LIKE '%furc%')))
    AND mu_4_posts.post_type IN ('post', 'page', 'attachment')
    AND (mu_4_posts.post_status = 'publish')
    ORDER BY mu_4_posts.post_date DESC
    LIMIT 0, 4
Some results do not contain the search string. I don’t understand it. :/
seems to work normally for me... are you sure there is no partial match somewhere?
yes, I checked it multiple times
running through wp or directly?
wp
the string is not even part of the markup
(1) try directly (2) reset object cache if using it
Aug 26, 2012 17:50
Here is one match for this search string: toscho.de/2010/das-falsche-gebot
it has "Fürchte" check collation stuff
no object cache
ah … good idea
Hm, no
define('DB_COLLATE', 'utf8_general_ci');
That should do it.
still seems like most likely reason...
yes
Switched to utf8_unicode_ci which is better anyway – still no progress
there is some code in $wpdb that sets up conenction, maybe something goes bonkers there... is there a way to pull opened connection properties? don't know
Aug 26, 2012 18:12
Ah, the collation stays utf8_general_ci once they are created.
Could we please all switch to Letter-Avatars like U & R? Maybe we'd get some nice words out of it ;)
@StephenHarris wat?
@Rarst With letter avatars we could play countdown.... you get (I think) 9 letters and 30 seconds to make a word out of it.. longest word wins :)
ALTER TABLE changed the collation … but not the search results.
Aug 26, 2012 18:20
@toscho tried direct query?
yes
try explicit collation in query?
4
A: Mysql unique index does't work on a certain umlaut

NullUserExceptionIt's because of the collation you are using. Anything that ends with _ci is case-insensitive (and also accent/umlaut insensitive). So yes, MySQL will consider "günni" and "gunni" the same thing, unless you change your collation. Docs: http://dev.mysql.com/doc/refman/5.0/en/charset-table.html

0
A: MySQL DB selects records with and without umlauts. e.g: '.. where something = FÖÖ'

GunniSELECT * FROM table WHERE some_field LIKE ('%ö%' COLLATE utf8_bin)

Aha!
SELECT  *
FROM  `mu_4_posts`
WHERE post_content LIKE  '%furc%'
COLLATE utf8_bin
LIMIT 0 , 30
I would never make logical jump from case sensitivity to umlaut %)
But now it isn’t case insensitive anymore, right?
Aug 26, 2012 18:27
yep
dangit
hm, I could change the query before I send it to the db
Aug 26, 2012 18:42
oh, this is really tricky.
 
Conversation ended Aug 26, 2012 at 18:42.