1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-22 12:22:45 +03:00

*** empty log message ***

This commit is contained in:
Michael Meskes
2000-04-05 09:05:40 +00:00
parent 5f39ba8142
commit 9fb20f105f
9 changed files with 64 additions and 41 deletions

View File

@@ -7,9 +7,10 @@
#include <sqlca.h>
void
ECPGraise(int line, int code, const char *str)
ECPGraise(int line, int code, char *str)
{
sqlca.sqlcode = code;
switch (code)
{
case ECPG_NOT_FOUND:
@@ -117,9 +118,13 @@ ECPGraise(int line, int code, const char *str)
"Variable is not a character type in line %d.", line);
break;
case ECPG_PGSQL:
case ECPG_PGSQL:
/* strip trailing newline */
if (str[strlen(str)-1] == '\n')
str[strlen(str)-1] = '\0';
snprintf(sqlca.sqlerrm.sqlerrmc,sizeof(sqlca.sqlerrm.sqlerrmc),
"Postgres error '%s' in line %d.", str, line);
"'%s' in line %d.", str, line);
break;
case ECPG_TRANS:
@@ -134,12 +139,12 @@ ECPGraise(int line, int code, const char *str)
default:
snprintf(sqlca.sqlerrm.sqlerrmc,sizeof(sqlca.sqlerrm.sqlerrmc),
"SQL error #%d in line %d.",code, line);
"SQL error #%d in line %d.", code, line);
break;
}
sqlca.sqlerrm.sqlerrml = strlen(sqlca.sqlerrm.sqlerrmc);
/* free all memory we have allocated for the user */
free_auto_mem();
}

View File

@@ -479,7 +479,7 @@ ECPGexecute(struct statement * stmt)
strncpy(mallocedval + strlen(mallocedval) - 1, "}'", sizeof("}'"));
}
else
sprintf(mallocedval, "%c,", (*((char *) var->value)) ? 't' : 'f');
sprintf(mallocedval, "%c", (*((char *) var->value)) ? 't' : 'f');
tobeinserted = mallocedval;
break;
@@ -541,7 +541,7 @@ ECPGexecute(struct statement * stmt)
default:
/* Not implemented yet */
ECPGraise(stmt->lineno, ECPG_UNSUPPORTED, ECPGtype_name(var->type));
ECPGraise(stmt->lineno, ECPG_UNSUPPORTED, (char *)ECPGtype_name(var->type));
return false;
break;
}
@@ -859,7 +859,7 @@ ECPGdo(int lineno, const char *connection_name, char *query, ...)
*
* Copyright (c) 2000, Christof Petig <christof.petig@wtal.de>
*
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.3 2000/04/03 19:34:25 meskes Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.4 2000/04/05 09:05:28 meskes Exp $
*/
PGconn *ECPG_internal_get_connection(char *name);
@@ -1024,6 +1024,6 @@ bool ECPGdo_descriptor(int line,const char *connection,
}
}
ECPGraise(line, ECPG_UNKNOWN_DESCRIPTOR, descriptor);
ECPGraise(line, ECPG_UNKNOWN_DESCRIPTOR, (char *) descriptor);
return false;
}