mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-2.2' into cassandra-3.0
This commit is contained in:
commit
fcc40e5886
|
|
@ -13,6 +13,7 @@
|
|||
* Add dropped_columns to the list of schema table so it gets handled
|
||||
properly (CASSANDRA-11050)
|
||||
Merged from 2.2:
|
||||
* cqlsh pg-style-strings broken if line ends with ';' (CASSANDRA-11123)
|
||||
* Always persist upsampled index summaries (CASSANDRA-10512)
|
||||
* (cqlsh) Fix inconsistent auto-complete (CASSANDRA-10733)
|
||||
* Make SELECT JSON and toJson() threadsafe (CASSANDRA-11048)
|
||||
|
|
|
|||
|
|
@ -1131,7 +1131,7 @@ class Shell(cmd.Cmd):
|
|||
"""
|
||||
|
||||
try:
|
||||
statements, in_batch = cqlruleset.cql_split_statements(statementtext)
|
||||
statements, endtoken_escaped = cqlruleset.cql_split_statements(statementtext)
|
||||
except pylexotron.LexingError, e:
|
||||
if self.show_line_nums:
|
||||
self.printerr('Invalid syntax at char %d' % (e.charnum,))
|
||||
|
|
@ -1147,7 +1147,7 @@ class Shell(cmd.Cmd):
|
|||
statements = statements[:-1]
|
||||
if not statements:
|
||||
return True
|
||||
if in_batch or statements[-1][-1][0] != 'endtoken':
|
||||
if endtoken_escaped or statements[-1][-1][0] != 'endtoken':
|
||||
self.set_continue_prompt()
|
||||
return
|
||||
for st in statements:
|
||||
|
|
|
|||
|
|
@ -142,6 +142,7 @@ class CqlParsingRuleSet(pylexotron.ParsingRuleSet):
|
|||
stmts = util.split_list(tokens, lambda t: t[0] == 'endtoken')
|
||||
output = []
|
||||
in_batch = False
|
||||
in_pg_string = len([st for st in tokens if len(st) > 0 and st[0] == 'unclosedPgString']) == 1
|
||||
for stmt in stmts:
|
||||
if in_batch:
|
||||
output[-1].extend(stmt)
|
||||
|
|
@ -152,7 +153,7 @@ class CqlParsingRuleSet(pylexotron.ParsingRuleSet):
|
|||
in_batch = False
|
||||
elif stmt[0][1].upper() == 'BEGIN':
|
||||
in_batch = True
|
||||
return output, in_batch
|
||||
return output, in_batch or in_pg_string
|
||||
|
||||
def cql_complete_single(self, text, partial, init_bindings={}, ignore_case=True,
|
||||
startsymbol='Start'):
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ def create_test_keyspace(cursor):
|
|||
|
||||
def split_cql_commands(source):
|
||||
ruleset = cql_rule_set()
|
||||
statements, in_batch = ruleset.cql_split_statements(source)
|
||||
if in_batch:
|
||||
statements, endtoken_escaped = ruleset.cql_split_statements(source)
|
||||
if endtoken_escaped:
|
||||
raise ValueError("CQL source ends unexpectedly")
|
||||
|
||||
return [ruleset.cql_extract_orig(toks, source) for toks in statements if toks]
|
||||
|
|
|
|||
Loading…
Reference in New Issue