mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#753 - @History "as of" query errors when executed a second time - invalid bind parameter
This commit is contained in:
@@ -70,6 +70,8 @@ public class CQueryPlan {
|
||||
|
||||
protected final DataTimeZone dataTimeZone;
|
||||
|
||||
private final int asOfTableCount;
|
||||
|
||||
/**
|
||||
* Key used to identify the query plan in audit logging.
|
||||
*/
|
||||
@@ -86,6 +88,7 @@ public class CQueryPlan {
|
||||
this.stats = new CQueryPlanStats(this, server.isCollectQueryOrigins());
|
||||
this.planKey = request.getQueryPlanKey();
|
||||
this.autoTuned = request.getQuery().isAutoTuned();
|
||||
this.asOfTableCount = request.getQuery().getAsOfTableCount();
|
||||
if (sqlRes != null) {
|
||||
this.sql = sqlRes.getSql();
|
||||
this.rowNumberIncluded = sqlRes.isIncludesRowNumberColumn();
|
||||
@@ -111,6 +114,7 @@ public class CQueryPlan {
|
||||
this.stats = new CQueryPlanStats(this, server.isCollectQueryOrigins());
|
||||
this.planKey = buildPlanKey(sql, rawSql, rowNumberIncluded, logWhereSql);
|
||||
this.autoTuned = false;
|
||||
this.asOfTableCount = 0;
|
||||
this.sql = sql;
|
||||
this.sqlTree = sqlTree;
|
||||
this.rawSql = rawSql;
|
||||
@@ -151,6 +155,10 @@ public class CQueryPlan {
|
||||
return dataBind;
|
||||
}
|
||||
|
||||
public int getAsOfTableCount() {
|
||||
return asOfTableCount;
|
||||
}
|
||||
|
||||
public boolean isAutoTuned() {
|
||||
return autoTuned;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ public class CQueryPredicates {
|
||||
dataBind.append(", ");
|
||||
}
|
||||
|
||||
int asOfTableCount = query.getAsOfTableCount();
|
||||
int asOfTableCount = request.getQueryPlan().getAsOfTableCount();
|
||||
if (asOfTableCount > 0) {
|
||||
// bind the asOf value for each table alias as part of the from/join clauses
|
||||
// there is one effective date predicate per table alias
|
||||
|
||||
Reference in New Issue
Block a user