#1
  1. Born Looser
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    /root
    Posts
    272
    Rep Power
    173

    but what if i just want to test a query


    the scenario is as following:
    i have all tables in MyISAM and it doesn't support transactions.
    I have to run a transaction so I first test queries if they throw some error
    if they dont then execute else fail gracefully
    any idea how to do it?
    Kumar Chetan Sharma
    -----

    _SelfProcclaimedGuru
    Hire a LAMP guy.
    To err is human. To blame your computer for your mistakes is even more human, it is downright natural.
  2. #2
  3. No Profile Picture
    Problem Solver
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jan 2001
    Location
    Stockholm, Sweden
    Posts
    4,495
    Rep Power
    534
    I suggest that you change your tables to InnoDB that supports transactions instead.

    Because trying to do what you want in MyISAM will require you to 1. put a write lock on _all_ tables that are involved in your "transaction".
    2. then selecting and checking these tables until you are sure that your real queries are going to work.
    3. then run the real queries
    4. and drop the write lock

    And in the end it will still not be transaction safe if there is some problem with a power outage or crashing OS etc.
    /Stefan

IMN logo majestic logo threadwatch logo seochat tools logo