hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesse Santangelo (JIRA)" <>
Subject [jira] [Created] (HIVE-17264) BaseSemanticAnalyzer.escapeSQLString escapes \0 unsafely
Date Mon, 07 Aug 2017 20:56:00 GMT
Jesse Santangelo created HIVE-17264:

             Summary: BaseSemanticAnalyzer.escapeSQLString escapes \0 unsafely
                 Key: HIVE-17264
             Project: Hive
          Issue Type: Bug
          Components: Query Planning
            Reporter: Jesse Santangelo
            Priority: Minor

Currently escapeSQLString() converts the null character to \0. If there are numerical values
after the null character, calling unescapeSQLString() can treat the resulting value as an
octal literal.

unescapeSQLString converts \u0000 to the null character. Calling escapeSQLString() on that
resulting string currently gives
A third call of unescapeSQLString() will then see \020 and convert it to 0x10.

This is an issue for the Hbase connector where key values are processed twice (I'm unfamiliar
with the hive codebase so I don't know why) and so the connector gets the wrong key value
if it's formatted like the example.

In my version I've changed escapeSQLString to replace the null character with '\u0000' instead
of '\0' and that seems to have fixed the issue, but I don't know if that might break anything

This message was sent by Atlassian JIRA

View raw message