Bug #559: MACADDR type & 00:00:00:00:00:00

Started by PostgreSQL Bugs Listover 24 years ago3 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

Michael Handler (handler@grendel.net) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
MACADDR type & 00:00:00:00:00:00

Long Description
postgresql version 7.1.3, compiled with gcc 2.95.2 on solaris 2.6, running on solaris 2.8.

provisioning=> \d enduser
Table "enduser"
Attribute | Type | Modifier
-----------------+-------------------+----------------------------
account | character varying | not null
active | boolean | not null default 't'::bool
isp_id | integer | not null
speed_plan_id | integer | not null
service_plan_id | integer | not null
node_id | integer | not null
cm_macaddr | macaddr | not null
Indices: enduser_cm_macaddr_key,
enduser_pkey

provisioning=> insert into enduser values ('2', 't', 1, 1, 1, 1, '00:00:00:00:00:00');
INSERT 20853 1
provisioning=> select account,cm_macaddr from enduser where account = '2';
account | cm_macaddr
---------+------------
2 |
(1 row)

provisioning=> select count(*) from enduser where cm_macaddr is null;
count
-------
0
(1 row)

it's not null, so shouldn't it be retrieving as '00:00:00:00:00:00'?
not that i ever expect to encounter that macaddress in the field, but
for consistency's sake...

i just tested 'ff:ff:ff:ff:ff:ff', and it works fine.

ps postgresql sends mysql running back home to mommy. you guys are my heroes.

Sample Code

No file was uploaded with this report

#2Thomas Lockhart
lockhart@fourpalms.org
In reply to: PostgreSQL Bugs List (#1)
Re: Bug #559: MACADDR type & 00:00:00:00:00:00

MACADDR type & 00:00:00:00:00:00
postgresql version 7.1.3, compiled with gcc 2.95.2 on solaris 2.6, running on solaris 2.8.

...

provisioning=> select macaddr '00:00:00:00:00:00';
it's not null, so shouldn't it be retrieving as '00:00:00:00:00:00'?
not that i ever expect to encounter that macaddress in the field, but
for consistency's sake...
i just tested 'ff:ff:ff:ff:ff:ff', and it works fine.

Already fixed in the upcoming 7.2. Thanks for the report.

- Thomas

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: PostgreSQL Bugs List (#1)
Re: Bug #559: MACADDR type & 00:00:00:00:00:00

pgsql-bugs@postgresql.org writes:

it's not null, so shouldn't it be retrieving as '00:00:00:00:00:00'?

Yeah, due to some brain-fade on the part of the original implementor,
the code went out of its way to special-case 00:00:00:00:00:00 as
being represented by an empty string. This was agreed to be broken
and we've changed it for 7.2. If you like you can drop the 7.2
version of the file mac.c into 7.1; see
http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/mac.c

regards, tom lane