dbTalk Databases Forums  

[BUGS] BUG #1905: When a column with the chkpass datatype is used in a where clause it returns invalid results

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1905: When a column with the chkpass datatype is used in a where clause it returns invalid results in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Trevor Tingey
 
Posts: n/a

Default [BUGS] BUG #1905: When a column with the chkpass datatype is used in a where clause it returns invalid results - 09-23-2005 , 09:24 AM







The following bug has been logged online:

Bug reference: 1905
Logged by: Trevor Tingey
Email address: ttingey (AT) gmail (DOT) com
PostgreSQL version: 8.1 beta 2
Operating system: Windows XP Home Edition SP 2
Description: When a column with the chkpass datatype is used in a
where clause it returns invalid results
Details:

My schema is as follows:

CREATE TABLE account
(
"AccountId" int4 NOT NULL DEFAULT
nextval('public."account_AccountId_seq"'::text),
"AccountName" varchar(255) NOT NULL,
"Password" chkpass,
"Description" varchar(255),
CONSTRAINT account_pkey PRIMARY KEY ("AccountId"),
CONSTRAINT "account_Username_key" UNIQUE ("AccountName")
)
WITHOUT OIDS;


I ran the following queries and got unexpected results:

UPDATE Account
SET "Password" = 'password1'
WHERE "AccountName" = 'Trevor'

SELECT *
FROM Account
WHERE "AccountName" = 'Trevor'
AND "Password" = 'password2'

(I ran them individually)

The Select query unexpectedly returned a result. I also added another digit
on the end of 'password2' i.e. 'password21' and that returned the same
result. I also changed it to 'password3' etc. and got the same result and
the same with 'password'. When I changed it to 'passwor1' it did not return
a result.

Running SELECT * FROM Account returns two rows, one with the accountname of
'administrator' and the other 'Trevor'.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #1905: When a column with the chkpass datatype is used in a where clause it returns invalid results - 09-23-2005 , 10:03 AM






"Trevor Tingey" <ttingey (AT) gmail (DOT) com> writes:
Quote:
I ran the following queries and got unexpected results:

UPDATE Account
SET "Password" = 'password1'
WHERE "AccountName" = 'Trevor'

SELECT *
FROM Account
WHERE "AccountName" = 'Trevor'
AND "Password" = 'password2'

(I ran them individually)

The Select query unexpectedly returned a result.
This is not a bug --- chkpass limits passwords to 8 significant
characters, so the above two values are in fact equal so far as
the datatype is concerned.

(The documentation probably ought to point that out...)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.