Re: Re: Re: UPDATE not working ...

2003-01-11 Thread Victoria Reznichenko
On Friday 10 January 2003 21:43, you wrote:

  mysql UPDATE t SET d=UNIX_TIMESTAMP(DATE_ADD(c, interval (b) day)) / 1;
  ERROR 1105: Unknown error

Thanks for bug report!

This is a patch from Sinisa Milivojevic:

= sql/item.cc 1.24 vs edited =
*** /tmp/item.cc-1.24-3175  Tue Dec  3 13:08:21 2002
--- edited/sql/item.cc  Fri Jan 10 21:38:55 2003
***
*** 505,511 
{
  double nr=val();
  if (null_value)
!   return set_field_to_null(field);
  field-set_notnull();
  field-store(nr);
}
--- 505,511 
{
  double nr=val();
  if (null_value)
!   return set_field_to_null_with_conversions(field, no_conversions);
  field-set_notnull();
  field-store(nr);
}



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




re: RE: RE: UPDATE

2002-12-12 Thread Egor Egorov
On Thursday 12 December 2002 03:32, Cesar Aracena wrote:
 Exaclty, 0 rows affected, but no password changed... why's that? Thanks,

If 0 rows were affected it's normal that password was not changed :)
If you do a SELECT with the same condition, does MySQL find the any matched 
rows?



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: RE: UPDATE

2002-12-11 Thread Cesar Aracena
Exaclty, 0 rows affected, but no password changed... why's that? Thanks,

Cesar L. Aracena
[EMAIL PROTECTED]
[EMAIL PROTECTED]
(0299) 156-356688
Neuquén (8300) Capital
Argentina


-Mensaje original-
De: Egor Egorov [mailto:[EMAIL PROTECTED]] 
Enviado el: jueves, 05 de diciembre de 2002 11:04
Para: [EMAIL PROTECTED]
Asunto: re: RE: UPDATE

Cesar,
Thursday, December 05, 2002, 2:50:30 AM, you wrote:

CA The problem shows up when receiving the response of the query which
CA tells me that the query was OK but  rows affected.

How many row were affected? 0? Was the password changed?




-- 
For technical support contracts, goto
https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




re: RE: UPDATE

2002-12-05 Thread Egor Egorov
Cesar,
Thursday, December 05, 2002, 2:50:30 AM, you wrote:

CA The problem shows up when receiving the response of the query which
CA tells me that the query was OK but  rows affected.

How many row were affected? 0? Was the password changed?




-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




re: Re: update tablename

2002-11-14 Thread Egor Egorov
Rodrigo,
Tuesday, November 12, 2002, 10:44:38 PM, you wrote:

 I want to change a tablename in my database. How do i do that? I want to
RSM do
 it from a webpage so i need to use php.

Take a look at ALTER TABLE statement:
 http://www.mysql.com/doc/en/ALTER_TABLE.html

or RENAME TABLE statement:
 http://www.mysql.com/doc/en/RENAME_TABLE.html



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Re: RE: update syntax

2002-06-21 Thread Egor Egorov

Hello Terry,
Thursday, June 20, 2002, 5:14:40 PM, you wrote:
DT Egor,

DT I hope I understand you work for MySQL in some fashion, is there any plan to
DT allow sub-selects in future releases ?

Yes, multi-table updates and sub-selects is on development and they
will come in version 4.1

DT RSVP,
DT Terry






-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: RE: UPDATE and ORDER BY troubles

2001-06-05 Thread X Gogo

Well, Jeff you are right! I've just taken the
wrong line from .mysql_history file. It was one
of my thousands of tries to make the ORDER BY work
with UPDATE. What I really try to do is ORDER BY
the 'received' column, which is a timestamp.
The point is if I have plenty of alarm messages
which are not parsed I would like to take and parse
the one that has come first in time. And because
this is done from concurent clients it is crucial
to parse it with just one update query and
not with ordered select and then update.
So here is the real query:

mysql UPDATE alarms SET is_parsed=1 WHERE is_parsed=0
   ORDER BY received LIMIT 1;

ERROR 1064: You have an error in your SQL syntax near 
'ORDER BY received LIMIT 1' at line 1

What I found is that UPDATE  SET  WHERE  ORDER BY 
never works in MySQL no matter what your table looks like.
And according to MySQL manual the UPDATE synthax is:

 UPDATE [LOW_PRIORITY] [IGNORE] tbl_name
 SET col_name1=expr1, [col_name2=expr2, ...]
 [WHERE where_definition]
 [ORDER BY ...]
 [LIMIT #]


Is this a bug in MySQL or the manual is not correct?!?
Has anyone managed to use ORDER BY with an UPDATE statement?
Thank you in advance!

George


Jeff wrote:
Why do you need the ORDER BY clause?  Can you take it out? 
For example:

UPDATE alarms SET is_parsed=1 WHERE is_parsed=0 LIMIT 1;

I just don't think the ORDER BY clause could serve any 
useful purpose there
and appears to actually cause problems.

Good luck,
Jeff

-Original Message-
Hi!

The MySQL manual states that you can use ORDER BY in 
combination with the UPDATE statement.
So I tried to use it, but it didn't work. 
Here is the sql query that's causing the trouble:

mysql UPDATE alarms SET is_parsed=1 WHERE is_parsed=0
   ORDER BY is_parsed LIMIT 1;

ERROR 1064: You have an error in your SQL syntax near
'order by is_parsed limit 1' at line 1

The same error happens when I don't use LIMIT:

mysql UPDATE alarms SET is_parsed=1 WHERE is_parsed=0
   ORDER BY is_parsed;

ERROR 1064: You have an error in your SQL syntax near
'order by is_parsed' at line 1

Here is the table's structure:

CREATE TABLE alarms (  
  serial int(10) unsigned NOT NULL auto_increment,
  sys_num tinyint(2) unsigned NOT NULL default '1',
  rtu_num smallint(4) unsigned NOT NULL default '0',
  status char(2) NOT NULL default 'XX',
  received datetime default NULL,
  device tinyint(2) unsigned NOT NULL default '0',
  is_parsed tinyint(1) unsigned NOT NULL default '0',
  PRIMARY KEY  (serial),
  KEY is_parsed (is_parsed),
  KEY rtu_num (rtu_num)
) TYPE=MyISAM;

Áåçïëàòíà ïîùåíñêà ñëóæáà http://mail.Rambler.bg/

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php