diff options
author | Andrei Elkin <aelkin@mysql.com> | 2008-11-12 19:51:47 +0200 |
---|---|---|
committer | Andrei Elkin <aelkin@mysql.com> | 2008-11-12 19:51:47 +0200 |
commit | ca2d1846950b07115a001a37d84ce63ab2acdc6c (patch) | |
tree | da19273bb9e832fe232c5251aa3f4d9dc29ee7f0 /sql/sql_lex.cc | |
parent | 162e550fcf986454cd1a542e98d8adc8fa81fd00 (diff) | |
parent | 1d521f6c20881997c9162bd11cadcbc77d20520b (diff) | |
download | mariadb-git-ca2d1846950b07115a001a37d84ce63ab2acdc6c.tar.gz |
merging 5.1 -> 5.1 rpl. 3 of 4 conflicts are resolved similarly to 6.0->6.0-rpl merging.
mysql_upgrade results changed due to the error messesge of mysqlcheck has changed.
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 4ac73baa992..983d53a041d 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -2397,15 +2397,20 @@ void st_select_lex_unit::set_limit(st_select_lex *sl) val= sl->select_limit ? sl->select_limit->val_uint() : HA_POS_ERROR; select_limit_val= (ha_rows)val; #ifndef BIG_TABLES - /* + /* Check for overflow : ha_rows can be smaller then ulonglong if BIG_TABLES is off. */ if (val != (ulonglong)select_limit_val) select_limit_val= HA_POS_ERROR; #endif - offset_limit_cnt= (ha_rows)(sl->offset_limit ? sl->offset_limit->val_uint() : - ULL(0)); + val= sl->offset_limit ? sl->offset_limit->val_uint() : ULL(0); + offset_limit_cnt= (ha_rows)val; +#ifndef BIG_TABLES + /* Check for truncation. */ + if (val != (ulonglong)offset_limit_cnt) + offset_limit_cnt= HA_POS_ERROR; +#endif select_limit_cnt= select_limit_val + offset_limit_cnt; if (select_limit_cnt < select_limit_val) select_limit_cnt= HA_POS_ERROR; // no limit |