Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6b9e742

Browse files
committed
The macaddr datatype understands most formats of MAC address, except 12
hex digits with no separators, eg 00AABBCCDDEE. This is easily remediedwith the following patch (against 7.2.1):Mike Wyer
1 parentcd7be4d commit6b9e742

File tree

1 file changed

+3
-1
lines changed
  • src/backend/utils/adt

1 file changed

+3
-1
lines changed

‎src/backend/utils/adt/mac.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
*PostgreSQL type definitions for MAC addresses.
33
*
4-
*$Header: /cvsroot/pgsql/src/backend/utils/adt/mac.c,v 1.22 2002/03/09 17:35:35 tgl Exp $
4+
*$Header: /cvsroot/pgsql/src/backend/utils/adt/mac.c,v 1.23 2002/06/15 19:39:33 momjian Exp $
55
*/
66

77
#include"postgres.h"
@@ -46,6 +46,8 @@ macaddr_in(PG_FUNCTION_ARGS)
4646
count=sscanf(str,"%2x%2x%2x-%2x%2x%2x",&a,&b,&c,&d,&e,&f);
4747
if (count!=6)
4848
count=sscanf(str,"%2x%2x.%2x%2x.%2x%2x",&a,&b,&c,&d,&e,&f);
49+
if (count!=6)
50+
count=sscanf(str,"%2x%2x%2x%2x%2x%2x",&a,&b,&c,&d,&e,&f);
4951

5052
if (count!=6)
5153
elog(ERROR,"macaddr_in: error in parsing \"%s\"",str);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp