Bug #23048 Classes Property/Properties could clash with external libraries
Submitted: 6 Oct 2006 12:31 Modified: 31 Aug 2010 6:00
Reporter: Geert Vanderkelen Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Cluster: NDB API Severity:S4 (Feature request)
Version:mysql-5.1 OS:Any (*)
Assigned to: Jonas Oreland CPU Architecture:Any
Tags: ndbapi

[6 Oct 2006 12:31] Geert Vanderkelen
Description:
The struct Property and the class Properties found in the NDB source could give problems with 3rd party libraries. The names are to generic.

When linking NDB API when Property is already defined, some compilers might give following error:

/usr/bin/ld: multiple definitions of symbol Property::~Property()
/usr/local/mysql/lib/libndbclient.a(Properties.o) definition of Property::~Property()in section (__TEXT,__text)
./libTPProperty.a(TPProperty.o) definition of Property::~Property()in section (__TEXT,__text)

This happens for example on MacOS 10.4 using gcc 4.0.1 and on HPUX using aCC.

How to repeat:
Attached is a test case with Makefile and some code to reproduce. It is made for HPUX but the Makefile can be modified to use g++.

Suggested fix:
Two ways: define a namespace for NDB or rename the Property/Properties classes. The latter is probably easiest and best. The namespace solution would be nice of course..

Attached is a patch against 5.1 bk tree renaming struct Property and class Properties. It also renames the NdbPropertiesTypes.

Rather big change.
[6 Oct 2006 12:32] Geert Vanderkelen
Test case

Attachment: propertyClash.tar (application/x-tar, text), 10.00 KiB.

[6 Oct 2006 12:33] Geert Vanderkelen
Patch renameing Property/Properties/.. to NdbProperty/..

Attachment: ndbproperty.patch.gz (application/x-tar, text), 21.37 KiB.

[8 Oct 2008 17:13] Geert Vanderkelen
Uploaded a fresh patch against MySQL Cluster 6.3bzr: bug23048_mc63.patch.gz
[8 Oct 2008 17:19] Geert Vanderkelen
Patch for MySQL Cluster 6.3 bzr (2008-10-08)

Attachment: bug23048_mc63.patch.gz (application/x-gzip, text), 28.44 KiB.

[12 Oct 2009 10:41] Jonas Oreland
issue is closed
[31 Aug 2010 6:00] Jonas Oreland
won't fix...
until someone bitches again atleast