Skip site navigation (1) Skip section navigation (2)

Bug #737: PQescapeBytea parameter #3 size_t *to_length

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #737: PQescapeBytea parameter #3 size_t *to_length
Date: 2002-08-13 14:44:24
Message-ID: (view raw or whole thread)
Lists: pgsql-bugs
Christoph Haller (ch(at)rodos(dot)fzk(dot)de) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
PQescapeBytea parameter #3 size_t *to_length

Long Description

I am referring to 

PostgreSQL 7.2.1 Documentation
Chapter 1. libpq - C Library
1.3. Command Execution Functions
1.3.3. Escaping binary strings for inclusion in SQL queries

I found the line 
"The result string length does not include the terminating zero byte of the result."
is not right. 
The result string length does indeed include the terminating zero byte. 

When I do 

    binarystr = (char *)
            PQescapeBytea((unsigned char *)"\01\02",2,(size_t *)&binarylen);
    printf(" binarylen = %d \n", binarylen) ;

I'll get 
 binarylen = 3 

I also dropped a DocNote, but unfortunately there is no way to 
scroll on longer notes. Maybe you like to fix this, too. 

Regards, Christoph 

Sample Code

No file was uploaded with this report


pgsql-bugs by date

Next:From: pgsql-bugsDate: 2002-08-13 23:04:41
Subject: Bug #738: "order by" returning different results in 7.2 and 7.21
Previous:From: Joe ConwayDate: 2002-08-12 22:59:17
Subject: Re: Bug #736: Old bug is back!! Drop database bug

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group