Обсуждение: Fixed issue "Error Message is displayed when the Package is Clicked"

Поиск
Список
Период
Сортировка

Fixed issue "Error Message is displayed when the Package is Clicked"

От
Akshay Joshi
Дата:
Hi Dave 

I have fixed one issue "Error Message is displayed when the Package is Clicked". I have performed the following on enterprisedb database

create or replace package pkgFoo is
        procedure foo(
                arg1 IN varchar default 'Nothing',
                arg2 IN integer default 100
        );
end pkgFoo;
 
create or replace package body pkgFoo is
        procedure foo(
                arg1 IN varchar default 'Nothing',
                arg2 IN integer default 100
        ) is
        begin
                dbms_output.put_line(arg1);
                dbms_output.put_line(arg2);
        end;
end pkgFoo;  

Now click on pkgFoo, we will get the error message.It only happens the first time. 

Attached is the patch file, please review it. If it looks good then please commit it.
I have also faced linking error in xrcDialog.cpp on the latest pgadmin3 code on Windows, after running "embed-xrc" it has been fixed.   

--
Akshay Joshi
Senior Software Engineer 
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
Phone: +91 20-3058-9522
Mobile: +91 976-788-8246

Вложения

Re: Fixed issue "Error Message is displayed when the Package is Clicked"

От
Dave Page
Дата:
Hi

On Thu, Mar 15, 2012 at 2:59 PM, Akshay Joshi
<akshay.joshi@enterprisedb.com> wrote:
> Hi Dave
>
> I have fixed one issue "Error Message is displayed when the Package is
> Clicked". I have performed the following on enterprisedb database
>
> create or replace package pkgFoo is
>         procedure foo(
>                 arg1 IN varchar default 'Nothing',
>                 arg2 IN integer default 100
>         );
> end pkgFoo;
>
> create or replace package body pkgFoo is
>         procedure foo(
>                 arg1 IN varchar default 'Nothing',
>                 arg2 IN integer default 100
>         ) is
>         begin
>                 dbms_output.put_line(arg1);
>                 dbms_output.put_line(arg2);
>         end;
> end pkgFoo;
>
> Now click on pkgFoo, we will get the error message.It only happens the first
> time.

I cannot reproduce the error, using GIT Master with PPAS 9.0 on CentOS 5.

> Attached is the patch file, please review it. If it looks good then please
> commit it.

The patch is wrong. The restriction is supposed to be " = 'void'" for
procedures, and " != 'void'" for functions, as it already is.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Fixed issue "Error Message is displayed when the Package is Clicked"

От
Akshay Joshi
Дата:
Hi

On Mon, Mar 19, 2012 at 7:29 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Thu, Mar 15, 2012 at 2:59 PM, Akshay Joshi
<akshay.joshi@enterprisedb.com> wrote:
> Hi Dave
>
> I have fixed one issue "Error Message is displayed when the Package is
> Clicked". I have performed the following on enterprisedb database
>
> create or replace package pkgFoo is
>         procedure foo(
>                 arg1 IN varchar default 'Nothing',
>                 arg2 IN integer default 100
>         );
> end pkgFoo;
>
> create or replace package body pkgFoo is
>         procedure foo(
>                 arg1 IN varchar default 'Nothing',
>                 arg2 IN integer default 100
>         ) is
>         begin
>                 dbms_output.put_line(arg1);
>                 dbms_output.put_line(arg2);
>         end;
> end pkgFoo;
>
> Now click on pkgFoo, we will get the error message.It only happens the first
> time.

I cannot reproduce the error, using GIT Master with PPAS 9.0 on CentOS 5.

  I am able to reproduce this every first time after launching pgAdmin using GIT Master with PPAS9.1 on Windows 7. Attached is the screen shot. 

> Attached is the patch file, please review it. If it looks good then please
> commit it.

The patch is wrong. The restriction is supposed to be " = 'void'" for
procedures, and " != 'void'" for functions, as it already is.

  OK. I am not much aware of that code, but we have to provide some other fix for the mentioned issue.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



--
Akshay Joshi
Senior Software Engineer 
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
Phone: +91 20-3058-9522
Mobile: +91 976-788-8246

Вложения

Re: Fixed issue "Error Message is displayed when the Package is Clicked"

От
Dave Page
Дата:
On Mon, Mar 19, 2012 at 2:35 PM, Akshay Joshi
<akshay.joshi@enterprisedb.com> wrote:
> Hi
>
> On Mon, Mar 19, 2012 at 7:29 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> Hi
>>
>> On Thu, Mar 15, 2012 at 2:59 PM, Akshay Joshi
>> <akshay.joshi@enterprisedb.com> wrote:
>> > Hi Dave
>> >
>> > I have fixed one issue "Error Message is displayed when the Package is
>> > Clicked". I have performed the following on enterprisedb database
>> >
>> > create or replace package pkgFoo is
>> >         procedure foo(
>> >                 arg1 IN varchar default 'Nothing',
>> >                 arg2 IN integer default 100
>> >         );
>> > end pkgFoo;
>> >
>> > create or replace package body pkgFoo is
>> >         procedure foo(
>> >                 arg1 IN varchar default 'Nothing',
>> >                 arg2 IN integer default 100
>> >         ) is
>> >         begin
>> >                 dbms_output.put_line(arg1);
>> >                 dbms_output.put_line(arg2);
>> >         end;
>> > end pkgFoo;
>> >
>> > Now click on pkgFoo, we will get the error message.It only happens the
>> > first
>> > time.
>>
>> I cannot reproduce the error, using GIT Master with PPAS 9.0 on CentOS 5.
>
>
>   I am able to reproduce this every first time after launching pgAdmin using
> GIT Master with PPAS9.1 on Windows 7. Attached is the screen shot.
>>
>>
>> > Attached is the patch file, please review it. If it looks good then
>> > please
>> > commit it.
>>
>> The patch is wrong. The restriction is supposed to be " = 'void'" for
>> procedures, and " != 'void'" for functions, as it already is.
>
>
>   OK. I am not much aware of that code, but we have to provide some other
> fix for the mentioned issue.

Hmm, that looks like something changed in 9.1 that needs handling
differently. Can you work out exactly what the query that causes the
error is? We may need to check with one of the server guys.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Fixed issue "Error Message is displayed when the Package is Clicked"

От
Akshay Joshi
Дата:


On Mon, Mar 19, 2012 at 8:12 PM, Dave Page <dpage@pgadmin.org> wrote:
On Mon, Mar 19, 2012 at 2:35 PM, Akshay Joshi
<akshay.joshi@enterprisedb.com> wrote:
> Hi
>
> On Mon, Mar 19, 2012 at 7:29 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> Hi
>>
>> On Thu, Mar 15, 2012 at 2:59 PM, Akshay Joshi
>> <akshay.joshi@enterprisedb.com> wrote:
>> > Hi Dave
>> >
>> > I have fixed one issue "Error Message is displayed when the Package is
>> > Clicked". I have performed the following on enterprisedb database
>> >
>> > create or replace package pkgFoo is
>> >         procedure foo(
>> >                 arg1 IN varchar default 'Nothing',
>> >                 arg2 IN integer default 100
>> >         );
>> > end pkgFoo;
>> >
>> > create or replace package body pkgFoo is
>> >         procedure foo(
>> >                 arg1 IN varchar default 'Nothing',
>> >                 arg2 IN integer default 100
>> >         ) is
>> >         begin
>> >                 dbms_output.put_line(arg1);
>> >                 dbms_output.put_line(arg2);
>> >         end;
>> > end pkgFoo;
>> >
>> > Now click on pkgFoo, we will get the error message.It only happens the
>> > first
>> > time.
>>
>> I cannot reproduce the error, using GIT Master with PPAS 9.0 on CentOS 5.
>
>
>   I am able to reproduce this every first time after launching pgAdmin using
> GIT Master with PPAS9.1 on Windows 7. Attached is the screen shot.
>>
>>
>> > Attached is the patch file, please review it. If it looks good then
>> > please
>> > commit it.
>>
>> The patch is wrong. The restriction is supposed to be " = 'void'" for
>> procedures, and " != 'void'" for functions, as it already is.
>
>
>   OK. I am not much aware of that code, but we have to provide some other
> fix for the mentioned issue.

Hmm, that looks like something changed in 9.1 that needs handling
differently. Can you work out exactly what the query that causes the
error is? We may need to check with one of the server guys.

  I am able to reproduce the same issue with PPAS 9.0. Below is the query for PPAS 9.0 and 9.1 which causes the error 

  PPAS 9.0 :- SELECT pg_get_expr('{CONST :consttype 1043 :consttypmod -1 :constcollid 100 :constlen -1 :constbyval false :constisnull false :location 283 :constvalue 11 [ 44 0 0 0 78 111 116 104 105 110 103 ]} {CONST :consttype 23 :consttypmod -1 :constcollid 0 :constlen 4 :constbyval true :constisnull false :location 334 :constvalue 4 [ 100 0 0 0 ]}', 'pg_catalog.pg_class'::regclass)
  
  PPAS 9.1 :-  SELECT pg_get_expr('{CONST :consttype 1043 :consttypmod -1 :constcollid 100 :constlen -1 :constbyval false :constisnull false :location 290 :constvalue 11 [ 44 0 0 0 78 111 116 104 105 110 103 ]} {CONST :consttype 23 :consttypmod -1 :constcollid 0 :constlen 4 :constbyval true :constisnull false :location 342 :constvalue 4 [ 100 0 0 0 ]}', 'pg_catalog.pg_class'::regclass)


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



--
Akshay Joshi
Senior Software Engineer 
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
Phone: +91 20-3058-9522
Mobile: +91 976-788-8246

Re: Fixed issue "Error Message is displayed when the Package is Clicked"

От
Ashesh Vashi
Дата:
Reason for the error:

REL-9_1_STABLE branch (PostgreSQL repository):

commit 303696c3b47e6719e983e93da5896ddc4a2e0dbb
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date:   Fri Sep 3 01:34:55 2010 +0000

    Install a data-type-based solution for protecting pg_get_expr().
    
    Since the code underlying pg_get_expr() is not secure against malformed
    input, and can't practically be made so, we need to prevent miscreants
    from feeding arbitrary data to it.  We can do this securely by declaring
    pg_get_expr() to take a new datatype "pg_node_tree" and declaring the
    system catalog columns that hold nodeToString output to be of that type.
    There is no way at SQL level to create a non-null value of type pg_node_tree.
    Since the backend-internal operations that fill those catalog columns
    operate below the SQL level, they are oblivious to the datatype relabeling
    and don't need any changes.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA:
Enterprise PostgreSQL Company


http://www.linkedin.com/in/asheshvashi


On Tue, Mar 20, 2012 at 12:32 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:


On Mon, Mar 19, 2012 at 8:12 PM, Dave Page <dpage@pgadmin.org> wrote:
On Mon, Mar 19, 2012 at 2:35 PM, Akshay Joshi
<akshay.joshi@enterprisedb.com> wrote:
> Hi
>
> On Mon, Mar 19, 2012 at 7:29 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> Hi
>>
>> On Thu, Mar 15, 2012 at 2:59 PM, Akshay Joshi
>> <akshay.joshi@enterprisedb.com> wrote:
>> > Hi Dave
>> >
>> > I have fixed one issue "Error Message is displayed when the Package is
>> > Clicked". I have performed the following on enterprisedb database
>> >
>> > create or replace package pkgFoo is
>> >         procedure foo(
>> >                 arg1 IN varchar default 'Nothing',
>> >                 arg2 IN integer default 100
>> >         );
>> > end pkgFoo;
>> >
>> > create or replace package body pkgFoo is
>> >         procedure foo(
>> >                 arg1 IN varchar default 'Nothing',
>> >                 arg2 IN integer default 100
>> >         ) is
>> >         begin
>> >                 dbms_output.put_line(arg1);
>> >                 dbms_output.put_line(arg2);
>> >         end;
>> > end pkgFoo;
>> >
>> > Now click on pkgFoo, we will get the error message.It only happens the
>> > first
>> > time.
>>
>> I cannot reproduce the error, using GIT Master with PPAS 9.0 on CentOS 5.
>
>
>   I am able to reproduce this every first time after launching pgAdmin using
> GIT Master with PPAS9.1 on Windows 7. Attached is the screen shot.
>>
>>
>> > Attached is the patch file, please review it. If it looks good then
>> > please
>> > commit it.
>>
>> The patch is wrong. The restriction is supposed to be " = 'void'" for
>> procedures, and " != 'void'" for functions, as it already is.
>
>
>   OK. I am not much aware of that code, but we have to provide some other
> fix for the mentioned issue.

Hmm, that looks like something changed in 9.1 that needs handling
differently. Can you work out exactly what the query that causes the
error is? We may need to check with one of the server guys.

  I am able to reproduce the same issue with PPAS 9.0. Below is the query for PPAS 9.0 and 9.1 which causes the error 

  PPAS 9.0 :- SELECT pg_get_expr('{CONST :consttype 1043 :consttypmod -1 :constcollid 100 :constlen -1 :constbyval false :constisnull false :location 283 :constvalue 11 [ 44 0 0 0 78 111 116 104 105 110 103 ]} {CONST :consttype 23 :consttypmod -1 :constcollid 0 :constlen 4 :constbyval true :constisnull false :location 334 :constvalue 4 [ 100 0 0 0 ]}', 'pg_catalog.pg_class'::regclass)
  
  PPAS 9.1 :-  SELECT pg_get_expr('{CONST :consttype 1043 :consttypmod -1 :constcollid 100 :constlen -1 :constbyval false :constisnull false :location 290 :constvalue 11 [ 44 0 0 0 78 111 116 104 105 110 103 ]} {CONST :consttype 23 :consttypmod -1 :constcollid 0 :constlen 4 :constbyval true :constisnull false :location 342 :constvalue 4 [ 100 0 0 0 ]}', 'pg_catalog.pg_class'::regclass)


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



--
Akshay Joshi
Senior Software Engineer 
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
Phone: +91 20-3058-9522
Mobile: +91 976-788-8246


Re: Fixed issue "Error Message is displayed when the Package is Clicked"

От
Dave Page
Дата:
On Tue, Mar 20, 2012 at 7:35 AM, Ashesh Vashi
<ashesh.vashi@enterprisedb.com> wrote:
> Reason for the error:
>
> REL-9_1_STABLE branch (PostgreSQL repository):
>
> commit 303696c3b47e6719e983e93da5896ddc4a2e0dbb
> Author: Tom Lane <tgl@sss.pgh.pa.us>
> Date:   Fri Sep 3 01:34:55 2010 +0000
>
>     Install a data-type-based solution for protecting pg_get_expr().
>
>     Since the code underlying pg_get_expr() is not secure against malformed
>     input, and can't practically be made so, we need to prevent miscreants
>     from feeding arbitrary data to it.  We can do this securely by declaring
>     pg_get_expr() to take a new datatype "pg_node_tree" and declaring the
>     system catalog columns that hold nodeToString output to be of that type.
>     There is no way at SQL level to create a non-null value of type
> pg_node_tree.
>     Since the backend-internal operations that fill those catalog columns
>     operate below the SQL level, they are oblivious to the datatype
> relabeling
>     and don't need any changes.

Oh yeah, I vaguely remember that. Surely that wasn't back ported to
9.0 though? Akshay said he sees the issue there as well (which I
don't).


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Fixed issue "Error Message is displayed when the Package is Clicked"

От
Ashesh Vashi
Дата:
On Tue, Mar 20, 2012 at 2:07 PM, Dave Page <dpage@pgadmin.org> wrote:
On Tue, Mar 20, 2012 at 7:35 AM, Ashesh Vashi
<ashesh.vashi@enterprisedb.com> wrote:
> Reason for the error:
>
> REL-9_1_STABLE branch (PostgreSQL repository):
>
> commit 303696c3b47e6719e983e93da5896ddc4a2e0dbb
> Author: Tom Lane <tgl@sss.pgh.pa.us>
> Date:   Fri Sep 3 01:34:55 2010 +0000
>
>     Install a data-type-based solution for protecting pg_get_expr().
>
>     Since the code underlying pg_get_expr() is not secure against malformed
>     input, and can't practically be made so, we need to prevent miscreants
>     from feeding arbitrary data to it.  We can do this securely by declaring
>     pg_get_expr() to take a new datatype "pg_node_tree" and declaring the
>     system catalog columns that hold nodeToString output to be of that type.
>     There is no way at SQL level to create a non-null value of type
> pg_node_tree.
>     Since the backend-internal operations that fill those catalog columns
>     operate below the SQL level, they are oblivious to the datatype
> relabeling
>     and don't need any changes.

Oh yeah, I vaguely remember that. Surely that wasn't back ported to
9.0 though? Akshay said he sees the issue there as well (which I
don't).
Certainly not in PostgreSQL 9.0.
I can't find those changes in PPAS.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: 
Enterprise PostgreSQL Company

 

http://www.linkedin.com/in/asheshvashi




--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Fixed issue "Error Message is displayed when the Package is Clicked"

От
Akshay Joshi
Дата:


On Tue, Mar 20, 2012 at 2:17 PM, Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Tue, Mar 20, 2012 at 2:07 PM, Dave Page <dpage@pgadmin.org> wrote:
On Tue, Mar 20, 2012 at 7:35 AM, Ashesh Vashi
<ashesh.vashi@enterprisedb.com> wrote:
> Reason for the error:
>
> REL-9_1_STABLE branch (PostgreSQL repository):
>
> commit 303696c3b47e6719e983e93da5896ddc4a2e0dbb
> Author: Tom Lane <tgl@sss.pgh.pa.us>
> Date:   Fri Sep 3 01:34:55 2010 +0000
>
>     Install a data-type-based solution for protecting pg_get_expr().
>
>     Since the code underlying pg_get_expr() is not secure against malformed
>     input, and can't practically be made so, we need to prevent miscreants
>     from feeding arbitrary data to it.  We can do this securely by declaring
>     pg_get_expr() to take a new datatype "pg_node_tree" and declaring the
>     system catalog columns that hold nodeToString output to be of that type.
>     There is no way at SQL level to create a non-null value of type
> pg_node_tree.
>     Since the backend-internal operations that fill those catalog columns
>     operate below the SQL level, they are oblivious to the datatype
> relabeling
>     and don't need any changes.

Oh yeah, I vaguely remember that. Surely that wasn't back ported to
9.0 though? Akshay said he sees the issue there as well (which I
don't).
Certainly not in PostgreSQL 9.0.
I can't find those changes in PPAS.

  Sorry my mistake, When I run pgadmin3 PPAS9.0 is down and 9.1 is running on port 5444. When I add the server by mistake give port to 5444 which is of PPAS 9.1. So bug is not reproducible on PPAS 9.0   

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: 
Enterprise PostgreSQL Company

 

http://www.linkedin.com/in/asheshvashi




--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company




--
Akshay Joshi
Senior Software Engineer 
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
Phone: +91 20-3058-9522
Mobile: +91 976-788-8246

Re: Fixed issue "Error Message is displayed when the Package is Clicked"

От
Dave Page
Дата:


On Tue, Mar 20, 2012 at 9:27 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:


On Tue, Mar 20, 2012 at 2:17 PM, Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Tue, Mar 20, 2012 at 2:07 PM, Dave Page <dpage@pgadmin.org> wrote:
On Tue, Mar 20, 2012 at 7:35 AM, Ashesh Vashi
<ashesh.vashi@enterprisedb.com> wrote:
> Reason for the error:
>
> REL-9_1_STABLE branch (PostgreSQL repository):
>
> commit 303696c3b47e6719e983e93da5896ddc4a2e0dbb
> Author: Tom Lane <tgl@sss.pgh.pa.us>
> Date:   Fri Sep 3 01:34:55 2010 +0000
>
>     Install a data-type-based solution for protecting pg_get_expr().
>
>     Since the code underlying pg_get_expr() is not secure against malformed
>     input, and can't practically be made so, we need to prevent miscreants
>     from feeding arbitrary data to it.  We can do this securely by declaring
>     pg_get_expr() to take a new datatype "pg_node_tree" and declaring the
>     system catalog columns that hold nodeToString output to be of that type.
>     There is no way at SQL level to create a non-null value of type
> pg_node_tree.
>     Since the backend-internal operations that fill those catalog columns
>     operate below the SQL level, they are oblivious to the datatype
> relabeling
>     and don't need any changes.

Oh yeah, I vaguely remember that. Surely that wasn't back ported to
9.0 though? Akshay said he sees the issue there as well (which I
don't).
Certainly not in PostgreSQL 9.0.
I can't find those changes in PPAS.

  Sorry my mistake, When I run pgadmin3 PPAS9.0 is down and 9.1 is running on port 5444. When I add the server by mistake give port to 5444 which is of PPAS 9.1. So bug is not reproducible on PPAS 9.0  


OK, so the next step is to figure out where that query is created in the source, and figure out how to fix it for 9.1. I assume/hope we can just cast the string to the new type. 


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company