Feature Requests item #2075085, was opened at 2008-08-26 07:57
Message generated for change (Settings changed) made by mr-meltdown
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482471&aid=2075085&group_id=56967
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: Qian Qiao (drizzlerain)
Assigned to: Niels Nes (nielsnes)
>Summary: SQL: support native (fixed size) CHAR type
Initial Comment:
OS:RedHat Linux AS 4
GCC:3.4.6
1.setup:
CREATE TABLE T850 (
T850KEY INT NOT NULL UNIQUE,
T850C CHAR (11),
T850VC VARCHAR (10));
2.insert:
INSERT INTO T850 VALUES (10, '1234567890', '1234567890');
INSERT INTO T850 VALUES (5, '12345 ', '12345');
3.result:
SELECT COUNT(*) FROM T850 WHERE T850C = T850VC;
+--------+
| count_ |
+========+
| 1 |
+--------+
4.question:
count should be 2.
----------------------------------------------------------------------
Comment By: Niels Nes (nielsnes)
Date: 2008-08-26 14:01
Message:
Logged In: YES
user_id=43556
Originator: NO
Test added to
src/tests/BugTracker-2008/Tests/varchar_char_semantics.SF-2075085.sql
sql defines CHAR(x) as a fixed length type with implicit collation 'pad
space'
which means its filled up till the x length with spaces.
MonetDB doesn't follow this definition, it puts char into varchar and
takes
the varchar specification for it too. So no space padding.
This is done for 2 main reasons
1) we don't support 'collations'
2) we currently don't have a native fixed with character data type.
(so we move this bug to a feature request!)
----------------------------------------------------------------------
Comment By: Stefan Manegold (stmane)
Date: 2008-08-26 10:10
Message:
Logged In: YES
user_id=572415
Originator: NO
See also
[ 2075268 ] About CHAR
http://sourceforge.net/tracker/index.php?func=detail&aid=2075268&group_id=56967&atid=482468
----------------------------------------------------------------------
Comment By: Fabian (mr-meltdown)
Date: 2008-08-26 09:12
Message:
Logged In: YES
user_id=963970
Originator: NO
I think the output is correct. Trailing spaces /are/ included in the
string if it is of type CHAR. If you want to compare to VARCHAR, use LTRIM
or something.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482471&aid=2075085&group_id=56967
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs