mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
parent
8a1a63de90
commit
830e53c8b1
3 changed files with 16 additions and 10 deletions
|
@ -25,3 +25,6 @@ find_in_set("","a,b,c") find_in_set("","a,b,c,") find_in_set("",",a,b,c")
|
|||
select find_in_set("abc","abc"),find_in_set("ab","abc"),find_in_set("abcd","abc");
|
||||
find_in_set("abc","abc") find_in_set("ab","abc") find_in_set("abcd","abc")
|
||||
1 0 0
|
||||
select interval(null, 1, 10, 100);
|
||||
interval(null, 1, 10, 100)
|
||||
NULL
|
||||
|
|
|
@ -15,3 +15,4 @@ select export_set(9,"Y","N","-",5),export_set(9,"Y","N"),export_set(9,"Y","N",""
|
|||
select elt(2,1),field(NULL,"a","b","c");
|
||||
select find_in_set("","a,b,c"),find_in_set("","a,b,c,"),find_in_set("",",a,b,c");
|
||||
select find_in_set("abc","abc"),find_in_set("ab","abc"),find_in_set("abcd","abc");
|
||||
select interval(null, 1, 10, 100);
|
||||
|
|
|
@ -311,7 +311,7 @@ void Item_func_interval::split_sum_func(List<Item> &fields)
|
|||
}
|
||||
|
||||
/*
|
||||
return -1 if null value,
|
||||
return NULL if null value,
|
||||
0 if lower than lowest
|
||||
1 - arg_count if between args[n] and args[n+1]
|
||||
arg_count+1 if higher than biggest argument
|
||||
|
@ -321,11 +321,13 @@ longlong Item_func_interval::val_int()
|
|||
{
|
||||
double value= item->val();
|
||||
if (item->null_value)
|
||||
return -1; // -1 if null /* purecov: inspected */
|
||||
{
|
||||
null_value= 1;
|
||||
return -1;
|
||||
}
|
||||
if (intervals)
|
||||
{ // Use binary search to find interval
|
||||
uint start,end;
|
||||
start=0; end=arg_count-1;
|
||||
uint start= 0, end= arg_count - 1;
|
||||
while (start != end)
|
||||
{
|
||||
uint mid= (start + end + 1) / 2;
|
||||
|
|
Loading…
Reference in a new issue