[ 
https://issues.apache.org/jira/browse/IGNITE-5361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16031494#comment-16031494
 ] 

Alexander Paschenko commented on IGNITE-5361:
---------------------------------------------

I've done a bit of research, and it looks like we need to:

# allow setting additional SQL related metadata in {{QueryEntity}} (per field) 
- most likely it will be a new map, much like {{keyFields}}
# create tables inside Ignite with respect to that metadata
# enhance {{GridH2RowDescriptor}} interface to make it capable of providing 
additional data about expected field values to client code
# enhance our {{H2RowDescriptor#wrap}} and {{DmlStatementsProcessor#convert}} 
routines responsible for turning user given stuff to what H2 actually expects 
(essentially type conversions logic)

All of this will ultimately let us do correct index lookups on {{get}} as 
Andrey described above, and correct, previously loaded value will be returned 
as a result, instead of putting new gibberish into cache.

> 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