Beispiel #1
0
        public static async ValueTask <ServerErrorMessage> Read(ClickHouseBinaryProtocolReader reader, bool async, CancellationToken cancellationToken)
        {
            var errorCode = await reader.ReadInt32(async, cancellationToken);

            var name = await reader.ReadString(async, cancellationToken);

            var errorMessage = await reader.ReadString(async, cancellationToken);

            var stackTrace = await reader.ReadString(async, cancellationToken);

            bool hasNested = await reader.ReadBool(async, cancellationToken);

            ClickHouseServerException exception;

            if (hasNested)
            {
                var nested = await Read(reader, async, cancellationToken);

                exception = new ClickHouseServerException(errorCode, name, errorMessage, stackTrace, nested.Exception);
            }
            else
            {
                exception = new ClickHouseServerException(errorCode, name, errorMessage, stackTrace);
            }

            return(new ServerErrorMessage(exception));
        }
        public static async ValueTask <ServerProfileInfoMessage> Read(ClickHouseBinaryProtocolReader reader, bool async, CancellationToken cancellationToken)
        {
            ulong rows = await reader.Read7BitUInt64(async, cancellationToken);

            ulong blocks = await reader.Read7BitUInt64(async, cancellationToken);

            ulong bytes = await reader.Read7BitUInt64(async, cancellationToken);

            bool limitApplied = await reader.ReadBool(async, cancellationToken);

            ulong rowsBeforeLimit = await reader.Read7BitUInt64(async, cancellationToken);

            bool calculatedRowsBeforeLimit = await reader.ReadBool(async, cancellationToken);

            return(new ServerProfileInfoMessage(rows, blocks, bytes, limitApplied, rowsBeforeLimit, calculatedRowsBeforeLimit));
        }