Bug #16811 missing volatile in extern declaration in sql/set_var.cc
Submitted: 26 Jan 2006 16:13 Modified: 10 Feb 2006 0:02
Reporter: Kristian Nielsen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version:5.1.6 OS:Windows (Windows/all)
Assigned to: Andrey Hristov CPU Architecture:Any

[26 Jan 2006 16:13] Kristian Nielsen
Description:
In sql/event_executor.cc we have

    volatile my_bool event_executor_running_global_var;

But in sql/set_var.cc we have

    extern my_bool event_executor_running_global_var;

[note the missing volatile in the extern declaration].

This causes a linker failure on Windows. But it is implicitly casting away the volatile, which is either unintended, or at least bad style.

How to repeat:
Compile latest 5.1 bitkeeper on Windows and/or read source code.

Suggested fix:
If casting away the volatile is intended, make the cast explicit in sql_var.cc.

If not intended, the class sys_var_event_executor in set_var.h should be fixed to take volatile.
[31 Jan 2006 22:07] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/1964
[10 Feb 2006 0:02] Andrey Hristov
Fixed, no need to document.