Merge 11.4 into 11.7

This commit is contained in:
Marko Mäkelä 2024-12-02 17:51:17 +02:00
commit 33907f9ec6
449 changed files with 6778 additions and 4295 deletions

View file

@ -675,10 +675,11 @@ bool Item_sum::check_vcol_func_processor(void *arg)
@retval > 0 if key1 > key2
*/
int simple_str_key_cmp(void* arg, uchar* key1, uchar* key2)
int simple_str_key_cmp(void *arg, const void *key1, const void *key2)
{
Field *f= (Field*) arg;
return f->cmp(key1, key2);
Field *f= static_cast<Field *>(arg);
return f->cmp(static_cast<const uchar *>(key1),
static_cast<const uchar *>(key2));
}
@ -708,9 +709,12 @@ C_MODE_END
@retval >0 if key1 > key2
*/
int Aggregator_distinct::composite_key_cmp(void* arg, uchar* key1, uchar* key2)
int Aggregator_distinct::composite_key_cmp(void *arg, const void *key1_,
const void *key2_)
{
Aggregator_distinct *aggr= (Aggregator_distinct *) arg;
const uchar *key1= static_cast<const uchar *>(key1_);
const uchar *key2= static_cast<const uchar *>(key2_);
Aggregator_distinct *aggr= static_cast<Aggregator_distinct *>(arg);
Field **field = aggr->table->field;
Field **field_end= field + aggr->table->s->fields;
uint32 *lengths=aggr->field_lengths;
@ -727,7 +731,6 @@ int Aggregator_distinct::composite_key_cmp(void* arg, uchar* key1, uchar* key2)
return 0;
}
/***************************************************************************/
C_MODE_START
@ -736,7 +739,7 @@ C_MODE_START
int simple_raw_key_cmp(void* arg, const void* key1, const void* key2)
{
return memcmp(key1, key2, *(uint *) arg);
return memcmp(key1, key2, *(static_cast<uint *>(arg)));
}
@ -849,7 +852,7 @@ bool Aggregator_distinct::setup(THD *thd)
if (all_binary)
{
cmp_arg= (void*) &tree_key_length;
compare_key= (qsort_cmp2) simple_raw_key_cmp;
compare_key= simple_raw_key_cmp;
}
else
{
@ -861,14 +864,14 @@ bool Aggregator_distinct::setup(THD *thd)
compare method that can take advantage of not having to worry
about other fields.
*/
compare_key= (qsort_cmp2) simple_str_key_cmp;
compare_key= simple_str_key_cmp;
cmp_arg= (void*) table->field[0];
/* tree_key_length has been set already */
}
else
{
uint32 *length;
compare_key= (qsort_cmp2) composite_key_cmp;
compare_key= composite_key_cmp;
cmp_arg= (void*) this;
field_lengths= thd->alloc<uint32>(table->s->fields);
for (tree_key_length= 0, length= field_lengths, field= table->field;
@ -3576,11 +3579,10 @@ String *Item_sum_udf_str::val_str(String *str)
@retval 1 : key1 > key2
*/
extern "C"
int group_concat_key_cmp_with_distinct(void* arg, const void* key1,
const void* key2)
extern "C" int group_concat_key_cmp_with_distinct(void *arg, const void *key1,
const void *key2)
{
Item_func_group_concat *item_func= (Item_func_group_concat*)arg;
auto item_func= static_cast<const Item_func_group_concat *>(arg);
for (uint i= 0; i < item_func->arg_count_field; i++)
{
@ -3619,11 +3621,11 @@ int group_concat_key_cmp_with_distinct(void* arg, const void* key1,
Used for JSON_ARRAYAGG function
*/
int group_concat_key_cmp_with_distinct_with_nulls(void* arg,
const void* key1_arg,
const void* key2_arg)
int group_concat_key_cmp_with_distinct_with_nulls(void *arg,
const void *key1_arg,
const void *key2_arg)
{
Item_func_group_concat *item_func= (Item_func_group_concat*)arg;
auto item_func= static_cast<Item_func_group_concat *>(arg);
uchar *key1= (uchar*)key1_arg + item_func->table->s->null_bytes;
uchar *key2= (uchar*)key2_arg + item_func->table->s->null_bytes;
@ -3672,11 +3674,10 @@ int group_concat_key_cmp_with_distinct_with_nulls(void* arg,
function of sort for syntax: GROUP_CONCAT(expr,... ORDER BY col,... )
*/
extern "C"
int group_concat_key_cmp_with_order(void* arg, const void* key1,
const void* key2)
extern "C" int group_concat_key_cmp_with_order(void *arg, const void *key1,
const void *key2)
{
Item_func_group_concat* grp_item= (Item_func_group_concat*) arg;
auto grp_item= static_cast<Item_func_group_concat *>(arg);
ORDER **order_item, **end;
for (order_item= grp_item->order, end=order_item+ grp_item->arg_count_order;
@ -3732,10 +3733,11 @@ int group_concat_key_cmp_with_order(void* arg, const void* key1,
Used for JSON_ARRAYAGG function
*/
int group_concat_key_cmp_with_order_with_nulls(void *arg, const void *key1_arg,
int group_concat_key_cmp_with_order_with_nulls(void *arg,
const void *key1_arg,
const void *key2_arg)
{
Item_func_group_concat* grp_item= (Item_func_group_concat*) arg;
auto grp_item= static_cast<const Item_func_group_concat *>(arg);
ORDER **order_item, **end;
uchar *key1= (uchar*)key1_arg + grp_item->table->s->null_bytes;