Menu

#49 Wrong SQL Column type is generated for bitfields

open
nobody
None
5
2008-09-15
2008-09-15
LGirndt
No

According to datascript.emit.java.SqlTypeNameEmitter

-- snip --
protected static String getTypeName(BitFieldType t)
{
int length = t.getLength();
if (length < 64)
return "INT";
else
return "BLOB";
}

-- snap --

an sql integer type should be generated for bitfields less than 64 bits. For enum types the respective base type is taken.

As a matter of fact NvcType is defined as an enum with a bitfield of the length 1 as base type:

enum bit:1 NvcType
{
ATTRIBUTE_ORIENTED = 0,
ENTITY_ORIENTED = 1
};

Nevertheless rds 0.24.2 generates a BLOB for NvcTable:

-- snip --
public void createTable(String __tableName) throws SQLException
{
// ...
query.append(", nvcType BLOB NOT NULL ");
// ...
}
-- snap --

The C++ implementation correctly generates an INTEGER here. What is the correct hehaviour? The de facto standard of the generated BLOB or the supposed INTEGER type?

Discussion


Log in to post a comment.

MongoDB Logo MongoDB