Merge lp:~hingo/drizzle/ipv6-doc-fixes into lp:~drizzle-trunk/drizzle/development

Proposed by Henrik Ingo
Status: Merged
Approved by: Brian Aker
Approved revision: 2527
Merged at revision: 2534
Proposed branch: lp:~hingo/drizzle/ipv6-doc-fixes
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: 148 lines (+84/-14)
2 files modified
docs/columntypes.rst (+17/-5)
docs/ipv6_data_type.rst (+67/-9)
To merge this branch: bzr merge lp:~hingo/drizzle/ipv6-doc-fixes
Reviewer Review Type Date Requested Status
Drizzle Merge Team Pending
Review via email: mp+98168@code.launchpad.net

Description of the change

Update IPv6 data type docs with examples from the white paper and some cleanup.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'docs/columntypes.rst'
--- docs/columntypes.rst 2011-08-17 06:10:57 +0000
+++ docs/columntypes.rst 2012-03-19 09:06:19 +0000
@@ -9,7 +9,8 @@
9on these types are by default the full length of the data stored.9on these types are by default the full length of the data stored.
10The only difference between the two types is the COLLATION which is10The only difference between the two types is the COLLATION which is
11used. VARBINARY uses a binary collation for all index usage. VARCHAR can only11used. VARBINARY uses a binary collation for all index usage. VARCHAR can only
12contain valid UTF-8 characters. If you need to store ASCII values the VARBINARY type.12contain valid UTF-8 characters. If you need to store ASCII values the VARBINARY
13type.
1314
14-------------15-------------
15TEXT and BLOB16TEXT and BLOB
@@ -26,7 +27,8 @@
26---------27---------
2728
28BIGINT and INTEGER exist as Drizzle's two integer numerical types. BIGINT is29BIGINT and INTEGER exist as Drizzle's two integer numerical types. BIGINT is
29a 64bit integer while INTEGER is a 32bit integer. Declaring a numerical types as UNSIGNED the value to be 64bit.30a 64 bit integer while INTEGER is a 32 bit integer. Declaring a numerical types
31as UNSIGNED causes the value to be 64 bit.
3032
31DOUBLE is the systems native double type.33DOUBLE is the systems native double type.
3234
@@ -44,7 +46,9 @@
4446
45TIME47TIME
4648
47TIMESTAMP can be supplied an optional parameter of (6) during creation. This causes microseconds to be recorded as well. The TIME type represents duration of an event in seconds.49TIMESTAMP can be supplied an optional parameter of (6) during creation. This
50causes microseconds to be recorded as well. The TIME type represents duration
51of an event in seconds.
4852
49----53----
50ENUM54ENUM
@@ -62,8 +66,16 @@
62increasing order as rows are inserted into the table. The actual type is a66increasing order as rows are inserted into the table. The actual type is a
63BIGINT.67BIGINT.
6468
69----
70IPV6
71----
72
73IPV6 is a special column type that allows you to insert and query both IPv4 and
74IPv6 addresses in their human readable presentation forms (e.g. 127.0.0.1 and
75::1 respectively) but stores them as binary 128 bit values. For example usage,
76see:
77
65.. toctree::78.. toctree::
66 :maxdepth: 279 :maxdepth: 1
6780
68 ipv6_data_type81 ipv6_data_type
69
7082
=== modified file 'docs/ipv6_data_type.rst'
--- docs/ipv6_data_type.rst 2011-08-21 23:08:13 +0000
+++ docs/ipv6_data_type.rst 2012-03-19 09:06:19 +0000
@@ -1,13 +1,17 @@
1IPV6 Data Type1IPV6 Data Type
2==============2==============
33
4The data type IPV6 stores Internet Protocol version(IPv) 4 & 6 addresses. 4The data type IPV6 stores Internet Protocol version(IPv) 4 & 6 addresses. [1]_
55
6This data type is a 128-bit quantity that is generated by an algorithm designed to make it very unlikely that the same data type will be generated by anyone else in the world using the same algorithm. 6About IPv6
77----------
8IPv6 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:8
99IPv6 address are written in preferred form as x:x:x:x:x:x:x:x, where the 'x's
10 1080:0:0:0:8:800:200C:417A a unicast address10are the hexadecimal values of the eight 16 bit pieces of the address separated
11by colons. Leading zeros in a group are allowed to be dropped, upper and lower
12case are equivalent. For example:
13
14 1080:0:0:0:8:800:200C:417A a unicast address
11 FF01:0:0:0:0:0:0:101 a multicast address15 FF01:0:0:0:0:0:0:101 a multicast address
12 0:0:0:0:0:0:0:1 the loopback address16 0:0:0:0:0:0:0:1 the loopback address
13 0:0:0:0:0:0:0:0 the unspecified addresses17 0:0:0:0:0:0:0:0 the unspecified addresses
@@ -19,10 +23,64 @@
19 ::1 the loopback address23 ::1 the loopback address
20 :: the unspecified addresses24 :: the unspecified addresses
2125
22The IPV6 data type support to store IPv4 address in both formats. 26The IPV6 data type supports storing also IPv4 address in both formats.
27
23For example:28For example:
2429
25::192.168.1.10 or 192.168.1.1030::192.168.1.10 or 192.168.1.10
2631
27IPV6 are documented as part of Standard Track :rfc:'2373'.32
33Example usage
34-------------
35
36Creating a database schema and changing to using the schema as default.
37
38.. code-block:: mysql
39
40 CREATE SCHEMA ipaddress;
41 use ipaddress;
42
43
44Creating a table with a IPV6 column:
45
46.. code-block:: mysql
47
48 CREATE TABLE ipaddress_table (addr IPV6);
49
50Adding data to the table:
51
52.. code-block:: mysql
53
54 INSERT INTO ipaddress_table (addr)
55 VALUES ("fe8::b3ff:fe1a:8329");
56
57The above command adds one row to the database. IPv4 addresses can be inserted
58to the same column as well. The IPV6 data type handles the distinction between
59IPv4 & IPv6 addresses internally:
60
61.. code-block:: mysql
62
63 INSERT INTO ipaddress_table (address)
64 VALUES ("192.168.100.10");
65
66Querying the table:
67
68.. code-block:: mysql
69
70 SELECT * FROM ipaddress_table;
71
72 address
73 0fe8:0000:0000:0000:0000:beff:fe1a:8329
74 000:000:000:000:000:000:192.168.100.010
75
76Authors
77-------
78
79:Code: Muhammad Umair, Mark Atwood
80:Documentation: Muhammad Umair, Henrik Ingo
81
82
83.. rubric:: Footnotes
84
85.. [1] IPv6 is documented as part of the IETF Standard Track `RFC 2373 <http://www.ietf.org/rfc/rfc2373.txt>`_.
2886