[eml-dev] [Bug 2737] Exception when attributeName contains SQL keywords
bugzilla-daemon at ecoinformatics.org
bugzilla-daemon at ecoinformatics.org
Fri Jan 27 13:38:36 PST 2012
http://bugzilla.ecoinformatics.org/show_bug.cgi?id=2737
--- Comment #3 from Duane Costa <dcosta at lternet.edu> 2012-01-27 13:38:36 PST ---
Needed to rework the original bug fix because it did not work well with the
logic for handling non-unique attribute names. Thanks to Gastil for catching
this! (Read on for details.)
This has been fixed with update r2223.
---
On January 25, 2012, mgastil-buhl wrote:
The DML already had in it a method mangledName() which appended _Prime to
attributeNames as many times as needed to make them unique within a table. (Of
course it is bad practice to use non-unique column names but such exist.) The
wrapping in double quotes needs to happen after the mangledName() method.
For example, knb-lter-mcr.31.23 returned this error (excerpt)
...
"adcp_wave_measurment" FLOAT,
"adcp_wave_measurment"_Prime FLOAT,
"adcp_wave_measurment"_Prime_Prime FLOAT,
"adcp_wave_measurment"_Prime_Prime_Prime FLOAT,
"adcp_wave_measurment"_Prime_Prime_Prime_Prime FLOAT,
"Temp_01m_HeightAboveBottom" FLOAT,
...
in its attempted sql table create statement.
Line 158 of DatabaseAdapter?.java is where mangledName() is called.
Line 154 is where getLegalDbFieldName() is called.
I can see the logic of how replacing any of a set of odd characters with
underscore could make attributeNames suddenly non-unique. So, if mangle is done
after legal, then at least stuff the _Prime inside the quotes, even if it means
stripping the quotes, appending _Prime, and re-quoting.
I'll be uniquifying knb-lter-mcr.31.23 but there may be others out there.
--
Configure bugmail: http://bugzilla.ecoinformatics.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
More information about the Eml-dev
mailing list