From f93f7384a6d9e288ff32d4dfb81fba6316104cdb Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 22 May 2009 02:07:22 +0000 Subject: [PATCH] Fix incorrectly entered MIME types and the DB bug in 2.0b4 that caused it --- chrome/content/zotero/xpcom/db.js | 1 + chrome/content/zotero/xpcom/schema.js | 4 ++++ userdata.sql | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js index b7801d4d8..2eeab1ddd 100644 --- a/chrome/content/zotero/xpcom/db.js +++ b/chrome/content/zotero/xpcom/db.js @@ -265,6 +265,7 @@ Zotero.DBConnection.prototype.getStatement = function (sql, params, checkParams) params.splice(i, 1); i--; + lastNullParamIndex--; continue; } if (!params.length) { diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index d6eb06ab2..b54548295 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -2386,6 +2386,10 @@ Zotero.Schema = new function(){ Zotero.DB.query("DROP TABLE tmpEmptyCreators"); Zotero.DB.query("DELETE FROM creatorData WHERE firstName='' AND lastName=''"); } + + if (i==56) { + Zotero.DB.query("UPDATE itemAttachments SET mimeType=charsetID, charsetID=NULL WHERE charsetID REGEXP '[a-zA-Z0-9\-]+/[a-zA-Z0-9\-]'"); + } } _updateDBVersion('userdata', toVersion); diff --git a/userdata.sql b/userdata.sql index 28936932d..82cc00e7e 100644 --- a/userdata.sql +++ b/userdata.sql @@ -1,4 +1,4 @@ --- 55 +-- 56 -- This file creates tables containing user-specific data for new users -- -- any changes made here must be mirrored in transition steps in schema.js::_migrateSchema()