delete from table limit @var; is not working

delete from table limit @var; is not working

am 28.04.2004 20:51:01 von 999555111

The following command:
delete from table limit @var;
says syntax error... why?
-- Server version 4.0.17-max-debug

Thank you all,
Sergey1

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: delete from table limit @var; is not working

am 30.04.2004 10:59:51 von Matt W

Hi,

This isn't a bug. You can't currently use user variables in LIMIT. I
think this is going to be fixed in a future version.

Hope that helps.


Matt


----- Original Message -----
From: "qwerq qerq " <999555111@mail.ru>
To:
Sent: Wednesday, April 28, 2004 1:51 PM
Subject: delete from table limit @var; is not working


> The following command:
> delete from table limit @var;
> says syntax error... why?
> -- Server version 4.0.17-max-debug
>
> Thank you all,
> Sergey1


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: delete from table limit @var; is not working

am 30.04.2004 12:45:39 von Sergei Golubchik

Hi!

On Apr 28, "qwerq qerq" wrote:
> The following command:
> delete from table limit @var;
> says syntax error... why?
> -- Server version 4.0.17-max-debug

Because the manual specifies the syntax as:

DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name
[WHERE where_definition]
[ORDER BY ...]
[LIMIT row_count]

It does not say LIMIT expr, so expressions are not allowed -
you can have only integer literals in LIMIT clause.

Regards,
Sergei

--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Senior Software Developer
/_/ /_/\_, /___/\___\_\___/ Osnabrueck, Germany
<___/ www.mysql.com

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: delete from table limit @var; is not working

am 30.04.2004 13:34:35 von Paul DuBois

At 22:51 +0400 4/28/04, qwerq qerq wrote:
>The following command:
>delete from table limit @var;
>says syntax error... why?

The manual says this is not allowed.

http://dev.mysql.com/doc/mysql/en/Variables.html says:

User variables may be used where expressions are allowed. This does not
currently include contexts that explicitly require a number, such as in the
LIMIT clause of a SELECT statement, or the IGNORE number LINES clause of a
LOAD DATA statement.


--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org