Bug 569 - asgning a number to a property mapped to a characater/varchar/character varying column leads to a strange result
: asgning a number to a property mapped to a characater/varchar/character varyi...
Status: RESOLVED WONTFIX
: Helma
HopObject Functionality
: 1.6.0
: All All
: P3 major
: ---
Assigned To:
:
:
:
  Show dependency treegraph
 
Reported: 2007-11-13 11:19 by
Modified: 2007-12-11 11:53 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2007-11-13 11:19:43
1.  What you were trying to do
assign a number value (1) to a property of a mapped HopObject (property mapped
to a column with datatype character varying) 
   2. The (buggy) result you got
1.0 is inserted
   3. The result you were expecting
no period etc. should be inserted when the number is an integer ("ganzzahl") ->
1
------- Comment #1 From 2007-12-11 11:53:15 -------
Rhino keeps numbers internally as floating point numbers, and only converts to
integers at runtime. The only way to fix this in Helma would be to invoke
org.mozilla.javascript.ScriptRuntime.toString() in
helma.objectmodel.db.NodeManager when setting a string column, which is pretty
much out of question.

I suggest you fix this by converting to string when assigning the property.
Marking as WONTFIX.