cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Corey Hulen (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-3307) Java JDBC driver fails with DELETE statements
Date Tue, 04 Oct 2011 17:45:34 GMT

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

Corey Hulen commented on CASSANDRA-3307:
----------------------------------------


The consistancy level error can be fixed by changing the regex in drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraPreparedStatement.java
on line #66 from 

private static final Pattern Delete = Pattern.compile("DELETE\\s+(.*)\\s+FROM\\s+\\w+\\s+WHERE
KEY(.*)", Pattern.CASE_INSENSITIVE);

to

private static final Pattern Delete = Pattern.compile("DELETE\\s+(.*)\\s+FROM\\s+\\w+.*\\s+WHERE
KEY(.*)", Pattern.CASE_INSENSITIVE);

Added the ".*" after FROM. Copied pattern from the UPDATE statement

Stack trace for the consistency error

java.sql.SQLSyntaxErrorException: line 1:57 no viable alternative at character '?'
	at org.apache.cassandra.cql.jdbc.CassandraStatement.doExecute(CassandraStatement.java:173)
	at org.apache.cassandra.cql.jdbc.CassandraStatement.executeUpdate(CassandraStatement.java:230)
	at org.apache.cassandra.cql.jdbc.CassandraPreparedStatement.executeUpdate(CassandraPreparedStatement.java:277)

                
> Java JDBC driver fails with DELETE statements
> ---------------------------------------------
>
>                 Key: CASSANDRA-3307
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3307
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Drivers
>            Reporter: Corey Hulen
>
> The following 2 statements are valid, but fail in the java jdbc driver.
> "DELETE FROM users WHERE KEY = 'user1'"  // missing column should be valid to delete
entire row
> "DELETE test FROM users USING CONSISTENCY QUORUM WHERE KEY = 'user1'" // Should be valid
to pass consistency level to a delete statment

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message