Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kApR3-00079Q-Qd for pgsql-odbc@arkaria.postgresql.org; Wed, 26 Aug 2020 07:01:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kApR1-0007PS-Uj for pgsql-odbc@arkaria.postgresql.org; Wed, 26 Aug 2020 07:01:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kApR1-0007PE-P4 for pgsql-odbc@lists.postgresql.org; Wed, 26 Aug 2020 07:01:27 +0000 Received: from webclient5.webclient5.de ([136.243.32.184]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kApQx-0005gN-T1 for pgsql-odbc@lists.postgresql.org; Wed, 26 Aug 2020 07:01:26 +0000 Received: from [10.1.2.92] (unknown [94.101.37.79]) by webclient5.webclient5.de (Postfix) with ESMTPSA id F182C5968777 for ; Wed, 26 Aug 2020 09:01:20 +0200 (CEST) Subject: Re: Report BUG: The column size for BIT VARYING(5) type is incorrect To: pgsql-odbc@lists.postgresql.org References: From: Clemens Ladisch Message-ID: <5b781d8a-1384-32be-1fbf-4e9c184e0467@ladisch.de> Date: Wed, 26 Aug 2020 09:01:20 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.101.5 at webclient5 X-Virus-Status: Clean List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk James (Ke) Wang wrote: > create table j_varbit2 (vbt1 bit varying (5)) > > *ColumnName = "vbt1", *NameLengthPtr = 4, *DataTypePtr = SQL_WVARCHAR=-9, *ColumnSizePtr = 1, *DecimalDigits = 0, *NullablePtr = SQL_NULLABLE=1 > > Why is the *ColumnSizePtr = 1 instead of *ColumnSizePtr = 5 since the column is created with bit varying (5) in the test case? The ODBC specification does not define the data type BIT VARYING, so the ODBC driver tries to represent it as a blob or text. And five bits fit into one byte. Regards, Clemens