| From: | 刘庄 <lzwp0521(at)163(dot)com> | 
|---|---|
| To: | "Dave Cramer" <davecramer(at)postgres(dot)rocks> | 
| Cc: | pgsql-odbc(at)postgresql(dot)org | 
| Subject: | Re:Re: [PATCH] Allow catalogname (database) and procname (no under public schema) enumeration with SQLProcedures | 
| Date: | 2023-10-11 12:16:18 | 
| Message-ID: | 76e935dd.6634.18b1eaa9716.Coremail.lzwp0521@163.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-odbc | 
hello Dave Cramer:
 I'm sorry that my access to github is very unstable.
 I will send you the source code change file(info-patch.c) and added test cases first(catalogfunctions-test.c, sampletables.sql).
 I will submit a PR postgresql-interfaces/psqlodbc (github.com)  when my network is stable.
This patch has been verified in my local environment   can make enumeration of databases and procedurename work. The verification results are as follows:
 OS vesion:                CentOS7 3.10.0-957.el7.x86_64
 PG server version:    PostgreSQL 14.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
 psqlODBC version:    psqlodbc-15.00.0000
 unixODBC version:    unixODBC 2.3.1
 The regression (with added test cases) result:
                  With no path: is empty.
 
                 With the attached patch: SQLProcedures work well
             
Regards,
Liu Zhuang
At 2023-10-10 21:04:31, "Dave Cramer" <davecramer(at)postgres(dot)rocks> wrote:
Hello,
Thanks for the patch, however it does not apply cleanly using patch or git apply
Can you provide a PR postgresql-interfaces/psqlodbc (github.com) and add tests please ?
Dave Cramer
www.postgres.rocks
On Tue, 10 Oct 2023 at 01:09, 刘庄 <lzwp0521(at)163(dot)com> wrote:
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:
     
| Attachment | Content-Type | Size | 
|---|---|---|
| info-patch.c | text/x-c | 182.1 KB | 
| catalogfunctions-test.c | text/x-c | 10.4 KB | 
| sampletables.sql | application/x-sql | 2.9 KB | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Victor K. | 2023-10-12 10:23:01 | ODBC error | 
| Previous Message | Dave Cramer | 2023-10-10 13:04:31 | Re: [PATCH] Allow catalogname (database) and procname (no under public schema) enumeration with SQLProcedures |