michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: function setup() { michael@0: // Create the table michael@0: getOpenedDatabase().createTable("test_bug444233", michael@0: "id INTEGER PRIMARY KEY, value TEXT"); michael@0: michael@0: // Insert dummy data, using wrapper methods michael@0: var stmt = createStatement("INSERT INTO test_bug444233 (value) VALUES (:value)"); michael@0: stmt.params.value = "value1" michael@0: stmt.execute(); michael@0: stmt.finalize(); michael@0: michael@0: stmt = createStatement("INSERT INTO test_bug444233 (value) VALUES (:value)"); michael@0: stmt.params.value = "value2" michael@0: stmt.execute(); michael@0: stmt.finalize(); michael@0: } michael@0: michael@0: function test_bug444233() { michael@0: print("*** test_bug444233: started"); michael@0: michael@0: // Check that there are 2 results michael@0: var stmt = createStatement("SELECT COUNT(*) AS number FROM test_bug444233"); michael@0: do_check_true(stmt.executeStep()); michael@0: do_check_eq(2, stmt.row.number); michael@0: stmt.reset(); michael@0: stmt.finalize(); michael@0: michael@0: print("*** test_bug444233: doing delete"); michael@0: michael@0: // Now try to delete using IN michael@0: // Cheating since we know ids are 1,2 michael@0: try { michael@0: var ids = [1, 2]; michael@0: stmt = createStatement("DELETE FROM test_bug444233 WHERE id IN (:ids)"); michael@0: stmt.params.ids = ids; michael@0: } catch (e) { michael@0: print("*** test_bug444233: successfully caught exception"); michael@0: } michael@0: stmt.finalize(); michael@0: } michael@0: michael@0: function run_test() { michael@0: setup(); michael@0: test_bug444233(); michael@0: cleanup(); michael@0: } michael@0: