Closed GoogleCodeExporter closed 8 years ago
CHAR is implemented as a workaround for existing (old) applications, and it
works well for this use case. Changing the implementation would break those
applications.
I suggest to use VARCHAR instead.
Original comment by thomas.t...@gmail.com
on 17 Jan 2013 at 8:09
Um, one of your biggest users (CDO from Eclipse which ships natively H2)
specifically uses a CHAR(1) for their EChar datatype. Are you suggesting that
an entire EMF datatype not be used? I tried to force this in EMF/CDO and it
would not let me.
To me it seems like a simple fix to ensure that you have at least 1 char in the
string returned. Otherwise, I will need to change to a different database that
has the proper support for CHAR(1).
Original comment by rbraithw...@gmail.com
on 17 Jan 2013 at 8:50
Is there a issue logged with EMF/CDO? If yes could you add a link?
I would prefer if this is changed in EMF/CDO.
Original comment by thomas.t...@gmail.com
on 12 Feb 2013 at 5:59
I created an EMF bug the same day. They are doing a work around and it has
already been implemented.
I do not understand your reluctance to fix this in H2. A single space is
completely valid to have and having EMF need to recognize an empty string to
really be a single space is hacky and can become problematic. I have looked at
the offending code. All you need to do is not strip all spaces if there is
only a single space.
Original comment by rbraithw...@gmail.com
on 13 Feb 2013 at 2:47
Hi,
I don't want to use that as an excuse really, but MySQL also strips the space,
so that:
drop table test;
create table test(id int, name char(1));
insert into test values(1, ' ');
select length(name) from test;
in MySQL returns 0. See also http://sqlfiddle.com/
For MS SQL Server, select len(name) from test also returns 0, however it seems
the space is sometimes not stripped.
And for the following case, even PostgreSQL strips all spaces, for all rows:
create table test(id int, name char(10));
insert into test values(1, 'test ');
insert into test values(2, ' ');
insert into test values(3, ' ');
So let's say behavior is a bit weird with the CHAR data type.
Original comment by thomas.t...@gmail.com
on 13 Feb 2013 at 6:17
Original issue reported on code.google.com by
rbraithw...@gmail.com
on 27 Dec 2012 at 8:22