Re: using the same field to be set in the update query and in the where clause

From: Peter H. Coffin <hellsop_at_ninehells.com>
Date: Thu, 9 Mar 2017 10:01:25 -0600
Message-ID: <slrnoc2v2l.t3q.hellsop_at_nibelheim.ninehells.com>


[Quoted] On Wed, 8 Mar 2017 02:24:00 -0800 (PST), kushal bhattacharya wrote:
> update msg_table set state=? where (msg_id=? and (sock_fd=? and state=?)

[Quoted] I'm pretty sure MySQL won't do the work of updating a row where nothing actually changes. So the same question as I asked in the other thread: What exactly are you trying to make happen with this? What outcome do you want? Do you have a timestamp that changes on update that you want to poke or something? Both of your questions seem to be relying on an assumption about some kind of side-effect behavior, and being [Quoted] prematurely clever is a very direct path to making your own life very difficult.

-- 
I think it's a beautiful day to go to the zoo and feed the ducks.
To the lions.
              -- Brian Kantor
Received on Thu Mar 09 2017 - 17:01:25 CET

Original text of this message