Re: Mysql 4.1 and the LIMIT sql statement

2005-03-09 Thread Dennis Fogg
On Nov 17, 2004, Matt Babineau & Dan Nelson discussed:

> > Has anyone run into problems with this sql syntax?
> > 
> > LIMIT -1
> > 
> > I've used this extensively in my code to get back all records rather then
> > specifing a limit. I've done this programmatically with PHP, so all my
> > queries have a limit even if I don't need one, I just have it specify LIMIT
> > -1, but apparently this functionality doesn't seem to work in 4.1???
> 
> From http://dev.mysql.com/doc/mysql/en/Upgrading-from-4.0.html :
> 
>  # LIMIT no longer accepts negative arguments. Use some large number
>(maximum 18446744073709551615) instead of -1.
> 
> not sure why it was changed, though.
> 

This is going to break a fair number of phpMyEdit scripts because
phpMyEdit's default template recommends $opts['inc'] being set to
"Value of -1 lists all records in a table"
which gets converted to a SQL statement using LIMIT 0,-1

This does not make for a smooth migration from MySQL 4.0 to 4.1
and the solution suggested in the documentation is a step backwards
in elegance (IMHO).

Dennis Fogg

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Mysql 4.1 and the LIMIT sql statement

2004-11-17 Thread Mark Papadakis
I suppose they fixed it.
Relying on 'undocumented features' is a bad habbit. 

Update your code to exclude the LIMIT clause if you do not wish to use
it. Its the best thing ou can do.

Mark Papadakis



On Wed, 17 Nov 2004 12:21:31 -0800, Matt Babineau <[EMAIL PROTECTED]> wrote:
> Hi all-
> 
> Has anyone run into problems with this sql syntax?
> 
> LIMIT -1
> 
> I've used this extensively in my code to get back all records rather then
> specifing a limit. I've done this programmatically with PHP, so all my
> queries have a limit even if I don't need one, I just have it specify LIMIT
> -1, but apparently this functionality doesn't seem to work in 4.1???
> 
> Thanks,
> 
> Matt Babineau
> Web Developer
> Criticalcode - http://www.criticalcode.com
> 
> 


-- 
Mark Papadakis
Head of R&D
Phaistos Networks, S.A

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Mysql 4.1 and the LIMIT sql statement

2004-11-17 Thread Dan Nelson
In the last episode (Nov 17), Matt Babineau said:
> Has anyone run into problems with this sql syntax?
> 
> LIMIT -1
> 
> I've used this extensively in my code to get back all records rather then
> specifing a limit. I've done this programmatically with PHP, so all my
> queries have a limit even if I don't need one, I just have it specify LIMIT
> -1, but apparently this functionality doesn't seem to work in 4.1???

>From http://dev.mysql.com/doc/mysql/en/Upgrading-from-4.0.html :

 # LIMIT no longer accepts negative arguments. Use some large number
   (maximum 18446744073709551615) instead of -1.

not sure why it was changed, though.

-- 
Dan Nelson
[EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]