"Fossies" - the Fresh Open Source Software Archive

Member "drizzle-7.1.36-stable/docs/ipv6_data_type.rst" (6 May 2012, 2213 Bytes) of package /linux/misc/old/drizzle-7.1.36-stable.tar.gz:

As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

IPV6 Data Type

The data type IPV6 stores Internet Protocol version(IPv) 4 & 6 addresses.1

About IPv6

IPv6 address are written in preferred form as x:x:x:x:x:x:x:x, where the 'x's are the hexadecimal values of the eight 16 bit pieces of the address separated by colons. Leading zeros in a group are allowed to be dropped, upper and lower case are equivalent. For example:

1080:0:0:0:8:800:200C:417A a unicast address FF01:0:0:0:0:0:0:101 a multicast address 0:0:0:0:0:0:0:1 the loopback address 0:0:0:0:0:0:0:0 the unspecified addresses

may be represented as:

1080::8:800:200C:417A a unicast address FF01::101 a multicast address ::1 the loopback address :: the unspecified addresses

The IPV6 data type supports storing also IPv4 address in both formats.

For example:

:: or

Example usage

Creating a database schema and changing to using the schema as default.

CREATE SCHEMA ipaddress;
use ipaddress;

Creating a table with a IPV6 column:

CREATE TABLE ipaddress_table (addr IPV6);

Adding data to the table:

INSERT INTO ipaddress_table (addr) 
VALUES ("fe8::b3ff:fe1a:8329");

The above command adds one row to the database. IPv4 addresses can be inserted to the same column as well. The IPV6 data type handles the distinction between IPv4 & IPv6 addresses internally:

INSERT INTO ipaddress_table (address) 
VALUES ("");

Querying the table:

SELECT * FROM ipaddress_table;         




Muhammad Umair, Mark Atwood


Muhammad Umair, Henrik Ingo


  1. IPv6 is documented as part of the IETF Standard Track RFC 2373.↩︎