mirror of
https://github.com/MariaDB/server.git
synced 2026-04-30 12:15:32 +02:00
Merge c-0409e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/clean-mysql-5.1
into c-0409e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug19801 mysql-test/r/partition.result: Auto merged mysql-test/t/partition.test: Auto merged sql/sql_partition.cc: Auto merged sql/partition_info.cc: manual merge
This commit is contained in:
commit
179c979937
4 changed files with 57 additions and 22 deletions
|
|
@ -569,7 +569,6 @@ bool partition_info::check_list_constants()
|
|||
uint i;
|
||||
uint list_index= 0;
|
||||
longlong *list_value;
|
||||
bool not_first;
|
||||
bool result= TRUE;
|
||||
longlong curr_value, prev_value;
|
||||
partition_element* part_def;
|
||||
|
|
@ -614,7 +613,8 @@ bool partition_info::check_list_constants()
|
|||
no_list_values++;
|
||||
} while (++i < no_parts);
|
||||
list_func_it.rewind();
|
||||
list_array= (LIST_PART_ENTRY*)sql_alloc(no_list_values*sizeof(LIST_PART_ENTRY));
|
||||
list_array= (LIST_PART_ENTRY*)sql_alloc((no_list_values+1) *
|
||||
sizeof(LIST_PART_ENTRY));
|
||||
if (unlikely(list_array == NULL))
|
||||
{
|
||||
mem_alloc_error(no_list_values * sizeof(LIST_PART_ENTRY));
|
||||
|
|
@ -633,24 +633,28 @@ bool partition_info::check_list_constants()
|
|||
}
|
||||
} while (++i < no_parts);
|
||||
|
||||
qsort((void*)list_array, no_list_values, sizeof(LIST_PART_ENTRY),
|
||||
&list_part_cmp);
|
||||
|
||||
not_first= FALSE;
|
||||
prev_value= 0; // prev_value initialised to quiet compiler
|
||||
for (i= 0; i < no_list_values ; i++)
|
||||
if (no_list_values)
|
||||
{
|
||||
curr_value= list_array[i].list_value;
|
||||
if (likely(!not_first || prev_value != curr_value))
|
||||
bool first= TRUE;
|
||||
qsort((void*)list_array, no_list_values, sizeof(LIST_PART_ENTRY),
|
||||
&list_part_cmp);
|
||||
|
||||
i= prev_value= 0; //prev_value initialised to quiet compiler
|
||||
do
|
||||
{
|
||||
prev_value= curr_value;
|
||||
not_first= TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
my_error(ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR, MYF(0));
|
||||
goto end;
|
||||
}
|
||||
DBUG_ASSERT(i < no_list_values);
|
||||
curr_value= list_array[i].list_value;
|
||||
if (likely(first || prev_value != curr_value))
|
||||
{
|
||||
prev_value= curr_value;
|
||||
first= FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
my_error(ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR, MYF(0));
|
||||
goto end;
|
||||
}
|
||||
} while (++i < no_list_values);
|
||||
}
|
||||
result= FALSE;
|
||||
end:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue