michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/licenses/publicdomain/ */ michael@0: michael@0: // Testcase for bug 365166 - crash [@ strlen] calling michael@0: // mozIStorageStatement::getColumnName of a statement created with michael@0: // "PRAGMA user_version" or "PRAGMA schema_version" michael@0: function run_test() { michael@0: test('user'); michael@0: test('schema'); michael@0: michael@0: function test(param) michael@0: { michael@0: var colName = param + "_version"; michael@0: var sql = "PRAGMA " + colName; michael@0: michael@0: var file = getTestDB(); michael@0: var storageService = Components.classes["@mozilla.org/storage/service;1"]. michael@0: getService(Components.interfaces.mozIStorageService); michael@0: var conn = storageService.openDatabase(file); michael@0: var statement = conn.createStatement(sql); michael@0: try { michael@0: // This shouldn't crash: michael@0: do_check_eq(statement.getColumnName(0), colName); michael@0: } finally { michael@0: statement.reset(); michael@0: statement.finalize(); michael@0: } michael@0: } michael@0: }