Crashing v1.6.2 with a syntax error

Lists: pgadmin-support
From: Erwin Brandstetter <brandstetter(at)falter(dot)at>
To: pgadmin-support(at)postgresql(dot)org
Subject: Crashing v1.6.2 with a syntax error
Date: 2007-02-21 01:06:21
Message-ID: 45DB9B0D.809@falter.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-support

Hi developers! Hi Dave!

Testing pgAdmin III v1.6.2 rev: 5837, client Win XP, host Debian Sarge,
PG 8.1.4. / Debian Etch, PG 8.2.1.

I have found a 'reliable' way to crash pgAdmin. Look at the following query:
select * from loc where loc like 'a%' loc = 'b';
Note the syntax error: "and" is missing in the WHERE clause. If I run
this from the SQL query dialogue window I get an error message with only
the error code - but that has been reported before.

FEHLER: Fehler »Syntaxfehler« bei »loc«
SQL state: 42601
Character: 1

However, if I open the edit grid with a filter and enter the faulty
WHERE clause, pgAdmin crashes.
I have run tests with a variety of tables and operators in PG 8.1.4 and
PG 8.2.1. Any of the following WHERE clauses triggers a crash.
fld1 like 'a%' fld2 = 'b'
fld1 = 'a%' fld2 = 'b'
fld1 = 'a%' fld1 = '%a%'
...

The "essential" part ist the "%" at the end of the first string.

An observation I have made along the way:
Look at the error message I get from pgAdmin for the following WHERE clause:
loc = '%a' loc = ''
Note that the % is in front this time (does not trigger a crash).

An error has occurred:
FEHLER: Fehler >>Syntaxfehler<< bei >>b<<
Line 1: EXPLAIN SELECT * FROM loc WHERE loc = '0x1.1f9d8ap-997' loc = ''
^
The string containing the character "%" is scrambled in a weird way. The
caret in the next line points to a seemingly random position.
If I run it from psql, I get a similar error message. Only the string is
not scrambled, and the caret is in a reasonable position.

event=# select * from loc where loc = '%a' loc = '';
FEHLER: Fehler »Syntaxfehler« bei »loc« at character 36
ZEILE 1: select * from loc where loc = '%a' loc = '';
^
I have tried to switch the "user language" in the pgAdmin options from
English to German. To no effect.

It might have to do with locales. From my postgresql.conf:
lc_messages = 'de_AT(dot)utf8(at)euro'

I have tried changing it to:
lc_messages = 'C'

After that the error message was scrambled differently:
loc = '%a' loc = ''

An error has occurred:
ERROR: syntax error at or near "loc"
LINE 1: EXPLAIN SELECT * FROM loc WHERE loc = '0x1.518a0fp-1002' loc
= ''
^

But it crashes just as well.
loc = 'a%' loc = ''

Regards
Erwin


From: Dave Page <dpage(at)postgresql(dot)org>
To: Erwin Brandstetter <brandstetter(at)falter(dot)at>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: Crashing v1.6.2 with a syntax error
Date: 2007-02-22 10:13:54
Message-ID: 45DD6CE2.9020005@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-support

Erwin Brandstetter wrote:
> Hi developers! Hi Dave!

Hi Erwin,

> Testing pgAdmin III v1.6.2 rev: 5837, client Win XP, host Debian Sarge,
> PG 8.1.4. / Debian Etch, PG 8.2.1.
>
> I have found a 'reliable' way to crash pgAdmin. Look at the following
> query:
> select * from loc where loc like 'a%' loc = 'b';
> Note the syntax error: "and" is missing in the WHERE clause. If I run
> this from the SQL query dialogue window I get an error message with only
> the error code - but that has been reported before.
>
> FEHLER: Fehler »Syntaxfehler« bei »loc«
> SQL state: 42601
> Character: 1
>
> However, if I open the edit grid with a filter and enter the faulty
> WHERE clause, pgAdmin crashes.
> I have run tests with a variety of tables and operators in PG 8.1.4 and
> PG 8.2.1. Any of the following WHERE clauses triggers a crash.
> fld1 like 'a%' fld2 = 'b'
> fld1 = 'a%' fld2 = 'b'
> fld1 = 'a%' fld1 = '%a%'
> ...
>
> The "essential" part ist the "%" at the end of the first string.

Yeah, in some cases that string was going through a printf variant, so
it was trying to expand the %. Fixed for 1.6.3.

> After that the error message was scrambled differently:
> loc = '%a' loc = ''

Yeah, it would have been unpredictable because of the bug above. Can you
test the SVN code please, and let me know if there's still a problem.

Cheers, Dave.


From: "Ezequias Rodrigues da Rocha" <ezequias(dot)rocha(at)gmail(dot)com>
To: "Erwin Brandstetter" <brandstetter(at)falter(dot)at>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: Crashing v1.6.2 with a syntax error
Date: 2007-02-22 16:04:19
Message-ID: 55c095e90702220804j19da5c83ncec025534fd56b63@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-support

The crashes occurs with me too.

[]s
Ezequias

2007/2/20, Erwin Brandstetter <brandstetter(at)falter(dot)at>:
> Hi developers! Hi Dave!
>
>
> Testing pgAdmin III v1.6.2 rev: 5837, client Win XP, host Debian Sarge,
> PG 8.1.4. / Debian Etch, PG 8.2.1.
>
> I have found a 'reliable' way to crash pgAdmin. Look at the following query:
> select * from loc where loc like 'a%' loc = 'b';
> Note the syntax error: "and" is missing in the WHERE clause. If I run
> this from the SQL query dialogue window I get an error message with only
> the error code - but that has been reported before.
>
> FEHLER: Fehler »Syntaxfehler« bei »loc«
> SQL state: 42601
> Character: 1
>
> However, if I open the edit grid with a filter and enter the faulty
> WHERE clause, pgAdmin crashes.
> I have run tests with a variety of tables and operators in PG 8.1.4 and
> PG 8.2.1. Any of the following WHERE clauses triggers a crash.
> fld1 like 'a%' fld2 = 'b'
> fld1 = 'a%' fld2 = 'b'
> fld1 = 'a%' fld1 = '%a%'
> ...
>
> The "essential" part ist the "%" at the end of the first string.
>
>
> An observation I have made along the way:
> Look at the error message I get from pgAdmin for the following WHERE clause:
> loc = '%a' loc = ''
> Note that the % is in front this time (does not trigger a crash).
>
> An error has occurred:
> FEHLER: Fehler >>Syntaxfehler<< bei >>b<<
> Line 1: EXPLAIN SELECT * FROM loc WHERE loc = '0x1.1f9d8ap-997' loc = ''
> ^
> The string containing the character "%" is scrambled in a weird way. The
> caret in the next line points to a seemingly random position.
> If I run it from psql, I get a similar error message. Only the string is
> not scrambled, and the caret is in a reasonable position.
>
> event=# select * from loc where loc = '%a' loc = '';
> FEHLER: Fehler »Syntaxfehler« bei »loc« at character 36
> ZEILE 1: select * from loc where loc = '%a' loc = '';
> ^
> I have tried to switch the "user language" in the pgAdmin options from
> English to German. To no effect.
>
> It might have to do with locales. From my postgresql.conf:
> lc_messages = 'de_AT(dot)utf8(at)euro'
>
> I have tried changing it to:
> lc_messages = 'C'
>
> After that the error message was scrambled differently:
> loc = '%a' loc = ''
>
> An error has occurred:
> ERROR: syntax error at or near "loc"
> LINE 1: EXPLAIN SELECT * FROM loc WHERE loc = '0x1.518a0fp-1002' loc
> = ''
> ^
>
> But it crashes just as well.
> loc = 'a%' loc = ''
>
>
> Regards
> Erwin
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Atenciosamente (Sincerely)
Ezequias Rodrigues da Rocha
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A pior das democracias ainda é melhor do que a melhor das ditaduras
The worst of democracies is still better than the better of dictatorships
http://ezequiasrocha.blogspot.com/


From: Erwin Brandstetter <brandstetter(at)falter(dot)at>
To: dpage(at)postgresql(dot)org
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: Crashing v1.6.2 with a syntax error
Date: 2007-02-24 05:56:17
Message-ID: 45DFD381.50501@falter.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-support

Hi Dave!

Thanks for another promt fix! I am afraid I don't have the necessary
tools (nor experience) to compile the windows binaries. So, if anyone
could step in and test in my stead I'd be grateful.
Or, if you would provide me with the binaries, I'd look into it, of course.

Regards
Erwin

dpage(at)postgresql(dot)org wrote:
> Erwin Brandstetter wrote:
>
> (...)
>> ...
>>
>> The "essential" part ist the "%" at the end of the first string.
>>
>
> Yeah, in some cases that string was going through a printf variant, so
> it was trying to expand the %. Fixed for 1.6.3.
>
>
>> After that the error message was scrambled differently:
>> loc = '%a' loc = ''
>>
>
> Yeah, it would have been unpredictable because of the bug above. Can you
> test the SVN code please, and let me know if there's still a problem.
>
> Cheers, Dave.
>
>


From: Erwin Brandstetter <brandstetter(at)falter(dot)at>
To: dpage(at)postgresql(dot)org
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: Crashing v1.6.2 with a syntax error
Date: 2007-02-25 18:46:57
Message-ID: 45E1D9A1.9080600@falter.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-support

Hi Dave!

dpage(at)postgresql(dot)org wrote:
> Erwin Brandstetter wrote:
>
> (...)
>> The "essential" part ist the "%" at the end of the first string.
>>
>
> Yeah, in some cases that string was going through a printf variant, so
> it was trying to expand the %. Fixed for 1.6.3.
>
>
>> After that the error message was scrambled differently:
>> loc = '%a' loc = ''
>>
>
> Yeah, it would have been unpredictable because of the bug above. Can you
> test the SVN code please, and let me know if there's still a problem.
>
> Cheers, Dave.

Testing pgAdmin III v1.6.3 rev: 5941M on Win XP (SP2), hosts are PG 8.1.8 on Debian Sarge and PG 8.2.1 on Debian Etch.

The new Windows binary I have got from Dave does not crash any more. The
problem at had seems fixed. :)

I noticed, however, that another issue mentioned in my report is still
there. Referring to what Laurent ROCHE posted initially on Tue, 9 Jan
2007: "Still no text for error messages only numbers for 1.6.2 (aka the
Saga continues)". I will post a reply to that thread.

Regards
Erwin