[mapguide-commits] r8695 - sandbox/adsk/3.0m/Common/Stylization
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Mon Jul 6 00:39:56 PDT 2015
Author: hubu
Date: 2015-07-06 00:39:56 -0700 (Mon, 06 Jul 2015)
New Revision: 8695
Modified:
sandbox/adsk/3.0m/Common/Stylization/KeyEncode.cpp
Log:
#2562, Linux: Select feature doesn't work when type of key column is string.
Select feature doesn't work again when connecting to Oracle. The type of key column is NUMBER(10). And the FDO data type of the column is double. The odd thing is that it works well with my local build version, but don't work in AIMS official build. After investigation, I found the issue is in KeyEncode::WriteDouble(). The WriteDouble function of KeyEncode is like below:
void KeyEncode::WriteDouble(double d)
{
FdoInt64 swap = *(FdoInt64*)&d;
WriteInt64(swap);
}
The code FdoInt64 swap = *(FdoInt64*)&d; is optimized by gcc. It works after I added the volatile keyword.
Modified: sandbox/adsk/3.0m/Common/Stylization/KeyEncode.cpp
===================================================================
--- sandbox/adsk/3.0m/Common/Stylization/KeyEncode.cpp 2015-07-02 06:10:03 UTC (rev 8694)
+++ sandbox/adsk/3.0m/Common/Stylization/KeyEncode.cpp 2015-07-06 07:39:56 UTC (rev 8695)
@@ -143,7 +143,7 @@
void KeyEncode::WriteDouble(double d)
{
- FdoInt64 swap = *(FdoInt64*)&d;
+ FdoInt64 swap = *(FdoInt64 volatile*)&d;
WriteInt64(swap);
}
More information about the mapguide-commits
mailing list