The update command for function fontyourface_upadate_7203() is invalid sql format for SQLite. It should be

/**
* Remove single quotes from CSS selectors
*/
function fontyourface_update_7203() {
  db_query("UPDATE {fontyourface_font} SET css_family = REPLACE(css_family, '''', '');");
} // fontyourface_update_7203

With this modification the update script runs.

Also, per Issue #14 on http://www.sqlite.org/faq.html, the single-quote(') charachter are escaped by putting two single quotes in a row.

Files: 
CommentFileSizeAuthor
#3 fontyourface-fontyourface_update_7203_did_not_work_properly_on_some_databases-1803264-3.patch1.17 KBDrave Robber
PASSED: [[SimpleTest]]: [MySQL] 9 pass(es).
[ View ]

Comments

According to http://dev.mysql.com/doc/refman/5.1/en/string-literals.html,

A “'” inside a string quoted with “'” may be written as “''”.

...so proposed fix is OK for MySQL (checked docs for 5.0 and 5.1, tested live on 5.1.63-0ubuntu0.11.04.1);

I can't right now find authoritative reference for PostgreSQL, but AFAIR '' was considered the normal way there, and \' the odd one.

I'm not sure however how to fix this for SQLite users who have already ran this update - it might take fontyourface_update_7204().

Version:7.x-2.4» 7.x-2.x-dev
Status:Needs review» Needs work

By the way, does it throw errors in SQLite or just fails silently? If the latter, we might make "do it once again, this time properly" fontyourface_update_7204().

Status:Needs work» Needs review
StatusFileSize
new1.17 KB
PASSED: [[SimpleTest]]: [MySQL] 9 pass(es).
[ View ]

Actually, documentation for db_query() explicitly warns against using it for UPDATE queries.

Patch attached.

(Trying to remove single quotes once again where fontyourface_update_7203 worked would not do much harm, I reckon)

Status:Needs review» Fixed

Status:Fixed» Closed (fixed)

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