Home > Archive > PostgreSQL Bugs > September 2005 > BUG #1905: When a column with the chkpass datatype is used in a where clause it returns invalid res









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author BUG #1905: When a column with the chkpass datatype is used in a where clause it returns invalid res
Trevor Tingey

2005-09-23, 11:24 am


The following bug has been logged online:

Bug reference: 1905
Logged by: Trevor Tingey
Email address: ttingey@gmail.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_se
q"'::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

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com