HHH-7716 Fixed a bug in CUBRIDLimitHandler. Now correctly processes
LIMIT clause in SQL.
This commit is contained in:
parent
e7af2f4b76
commit
220365600c
|
@ -20,15 +20,18 @@ public class CUBRIDLimitHandler extends AbstractLimitHandler {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean useMaxForLimit() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getProcessedSql() {
|
public String getProcessedSql() {
|
||||||
boolean useLimitOffset = supportsLimit() && supportsLimitOffset()
|
if (LimitHelper.useLimit(this, selection)) {
|
||||||
&& LimitHelper.hasFirstRow( selection ) && LimitHelper.hasMaxRows( selection );
|
// useLimitOffset: whether "offset" is set or not;
|
||||||
return dialect.getLimitString(
|
// if set, use "LIMIT offset, row_count" syntax;
|
||||||
sql, useLimitOffset ? LimitHelper.getFirstRow( selection ) : 0, getMaxOrLimit()
|
// if not, use "LIMIT row_count"
|
||||||
);
|
boolean useLimitOffset = LimitHelper.hasFirstRow(selection);
|
||||||
|
|
||||||
|
return new StringBuilder(sql.length() + 20).append(sql)
|
||||||
|
.append(useLimitOffset ? " limit ?, ?" : " limit ?").toString();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return sql; // or return unaltered SQL
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue