Commit 7e206872 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fix compile errors:

* declaration in the middle of the block in C file.
* round() is only available in C99.
parent 8041013f
...@@ -221,9 +221,10 @@ TREE_ELEMENT *tree_insert(TREE *tree, void *key, uint key_size, ...@@ -221,9 +221,10 @@ TREE_ELEMENT *tree_insert(TREE *tree, void *key, uint key_size,
} }
if (element == &tree->null_element) if (element == &tree->null_element)
{ {
uint alloc_size;
if (tree->flag & TREE_ONLY_DUPS) if (tree->flag & TREE_ONLY_DUPS)
return((TREE_ELEMENT *) 1); return((TREE_ELEMENT *) 1);
uint alloc_size=sizeof(TREE_ELEMENT)+key_size+tree->size_of_element; alloc_size=sizeof(TREE_ELEMENT)+key_size+tree->size_of_element;
tree->allocated+=alloc_size; tree->allocated+=alloc_size;
if (tree->memory_limit && tree->elements_in_tree if (tree->memory_limit && tree->elements_in_tree
......
...@@ -4925,7 +4925,7 @@ ha_rows get_table_cardinality_for_index_intersect(TABLE *table) ...@@ -4925,7 +4925,7 @@ ha_rows get_table_cardinality_for_index_intersect(TABLE *table)
ha_rows d; ha_rows d;
double q; double q;
for (q= table->file->stats.records, d= 1 ; q >= 10; q/= 10, d*= 10 ) ; for (q= table->file->stats.records, d= 1 ; q >= 10; q/= 10, d*= 10 ) ;
return (ha_rows) (round(q) * d); return (ha_rows) (floor(q+0.5) * d);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment