Bug #47857 strip_sp function in mysys/mf_strip.c never used and cause name clash
Submitted: 6 Oct 2009 10:12 Modified: 18 Dec 2009 11:45
Reporter: Magnus Blåudd Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Magnus Blåudd CPU Architecture:Any
Triage: Triaged: D3 (Medium)

[6 Oct 2009 10:12] Magnus Blåudd
Description:
The file mysys/mf_strip.c defines the global function strip_sp. This function is not used in any place of the MySQL Server code and should thus be removed, especially since it cause name clashes. Preferrably all exported functions should be prefixed with "my_" ot be a C++ name mangled function.

How to repeat:
MCI

Suggested fix:
Remove the file mysys/mf_strip.c, remove it's declaration from mysys.h and remove it from Makefile.am and CMakeLists.txt
[6 Oct 2009 11:05] 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/85861
[6 Oct 2009 11:34] Vladislav Vaintroub
Quite interesting , this function causes problems during linking of mysqld
in CMake projects with VS2003 generator and with VS2010 (tried with cmake 2.8rc2).

The name clash comes from our attempt to export every global symbol from mysqld, which was implemented as part of plugin support - in absence of any documented API between plugin and mysqld we export all symbols to match Unix linkers behavior.

This must be a some subtle bug in the VS / CMake integration that causes the linker error , because 

a) stricty speaking, there are no 2 global symbols with exactly the same name, so linker error seems bogus.
b) CMake's NMake generator does not bring this error.
[6 Oct 2009 12:25] Magnus Blåudd
Quite "bogus" since it only occurs with "vcbuild" so far.

Reducing the number of exported symbols is always good.
[8 Oct 2009 11:43] 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/86140
[8 Oct 2009 12:28] Magnus Blåudd
Pushed to 5.1-bugteam and pe
[14 Oct 2009 14:40] Bugs System
Pushed into 5.1.41 (revid:joro@sun.com-20091014143611-cphb0enjlx6lpat1) (version source revid:satya.bn@sun.com-20091013071829-zc4c3go44j6re592) (merge vers: 5.1.40) (pib:13)
[15 Oct 2009 7:27] MC Brown
A note has been added to the 5.1.41 changelog: 

The mysys/mf_strip.c file, which defines the strip_sp has been removed from the MySQL source. The function was no longer in use within the main build, and the supplied function was causing symbol errors on Windows builds.
[22 Oct 2009 6:37] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091022063126-l0qzirh9xyhp0bpc) (version source revid:alik@sun.com-20091019135554-s1pvptt6i750lfhv) (merge vers: 6.0.14-alpha) (pib:13)
[22 Oct 2009 7:09] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091022060553-znkmxm0g0gm6ckvw) (version source revid:alik@sun.com-20091019131708-bc6pv55x6287a0wc) (merge vers: 5.5.0-beta) (pib:13)
[30 Oct 2009 11:12] MC Brown
Changelog entry added to the 5.5.0 and 6.0.14: 

The mysys/mf_strip.c file, which defines the strip_sp has been removed from the MySQL
source. The function was no longer in use within the main build, and the supplied function
was causing symbol errors on Windows builds.
[18 Dec 2009 10:40] Bugs System
Pushed into 5.1.41-ndb-7.1.0 (revid:jonas@mysql.com-20091218102229-64tk47xonu3dv6r6) (version source revid:jonas@mysql.com-20091218095730-26gwjidfsdw45dto) (merge vers: 5.1.41-ndb-7.1.0) (pib:15)
[18 Dec 2009 10:53] MC Brown
Added entry to 5.1.41-ndb-7.1.0
[18 Dec 2009 10:55] Bugs System
Pushed into 5.1.41-ndb-6.2.19 (revid:jonas@mysql.com-20091218100224-vtzr0fahhsuhjsmt) (version source revid:jonas@mysql.com-20091217101452-qwzyaig50w74xmye) (merge vers: 5.1.41-ndb-6.2.19) (pib:15)
[18 Dec 2009 11:00] MC Brown
Added entry to 5.1.41-ndb-6.2.19
[18 Dec 2009 11:10] Bugs System
Pushed into 5.1.41-ndb-6.3.31 (revid:jonas@mysql.com-20091218100616-75d9tek96o6ob6k0) (version source revid:jonas@mysql.com-20091217154335-290no45qdins5bwo) (merge vers: 5.1.41-ndb-6.3.31) (pib:15)
[18 Dec 2009 11:24] Bugs System
Pushed into 5.1.41-ndb-7.0.11 (revid:jonas@mysql.com-20091218101303-ga32mrnr15jsa606) (version source revid:jonas@mysql.com-20091218064304-ezreonykd9f4kelk) (merge vers: 5.1.41-ndb-7.0.11) (pib:15)
[18 Dec 2009 11:45] MC Brown
Already documented in 5.1.41