Details
-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
None
-
None
Description
SourceForge Submitter: anajavi .
Platform: Linux, Solaris, WindowsXP
JBoss 3.2.6
DB: Sybase Adaptive Server Enterprise 12.5 (on Solaris)
JDK1.4.2_06
When cmp-field is left empty in CMPBean, JBoss
generates SQL for insert with empty string:
INSERT INTO user (login, password) VALUES ('TEST', '')
Passing '' as a value to varchar column in Sybase
causes it to store empty space. This behaviour is
documented in Sybase manual as follows:
"The empty string (" ") is treated as a single space.
In char, nchar and unichar not null columns, the result
is a column-length field of spaces."
This can be tried out with: select len('') which returns 1.
Sybase manual page for character datatypes:
http://sybooks.sybase.com/onlinebooks/group-as/asg1250e/refman/@Generic__BookTextView/3571;pt=1908#X
I think this is stupid from Sybase's side, but they
have made it a feature.