From 0b49b1776e5c6aa20bc2845e5b48dafe84169d46 Mon Sep 17 00:00:00 2001 From: Mike Adamson Date: Wed, 13 Jul 2016 10:39:59 +0100 Subject: [PATCH] cqlsh: Fix handling of $$-escaped strings patch by Mike Adamson; reviewed by Alex Petrov for CASSANDRA-12189 --- CHANGES.txt | 1 + pylib/cqlshlib/cql3handling.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index e4ef64ceea..ef8014115d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 3.9 + * cqlsh: Fix handling of $$-escaped strings (CASSANDRA-12189) * Fix SSL JMX requiring truststore containing server cert (CASSANDRA-12109) Merged from 3.0: * NullPointerExpception when reading/compacting table (CASSANDRA-11988) diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py index 70e12d4199..c01e441444 100644 --- a/pylib/cqlshlib/cql3handling.py +++ b/pylib/cqlshlib/cql3handling.py @@ -142,7 +142,7 @@ JUNK ::= /([ \t\r\f\v]+|(--|[/][/])[^\n\r]*([\n\r]|$)|[/][*].*?[*][/])/ ; ::= | ; ::= /'([^']|'')*'/ ; - ::= /\$\$(?:(?!\$\$)|[^$])*\$\$/; + ::= /\$\$(?:(?!\$\$).)*\$\$/; ::= /"([^"]|"")*"/ ; ::= /-?[0-9]+\.[0-9]+/ ; ::= /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/ ; @@ -161,7 +161,7 @@ JUNK ::= /([ \t\r\f\v]+|(--|[/][/])[^\n\r]*([\n\r]|$)|[/][*].*?[*][/])/ ; | "false" ; -::= /\$\$(?:(?!\$\$)|[^$])*/ ; +::= /\$\$(?:(?!\$\$).)*/ ; ::= /'([^']|'')*/ ; ::= /"([^"]|"")*/ ; ::= /[/][*].*$/ ;