2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-08-28 20:39:07 +04:00
|
|
|
|
|
|
|
// Testcase for bug 393952: crash when I try to VACUUM and one of the tables
|
2015-12-04 19:00:03 +03:00
|
|
|
// has a UNIQUE text column. StorageUnicodeFunctions::likeFunction()
|
2007-08-28 20:39:07 +04:00
|
|
|
// needs to handle null aArgv[0] and aArgv[1]
|
|
|
|
|
2016-12-31 05:47:25 +03:00
|
|
|
function setup() {
|
2007-08-28 20:39:07 +04:00
|
|
|
getOpenedDatabase().createTable("t1", "x TEXT UNIQUE");
|
|
|
|
|
|
|
|
var stmt = createStatement("INSERT INTO t1 (x) VALUES ('a')");
|
|
|
|
stmt.execute();
|
|
|
|
stmt.reset();
|
2007-09-19 07:26:51 +04:00
|
|
|
stmt.finalize();
|
2007-08-28 20:39:07 +04:00
|
|
|
}
|
|
|
|
|
2016-12-31 05:47:25 +03:00
|
|
|
function test_vacuum() {
|
2007-08-28 20:39:07 +04:00
|
|
|
var stmt = createStatement("VACUUM;");
|
|
|
|
stmt.executeStep();
|
|
|
|
stmt.reset();
|
2007-09-19 07:26:51 +04:00
|
|
|
stmt.finalize();
|
2007-08-28 20:39:07 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
var tests = [test_vacuum];
|
|
|
|
|
2016-12-31 05:47:25 +03:00
|
|
|
function run_test() {
|
2007-08-28 20:39:07 +04:00
|
|
|
setup();
|
|
|
|
|
|
|
|
for (var i = 0; i < tests.length; i++) {
|
|
|
|
tests[i]();
|
2019-07-05 11:59:24 +03:00
|
|
|
}
|
2015-12-04 19:00:03 +03:00
|
|
|
|
2007-08-28 20:39:07 +04:00
|
|
|
cleanup();
|
|
|
|
}
|