diff options
author | Guilhem Bichot <guilhem@mysql.com> | 2010-07-08 14:36:10 +0200 |
---|---|---|
committer | Guilhem Bichot <guilhem@mysql.com> | 2010-07-08 14:36:10 +0200 |
commit | 65bdafda29864697100260e4726b90166b122050 (patch) | |
tree | 5f9ac42249073c026a0a3e9bb275195c541cac2e | |
parent | 37caf28c83c642b631bf5cbfdad8ebd85f9ae3fe (diff) | |
download | mariadb-git-65bdafda29864697100260e4726b90166b122050.tar.gz |
backport of guilhem@mysql.com-20100628140739-i9vy8ugxp1v5aspb
from next-mr-bugfixing:
BUG#54682 "set sql_select_limit=0 does not work"; let SQL_SELECT_LIMIT=0
work like it does in 5.1.
-rw-r--r-- | mysql-test/suite/sys_vars/r/sql_select_limit_func.result | 10 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/t/sql_select_limit_func.test | 8 | ||||
-rw-r--r-- | sql/sys_vars.cc | 2 |
3 files changed, 19 insertions, 1 deletions
diff --git a/mysql-test/suite/sys_vars/r/sql_select_limit_func.result b/mysql-test/suite/sys_vars/r/sql_select_limit_func.result index 893816e6f0f..5d4daf8367b 100644 --- a/mysql-test/suite/sys_vars/r/sql_select_limit_func.result +++ b/mysql-test/suite/sys_vars/r/sql_select_limit_func.result @@ -62,6 +62,16 @@ a b a b 6 val6 6 val6 affected rows: 2 Expecting affected rows: 2 +SET SESSION sql_select_limit = 0; +affected rows: 0 +SELECT * FROM t1; +a b +affected rows: 0 +Expecting affected rows: 0 +SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a; +a b a b +affected rows: 0 +Expecting affected rows: 0 '#-----------------------------FN_DYNVARS_165_03---------------#' SET SESSION sql_select_limit = 2; affected rows: 0 diff --git a/mysql-test/suite/sys_vars/t/sql_select_limit_func.test b/mysql-test/suite/sys_vars/t/sql_select_limit_func.test index ed582949aa0..99bc05c465c 100644 --- a/mysql-test/suite/sys_vars/t/sql_select_limit_func.test +++ b/mysql-test/suite/sys_vars/t/sql_select_limit_func.test @@ -86,6 +86,14 @@ SELECT * FROM t1; SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a; --echo Expecting affected rows: 2 +SET SESSION sql_select_limit = 0; + +SELECT * FROM t1; +--echo Expecting affected rows: 0 + +SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a; +--echo Expecting affected rows: 0 + --echo '#-----------------------------FN_DYNVARS_165_03---------------#' # # Small value with LIMIT Clause diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 6b7dd7a8a2e..eafb20cf0a3 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -2379,7 +2379,7 @@ static Sys_var_harows Sys_select_limit( "sql_select_limit", "The maximum number of rows to return from SELECT statements", SESSION_VAR(select_limit), NO_CMD_LINE, - VALID_RANGE(1, HA_POS_ERROR), DEFAULT(HA_POS_ERROR), BLOCK_SIZE(1)); + VALID_RANGE(0, HA_POS_ERROR), DEFAULT(HA_POS_ERROR), BLOCK_SIZE(1)); static bool update_timestamp(THD *thd, set_var *var) { |