#At file:///home/mysql_src/bzrrepos_new/mysql-next-mr-opt-backporting-wl4800/ based on revid:guilhem.bichot@stripped
3285 Guilhem Bichot 2011-04-04
review comments
modified:
WL4800_TODO.txt
sql/opt_trace.cc
=== modified file 'WL4800_TODO.txt'
--- a/WL4800_TODO.txt 2011-03-21 17:55:41 +0000
+++ b/WL4800_TODO.txt 2011-04-04 13:56:54 +0000
@@ -44,3 +44,5 @@ should the debug binary really assert(0)
good idea at the customer's? On the other hand, how to make sure a
developer notices a syntax error when running tests?
sql_print_warning() is an idea.
+
+get a review for http://lists.mysql.com/commits/133482
=== modified file 'sql/opt_trace.cc'
--- a/sql/opt_trace.cc 2011-03-22 10:08:27 +0000
+++ b/sql/opt_trace.cc 2011-04-04 13:56:54 +0000
@@ -368,16 +368,16 @@ Opt_trace_struct& Opt_trace_struct::do_a
namespace {
/// human-readable names for boolean values
-LEX_CSTRING readables[]= { { STRING_WITH_LEN("false") },
- { STRING_WITH_LEN("true") } };
+LEX_CSTRING bool_as_text[]= { { STRING_WITH_LEN("false") },
+ { STRING_WITH_LEN("true") } };
}
Opt_trace_struct& Opt_trace_struct::do_add(const char *key, bool val)
{
DBUG_ASSERT(started);
DBUG_PRINT("opt", ("%s: %d", key, (int)val));
- const LEX_CSTRING *readable= &readables[val];
- stmt->add(check_key(key), readable->str, readable->length, false, false);
+ const LEX_CSTRING *text= &bool_as_text[val];
+ stmt->add(check_key(key), text->str, text->length, false, false);
return *this;
}
@@ -485,7 +485,7 @@ Opt_trace_stmt::Opt_trace_stmt(Opt_trace
ended(false), support_I_S(support_I_S_arg), ctx(ctx_arg),
current_struct(NULL)
{
- // Trace is always in UTF8, it's "all" that JSON accepts
+ // Trace is always in UTF8. This is the only charset which JSON accepts.
trace_buffer.set_charset(system_charset_info);
DBUG_ASSERT(system_charset_info == &my_charset_utf8_general_ci);
}
@@ -926,7 +926,10 @@ bool Opt_trace_stmt::Buffer::prealloc()
with a hole if there is later memory again for the trace's
continuation. The statement will fail anyway due to my_error(), in the
server.
- We jump from 0 to first_increment and then multiply by 1.5.
+ We jump from 0 to first_increment and then multiply by 1.5. Unlike
+ addition of a constant length, multiplying is expected to give amortized
+ constant reallocation time; 1.5 is a commonly seen factor in the
+ litterature.
*/
size_t new_size= (alloced == 0) ? first_increment : (alloced * 15 / 10);
size_t max_size= allowed_mem_size;
Attachment: [text/bzr-bundle] bzr/guilhem.bichot@oracle.com-20110404135654-qws05n2jz01e12yu.bundle
| Thread |
|---|
| • bzr commit into mysql-trunk branch (guilhem.bichot:3285) | Guilhem Bichot | 4 Apr |