public inbox for [email protected]  
help / color / mirror / Atom feed
From: =?GBK?B?wfXXrw==?= <[email protected]>
To: [email protected]
Subject: =?GBK?Q?[PATCH]_Allow_catalogname_(database)_and_procname_=A3=A8no?= =?GBK?Q?_under_public_schema)__enumeration_with_SQLProcedures_?=
Date: Tue, 10 Oct 2023 13:09:01 +0800 (CST)
Message-ID: <[email protected]> (raw)

hello!




The attached patch fixed  SQLProcedures two bug:

1.  make enumeration of databases (catalogs in ODBC speak) work.

2.  make enumeration of procedurename (procname  in ODBC speak) work.







Step:

   1.  login postgres

   2.  create schem named  schem1 

   3.  set search_path TO schem1

   4.  create procedure named genre_insert_data

   5.  with odbc application(retcode =  SQLProcedures (hstmt, NULL, 0, NULL, 0, (SQLCHAR *)"genre_insert_data", strlen("genre_insert_data"));)to get the genre_insert_data(step 4)

   6.  the result is empty.

   
   7. After the patch is compiled using the attached patch, then run the odbc application(step 5), The result is shown below:
     






  

Attachments:

  [image/png] image.png (3.3K, 3-image.png)
  download | view image

  [image/png] image.png (6.7K, 4-image.png)
  download | view image

  [application/octet-stream] AllCatalogsProcname-SQLProcedures.patch (696B, 5-AllCatalogsProcname-SQLProcedures.patch)
  download | inline diff:
diff info.c info--bak.c
1936c1936
<       {
---
>       {
5485c5485
<       appendPQExpBufferStr(&proc_query, "select"  "(select current_catalog)" " as " "PROCEDURE_CAT" ", nspname as " "PROCEDURE_SCHEM" ","
---
>       appendPQExpBufferStr(&proc_query, "select ''::varchar as " "PROCEDURE_CAT" ", nspname as " "PROCEDURE_SCHEM" ","
5493,5495c5493
<
<         if (escSchemaName)
<               schema_appendPQExpBuffer1(&proc_query, " and nspname %s'%.*s'", op_string, escSchemaName, TABLE_IS_VALID(szProcName, cbProcName), conn);
---
>       schema_appendPQExpBuffer1(&proc_query, " and nspname %s'%.*s'", op_string, escSchemaName, TABLE_IS_VALID(szProcName, cbProcName), conn);


view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: =?GBK?Q?[PATCH]_Allow_catalogname_(database)_and_procname_=A3=A8no?= =?GBK?Q?_under_public_schema)__enumeration_with_SQLProcedures_?=
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox