Re: An amusing MySQL weakness--not!

Поиск
Список
Период
Сортировка
От Gavin Flower
Тема Re: An amusing MySQL weakness--not!
Дата
Msg-id 4E06C6FE.8060701@archidevsys.co.nz
обсуждение исходный текст
Ответ на An amusing MySQL weakness--not!  (Michael Nolan <htfoot@gmail.com>)
Список pgsql-general
On 26/06/11 16:44, Michael Nolan wrote:
Earlier today I was working on a MySQL database (not by choice, I assure you),
and I typed a statement like this:

Update tablexyz set field1 = '15' where field2 - 20;

The '-' was supposed to be an equal sign, but MySQL executed it anyway.  (Field2 is an integer.)

I was not amused.

PostgreSQL reports this as an error, of course.
--
Mike Nolan
nolan@tssi.com

I am guessing that '(field2 - 20)' is evaluated, and if non-zero it is treated as true?

В списке pgsql-general по дате отправления:

Предыдущее
От: sfrost@snowman.net
Дата:
Сообщение: Re: An amusing MySQL weakness--not!
Следующее
От: Gavin Flower
Дата:
Сообщение: Re: unique across two tables