TMP: stashing tmp changes on test environment

This commit is contained in:
Vasily Nemkov 2019-10-11 11:12:45 +03:00
parent a6b20e8ca3
commit b6b080745b
2 changed files with 13 additions and 8 deletions

View File

@ -174,14 +174,16 @@ else:
def escape_string(s):
return s.encode(escape_string_codec).decode('utf-8')
# WITH toDateTime64(20191010163704, 3, 'UTC')
# TODO: use string.Template here to allow lines that do not contain type, like: SELECT CAST(toDateTime64(1234567890), 'DateTime64')
for func in functions:
for dt in datetime64_args:
dt32 = func.format(datetime='now()')
dt64 = func.format(datetime=dt)
f = "'values match:', ({dt32}) == ({dt64}), 'types match:', toTypeName({dt32}) == toTypeName({dt64})".format(dt32=dt32, dt64=dt64)
print("""SELECT 'SELECT {dt64}';""".format(dt64=escape_string(dt64))) # for debug only
print("""SELECT toTypeName({dt32}), {dt32};""".format(dt32=dt32)) # for debug only
print("""SELECT toTypeName({dt64}), {dt64};""".format(dt64=dt64)) # for debug only
print("""SELECT {f};""".format(f=f))
print("""SELECT '------------------------------------------';""") # for debug only
# dt64 = func.format(datetime=dt)
# f = "'values match:', ({dt32}) == ({dt64}), 'types match:', toTypeName({dt32}) == toTypeName({dt64})".format(dt32=dt32, dt64=dt64)
print("""SELECT 'SELECT {dt32}'""".format(dt32=escape_string(dt32))) # for debug only
print("""SELECT toTypeName(r), {dt32} as r""".format(dt32=dt32)) # for debug only
# print("""SELECT toTypeName(r), {dt64} as r""".format(dt64=dt64)) # for debug only
# print("""SELECT {f};""".format(f=f))
print("""SELECT '------------------------------------------'""") # for debug only

View File

@ -4,5 +4,8 @@
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. $CURDIR/../shell_config.sh
export CH_C_SETTINGS='--format_custom_field_delimiter=\ --format_custom_row_before_delimiter= --format_custom_row_between_delimiter= --format_custom_result_before_delimiter= --format_custom_result_after_delimiter='
# in order to check queries individually (does not stop on the first one that fails):
IFS=$'\n'; for I in $($CURDIR/00921_datetime64_compatibility.python) ; do "${CLICKHOUSE_CLIENT}" -nm -q "$I"; echo ; done # 2>&1 | tee datetime64_compat.log
IFS=$'\n'; for I in $($CURDIR/00921_datetime64_compatibility.python) ; do "${CLICKHOUSE_CLIENT}" -nm -q "$I" $CH_C_SETTINGS; echo ; done 2>&1 \
| tr "\n" "\t" \
| sed -Eu 's/-------+\t+/\n/g; s/Received exception from server \(version 19.16.1\):\s+//g; s/DB::Exception: Received from localhost:9000. //g; s/\s+$//g; '