From: | "Trevor Tingey" <ttingey(at)gmail(dot)com> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | BUG #1905: When a column with the chkpass datatype is used in a where clause it returns invalid results |
Date: | 2005-09-23 04:42:16 |
Message-ID: | 20050923044216.C50F6F0D79@svr2.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
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'.
From | Date | Subject | |
---|---|---|---|
Next Message | Mark Stosberg | 2005-09-23 14:40:54 | suggestion: fix 'now' -> CURRENT_TIMESTAMP |
Previous Message | Tom Lane | 2005-09-23 04:35:02 | Re: BUG #1883: Renaming a schema leaves inconsistent sequence |