Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebSQL : Fix getSchema when having more than one multi-entry index.
In WebSQL implementation multi-entry indexes are stored in a separate table. Each 'multientry' table is composed of two columns, one which name match the multi-entry index name and one column 'id'. What we expect getSchema method to do is : When parsing a 'multientry' table, - If there already is an entry in the stores map, add the multi-entry index to the entry - if not, create an entry in the stores map with only the multi-entry index When parsing the 'store' table : - If there already is an entry in the stores map, merge all indexes of the entry with those of the 'store' table. What getSchema was doing : When parsing a 'multientry' table : - If there already is an entry in the stores map, replace all indexes of the entry by the multientry table indexes (id + multientry index) - if not, it works as expected. When parsing the 'store' table : - if there already is an entry in the stores map, add only the first recorded index to the store indexes So if : - Store is parsed before the multientry table (which happens rarely ) the store indexes are overwritten by the multientry table indexes. - There is more than one multi-entry index, only one of the multi entry indexes is added to the store description.
- Loading branch information