@@ -8,15 +8,27 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
88function run_test_with_layout()
99{
1010 local layout=$1
11+
12+ # NOTE: dictionaries will be updated according to server TZ, not session, so prohibit it's randomization
13+ $CLICKHOUSE_CLIENT --session_timezone ' ' -q "
14+ CREATE TABLE table_for_update_field_dictionary
15+ (
16+ key UInt64,
17+ value String,
18+ last_insert_time DateTime
19+ )
20+ ENGINE = TinyLog
21+ "
22+
1123 for custom_query in " " " custom" ; do
1224 if [[ $custom_query == custom ]]; then
1325 dictionary_name=" dict_${layout} _custom"
14- dictionary_source=" query \$ doc\$ SELECT key, value, last_insert_time FROM $CLICKHOUSE_DATABASE .table_for_update_field_dictionary WHERE {condition};\$ doc\$ update_field 'last_insert_time' update_lag 30 "
26+ dictionary_source=" query \$ doc\$ SELECT key, value, last_insert_time FROM $CLICKHOUSE_DATABASE .table_for_update_field_dictionary WHERE {condition};\$ doc\$ update_field 'last_insert_time' update_lag 0 "
1527
1628 echo " $layout /custom"
1729 else
1830 dictionary_name=" dict_${layout} "
19- dictionary_source=" table 'table_for_update_field_dictionary' update_field 'last_insert_time' update_lag 30 "
31+ dictionary_source=" table 'table_for_update_field_dictionary' update_field 'last_insert_time' update_lag 0 "
2032
2133 echo " $layout "
2234 fi
@@ -43,15 +55,15 @@ function run_test_with_layout()
4355 sleep .1;
4456 done
4557
46- $CLICKHOUSE_CLIENT --query " INSERT INTO table_for_update_field_dictionary VALUES (2, 'Second', now());"
58+ $CLICKHOUSE_CLIENT --query " INSERT INTO table_for_update_field_dictionary VALUES (2, 'Second', now()+5 );"
4759
4860 while true
4961 do
5062 $CLICKHOUSE_CLIENT --query " SELECT key, value FROM $dictionary_name ORDER BY key ASC" | grep -A10 -B10 ' Second' && break ;
5163 sleep .1;
5264 done
5365
54- $CLICKHOUSE_CLIENT --query " INSERT INTO table_for_update_field_dictionary VALUES (2, 'SecondUpdated', now()), (3, 'Third', now())"
66+ $CLICKHOUSE_CLIENT --query " INSERT INTO table_for_update_field_dictionary VALUES (2, 'SecondUpdated', now()+10 ), (3, 'Third', now()+10 )"
5567
5668 while true
5769 do
0 commit comments