You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Alice Chen (JIRA)" <ji...@apache.org> on 2015/07/22 20:14:19 UTC

[jira] [Created] (TRAFODION-131) LP Bug: 1244042 - Trailing spaces in character string literals have no effect

Alice Chen created TRAFODION-131:
------------------------------------

             Summary: LP Bug: 1244042 - Trailing spaces in character string literals have no effect
                 Key: TRAFODION-131
                 URL: https://issues.apache.org/jira/browse/TRAFODION-131
             Project: Apache Trafodion
          Issue Type: Bug
          Components: sql-general
            Reporter: Weishiun Tsai
            Assignee: Anoop Sharma


Trailing spaces in character string literals have no effect.  The two literals ‘abcd ‘ (1 space) and ‘abcd  ‘ (2 spaces) are treated as the same, as shown in the following examples.  Seaquest may also have the same behavior, but this is a different behavior compared to Phoenix.  The strange thing is that the “Considerations for Character String literals” section in our SQL reference manual, it actually says: “Leading and trailing spaces within a string literal are significant.”


>>set schema seabase.phoenix;

--- SQL operation complete.
>>create table t (s1 char(10) not null not droppable primary key, s2 char(10));

--- SQL operation complete.
>>upsert into t values ('abcd ', 'c');

--- 1 row(s) inserted.
>>upsert into t values ('abcd  ', 'd');

--- 1 row(s) inserted.
>>select * from t;

S1          S2
----------  ----------

abcd        d

--- 1 row(s) selected.
>>insert into t values ('abcd   ', 'd');

*** ERROR[8102] The operation is prevented by a unique constraint.

--- 0 row(s) inserted.

>>select * from t where s1='abcd        ';

S1          S2
----------  ----------

abcd        d

--- 1 row(s) selected.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)