Merge lp:~linuxjedi/drizzle/drizzle-bug-597905 into lp:~drizzle-trunk/drizzle/development

Proposed by Andrew Hutchings
Status: Merged
Approved by: Monty Taylor
Approved revision: 1659
Merged at revision: 1736
Proposed branch: lp:~linuxjedi/drizzle/drizzle-bug-597905
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: 80 lines (+15/-14)
2 files modified
drizzled/drizzled.cc (+8/-3)
drizzled/main.cc (+7/-11)
To merge this branch: bzr merge lp:~linuxjedi/drizzle/drizzle-bug-597905
Reviewer Review Type Date Requested Status
Monty Taylor Approve
Andrew Hutchings Needs Fixing
Review via email: mp+29627@code.launchpad.net

Description of the change

Fix segfault when using .temporary which was caused by the error handler hook not set yet and .temporary created as the wrong user.

Message handler hook is set earlier and .temporary is now created after set_user.

To post a comment you must log in.
Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

Figuring out a dtr test case for this

review: Needs Fixing
Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

dtr test case not currently possible (and not going to be possible 'soon'), having the fix in code is possibly more important.

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

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'drizzled/drizzled.cc'
2--- drizzled/drizzled.cc 2010-08-24 01:36:17 +0000
3+++ drizzled/drizzled.cc 2010-08-27 22:27:48 +0000
4@@ -710,8 +710,16 @@
5 internal::load_defaults(conf_file_name, groups, &argc, &argv);
6 defaults_argv=argv;
7 defaults_argc=argc;
8+ string progname(argv[0]);
9 get_options(&defaults_argc, defaults_argv);
10
11+ if ((user_info= check_user(drizzled_user)))
12+ {
13+ set_user(drizzled_user, user_info);
14+ }
15+
16+ fix_paths(progname);
17+
18 current_pid= getpid(); /* Save for later ref */
19 init_time(); /* Init time-functions (read zone) */
20
21@@ -1603,8 +1611,6 @@
22
23 my_getopt_error_reporter= option_error_reporter;
24
25- string progname(argv[0]);
26-
27 /* Skip unknown options so that they may be processed later by plugins */
28 my_getopt_skip_unknown= true;
29
30@@ -1635,7 +1641,6 @@
31
32 if (drizzled_chroot)
33 set_root(drizzled_chroot);
34- fix_paths(progname);
35
36 /*
37 Set some global variables from the global_system_variables
38
39=== modified file 'drizzled/main.cc'
40--- drizzled/main.cc 2010-08-18 16:12:58 +0000
41+++ drizzled/main.cc 2010-08-27 22:27:48 +0000
42@@ -229,6 +229,13 @@
43
44 google::protobuf::SetLogHandler(&GoogleProtoErrorThrower);
45
46+ /*
47+ init signals & alarm
48+ After this we can't quit by a simple unireg_abort
49+ */
50+ error_handler_hook= my_message_sql;
51+
52+
53 if (init_common_variables(DRIZZLE_CONFIG_NAME,
54 argc, argv, load_default_groups))
55 unireg_abort(1); // Will do exit
56@@ -249,11 +256,6 @@
57 data_home[1]=0;
58 data_home_len= 2;
59
60- if ((user_info= check_user(drizzled_user)))
61- {
62- set_user(drizzled_user, user_info);
63- }
64-
65 if (server_id == 0)
66 {
67 server_id= 1;
68@@ -279,12 +281,6 @@
69 if (plugin::Listen::setup())
70 unireg_abort(1);
71
72- /*
73- init signals & alarm
74- After this we can't quit by a simple unireg_abort
75- */
76- error_handler_hook= my_message_sql;
77-
78 assert(plugin::num_trx_monitored_objects > 0);
79 if (drizzle_rm_tmp_tables() ||
80 my_tz_init((Session *)0, default_tz_name))