diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2011-02-01 14:19:58 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2011-02-01 14:19:58 +0100 |
commit | 7e206872128d891fffa5238c093c8d6506da8dbb (patch) | |
tree | 6165d2406ed5c65f0db313ef74dafc5726956e3d | |
parent | 8041013fb166c071534115873a6d7d359e9ecaf5 (diff) | |
download | mariadb-git-7e206872128d891fffa5238c093c8d6506da8dbb.tar.gz |
Fix compile errors:
* declaration in the middle of the block in C file.
* round() is only available in C99.
-rw-r--r-- | mysys/tree.c | 3 | ||||
-rw-r--r-- | sql/opt_range.cc | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/mysys/tree.c b/mysys/tree.c index 70f2972b03f..c8571fd0337 100644 --- a/mysys/tree.c +++ b/mysys/tree.c @@ -221,9 +221,10 @@ TREE_ELEMENT *tree_insert(TREE *tree, void *key, uint key_size, } if (element == &tree->null_element) { + uint alloc_size; if (tree->flag & TREE_ONLY_DUPS) 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; if (tree->memory_limit && tree->elements_in_tree diff --git a/sql/opt_range.cc b/sql/opt_range.cc index faeafab7209..6c9ed241de2 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -4925,7 +4925,7 @@ ha_rows get_table_cardinality_for_index_intersect(TABLE *table) ha_rows d; double q; 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); } } |