[ic] DatabaseAuto and auto_increment

Stefan Hornburg racke at linuxia.de
Wed Nov 2 16:56:47 EST 2005


On Wed, 2 Nov 2005 15:08:44 -0500
Mike Heins <mike at perusion.com> wrote:

> Quoting Jon Jensen (jon at endpoint.com):
> > On Wed, 2 Nov 2005, JT Justman wrote:
> > 
> > >I've recently set up DatabaseAuto on first my testing and now production
> > >servers. I neglected to notice, however, that for tables with
> > >auto_incriment set, IC still tries to set an index in the UI. If I set
> > >like this:
> > >
> > >Database table_name AUTO_SEQUENCE 1
> > >
> > >in catalog/db config, as I had before, it seems to work. But, the point
> > >of using DatabaseAuto was to avoid having to specify such things for
> > >each table, and I've got tons of custom tables.
> > 
> > Does that really work with MySQL? Does MySQL 4.1 have sequences?
> 
> It doesn't have sequences, but we emulate the behavior with
> AUTO_INCREMENT.
> 
> > They are 
> > different than AUTO_INCREMENT columns. I believe you should be supplying 
> > the sequence name, not a boolean '1'. But I haven't tried it.
> 
> 1 is the same as a sequence name for MySQL. It wouldn't work for
> Postgres (certainly not more than once).
> 
> > 
> > >I was looking at the DatabaseDefault code and it's a tad over my head. I
> > >can only imagine that there is some kind of magic going on that pulls
> > >the hash of the table info from DBI. Is there an existing mechanism that
> > >can help me out here?
> > 
> > I'm not aware of any. It would be nice to have. Still, using DatabaseAuto 
> > saves you a fair amount of manual configuration even if you still need to 
> > specify sequences separately ...
> 
> If the OP could explain precisely how we might intuit the AUTO_SEQUENCE
> behavior from the SQL configuration perhaps we would. But I think we are
> waiting on the Mind::Read module for Perl....

Hm, you can definitely determine if the key is AUTO_INCREMENT for MySQL.
Then it would makes sense to have AUTO_SEQUENCE set automatically.

Bye
	Racke

-- 
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team



More information about the interchange-users mailing list