1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/storage/test/unit/test_bug-393952.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,38 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +// Testcase for bug 393952: crash when I try to VACUUM and one of the tables 1.9 +// has a UNIQUE text column. StorageUnicodeFunctions::likeFunction() 1.10 +// needs to handle null aArgv[0] and aArgv[1] 1.11 + 1.12 +function setup() 1.13 +{ 1.14 + getOpenedDatabase().createTable("t1", "x TEXT UNIQUE"); 1.15 + 1.16 + var stmt = createStatement("INSERT INTO t1 (x) VALUES ('a')"); 1.17 + stmt.execute(); 1.18 + stmt.reset(); 1.19 + stmt.finalize(); 1.20 +} 1.21 + 1.22 +function test_vacuum() 1.23 +{ 1.24 + var stmt = createStatement("VACUUM;"); 1.25 + stmt.executeStep(); 1.26 + stmt.reset(); 1.27 + stmt.finalize(); 1.28 +} 1.29 + 1.30 +var tests = [test_vacuum]; 1.31 + 1.32 +function run_test() 1.33 +{ 1.34 + setup(); 1.35 + 1.36 + for (var i = 0; i < tests.length; i++) 1.37 + tests[i](); 1.38 + 1.39 + cleanup(); 1.40 +} 1.41 +