You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Ben DeMott (Jira)" <ji...@apache.org> on 2021/03/09 17:45:00 UTC
[jira] [Updated] (PHOENIX-6407) phoenidb for Python silently
ignores placeholders < placeholder arguments
[ https://issues.apache.org/jira/browse/PHOENIX-6407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ben DeMott updated PHOENIX-6407:
--------------------------------
Description:
The `phoenixdb` driver for Python does not alert the user to excess arguments that are not represented by placeholders.
*Example 1*, fewer arguments than placeholders raise exception (works as expected)
{code:java}
cursor.execute("UPSERT INTO users VALUES (?, ?, ?)", (123, 'John Doe')) {code}
{noformat}
phoenixdb.errors.ProgrammingError: ('Number of columns upserting must match number of values. Numbers of columns: 3. Number of values: 4 tableName=USERS', 1020, '42Y60', None){noformat}
*Example 2,* additional arguments than placeholders is silently ignored
{code:java}
cursor.execute("UPSERT INTO users VALUES (?, ?)", (123, 'John Doe', 'admin')){code}
The program should generate a similar error to the one above, that the columns need to match the replacements.
was:
The `phoenixdb` driver for Python does not alert the user to excess arguments that are not represented by placeholders.
*Example 1*, fewer arguments than placeholders raise exception (works as expected)
{code:java}
cursor.execute("UPSERT INTO users VALUES (?, ?, ?)", (123, 'John Doe')) {code}
{noformat}
phoenixdb.errors.ProgrammingError: ('Number of columns upserting must match number of values. Numbers of columns: 3. Number of values: 4 tableName=USERS', 1020, '42Y60', None){noformat}
*Example 2,* additional arguments than placeholders is silently ignored
{code:java}
cursor.execute("UPSERT INTO users VALUES (?, ?)", (123, 'John Doe', 'admin')){code}
**The program should generate a similar error as to the one above that the columns need to match the replacements.
> phoenidb for Python silently ignores placeholders < placeholder arguments
> -------------------------------------------------------------------------
>
> Key: PHOENIX-6407
> URL: https://issues.apache.org/jira/browse/PHOENIX-6407
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 5.1.0
> Reporter: Ben DeMott
> Priority: Minor
>
> The `phoenixdb` driver for Python does not alert the user to excess arguments that are not represented by placeholders.
> *Example 1*, fewer arguments than placeholders raise exception (works as expected)
>
> {code:java}
> cursor.execute("UPSERT INTO users VALUES (?, ?, ?)", (123, 'John Doe')) {code}
> {noformat}
> phoenixdb.errors.ProgrammingError: ('Number of columns upserting must match number of values. Numbers of columns: 3. Number of values: 4 tableName=USERS', 1020, '42Y60', None){noformat}
> *Example 2,* additional arguments than placeholders is silently ignored
> {code:java}
> cursor.execute("UPSERT INTO users VALUES (?, ?)", (123, 'John Doe', 'admin')){code}
> The program should generate a similar error to the one above, that the columns need to match the replacements.
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)