SELECT .... FOR UPDATE
On Feb 4, 2008 4:58 PM, Frederic Belleudy <fredericb@stripped> wrote:
> Hi there, I'm new with innodb and I'm not sure it's good to go with
> innodb for my personnal goals.
> Ok, let's assume I 've a table and want to select the first 10 rows from
> that table but I want to be sure that no other scripts will select the
> same rows I've previously got by the first script.
> How can I do that?
> my table contains one primary key. Let's say id is the column name.
> So my first script is running and select the ids: 1, 2, 3 .... 10
> Then that script will play with the returned ids.
> In the same time, I'm running a second script and do the same select.
> But I don't want him to get the first 10 ids.
> The only thing I can think about is to lock WRITE my table. I taught
> innodb was able to automatically lock the selected rows and not allowed any
> other script to get the same rows until it's commited...
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=1
- michael dykman
- All models are wrong. Some models are useful.