Re: LIMIT error

2005-06-11 Thread Gleb Paharenko
Hello.



UPDATE in MySQL supports only row_count. See:

   http://dev.mysql.com/doc/mysql/en/update.html



The same you could get from source file sql/sql_yacc.yy.







David Legault wrote:

 Hello,

 

 I'm using the MySQL C API and I got the following error for this query:

 

 UPDATE tracks SET track_state='-2', track_cost='1.50' WHERE 

 track_flynum='10' AND track_testcase='45' ORDER BY track_step DESC LIMIT 

 0,1

 

 SQL Error 1064 : You have an error in your SQL syntax; check the manual 

 that corresponds to your MySQL server version for the right syntax to 

 use near '1' at line 1

 

 If I put LIMIT 1 instead of LIMIT 0,1 I get the correct result.

 

 This seems to be a weird problem and according to the documentation, 

 should be equivalent, but it seems not.

 

 Running on Win2k, MySQL 4.1.11, mysqld-nt.exe

 

 Thanks

 

 David

 



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




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



LIMIT error

2005-06-10 Thread David Legault

Hello,

I'm using the MySQL C API and I got the following error for this query:

UPDATE tracks SET track_state='-2', track_cost='1.50' WHERE 
track_flynum='10' AND track_testcase='45' ORDER BY track_step DESC LIMIT 0,1


SQL Error 1064 : You have an error in your SQL syntax; check the manual 
that corresponds to your MySQL server version for the right syntax to 
use near '1' at line 1


If I put LIMIT 1 instead of LIMIT 0,1 I get the correct result.

This seems to be a weird problem and according to the documentation, 
should be equivalent, but it seems not.


Running on Win2k, MySQL 4.1.11, mysqld-nt.exe

Thanks

David

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



Re: LIMIT error

2005-06-10 Thread Kristen G. Thorson
I think you might be confusing UPDATE and SELECT syntax.  As far as I 
ever knew, you couldn't specify a limit offset in an update statement.  
I don't see in mysql update docs where it indicates offset is allowed.




kgt





David Legault wrote:


Hello,

I'm using the MySQL C API and I got the following error for this query:

UPDATE tracks SET track_state='-2', track_cost='1.50' WHERE 
track_flynum='10' AND track_testcase='45' ORDER BY track_step DESC 
LIMIT 0,1


SQL Error 1064 : You have an error in your SQL syntax; check the 
manual that corresponds to your MySQL server version for the right 
syntax to use near '1' at line 1


If I put LIMIT 1 instead of LIMIT 0,1 I get the correct result.

This seems to be a weird problem and according to the documentation, 
should be equivalent, but it seems not.


Running on Win2k, MySQL 4.1.11, mysqld-nt.exe

Thanks

David





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



Limit error

2004-11-17 Thread Stuart Felenstein
I'm trying to paginate my record results.  Running
into a sql syntax error that is boggling my limited
brain cells.

The print out of my statement as it is parsed:

This is before the error occurs, the first 15 records
return fine:
WHERE VendorJobs.Industry IN ('3') AND
VendorJobs.JobTitle LIKE '%%' AND
VendorJobs.LocationCity LIKE '%%' LIMIT 0, 15

I can't get a print, well maybe I can, but this is the
error that is coming back when I hit next:
Check the manual that corresponds to your MySQL server
version for the right syntax to use near 'LIMIT 15,
15' at line 6

I'll hold off on my statement for now if the error
isn't apparent.

Stuart



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



Re:[SOLVED] Limit error

2004-11-17 Thread Stuart Felenstein
Note to self, check variables for typos before posting
to list!


--- Stuart Felenstein [EMAIL PROTECTED] wrote:



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



Re: UPDATE with WHERE+ORDER+LIMIT error(?) - test shell script (fwd)

2003-11-25 Thread Alexander Keremidarski
Hello Serge,

Serge E. Yakubovich wrote:
Description:

First of all I want to thank you for your excelent bug report and apologize for
delayed responce.

The same test script I've submitted today to [EMAIL PROTECTED],
 which demonstrates improper(?) behaviour of UPDATE statement on
 4.0.12 server under FreeBSD, on 4.0.15 server under Alt Linux causes
 segmentation fault.

It is quite difficult to judje what is proper/improper behaviour of such UPDATE
statement.

From User Variables section in manual:

Note: in a SELECT statement, each expression is evaluated only when it's sent to
the client
...


The general rule is to never assign and use the same variable in the same statement.

end of quote

Furthermore Relational Model requires that no operation depends on internal
order of rows in table or order in which rows are processed.
(Tables are Sets - they have no order, Operations on Sets happen at once)


However no statement should crash mysqld so I am entering your bug report into
Bugs Database with comment that this is improper usage of User Variables.

I was able to narrow down the problem to simple test case and entered it as
#1945 in our Bugs Database
http://bugs.mysql.com/1945

Feel free to follow up discussion there.

 --- SAMPLE 1 (BAD): inproper row is updated

This is questionable.

My feeling is that this should be discussed as separate issue once crashing bug
is fixed.

Comments are welcome.

Best regards

-- 
 Are you MySQL certified? - http://www.mysql.com/certification
 For technical support contracts, visit https://order.mysql.com/?ref=msal
__  ___ ___   __
   /  |/  /_ __/ __/ __ \/ /Mr. Alexander Keremidarski [EMAIL PROTECTED]
  / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Full-Time Developer
 /_/  /_/\_, /___/\___\_\___/   Sofia, Bulgaria
 ___/  www.mysql.com




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



UPDATE with WHERE+ORDER+LIMIT error(?) - test shell script (fwd)

2003-11-06 Thread Serge E. Yakubovich
Description:

   The same test script I've submitted today to [EMAIL PROTECTED],
which demonstrates improper(?) behaviour of UPDATE statement on
4.0.12 server under FreeBSD, on 4.0.15 server under Alt Linux causes
segmentation fault.
   Below is messages from /var/log/mysql/info:
-- Start of listing ---
/usr/sbin/mysqld: ready for connections.
Version: '4.0.15'  socket: '/mysql.sock'  port: 3306
mysqld got signal 11;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help 
diagnose
the problem, but since we have already crashed, something is definitely 
wrong
and this may fail.

key_buffer_size=67108864
read_buffer_size=131072
max_used_connections=2
max_connections=100
threads_connected=2
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections 
= 897535 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd=0x881b578
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
frame pointer (ebp) is NULL, did you compile with
-fomit-frame-pointer? Aborting backtrace!
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd-query at 0x882c048 = UPDATE ip SET 
n=(@n:[EMAIL PROTECTED]),[EMAIL PROTECTED],ip=(@dip:=ip),tuse=0
   WHERE tuse1 ORDER BY !([EMAIL PROTECTED]),tuse LIMIT 1
thd-thread_id=6
The manual page at http://www.mysql.com/doc/en/Crashing.html contains
information that should help you find out what is causing the crash.
2003-Nov-06 13:40:48 :: execution failed
2003-Nov-06 13:40:48 :: shutdown
-- Stop of listing ---

How-To-Repeat: View (edit if need )  run attached shell script IP.SH
Fix:   N/A
Submitter-Id:  [EMAIL PROTECTED]
Originator:[EMAIL PROTECTED]
Organization:  UkrBiz
MySQL support: none
Synopsis:  improper operation (4.0.12) or server crash (4.0.15) on 
UPDATE query
Severity:  serious
Priority:  [ low | medium | high ] (one line)
Category:  mysql
Class: sw-bug
Release:   mysql-4.0.15 (ALT Linux MySQL RPM)
Server: /usr/bin/mysqladmin  Ver 8.40 Distrib 4.0.15, for 
alt-linux-gnu on i586
Copyright (C) 2000 MySQL AB  MySQL Finland AB  TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version  4.0.15
Protocol version10
Connection  Localhost via UNIX socket
UNIX socket /var/lib/mysql/mysql.sock
Uptime: 30 min 17 sec
Threads: 2  Questions: 1668  Slow queries: 0  Opens: 91  Flush tables: 
1  Open tables: 64  Queries per second avg: 0.918
C compiler:i586-alt-linux-gcc (GCC) 3.2.3 (ALT Linux, build 
3.2.3-alt1)
C++ compiler:  i586-alt-linux-g++ (GCC) 3.2.3 (ALT Linux, build 
3.2.3-alt1)
Environment:
   machine, os, target, libraries (multiple lines)
System: Linux server.int.ukrbiz.com 2.4.20-alt7-up #1 Fri Mar 14 
14:57:05 MSK 2003 i586 unknown unknown GNU/Linux
Architecture: i586

Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc 
/usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i586-alt-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --libdir=/usr/lib 
--with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info 
--enable-shared --enable-threads=posix --disable-checking 
--enable-long-long --enable-__cxa_atexit 
--enable-languages=c,c++,f77,objc,java --program-suffix=-3.2 
--enable-objc-gc --with-system-zlib --without-included-gettext 
--host=i586-alt-linux --build=i586-alt-linux --target=i586-alt-linux
Thread model: posix
gcc version 3.2.3 (ALT Linux, build 3.2.3-alt2)
Compilation info: CC='i586-alt-linux-gcc'  CFLAGS='-pipe -Wall -O2 
-march=i586 -mcpu=i686 -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 
-DHAVE_ERRNO_AS_DEFINE -DONE_THREAD'  CXX='i586-alt-linux-g++'  
CXXFLAGS='-pipe -Wall -O2 -march=i586 -mcpu=i686 -fomit-frame-pointer 
-D_FILE_OFFSET_BITS=64 -DHAVE_ERRNO_AS_DEFINE -DONE_THREAD 
-felide-constructors -fno-exceptions -fno-rtti'  LDFLAGS=''  ASFLAGS=''
LIBC:
lrwxrwxrwx1 root root   13 Sep  5 15:23 /lib/libc.so.6 
- libc-2.2.6.so
-rwxr-xr-x2 root root  1145896 Sep  1 20:08 /lib/libc-2.2.6.so
-rw-r--r--1 root root  2416908 Sep  1 20:08 /usr/lib/libc.a
-rw-r--r--1 root root  178 Sep  1 20:37 /usr/lib/libc.so
Configure command: ./configure '--build=i586-alt-linux' 
'--host=i586-alt-linux' '--prefix=/usr' '--exec-prefix=/usr' 
'--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' 
'--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib'