This is an automated email from the ASF dual-hosted git repository.
doebele pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/empire-db.git
The following commit(s) were added to refs/heads/master by this push:
new 802a5f6 EMPIREDB-382 small fix
802a5f6 is described below
commit 802a5f63610025e76ebd1dcbc821d361fb4d5dc9
Author: Rainer Döbele <[email protected]>
AuthorDate: Sun Mar 6 12:59:28 2022 +0100
EMPIREDB-382 small fix
---
.../java/org/apache/empire/db/expr/column/DBAbstractFuncExpr.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git
a/empire-db/src/main/java/org/apache/empire/db/expr/column/DBAbstractFuncExpr.java
b/empire-db/src/main/java/org/apache/empire/db/expr/column/DBAbstractFuncExpr.java
index 706837c..3976c17 100644
---
a/empire-db/src/main/java/org/apache/empire/db/expr/column/DBAbstractFuncExpr.java
+++
b/empire-db/src/main/java/org/apache/empire/db/expr/column/DBAbstractFuncExpr.java
@@ -26,6 +26,7 @@ import org.apache.empire.data.DataType;
import org.apache.empire.db.DBColumn;
import org.apache.empire.db.DBColumnExpr;
import org.apache.empire.db.DBDatabase;
+import org.apache.empire.db.DBExpr;
import org.apache.empire.db.exceptions.DatabaseNotOpenException;
import org.apache.empire.dbms.DBMSHandler;
import org.apache.empire.exceptions.InvalidArgumentException;
@@ -227,8 +228,10 @@ public abstract class DBAbstractFuncExpr extends
DBColumnExpr
String typeName = ((end>=idx) ?
template.substring(idx+1, end) : null);
if (StringUtils.isNotEmpty(typeName) &&
!typeName.equals("*"))
paramDataType = DataType.valueOf(typeName);
- else
+ else if (typeName.equals("*") || params[i]==null ||
(params[i] instanceof DBExpr))
paramDataType = DataType.UNKNOWN; /* use as
literal */
+ else
+ paramDataType =
DataType.fromJavaType(params[i].getClass());
}
// complete placeholder
ph += template.substring(idx, end+1);