[ic] Is omitting explicit MySQL column definitions bad?

Kevin Walsh interchange-users@icdevgroup.org
Sat Jun 7 13:00:01 2003


> 
> IC 4.9.7, MySQL 4.1, Mac OS 10.2
> 
> What happens if you do not explicitly include column definitions for 
> MySQL tables accessed in catalog.cfg?  I have a table that was created 
> in MySQL, which I later decided to access with Interchange.
> 
> Twice, over the course of the past month, my table's datatypes have 
> spontaneously changed from whatever they were (date, int, blob) to 
> varchar(256) or varchar(16).  The data remained as it was in the 
> database, however several fields were truncated down to 256 characters 
> when their types changed from TEXT or BLOB to varchar(256).
> 
> The only thing I can attribute this to is my editing the table's 
> contents using the admin UI, and using the UI to change the 
> presentation of the columns (changing the default textbox to textarea 
> or dropdowns, for example).
> 
> Any idea what could trigger this redefinition of my column types?  It's 
> quite disconcerting to see my data being truncated/redefined without 
> any reason (that I can figure out, anyway).  I thought I only had to 
> add explicit column typedefs in catalog.cfg for tables that were 
> created using Interchange.  Was I wrong?
> 
If you modify the .txt file then, when you next restart or reconfig,
the table will be dropped and recreated using the .mysql and .txt files.
The default datatype, unless you change it, is VARCHAR(255).

You can do one or all of the following:

  1. Don't manually modify your .txt files or allow the admin to
     auto-export.

  2. Update your .mysql files to correctly reflect your schema.

  3. Add "NoImport tablename" to your configuration to prevent
     the drop/recreate operation.  Note that this will prevent the
     table from being auto-created if it doesn't already exist.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/