From: SourceForge.net <no...@so...> - 2005-04-25 22:03:37
|
Bugs item #1174360, was opened at 2005-03-31 23:26 Message generated for change (Settings changed) made by dimitr You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109028&aid=1174360&group_id=9028 Category: UDF/Built-In Functions >Group: As Designed/Pitfall >Status: Closed >Resolution: Rejected Priority: 5 Submitted By: Mark Ericksen (mericksen) Assigned to: Nobody/Anonymous (nobody) Summary: rtrim function returns data plus padding (not trimmed) Initial Comment: RTRIM function returns the data plus spaces. This isn't "trimmed". The following sql statement demonstrates the problem... SELECT RTRIM("1 ") FROM RDB$FIELDS If you use some query interface that lets you inspect the returned data, you will find that the value that is returned is the "1" plus 79 spaces (for Firebird 1.5.1) or 254 spaces (for Firebird 1.5.2). Now for the wierd part... there is a workaround that also demonstrates that it really is a bug and not proper behavior. Workaround: SELECT RTRIM("1 ")||'' FROM RDB$FIELDS Concatenate an empty string to the end and alternate processing takes place, it now returns just the "1" as desired. This has been verified using IBX (IBConsole) and ADO->ODBC. The results are the same. -Mark E. ---------------------------------------------------------------------- Comment By: Milan Babuskov (mbabuskov) Date: 2005-04-01 02:41 Message: Logged In: YES user_id=577247 I usually fix it by casting it to varchar(255) select cast(rtrim("1 ") as varchar(255)) from rdb$fields My guess that this is as-designed. rtrim seems to return char(255) and unlike varchar it is padded with spaces ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109028&aid=1174360&group_id=9028 |