diff options
author | konstantin@mysql.com <> | 2005-06-07 14:11:36 +0400 |
---|---|---|
committer | konstantin@mysql.com <> | 2005-06-07 14:11:36 +0400 |
commit | 9f379d7f05c43b2d09de91c3af5cc35613a745e4 (patch) | |
tree | d2686d80a3486e1912b96a6e6774bd3f77da0022 /sql/sql_derived.cc | |
parent | 7288ef873f3168bf54d84967223e469dcf68fdf3 (diff) | |
download | mariadb-git-9f379d7f05c43b2d09de91c3af5cc35613a745e4.tar.gz |
Patch two (the final one) for Bug#7306 "the server side preparedStatement
error for LIMIT placeholder".
The patch adds grammar support for LIMIT ?, ? and changes the
type of ST_SELECT_LEX::select_limit,offset_limit from ha_rows to Item*,
so that it can point to Item_param.
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r-- | sql/sql_derived.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 2ae293c1bff..e1d701936cf 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -217,6 +217,8 @@ exit: queries defined. After temporary table is filled, if this is not EXPLAIN, then the entire unit / node is deleted. unit is deleted if UNION is used for derived table and node is deleted is it is a simple SELECT. + If you use this function, make sure it's not called at prepare. + Due to evaluation of LIMIT clause it can not be used at prepared stage. RETURN 0 ok @@ -245,11 +247,7 @@ int mysql_derived_filling(THD *thd, LEX *lex, TABLE_LIST *orig_table_list) } else { - unit->offset_limit_cnt= first_select->offset_limit; - unit->select_limit_cnt= first_select->select_limit+ - first_select->offset_limit; - if (unit->select_limit_cnt < first_select->select_limit) - unit->select_limit_cnt= HA_POS_ERROR; + unit->set_limit(first_select); if (unit->select_limit_cnt == HA_POS_ERROR) first_select->options&= ~OPTION_FOUND_ROWS; |