db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger I Martin PhD <hypernex...@hypernexinc.com>
Subject A unsigned BIGINT is coming out of mysql db as type OTHER
Date Mon, 14 Aug 2006 19:54:11 GMT
Using MySQL 4.0.11-gamma; mysql-connector-java-3.0.14-production-bin.jar

mysql> describe diaphragm_positions;
+------------------------+---------------------+------+-----+---------+----------------+
| Field                  | Type                | Null | Key | Default | 
Extra       |
+------------------------+---------------------+------+-----+---------+----------------+
| DIAPHRAGM_POSITIONS_PK | bigint(20) unsigned |      | PRI | NULL    | 
auto_increment |
...

    <table name="diaphragm_positions">
      <column name="DIAPHRAGM_POSITIONS_PK" primaryKey="true" 
required="true" type="OTHER" size="20" autoIncrement="true" 
description="auto_increment"/>
      <column name="TOOL_PK" primaryKey="false" required="false" 
type="INTEGER" size="11" autoIncrement="false"/>
      <column name="NAME" primaryKey="false" required="false" 
type="VARCHAR" size="255" autoIncrement="false"/>
      <column name="POSITION" primaryKey="false" required="false" 
type="INTEGER" size="11" autoIncrement="false"/>
    </table>

When using the mysql jdbc driver directly:
DIAPHRAGM_POSITIONS_PK bigint(20) unsigned  PRI null auto_increment
or full output from
....
        try
        {
            ResultSet 
rs=dt.elementAt(databaseIndex).getDatabaseMetaData().getColumns(null, 
null, tableName, "DIAPHRAGM_POSITIONS_PK");
            int columnCount=rs.getMetaData().getColumnCount();
            while(rs.next())
            {
                String str="";
                for(int i=1;i<=columnCount;i++)
                {
                    str+=(" "+rs.getObject(i));
                }
            System.out.println(rs.getRow()+" getMySQLTableDescription 
"+rs.getRow()+str);
            }
        } catch (SQLException ex)
        {
            ex.printStackTrace();
        }
....
yields:
1 WITCD null diaphragm_positions DIAPHRAGM_POSITIONS_PK 1111 bigint 
unsigned 20 65535 0 10 0 auto_increment null 0 0 20 1 NO

But this doesn't happen for a BIGINT
mysql> describe cassette;
+-----------------+------------+------+-----+---------+----------------+
| Field           | Type       | Null | Key | Default | Extra          |
+-----------------+------------+------+-----+---------+----------------+
| CASSETTE_PK     | bigint(20) |      | PRI | NULL    | auto_increment |
....
    <table name="cassette">
      <column name="CASSETTE_PK" primaryKey="true" required="true" 
type="BIGINT" size="20" autoIncrement="true" description="auto_increment"/>
      <column name="PRESENT" primaryKey="false" required="false" 
type="TINYINT" size="4" autoIncrement="false"/>
      <column name="NUMBER_OF_SLOTS" primaryKey="false" required="false" 
type="INTEGER" size="11" autoIncrement="false"/>
      <column name="DIAMETER" primaryKey="false" required="false" 
type="DOUBLE" size="22" autoIncrement="false"/>
    </table>
I'm currently going thru the ddlutils source and everything looks 
clean(and understandable but I got more learning to go) but I haven't 
discovered where the type gets set to OTHER.  Think it has to be the 
mysql driver but I fairly certain I'm using the same driver in both cases.

Incidently in building a Derby database the OTHER acts like a BLOB.

Mime
View raw message