Andrey Gura created IGNITE-5361:
-----------------------------------

             Summary: Query for string field represented as CHAR SQL type in 
underlying database doesn't retrieve entires that were loaded with 
CacheJdbcPojoStore
                 Key: IGNITE-5361
                 URL: https://issues.apache.org/jira/browse/IGNITE-5361
             Project: Ignite
          Issue Type: Bug
    Affects Versions: 1.7
            Reporter: Andrey Gura


Use case:

There is database where primary key has type {{CHAR(N)}} (not {{VARCHAR}}). In 
this case string that have length less than {{N}} will be spaces padded.

Data has loaded into Ignite cache using {{CacheJdbcPojoStore}}. As result 
string field contains trailing spaces. The following SQL query wont retrieve 
expected value in case when string parameter doesn't contain trailing spaces: 

{noformat}
select * from MyTable where id = 'some_value_without_trailing spaces'
{noformat}

Moreover, if {{readThrough}} is enabled, and {{cache.get()}} operation will be 
invoked, and string identifier in key contains the same value without trailing 
spaces the entry will be loaded from underlying database. As result cache will 
contain two values with differents keys (one of them with trailing spaces while 
other without trailing spaces).

Looks like usability bug.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to