List:General Discussion« Previous MessageNext Message »
From:Mark Hennessy Date:June 21 2002 3:35pm
Subject:Re: Migration of a database from mSQL 2.x to MySQL 3.23.51
View as plain text  
I have decided to use MAX(tablename_index)+1 in advance of inserting the
record, as I want to use as little dbms-specific magic as possible and
this matches as close as I can figure the behavior of _seq in mSQL.

I would be doing the following in the same thread in this order:
$id=SELECT MAX(tablename_index)+1;
INSERT into tablename VALUES($id,...);

Would it be prudent to wrap a rw lock around this?

--
 Mark P. Hennessy					      mark@stripped

On Wed, 19 Jun 2002, Mark Hennessy wrote:

> Date: Wed, 19 Jun 2002 14:44:49 -0400 (EDT)
> From: Mark Hennessy <mark@stripped>
> To: Gerald Clark <gerald_clark@stripped>
> Cc: mysql@stripped
> Subject: Re: Migration of a database from mSQL 2.x to MySQL 3.23.51
>
> I don't see how AUTO_INCREMENT preserves its value in the output of a
> mysqldump.
>
> --
>  Mark P. Hennessy					      mark@stripped
>
> On Wed, 19 Jun 2002, Gerald Clark wrote:
>
> > Date: Wed, 19 Jun 2002 13:33:00 -0500
> > From: Gerald Clark <gerald_clark@stripped>
> > To: Mark Hennessy <mark@stripped>
> > Cc: mysql@stripped
> > Subject: Re: Migration of a database from mSQL 2.x to MySQL 3.23.51
> >
> > 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
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > Before posting, please check:
> >    http://www.mysql.com/manual.php   (the manual)
> >    http://lists.mysql.com/           (the list archive)
> >
> > To request this thread, e-mail <mysql-thread112509@stripped>
> > To unsubscribe, e-mail
> <mysql-unsubscribe-mark=cloud9.net@stripped>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <mysql-thread112510@stripped>
> To unsubscribe, e-mail <mysql-unsubscribe-mark=cloud9.net@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>

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