--- sql/odbc/parser3odbc.C 2008/07/04 15:36:05 1.33 +++ sql/odbc/parser3odbc.C 2008/07/08 09:21:08 1.35 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char *RCSId="$Id: parser3odbc.C,v 1.33 2008/07/04 15:36:05 misha Exp $"; +static const char *RCSId="$Id: parser3odbc.C,v 1.35 2008/07/08 09:21:08 misha Exp $"; #ifndef _MSC_VER # error compile ISAPI module with MSVC [no urge for now to make it autoconf-ed (PAF)] @@ -511,10 +511,12 @@ private: +1/*terminator*/ ); - result.limit=true; // with TOP we can't skip offset records easily + result.limit=true; + if(!limit) + result.offset=true; // mark as we'll did it in query because of no point to skip anything if we need 0 rows result.statement=statement_limited; - snprintf(statement_limited, MAX_NUMBER+11, "SELECT TOP %u", (limit)?limit+offset:0/*no reasons to skip something if we need 0 rows*/); + snprintf(statement_limited, MAX_NUMBER+11, "SELECT TOP %u", (limit)?limit+offset:0/*no point to skip anything if we need 0 rows*/); astatement+=6;/*skip 'select'*/ strcat(statement_limited, astatement); @@ -524,7 +526,7 @@ private: } case SQL::FireBird: { - // add 'FIRST (limit) SKIP (offset)' after 'SELECT' + // add ' FIRST (limit) SKIP (offset)' after 'SELECT' char* statement_limited=(char *)connection.services->malloc_atomic( strlen(astatement) +MAX_NUMBER*2 @@ -548,7 +550,7 @@ private: break; } default: - connection.services->_throw("Unknown SQL Specific"); + connection.services->_throw("Unknown SQL specifics"); } } return result;