use of org.firebirdsql.util.FirebirdSupportInfo in project jaybird by FirebirdSQL.
the class AbstractStatementTest method testSelect_NoParameters_Describe.
@Test
public void testSelect_NoParameters_Describe() throws Exception {
allocateStatement();
statement.prepare("SELECT RDB$DESCRIPTION AS \"Description\", RDB$RELATION_ID, RDB$SECURITY_CLASS, RDB$CHARACTER_SET_NAME " + "FROM RDB$DATABASE");
assertEquals("Unexpected StatementType", StatementType.SELECT, statement.getType());
final RowDescriptor fields = statement.getFieldDescriptor();
assertNotNull("Fields", fields);
final FirebirdSupportInfo supportInfo = supportInfoFor(db);
final int metadataCharSetId = supportInfo.reportedMetadataCharacterSetId();
List<FieldDescriptor> expectedFields = Arrays.asList(new FieldDescriptor(0, db.getDatatypeCoder(), ISCConstants.SQL_BLOB | 1, 1, supportInfo.reportsBlobCharSetInDescriptor() ? metadataCharSetId : 0, 8, "Description", null, "RDB$DESCRIPTION", "RDB$DATABASE", "SYSDBA"), new FieldDescriptor(1, db.getDatatypeCoder(), ISCConstants.SQL_SHORT | 1, 0, 0, 2, "RDB$RELATION_ID", null, "RDB$RELATION_ID", "RDB$DATABASE", "SYSDBA"), new FieldDescriptor(2, db.getDatatypeCoder(), ISCConstants.SQL_TEXT | 1, metadataCharSetId, 0, supportInfo.maxReportedIdentifierLengthBytes(), "RDB$SECURITY_CLASS", null, "RDB$SECURITY_CLASS", "RDB$DATABASE", "SYSDBA"), new FieldDescriptor(3, db.getDatatypeCoder(), ISCConstants.SQL_TEXT | 1, metadataCharSetId, 0, supportInfo.maxReportedIdentifierLengthBytes(), "RDB$CHARACTER_SET_NAME", null, "RDB$CHARACTER_SET_NAME", "RDB$DATABASE", "SYSDBA"));
assertEquals("Unexpected values for fields", expectedFields, fields.getFieldDescriptors());
assertNotNull("Parameters", statement.getParameterDescriptor());
assertEquals("Unexpected parameter count", 0, statement.getParameterDescriptor().getCount());
}
Aggregations