test_bug-365166.js (635B)
1 // Testcase for bug 365166 - crash [@ strlen] calling 2 // mozIStorageStatement::getColumnName of a statement created with 3 // "PRAGMA user_version" or "PRAGMA schema_version" 4 function run_test() { 5 test("user"); 6 test("schema"); 7 8 function test(param) { 9 var colName = param + "_version"; 10 var sql = "PRAGMA " + colName; 11 12 var file = getTestDB(); 13 var conn = Services.storage.openDatabase(file); 14 var statement = conn.createStatement(sql); 15 try { 16 // This shouldn't crash: 17 Assert.equal(statement.getColumnName(0), colName); 18 } finally { 19 statement.reset(); 20 statement.finalize(); 21 } 22 } 23 }