Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
1. Mode: Fix issue of drop schema can not work on standalone mode - [#34470](https://github.com/apache/shardingsphere/pull/34470)
1. Encrypt: Resolve rewrite issue in nested concat function - [#35815](https://github.com/apache/shardingsphere/pull/35815)
1. Sharding: Fix mod sharding algorithm judgement -[#36386](https://github.com/apache/shardingsphere/pull/36386)
1. Encrypt: Resolve the conflict between encrypted derived columns and primary key columns -[#36899](https://github.com/apache/shardingsphere/pull/36899)

### Change Logs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ public abstract class SQLToken implements Comparable<SQLToken> {

@Override
public final int compareTo(final SQLToken sqlToken) {
return startIndex - sqlToken.startIndex;
int value = startIndex - sqlToken.startIndex;
if (value == 0) {
return getSubSort() - sqlToken.getSubSort();
}
return value;
}

/**
Expand All @@ -40,4 +44,13 @@ public final int compareTo(final SQLToken sqlToken) {
* @return stop index
*/
public abstract int getStopIndex();

/**
* When the startIndex is the same, sort according to subSort.
*
* @return sub sort.
*/
protected int getSubSort() {
return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* See the License for the specif
* limitations under the License.
*/

Expand Down Expand Up @@ -41,4 +41,12 @@ public String toString() {
public int getStopIndex() {
return getStartIndex();
}

/**
* Make the GeneratedKeyInsertColumnToken appear later.
*/
@Override
protected int getSubSort() {
return 1;
}
}