List:Commits« Previous MessageNext Message »
From:marc.alff Date:January 3 2007 6:47pm
Subject:bk commit into 5.0 tree (malff:1.2321) BUG#6298
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of marcsql. When marcsql does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-01-03 11:47:01-07:00, malff@weblab.(none) +2 -0
  Bug#6298 (LIMIT #, -1 no longer works to set start with no end limit)
  
  With MySQL 3.23 and 4.0, the syntax 'LIMIT N, -1' is accepted, and returns
  all the rows located after row N. This behavior, however, is not the
  intended result, and defeats the purpose of LIMIT, which is to constrain
  the size of a result set.
  
  With MySQL 4.1 and later, this construct is correctly detected as a syntax
  error.
  
  This fix does not change the production code, and only adds a new test case
  to improve test coverage in this area, to enforce in the test suite the
  intended behavior.

  mysql-test/r/select.result@stripped, 2007-01-03 11:46:59-07:00, malff@weblab.(none) +6 -0
    Enforce that LIMIT N, -1 is illegal.

  mysql-test/t/select.test@stripped, 2007-01-03 11:46:59-07:00, malff@weblab.(none) +20 -0
    Enforce that LIMIT N, -1 is illegal.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	malff
# Host:	weblab.(none)
# Root:	/home/marcsql/TREE/mysql-5.0-6298

--- 1.143/mysql-test/r/select.result	2007-01-03 11:47:07 -07:00
+++ 1.144/mysql-test/r/select.result	2007-01-03 11:47:07 -07:00
@@ -3611,3 +3611,9 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t2	range	si,ai	si	5	NULL	2	Using where
 1	SIMPLE	t3	eq_ref	PRIMARY,ci	PRIMARY	4	test.t2.a	1	Using where
 DROP TABLE t1,t2,t3;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(a int);
+INSERT into t1 values (1), (2), (3);
+SELECT * FROM t1 LIMIT 2, -1;
+ERROR 42000: 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
+DROP TABLE t1;

--- 1.117/mysql-test/t/select.test	2007-01-03 11:47:07 -07:00
+++ 1.118/mysql-test/t/select.test	2007-01-03 11:47:07 -07:00
@@ -3092,3 +3092,23 @@ SELECT t3.a FROM t1,t2,t3
         t3.c IN ('bb','ee');
 
 DROP TABLE t1,t2,t3;
+
+#
+# Bug#6298: LIMIT #, -1 no longer works to set start with no end limit
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1(a int);
+INSERT into t1 values (1), (2), (3);
+
+# LIMIT N, -1 was accepted by accident in 4.0, but was not intended.
+# This test verifies that this illegal construct is now properly detected.
+
+--error ER_PARSE_ERROR
+SELECT * FROM t1 LIMIT 2, -1;
+
+DROP TABLE t1;
+
Thread
bk commit into 5.0 tree (malff:1.2321) BUG#6298marc.alff3 Jan