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

ASF GitHub Bot commented on PHOENIX-5924:
-----------------------------------------

gjacoby126 commented on pull request #795:
URL: https://github.com/apache/phoenix/pull/795#issuecomment-744717349


   JIRA is resolved, closing


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


> RVC Offset does not handle variable length fields exclusive scan boundary 
> correctly
> -----------------------------------------------------------------------------------
>
>                 Key: PHOENIX-5924
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5924
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.0.0, 4.15.0, 4.14.3
>            Reporter: Daniel Wong
>            Assignee: Daniel Wong
>            Priority: Major
>             Fix For: 5.1.0, 4.16.0
>
>         Attachments: PHOENIX-5924-4.x.patch, PHOENIX-5924-master.patch
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The way exclusive boundary was handled by incrementing the key for variable 
> length fields is incorrect in the scan boundary.
>  
> In the following case we incrementing incorrectly from 0x490049 -> 0x490050 
> ('1','1' -> '1','2')
> We should increment from 0x490049 -> 0x49004900 ('1','1' -> '1','1'\x00) 
> @Test
> public void testScenario() throws Exception \{
>     String TEST_DDL = "CREATE TABLE IF NOT EXISTS TEST_SCHEMA (\n"
>             + "    ORGANIZATION_ID VARCHAR(15), \n" + "    TEST_ID 
> VARCHAR(15), \n"
>             + "    CREATED_DATE DATE, \n" + "    LAST_UPDATE DATE\n"
>             + "    CONSTRAINT TEST_SCHEMA_PK PRIMARY KEY (ORGANIZATION_ID, 
> TEST_ID) \n" + ")";
>     try (Statement statement = conn.createStatement()) {
>         statement.execute(TEST_DDL);
>     }
>     //setup
>     List<String> upserts = new ArrayList<>();
>     upserts.add("UPSERT INTO TEST_SCHEMA(ORGANIZATION_ID,TEST_ID) VALUES 
> ('1','1')");
>     upserts.add("UPSERT INTO TEST_SCHEMA(ORGANIZATION_ID,TEST_ID) VALUES 
> ('1','10')");
>     upserts.add("UPSERT INTO TEST_SCHEMA(ORGANIZATION_ID,TEST_ID) VALUES 
> ('2','2')");
>     for(String sql : upserts) \{
>         try (Statement statement = conn.createStatement()) {
>             statement.execute(sql);
>         }
>     }
>     conn.commit();
>     String query1 = "SELECT * FROM TEST_SCHEMA";
>     String query2 = "SELECT * FROM TEST_SCHEMA OFFSET 
> (ORGANIZATION_ID,TEST_ID) = ('1','1')";
>     try (Statement statement = conn.createStatement() ; ResultSet rs1 = 
> statement.executeQuery(query1) ) \{
>         TestUtil.printResultSet(rs1);
>     }
>     try (Statement statement = conn.createStatement() ; ResultSet rs2 = 
> statement.executeQuery(query2) ) \{
>         TestUtil.printResultSet(rs2);
>     }
> }
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to