Hi andy,
Before starting your migration maake sur to stop mysql and copy all the
datadir to another backup dir (just like directories).
About single transaction, this will be difficult since you manage myisam
tables.

So what we can think to is :
1. execute one query
2. check log
3. if OK, continue with query n+1
4. else rexecute query n         <--- But here data can become
incohrent.

A workaround seems to me to alter your table to innodb engine just for
the upgrade. Then start transactions with n grouped queries. Then decide
a commit or rollback.

At the end of teh upgrade, you can come back to myisam.
This is simplier. But you can also decide to take intermadiate backups
when upgrading.

Best Regards
--------------------
Mathias FATENE
 
Hope that helps
*This not an official mysql support answer
 


-----Original Message-----
From: Andy Pieters [mailto:[EMAIL PROTECTED] 
Sent: mardi 14 juin 2005 00:15
To: mysql@lists.mysql.com
Subject: Prevalidating queries?


Hi all

As part of an automated patch system, I am facing the following problem:

* A script will update the program from version x to version y
* The script contains file actions, and database (mysql) actions
* The actions are executed in order
* For each action, a backup copy is created (if necessary)
  example if action is deletedir then the dir is moved to a temp
directory
* if an action (with status fail=abort) occurs, then the system must be 
restored to previous state. 

As far as file/directory operation is concerned, this is easy to
implement, 
and that's why we are using backup copies.

For the mysql part I don't really see how to do this.  I am not using
inodb 
but MyIsam tables.

It is not that I need to know the result of the query in advance, only
if 
mysql will accept it or will errormessage on the query.

What I don't want is that query1, and 2 are already executed, and 3
fails 
because how could I do a rollback then?


Anybody got any ideas?


With kind regards



Andy


-- 
Registered Linux User Number 379093
-- --BEGIN GEEK CODE BLOCK-----
Version: 3.1
GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C++++$(+++) UL++++>++++$ P-(+)>++
L+++>++++$ E---(-)@ W+++>+++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e>++++$@ h++(*) r-->++ y--()>++++
-- ---END GEEK CODE BLOCK------
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/
--

--


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to