Merge lp:~skinny.moey/drizzle/show_variables_582975 into lp:~drizzle-trunk/drizzle/development

Proposed by Joe Daly
Status: Merged
Merged at revision: 1562
Proposed branch: lp:~skinny.moey/drizzle/show_variables_582975
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: 54 lines (+8/-1)
3 files modified
drizzled/drizzled.cc (+3/-1)
drizzled/set_var.cc (+4/-0)
drizzled/set_var.h (+1/-0)
To merge this branch: bzr merge lp:~skinny.moey/drizzle/show_variables_582975
Reviewer Review Type Date Requested Status
Monty Taylor Approve
Brian Aker Pending
Review via email: mp+25827@code.launchpad.net

Description of the change

fix for "show variables" not displaying the scheduler bug #582975

To post a comment you must log in.
Revision history for this message
Monty Taylor (mordred) wrote :

Looks mostly good. However ...

opt_scheduler_default= (char*) "multi_thread";

Casting a static const char * to a char * is something I've been trying to get rid of in the tree in general. Is there a reason you needed to go away from from the const string here?

review: Needs Information
Revision history for this message
Joe Daly (skinny.moey) wrote :

> Looks mostly good. However ...
>
> opt_scheduler_default= (char*) "multi_thread";
>
> Casting a static const char * to a char * is something I've been trying to get
> rid of in the tree in general. Is there a reason you needed to go away from
> from the const string here?

The constructor for sys_var_const_str_ptr() expects a char** so to leave the const string here I would need to do a cast of (char*) opt_scheduler_default.c_str() or strcpy() to set the value of opt_scheduler which gets passed into sys_var_const_str_ptr(). What I did above seemed like the best choice. I looked into changing the constructor for sys_var_const_str_ptr() to accept const char** but that sent me down problems with other variables that were not const. Maybe Im missing something?

Revision history for this message
Monty Taylor (mordred) wrote :

Ok. Fair enough. I can't wait until this is systemically fixed. I really hate all the casting nonsense.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'drizzled/drizzled.cc'
--- drizzled/drizzled.cc 2010-05-21 18:25:00 +0000
+++ drizzled/drizzled.cc 2010-05-23 00:13:27 +0000
@@ -218,7 +218,7 @@
218bool volatile select_thread_in_use;218bool volatile select_thread_in_use;
219bool volatile abort_loop;219bool volatile abort_loop;
220bool volatile shutdown_in_progress;220bool volatile shutdown_in_progress;
221const string opt_scheduler_default("multi_thread");221char *opt_scheduler_default;
222char *opt_scheduler= NULL;222char *opt_scheduler= NULL;
223223
224size_t my_thread_stack_size= 65536;224size_t my_thread_stack_size= 65536;
@@ -996,6 +996,7 @@
996 else996 else
997 {997 {
998 scheduler_name= opt_scheduler_default;998 scheduler_name= opt_scheduler_default;
999 opt_scheduler= opt_scheduler_default;
999 }1000 }
10001001
1001 if (plugin::Scheduler::setPlugin(scheduler_name))1002 if (plugin::Scheduler::setPlugin(scheduler_name))
@@ -1555,6 +1556,7 @@
1555 max_system_variables.select_limit= (uint64_t) HA_POS_ERROR;1556 max_system_variables.select_limit= (uint64_t) HA_POS_ERROR;
1556 global_system_variables.max_join_size= (uint64_t) HA_POS_ERROR;1557 global_system_variables.max_join_size= (uint64_t) HA_POS_ERROR;
1557 max_system_variables.max_join_size= (uint64_t) HA_POS_ERROR;1558 max_system_variables.max_join_size= (uint64_t) HA_POS_ERROR;
1559 opt_scheduler_default= (char*) "multi_thread";
15581560
1559 /* Variables that depends on compile options */1561 /* Variables that depends on compile options */
1560#ifdef HAVE_BROKEN_REALPATH1562#ifdef HAVE_BROKEN_REALPATH
15611563
=== modified file 'drizzled/set_var.cc'
--- drizzled/set_var.cc 2010-04-23 01:02:40 +0000
+++ drizzled/set_var.cc 2010-05-23 00:13:27 +0000
@@ -200,6 +200,10 @@
200200
201static sys_var_const_str_ptr sys_secure_file_priv(&vars, "secure_file_priv",201static sys_var_const_str_ptr sys_secure_file_priv(&vars, "secure_file_priv",
202 &opt_secure_file_priv);202 &opt_secure_file_priv);
203
204static sys_var_const_str_ptr sys_scheduler(&vars, "scheduler",
205 &opt_scheduler);
206
203static sys_var_uint32_t_ptr sys_server_id(&vars, "server_id", &server_id,207static sys_var_uint32_t_ptr sys_server_id(&vars, "server_id", &server_id,
204 fix_server_id);208 fix_server_id);
205209
206210
=== modified file 'drizzled/set_var.h'
--- drizzled/set_var.h 2010-05-21 02:16:56 +0000
+++ drizzled/set_var.h 2010-05-23 00:13:27 +0000
@@ -81,6 +81,7 @@
81extern bool opt_readonly;81extern bool opt_readonly;
82extern char* opt_secure_file_priv;82extern char* opt_secure_file_priv;
83extern char *default_tz_name;83extern char *default_tz_name;
84extern char *opt_scheduler;
8485
85uint64_t fix_unsigned(Session *, uint64_t, const struct option *);86uint64_t fix_unsigned(Session *, uint64_t, const struct option *);
8687