Skip to content

Commit

Permalink
[FIX MCASSANDRA-33] Trailing EOL is treated as a CQL statement, and f…
Browse files Browse the repository at this point in the history
…ails to execute

Submitted by Peter Janes.

git-svn-id: file:///home/tiste/MOJOHAUS-TO-GIT/SVN-MOJO-WIP/trunk/mojo/cassandra-maven-plugin@19362 52ab4f32-60fc-0310-b215-8acea882cd1b
  • Loading branch information
stephenc committed Feb 6, 2014
1 parent 558e1be commit c304b3d
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.io.FileReader;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.CharacterCodingException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
Expand Down Expand Up @@ -132,11 +133,15 @@ public void execute() throws MojoExecutionException, MojoFailureException {
{
for (String op : StringUtils.split(cqlStatement, ";"))
{
cqlOps.add(doExec(op));
if ( StringUtils.isNotBlank(op) ) {
cqlOps.add(doExec(op));
}
}
} else
{
cqlOps.add(doExec(cqlStatement));
if ( StringUtils.isNotBlank(cqlStatement) ) {
cqlOps.add(doExec(cqlStatement));
}
}
printResults(cqlOps);
}
Expand Down Expand Up @@ -219,6 +224,11 @@ void executeOperation(Client client) throws ThriftApiExecutionException
rowIter = result.getRowsIterator();
} catch (Exception e)
{
try {
getLog().debug(ByteBufferUtil.string(statementBuf));
} catch(CharacterCodingException cce) {
getLog().debug(cce);
}
throw new ThriftApiExecutionException(e);
}
}
Expand Down

0 comments on commit c304b3d

Please sign in to comment.