When using BoxLang with the SQL Server adapter (bx-mssql), calling cfdbinfo() with type=“index” throws the following error:
Error: class java.lang.Short cannot be cast to class java.lang.Integer (java.lang.Short and java.lang.Integer are in module java.base of loader ‘bootstrap’)
Repro Case:
it("creates an index", () => {
tableName = "dbm_addindex_tests";
indexName = "idx_to_add";
t = migration.createTable(name = tableName, force = true);
t.integer(columnNames = "integercolumn");
t.create();
migration.addIndex(table = tableName, columnName = "integercolumn", indexName = indexName);
arguments.datasource = "fpma_test";
arguments.table = "dbm_addindex_tests";
arguments.type = "index";
try {
cfdbinfo(attributeCollection = arguments);
} catch (any e) {
writeDump(var = e, label = "Custom Exception");
abort;
}
});
Note
When Works fine:
BoxLang + MySQL
Lucee / Adobe CF with all databases (including SQL Server)
Fails with:
BoxLang + SQL Server (bx-mssql)
Likely due to bx-mssql returning a Short where BoxLang expects an Integer in the cfdbinfo implementation.
BoxLang + Oracle
Request:
Could bx-mssql normalize numeric metadata fields to Integer for compatibility with cfdbinfo (and other functions expecting Integer)?