mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-4.1' into cassandra-5.0
This commit is contained in:
commit
9e0ccf0f95
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<project basedir="." name="apache-cassandra-cqlsh-tasks"
|
||||
xmlns:if="ant:if">
|
||||
<target name="set-cqlsh-version">
|
||||
<echo file="pylib/cqlshlib/serverversion.py" append="false">version = "${base.version}"${line.separator}</echo>
|
||||
</target>
|
||||
</project>
|
||||
|
|
@ -186,6 +186,7 @@ Merged from 4.0:
|
|||
* Partial compaction can resurrect deleted data (CASSANDRA-18507)
|
||||
Merged from 3.11:
|
||||
Merged from 3.0:
|
||||
* CQLSH emits a warning when the server version doesn't match (CASSANDRA-18745)
|
||||
* Fix missing speculative retries in tablestats (CASSANDRA-18767)
|
||||
* Fix Requires for Java for RPM package (CASSANDRA-18751)
|
||||
* Fix CQLSH online help topic link (CASSANDRA-17534)
|
||||
|
|
|
|||
|
|
@ -456,7 +456,7 @@
|
|||
</target>
|
||||
|
||||
<!-- create properties file with C version -->
|
||||
<target name="_createVersionPropFile" depends="_get-git-sha">
|
||||
<target name="_createVersionPropFile" depends="_get-git-sha,set-cqlsh-version">
|
||||
<taskdef name="propertyfile" classname="org.apache.tools.ant.taskdefs.optional.PropertyFile"/>
|
||||
<mkdir dir="${version.properties.dir}"/>
|
||||
<propertyfile file="${version.properties.dir}/version.properties">
|
||||
|
|
@ -2073,4 +2073,5 @@
|
|||
<import file="${build.helpers.dir}/build-owasp.xml"/>
|
||||
<import file="${build.helpers.dir}/build-git.xml"/>
|
||||
<import file="${build.helpers.dir}/build-checkstyle.xml"/>
|
||||
<import file="${build.helpers.dir}/build-cqlsh.xml"/>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -80,9 +80,8 @@ from cqlshlib.formatting import (DEFAULT_DATE_FORMAT, DEFAULT_NANOTIME_FORMAT,
|
|||
DEFAULT_TIMESTAMP_FORMAT, CqlType, DateTimeFormat,
|
||||
format_by_type)
|
||||
from cqlshlib.tracing import print_trace, print_trace_session
|
||||
from cqlshlib.util import get_file_encoding_bomsize
|
||||
from cqlshlib.util import is_file_secure
|
||||
|
||||
from cqlshlib.util import get_file_encoding_bomsize, is_file_secure
|
||||
from cqlshlib.serverversion import version as build_version
|
||||
|
||||
DEFAULT_HOST = '127.0.0.1'
|
||||
DEFAULT_PORT = 9042
|
||||
|
|
@ -431,6 +430,8 @@ class Shell(cmd.Cmd):
|
|||
if stdin is None:
|
||||
stdin = sys.stdin
|
||||
|
||||
self.check_build_versions()
|
||||
|
||||
if tty:
|
||||
self.reset_prompt()
|
||||
self.report_connection()
|
||||
|
|
@ -447,6 +448,14 @@ class Shell(cmd.Cmd):
|
|||
self.single_statement = single_statement
|
||||
self.is_subshell = is_subshell
|
||||
|
||||
def check_build_versions(self):
|
||||
baseversion = self.connection_versions['build']
|
||||
extra = baseversion.rfind('-')
|
||||
if extra:
|
||||
baseversion = baseversion[0:extra]
|
||||
if baseversion != build_version:
|
||||
print("WARNING: cqlsh was built against {}, but this server is {}. All features may not work!".format(baseversion, build_version))
|
||||
|
||||
@property
|
||||
def batch_mode(self):
|
||||
return not self.tty
|
||||
|
|
|
|||
Loading…
Reference in New Issue