Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a7b1ff6

Browse files
author
Michael Meskes
committed
*** empty log message ***
1 parent 6995c5f commit a7b1ff6

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,5 +902,9 @@ Wed Apr 5 07:54:56 CEST 2000
902902
- Removed duplicate ',' in execute.c.
903903
- Changed error message for backend errors so it fits into sqlca.
904904
- Fixed array handling.
905+
906+
Wed Apr 5 17:35:53 CEST 2000
907+
908+
- Fixed handling of bool variables.
905909
- Set library version to 3.1.0.
906910
- Set ecpg version to 2.7.0.

src/interfaces/ecpg/lib/execute.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ ECPGexecute(struct statement * stmt)
479479
strncpy(mallocedval + strlen(mallocedval) - 1, "}'", sizeof("}'"));
480480
}
481481
else
482-
sprintf(mallocedval, "%c", (*((char *) var->value)) ? 't' : 'f');
482+
sprintf(mallocedval, "'%c'", (*((char *) var->value)) ? 't' : 'f');
483483

484484
tobeinserted = mallocedval;
485485
break;
@@ -859,7 +859,7 @@ ECPGdo(int lineno, const char *connection_name, char *query, ...)
859859
*
860860
* Copyright (c) 2000, Christof Petig <christof.petig@wtal.de>
861861
*
862-
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.4 2000/04/05 09:05:28 meskes Exp $
862+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.5 2000/04/05 15:51:25 meskes Exp $
863863
*/
864864

865865
PGconn *ECPG_internal_get_connection(char *name);

src/interfaces/ecpg/test/test4.pgc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ EXEC SQL BEGIN DECLARE SECTION;
1414
char text[10] = "klmnopqrst";
1515
char *t = "uvwxyz1234";
1616
double f;
17+
bool b = true;
1718
EXEC SQL END DECLARE SECTION;
1819
FILE *dbgs;
1920

@@ -28,24 +29,24 @@ EXEC SQL END DECLARE SECTION;
2829

2930
EXEC SQL BEGIN WORK;
3031

31-
EXEC SQL CREATE TABLE test (f float, i int, a int[10], text char(10));
32+
EXEC SQL CREATE TABLE test (f float, i int, a int[10], text char(10), b bool);
3233

33-
EXEC SQL INSERT INTO test(f,i,a,text) VALUES(404.90,1,'{0,1,2,3,4,5,6,7,8,9}','abcdefghij');
34+
EXEC SQL INSERT INTO test(f,i,a,text,b) VALUES(404.90,1,'{0,1,2,3,4,5,6,7,8,9}','abcdefghij', 'f');
3435

35-
EXEC SQL INSERT INTO test(f,i,a,text) VALUES(140787.0,2,:a,:text);
36+
EXEC SQL INSERT INTO test(f,i,a,text,b) VALUES(140787.0,2,:a,:text,'t');
3637

37-
EXEC SQL INSERT INTO test(f,i,a,text) VALUES(14.07,:did,:a,:t);
38+
EXEC SQL INSERT INTO test(f,i,a,text,b) VALUES(14.07,:did,:a,:t,:b);
3839

3940
EXEC SQL COMMIT;
4041

4142
EXEC SQL BEGIN WORK;
4243

43-
EXEC SQL SELECT f,text
44-
INTO :f,:text
44+
EXEC SQL SELECT f,text,b
45+
INTO :f,:text,:b
4546
FROM test
4647
WHERE i = 1;
4748

48-
printf("Found f=%f text=%10.10s\n", f, text);
49+
printf("Found f=%f text=%10.10s b=%d\n", f, text, b);
4950

5051
f=14.07;
5152
EXEC SQL SELECT a,text

0 commit comments

Comments
 (0)