BUG #5969: ecpg can't see sqlca

Поиск
Список
Период
Сортировка
От Daniel Lyons
Тема BUG #5969: ecpg can't see sqlca
Дата
Msg-id 201104082247.p38MlWot030910@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #5969: ecpg can't see sqlca  (Michael Meskes <meskes@postgresql.org>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      5969
Logged by:          Daniel Lyons
Email address:      fusion@storytotell.org
PostgreSQL version: 9.0.3
Operating system:   FreeBSD 8.2-RELEASE
Description:        ecpg can't see sqlca
Details:

Under the current FreeBSD and the current PostgreSQL, ecpg-processed C
programs don't see the sqlca global variable. This wreaks havoc with error
handling. For example:

#include <stdlib.h>
#include <stdio.h>

EXEC SQL INCLUDE sqlca;

int main()
{
  /* stop on any error */
  EXEC SQL WHENEVER SQLERROR STOP;

  /* connect to a non-existent database */
  EXEC SQL CONNECT TO nonexistentdb USER nonexistentuser;

  /* if we get here, something is wrong. */
  printf("I'm still here, even though this database doesn't exist.\n");
  return 0;
}

Same program does the right thing on a Linux machine I have access to, so it
may be a platform issue.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Brendan Jurd
Дата:
Сообщение: Re: Failed assert ((data - start) == data_size) in heaptuple.c
Следующее
От: Michael Meskes
Дата:
Сообщение: Re: BUG #5969: ecpg can't see sqlca