提交 29b72772 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Do not preserve default sort settings automatically for compatibility with older versions

上级 e198f0dc
......@@ -855,8 +855,8 @@ public class Database implements DataHandler {
lockMeta(systemSession);
addDatabaseObject(systemSession, setting);
}
setSortSetting(SetTypes.BINARY_COLLATION, SysProperties.SORT_BINARY_UNSIGNED);
setSortSetting(SetTypes.UUID_COLLATION, SysProperties.SORT_UUID_UNSIGNED);
setSortSetting(SetTypes.BINARY_COLLATION, SysProperties.SORT_BINARY_UNSIGNED, true);
setSortSetting(SetTypes.UUID_COLLATION, SysProperties.SORT_UUID_UNSIGNED, false);
// mark all ids used in the page store
if (pageStore != null) {
BitSet f = pageStore.getObjectIds();
......@@ -877,7 +877,22 @@ public class Database implements DataHandler {
}
}
private void setSortSetting(int type, boolean defValue) {
/**
* Preserves a current default value of a sorting setting if it is not the
* same as default for older versions of H2 and if it was not modified by
* user.
*
* @param type
* setting type
* @param defValue
* current default value (may be modified via system properties)
* @param oldDefault
* default value for old versions
*/
private void setSortSetting(int type, boolean defValue, boolean oldDefault) {
if (defValue == oldDefault) {
return;
}
String name = SetTypes.getTypeName(type);
if (settings.get(name) == null) {
Setting setting = new Setting(this, allocateObjectId(), name);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论