mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-16316 Replace INT_ITEM references in the code behind ORDER, LIMIT, PROCEDURE clause
1. Adding new methods: - Item::is_order_clause_position() - Item_splocal::is_valid_limit_clause_variable_with_error() - Type_handler::is_order_clause_position_type() - is_limit_clause_valid_type() and changing all tests related to the ORDER and LIMIT clauses like "item->type()==INT_ITEM" to these new methods. 2. Adding a helper function prepare_param() in sql_analyse.cc and replacing three pieces of duplicate code to prepare_param() calls. Replacing the test "item->type()!=Item::INT_ITEM" to an equivalent condition using item->basic_const_item() and type_handler()->result_type().
This commit is contained in:
@ -22771,12 +22771,7 @@ find_order_in_list(THD *thd, Ref_ptr_array ref_pointer_array,
|
||||
uint counter;
|
||||
enum_resolution_type resolution;
|
||||
|
||||
/*
|
||||
Local SP variables may be int but are expressions, not positions.
|
||||
(And they can't be used before fix_fields is called for them).
|
||||
*/
|
||||
if (order_item->type() == Item::INT_ITEM && order_item->basic_const_item() &&
|
||||
!from_window_spec)
|
||||
if (order_item->is_order_clause_position() && !from_window_spec)
|
||||
{ /* Order by position */
|
||||
uint count;
|
||||
if (order->counter_used)
|
||||
|
Reference in New Issue
Block a user