mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Allow null values in postgresql protocol
This commit is contained in:
parent
5dda97bef1
commit
ccf5455624
@ -378,6 +378,9 @@ function run_tests
|
||||
01852_jit_if
|
||||
01865_jit_comparison_constant_result
|
||||
01871_merge_tree_compile_expressions
|
||||
|
||||
# needs psql
|
||||
01889_postgresql_protocol_null_fields
|
||||
)
|
||||
|
||||
time clickhouse-test --hung-check -j 8 --order=random --use-skip-list \
|
||||
|
@ -724,8 +724,9 @@ public:
|
||||
Int32 size() const override
|
||||
{
|
||||
Int32 sz = 4 + 2; // size of message + number of fields
|
||||
/// If values is NULL, field size is -1 and data not added.
|
||||
for (const std::shared_ptr<ISerializable> & field : row)
|
||||
sz += 4 + field->size();
|
||||
sz += 4 + (field->size() > 0 ? field->size() : 0);
|
||||
return sz;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,5 @@
|
||||
NULL
|
||||
------
|
||||
|
||||
(1 row)
|
||||
|
7
tests/queries/0_stateless/01889_postgresql_protocol_null_fields.sh
Executable file
7
tests/queries/0_stateless/01889_postgresql_protocol_null_fields.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CUR_DIR"/../shell_config.sh
|
||||
|
||||
psql --host localhost --port ${CLICKHOUSE_PORT_POSTGRESQL} default -c "SELECT NULL;"
|
Loading…
Reference in New Issue
Block a user