You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Shawn Aucoin (JIRA)" <ji...@apache.org> on 2008/05/06 05:09:56 UTC
[jira] Updated: (DERBY-3664) Trailing white space in varchar field
is trimmed off.
[ https://issues.apache.org/jira/browse/DERBY-3664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shawn Aucoin updated DERBY-3664:
--------------------------------
Description:
When executing an insert statement with a varchar field containing trailing whitespace, the trailing whitespace is removed. This results in unique constraint issues. If index is not unique, select * from login where login = 'first_test' will return both records. Preceeding whitespace doesn't appear to be affected. I tested this from IJ and from java api. I included an example below
CREATE TABLE LOGIN
(
LOGIN_ID INT PRIMARY KEY,
LOGIN VARCHAR(60)
);
CREATE UNIQUE INDEX LOGIN_LOGIN_IDX
ON LOGIN (LOGIN DESC);
insert into login (LOGIN_ID, LOGIN) values (1, 'first_test');
insert into login (LOGIN_ID, LOGIN) values (2, 'first_test ');
Now, i fully admit that there is no logical reason for trailing whitespace, but it is client data that i am dealing with and I may not be able to get it changed. Thanks, derby is a sweet product!
was:
When executing an insert statement with a varchar field containing trailing whitespace, the trailing whitespace is removed. This results in unique constraint issues. If index is not unique, select * from login where login = 'first_test' will return both records. Preceeding whitespace doesn't appear to be affected. I tested this from IJ and from java api. I included an example below
CREATE TABLE LOGIN
(
LOGIN_ID INT PRIMARY KEY,
LOGIN VARCHAR(60),
);
CREATE UNIQUE INDEX LOGIN_LOGIN_IDX
ON LOGIN (LOGIN DESC);
insert into login (LOGIN_ID, LOGIN) values (1, 'first_test');
insert into login (LOGIN_ID, LOGIN) values (2, 'first_test ');
Now, i fully admit that there is no logical reason for trailing whitespace, but it is client data that i am dealing with and I may not be able to get it changed. Thanks, derby is a sweet product!
removed extra comma in table definition
> Trailing white space in varchar field is trimmed off.
> -----------------------------------------------------
>
> Key: DERBY-3664
> URL: https://issues.apache.org/jira/browse/DERBY-3664
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.3.1.4, 10.3.2.1, 10.4.1.3
> Environment: Win XP, Derby 10.4.1.3
> Reporter: Shawn Aucoin
>
> When executing an insert statement with a varchar field containing trailing whitespace, the trailing whitespace is removed. This results in unique constraint issues. If index is not unique, select * from login where login = 'first_test' will return both records. Preceeding whitespace doesn't appear to be affected. I tested this from IJ and from java api. I included an example below
> CREATE TABLE LOGIN
> (
> LOGIN_ID INT PRIMARY KEY,
> LOGIN VARCHAR(60)
> );
> CREATE UNIQUE INDEX LOGIN_LOGIN_IDX
> ON LOGIN (LOGIN DESC);
> insert into login (LOGIN_ID, LOGIN) values (1, 'first_test');
> insert into login (LOGIN_ID, LOGIN) values (2, 'first_test ');
> Now, i fully admit that there is no logical reason for trailing whitespace, but it is client data that i am dealing with and I may not be able to get it changed. Thanks, derby is a sweet product!
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.