[jOOQ/jOOQ#10830] There should be no diff between implicit and explicit ASC ordering in index definitions
This commit is contained in:
parent
c961e71baf
commit
c2784cdd88
@ -37,6 +37,8 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.SortOrder.ASC;
|
||||
import static org.jooq.SortOrder.DEFAULT;
|
||||
import static org.jooq.impl.DSL.noCondition;
|
||||
import static org.jooq.tools.StringUtils.defaultIfNull;
|
||||
|
||||
@ -49,6 +51,9 @@ import org.jooq.Index;
|
||||
import org.jooq.Key;
|
||||
import org.jooq.Named;
|
||||
import org.jooq.SortField;
|
||||
import org.jooq.SortOrder;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Commonly used comparators and related utilities.
|
||||
@ -138,7 +143,9 @@ final class Comparators {
|
||||
if (c != 0)
|
||||
return c;
|
||||
|
||||
c = s1.getOrder().compareTo(s2.getOrder());
|
||||
SortOrder d1 = s1.getOrder(); if (d1 == DEFAULT) d1 = ASC;
|
||||
SortOrder d2 = s2.getOrder(); if (d2 == DEFAULT) d2 = ASC;
|
||||
c = d1.compareTo(d2);
|
||||
if (c != 0)
|
||||
return c;
|
||||
}
|
||||
|
||||
@ -39,7 +39,10 @@ package org.jooq.impl;
|
||||
|
||||
import static java.lang.Boolean.FALSE;
|
||||
import static java.util.Arrays.asList;
|
||||
import static org.jooq.SQLDialect.*;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.MARIADB;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.MYSQL;
|
||||
import static org.jooq.impl.Comparators.CHECK_COMP;
|
||||
import static org.jooq.impl.Comparators.FOREIGN_KEY_COMP;
|
||||
import static org.jooq.impl.Comparators.INDEX_COMP;
|
||||
@ -50,7 +53,6 @@ import static org.jooq.impl.ConstraintType.FOREIGN_KEY;
|
||||
import static org.jooq.impl.ConstraintType.PRIMARY_KEY;
|
||||
import static org.jooq.impl.ConstraintType.UNIQUE;
|
||||
import static org.jooq.impl.DSL.field;
|
||||
import static org.jooq.impl.DSL.noCondition;
|
||||
import static org.jooq.impl.Tools.NO_SUPPORT_TIMESTAMP_PRECISION;
|
||||
import static org.jooq.tools.StringUtils.defaultIfNull;
|
||||
import static org.jooq.tools.StringUtils.defaultString;
|
||||
@ -720,9 +722,7 @@ final class Diff {
|
||||
new Merge<Index>() {
|
||||
@Override
|
||||
public void merge(DiffResult r, Index ix1, Index ix2) {
|
||||
if (ix1.getUnique() != ix2.getUnique()
|
||||
|| !ix1.getFields().equals(ix2.getFields())
|
||||
|| !defaultIfNull(ix1.getWhere(), noCondition()).equals(defaultIfNull(ix2.getWhere(), noCondition()))) {
|
||||
if (INDEX_COMP.compare(ix1, ix2) != 0) {
|
||||
drop.drop(r, ix1);
|
||||
create.create(r, ix2);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user