MySQL Datatype - VARBINARY vs LONGBLOB confusion

Description

Create VARBINARY table

CREATE TABLE TESTVARBINARY(
VARBINARY_NULL VARBINARY(200) NULL,
VARBINARY_NOTNULL VARBINARY(200) NOT NULL,
VARBINARY_DEFAULT VARBINARY(200) DEFAULT '1',
VARBINARY_PK VARBINARY(200) NOT NULL,
VARBINARY_UNIQUE VARBINARY(200) NOT NULL,
CONSTRAINT PK_VARBINARY PRIMARY KEY (VARBINARY_PK),
CONSTRAINT UN_VARBINARY UNIQUE (VARBINARY_UNIQUE)
);

Generate Change Log and notice the value returned is LONGBLOB. However, you can't have a default value for LONGBLOB.

<changeSet author="robert" id="1383674467554-26">
<createTable tableName="testvarbinary">
<column name="VARBINARY_NULL" type="LONGBLOB"/>
<column name="VARBINARY_NOTNULL" type="LONGBLOB">
<constraints nullable="false"/>
</column>
<column defaultValueComputed="1" name="VARBINARY_DEFAULT" type="LONGBLOB"/>
<column name="VARBINARY_PK" type="LONGBLOB">
<constraints nullable="false"/>
</column>
<column name="VARBINARY_UNIQUE" type="LONGBLOB">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>

Environment

Linux and MySQL

Status

Reporter

Kevin Chappell

Fix versions

Affects versions

Priority

Major
Configure