Add test.

This commit is contained in:
Vitaly Baranov 2020-08-07 23:11:05 +03:00
parent 2e6ba2a05d
commit bc5e94a09b
2 changed files with 25 additions and 2 deletions

View File

@ -6,6 +6,7 @@ custom_a UInt64_5
custom_b Int64_-177
custom_c Float64_98.11
custom_d \'abc def\'
changed String
\N Nullable(Nothing)
50000 UInt16
@ -14,7 +15,16 @@ custom_a \'changed\'
custom_b NULL
custom_c UInt64_50000
custom_d Float64_1.11
0 UInt8
404 UInt16
-0.333 Float64
custom_e Float64_-0.333
404 UInt16
custom_e UInt64_404
word String
custom_f \'word\'
0
test String
custom_compound.identifier.v1 \'test\'

View File

@ -8,6 +8,7 @@ SELECT getSetting('custom_c') as v, toTypeName(v);
SELECT getSetting('custom_d') as v, toTypeName(v);
SELECT name, value FROM system.settings WHERE name LIKE 'custom_%' ORDER BY name;
SELECT '';
SET custom_a = 'changed';
SET custom_b = NULL;
SET custom_c = 50000;
@ -18,12 +19,24 @@ SELECT getSetting('custom_c') as v, toTypeName(v);
SELECT getSetting('custom_d') as v, toTypeName(v);
SELECT name, value FROM system.settings WHERE name LIKE 'custom_%' ORDER BY name;
SELECT '';
SELECT getSetting('custom_e') as v, toTypeName(v); -- { serverError 115 } -- Setting not found.
SET custom_e = 0;
SET custom_e = 404;
SELECT getSetting('custom_e') as v, toTypeName(v);
SET invalid_custom = 8; -- { serverError 115 } -- Setting is neither a builtin nor started with one of the registered prefixes for user-defined settings.
SELECT '';
SELECT getSetting('custom_e') as v, toTypeName(v) SETTINGS custom_e = -0.333;
SELECT name, value FROM system.settings WHERE name = 'custom_e' SETTINGS custom_e = -0.333;
SELECT getSetting('custom_e') as v, toTypeName(v);
SELECT name, value FROM system.settings WHERE name = 'custom_e';
SELECT getSetting('custom_f') as v, toTypeName(v) SETTINGS custom_f = 'word';
SELECT name, value FROM system.settings WHERE name = 'custom_f' SETTINGS custom_f = 'word';
SELECT getSetting('custom_f') as v, toTypeName(v); -- { serverError 115 } -- Setting not found.
SELECT COUNT() FROM system.settings WHERE name = 'custom_f';
SELECT '';
SET custom_compound.identifier.v1 = 'test';
SELECT getSetting('custom_compound.identifier.v1') as v, toTypeName(v);