Unix Technical Forum

Re: Patch for Bug No: 1254

This is a discussion on Re: Patch for Bug No: 1254 within the pgsql Interfaces odbc forums, part of the PostgreSQL category; --> Thanks Anoop, patch applied, bug closed. Regards, Dave. > -----Original Message----- > From: pgsql-odbc-owner@postgresql.org > [mailto gsql-odbc-owner@postgresql.org] On Behalf ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces odbc

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-16-2008, 02:09 AM
Dave Page
 
Posts: n/a
Default Re: Patch for Bug No: 1254

Thanks Anoop, patch applied, bug closed.

Regards, Dave.

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailtogsql-odbc-owner@postgresql.org] On Behalf Of Anoop Kumar
> Sent: 21 April 2005 10:09
> To: pgsql-odbc@postgresql.org
> Subject: [ODBC] Patch for Bug No: 1254
>
> I am sending a patch for the following bug:
>
> http://gborg.postgresql.org/project/...pdate.php?1254
>
> The patch was tested on postgresql (ver. 8.0.1), psqlodbc (ver.
> 08.00.0101), Windows XP (client side) and Windows XP with SP2 (Server
> end)/Fedora Core 3 (Server end).
>
>
> Regards
>
> Anoop
>
> --------------------------------------------------------------
> ----------
> -----------------------------------------
> Index: info.c
> ================================================== =================
> RCS file: /usr/local/cvsroot/psqlodbc/info.c,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 info.c
> --- info.c 21 Apr 2005 05:27:13 -0000 1.1.1.1
> +++ info.c 21 Apr 2005 05:29:28 -0000
> @@ -1217,6 +1217,7 @@
> table_types[MAX_INFO_STRING];
> char show_system_tables,
> show_regular_tables,
> + remarks[254], //Added for holding Table
> Description, if any.
> show_views;
> char regular_table,
> view,
> @@ -1254,9 +1255,18 @@
> if (conn->schema_support)
> {
> /* view is represented by its relkind since 7.1 */
> - strcpy(tables_query, "select relname, nspname, relkind"
> - " from pg_catalog.pg_class c, pg_catalog.pg_namespace
> n");
> - strcat(tables_query, " where relkind in ('r', 'v')");
> +
> + /* Previously it was:
> + * strcpy(tables_query, "select relname, nspname,
> relkind"
> + * from pg_catalog.pg_class c, pg_catalog.pg_namespace
> n");
> + * strcat(tables_query, " where relkind in ('r', 'v')");
> + * Modified query to retrieve the description of the
> table:
> + */
> +
> + strcpy(tables_query,"SELECT DISTINCT tt.relname,
> tt.nspname, tt.relkind, COALESCE(d.description,'') from");
> + strcat(tables_query," (SELECT c.oid as oid, c.tableoid as
> tableoid, n.nspname as nspname, c.relname, c.relkind");
> + strcat(tables_query," FROM pg_catalog.pg_class c LEFT
> JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace");
> + strcat(tables_query," WHERE c.relkind IN ('r', 'v') ");
> }
> else if (PG_VERSION_GE(conn, 7.1))
> {
> @@ -1367,7 +1377,16 @@
> strcat(tables_query, " and relname !~ '^xinv[0-9]+'");
>
> if (conn->schema_support)
> - strcat(tables_query, " and n.oid = relnamespace order by
> nspname, relname");
> + {
> + /* Previously it was:
> + * strcat(tables_query, " and n.oid = relnamespace order
> by nspname, relname");
> + * Modified query to retrieve the description of the
> table:
> + */
> +
> + strcat(tables_query," ) AS tt LEFT JOIN
> pg_catalog.pg_description d ");
> + strcat(tables_query," ON (tt.oid = d.objoid AND
> tt.tableoid = d.classoid AND d.objsubid = 0)");
> + strcat(tables_query," order by nspname, relname");
> + }
> else
> strcat(tables_query, " and usesysid = relowner order by
> relname");
>
> @@ -1427,7 +1446,15 @@
> SC_error_copy(stmt, tbl_stmt);
> goto cleanup;
> }
> -
> + /* Binds the description column to variable 'remarks' */
> + result = PGAPI_BindCol(htbl_stmt, 4, internal_asis_type,
> + remarks, 254,
> NULL);
> + if ((result != SQL_SUCCESS) && (result !=
> SQL_SUCCESS_WITH_INFO))
> + {
> + SC_error_copy(stmt, tbl_stmt);
> + goto cleanup;
> + }
> +
> if (res = QR_Constructor(), !res)
> {
> SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Couldn't
> allocate memory for PGAPI_Tables result.");
> @@ -1525,7 +1552,7 @@
> set_tuplefield_null(&row->tuple[1]);
> set_tuplefield_string(&row->tuple[2],
> table_name);
> set_tuplefield_string(&row->tuple[3], systable ?
> "SYSTEM TABLE" : (view ? "VIEW" : "TABLE"));
> - set_tuplefield_string(&row->tuple[4], "");
> + set_tuplefield_string(&row->tuple[4], remarks);
> /*** set_tuplefield_string(&row->tuple[4],
> "TABLE"); ***/
>
> QR_add_tuple(res, row);
>
> --------------------------------------------------------------
> ----------
> ---------------------------------------------
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:43 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com