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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Drave Robber’s picture

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().

Drave Robber’s picture

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().

Drave Robber’s picture

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)

sreynen’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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