Commit ac6d32dc authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Arraysize bugfix

parent b3db4da7
Pipeline #110 passed with stage
in 11 seconds
......@@ -47,6 +47,8 @@ public enum ADQL {
CIRCLE,
POLYGON;
private static final ADQL[] FIXED_LENGTH_TYPES = new ADQL[]{CHAR, BOOLEAN, SMALLINT, INTEGER, BIGINT, REAL, DOUBLE};
/**
* Returns a string representing a datatype which can't be interpreted as an
* ADQL datatype (that is in case of not standard data types). Removes
......@@ -64,7 +66,15 @@ public enum ADQL {
* @return true if the datatype has a variable length, false otherwise.
*/
public static boolean isVariable(ADQL adql) {
return adql.equals(VARCHAR) || adql.equals(VARBINARY) || adql.equals(CLOB) || adql.equals(BLOB);
// Since unknow data types are mapped to string, here a negative-logic is used
// (e.g. TIMESTAMP need to be considered as variable, in order to have
// arraysize *, otherwise taplib will throw an error)
for (ADQL value : FIXED_LENGTH_TYPES) {
if (adql.equals(value)) {
return false;
}
}
return true;
}
public static ADQL parse(String adqlStr) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment