SET NAMES=utf8 has been lost during the DB:TNG development cycle. This is required because MySQL does so many funny things without it (like defaulting to latin-1 by default).

Comments

catch’s picture

Priority: Normal » Critical
catch’s picture

Status: Needs review » Reviewed & tested by the community

Trivial patch, I can't reproduce the specific bug that Damz got in the other issue, but it applies fine, breaks nothing, and my non-utf-8 aware shell noticed a difference, so marking rtbc.

damien tournoud’s picture

Priority: Critical » Normal
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.38 KB
catch’s picture

Priority: Normal » Critical
StatusFileSize
new2.03 KB

This really is critical ;)

Tested this regression test with and without the we-love-utf8-names patch and it detects the bug successfully.

This patch just rolls them into one, please don't credit on commit.

Crell’s picture

db_fetch_object() is deprecated, so the regression test is wrong. :-( It should instead be:

$from_database = db_query("SELECT name FROM {test} WHERE name = :name", array(':name' => $name))->fetchField();
$this->assertIdentical($name, $from_database, t("The database handles UTF-8 characters cleanly."));

Also, let's put a comment on the query to say why we're doing it.

Crell’s picture

Status: Needs review » Needs work

CNW, but I agree on critical.

maartenvg’s picture

Status: Needs work » Needs review
StatusFileSize
new2.03 KB

Like this?

Crell’s picture

Yep. I'd prefer a comment on the line in the driver, but I leave that to the committers to decide. (Haven't tested yet, just visual review.)

Crell’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.28 KB

Attached patch cleans up the Insert query in the unit test to use the new builder and adds comments to both of the MySQL config lines (this and the strict mode line). Test passes. Setting RTBC to get it into webchick's queue even though I am posting the patch, since this is a blocker. :-)

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks! And 'yay' for the tests ...

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

pierrepaul’s picture

Shouldn't we use mysql(i)_set_charset('utf8') ?