Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3819afa

Browse files
author
Michael Meskes
committed
Added patch by Dave Cramer for array handling in ecpglib.
1 parente2605c8 commit3819afa

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,3 +1714,11 @@ Mon Nov 3 15:43:19 CET 2003
17141714
- Set pgtypes library to 1.0.0
17151715
- Set compat library to 1.0.0
17161716

1717+
Wed Dec 3 09:45:21 CET 2003
1718+
1719+
- Added patch for array handling by Dave Cramer
1720+
- Set ecpg version to 3.1.0
1721+
- Set ecpg library to 4.1.0
1722+
- Set pgtypes library to 1.1.0
1723+
- Set compat library to 1.1.0
1724+

‎src/interfaces/ecpg/ecpglib/execute.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.29 2003/11/29 19:52:08 pgsql Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.30 2003/12/03 08:49:17 meskes Exp $ */
22

33
/*
44
* The aim is to get a simpler inteface to the database routines.
@@ -314,16 +314,21 @@ ECPGis_type_an_array(int type, const struct statement * stmt, const struct varia
314314
sprintf(array_query,"select typlen from pg_type where oid=%d and typelem<>0",type);
315315
query=PQexec(stmt->connection->connection,array_query);
316316
ECPGfree(array_query);
317-
if (PQresultStatus(query)==PGRES_TUPLES_OK)
317+
if (PQresultStatus(query)==PGRES_TUPLES_OK)
318318
{
319-
isarray= (atol((char*)PQgetvalue(query,0,0))==-1) ?ECPG_ARRAY_ARRAY :ECPG_ARRAY_VECTOR;
320-
if (ECPGDynamicType(type)==SQL3_CHARACTER||
321-
ECPGDynamicType(type)==SQL3_CHARACTER_VARYING)
322-
{
323-
/*
324-
* arrays of character strings are not yet implemented
325-
*/
319+
if (PQntuples(query)==0 )
326320
isarray=ECPG_ARRAY_NONE;
321+
else
322+
{
323+
isarray= (atol((char*)PQgetvalue(query,0,0))==-1) ?ECPG_ARRAY_ARRAY :ECPG_ARRAY_VECTOR;
324+
if (ECPGDynamicType(type)==SQL3_CHARACTER||
325+
ECPGDynamicType(type)==SQL3_CHARACTER_VARYING)
326+
{
327+
/*
328+
* arrays of character strings are not yet implemented
329+
*/
330+
isarray=ECPG_ARRAY_NONE;
331+
}
327332
}
328333
}
329334
PQclear(query);
@@ -353,7 +358,7 @@ ECPGstore_result(const PGresult *results, int act_field,
353358
{
354359
ECPGlog("ECPGexecute line %d: Incorrect number of matches: %d don't fit into array of %d\n",
355360
stmt->lineno,ntuples,var->arrsize);
356-
ECPGraise(stmt->lineno,ECPG_TOO_MANY_MATCHES,ECPG_SQLSTATE_CARDINALITY_VIOLATION,NULL);
361+
ECPGraise(stmt->lineno,INFORMIX_MODE(stmt->compat)?ECPG_INFORMIX_SUBSELECT_NOT_ONE:ECPG_TOO_MANY_MATCHES,ECPG_SQLSTATE_CARDINALITY_VIOLATION,NULL);
357362
return false;
358363
}
359364
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp