List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:June 19 2002 6:33pm
Subject:Re: Migration of a database from mSQL 2.x to MySQL 3.23.51
View as plain text  
Use AUTO_INCREMENT.
Why should there be a problem restoring?

Mark Hennessy wrote:

>I'm using DBI/DBD with Perl 5.6.1 to send queries to this database.
>
>I'm a relative newbie to DB design, I have done some basic administration
>for clients.  I ask:
>
>1) In the database I plan on migrating, I have a few simple tables which
>use "select _seq" to increment the index value for each table as insert
>queries are done.  I looked at AUTO_INCREMENT in MySQL and couldn't see
>how one would restore from backup (backups made by mysqldump) the last
>AUTO_INCREMENT value for a table.  I am thinking of using:
>
>select MAX('tablename_index')+1 from tablename
>
>instead of mucking around with AUTO_INCREMENT.  I plan on making an
>insert query with the resulting value in the same session in DBI.  Is it
>likely that I need to worry about locking the table for this process?
>
>I don't want to even think about backfilling, so MAX+1 seems fine for what
>I'm doing.
>
>If I understand correctly, as the field is designated as an index, MAX for
>it is a stored value and thus is selected very quickly.
>
>2) Are there any known problems in 3.23.51 stable that would muck with
>something as simple as described above?
>
>Any suggestions?
>
>--
> Mark P. Hennessy					      mark@stripped
>


Thread
Migration of a database from mSQL 2.x to MySQL 3.23.51Mark Hennessy19 Jun
  • Re: Migration of a database from mSQL 2.x to MySQL 3.23.51Gerald Clark19 Jun
    • Re: Migration of a database from mSQL 2.x to MySQL 3.23.51Mark Hennessy19 Jun
      • Re: Migration of a database from mSQL 2.x to MySQL 3.23.51Mark Hennessy21 Jun
        • Re: Migration of a database from mSQL 2.x to MySQL 3.23.51Joseph Bueno21 Jun
Re: Migration of a database from mSQL 2.x to MySQL 3.23.51mos19 Jun
  • Re: Migration of a database from mSQL 2.x to MySQL 3.23.51Keith C. Ivey19 Jun