mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 734351 - Fix a query syntax error that disallows populating the hosts table.
r=dietrich
This commit is contained in:
parent
951fa09a3f
commit
6e733cc348
@ -1699,8 +1699,8 @@ Database::MigrateV17Up()
|
||||
"INSERT OR IGNORE INTO moz_hosts (host, frecency) "
|
||||
"SELECT fixup_url(get_unreversed_host(h.rev_host)) AS host, "
|
||||
"(SELECT MAX(frecency) FROM moz_places "
|
||||
"WHERE rev_host = get_unreversed_host(host || '.') || '.' "
|
||||
"OR rev_host = get_unreversed_host(host || '.') || '.www.') "
|
||||
"WHERE rev_host = h.rev_host "
|
||||
"OR rev_host = h.rev_host || 'www.' "
|
||||
") AS frecency "
|
||||
"FROM moz_places h "
|
||||
"WHERE LENGTH(h.rev_host) > 1 "
|
||||
|
@ -292,24 +292,24 @@ function test_moz_hosts()
|
||||
// check the number of entries in moz_hosts equals the number of
|
||||
// unique rev_host in moz_places
|
||||
stmt = DBConn().createAsyncStatement(
|
||||
"SELECT ("
|
||||
+ "SELECT COUNT(host) "
|
||||
+ "FROM moz_hosts), ("
|
||||
+ "SELECT COUNT(DISTINCT rev_host) "
|
||||
+ "FROM moz_places "
|
||||
+ "WHERE LENGTH(rev_host) > 1)"
|
||||
);
|
||||
"SELECT (SELECT COUNT(host) FROM moz_hosts), " +
|
||||
"(SELECT COUNT(DISTINCT rev_host) " +
|
||||
"FROM moz_places " +
|
||||
"WHERE LENGTH(rev_host) > 1)");
|
||||
try {
|
||||
stmt.executeAsync({
|
||||
handleResult: function (aResultSet) {
|
||||
handleResult: function (aResult) {
|
||||
this._hasResults = true;
|
||||
let row = aResult.getNextRow();
|
||||
let mozPlacesCount = row.getResultByIndex(0);
|
||||
let mozHostsCount = row.getResultByIndex(1);
|
||||
let mozHostsCount = row.getResultByIndex(0);
|
||||
let mozPlacesCount = row.getResultByIndex(1);
|
||||
do_check_true(mozPlacesCount > 0);
|
||||
do_check_eq(mozPlacesCount, mozHostsCount);
|
||||
},
|
||||
handleError: function () {},
|
||||
handleCompletion: function (aReason) {
|
||||
do_check_eq(aReason, Ci.mozIStorageStatementCallback.REASON_FINISHED);
|
||||
do_check_true(this._hasResults);
|
||||
run_next_test();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user