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

Proposed by Henrik Ingo on 2012-03-19
Status: Merged
Approved by: Brian Aker on 2012-03-21
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 2012-03-19 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
1=== modified file 'docs/columntypes.rst'
2--- docs/columntypes.rst 2011-08-17 06:10:57 +0000
3+++ docs/columntypes.rst 2012-03-19 09:06:19 +0000
4@@ -9,7 +9,8 @@
5 on these types are by default the full length of the data stored.
6 The only difference between the two types is the COLLATION which is
7 used. VARBINARY uses a binary collation for all index usage. VARCHAR can only
8-contain valid UTF-8 characters. If you need to store ASCII values the VARBINARY type.
9+contain valid UTF-8 characters. If you need to store ASCII values the VARBINARY
10+type.
11
12 -------------
13 TEXT and BLOB
14@@ -26,7 +27,8 @@
15 ---------
16
17 BIGINT and INTEGER exist as Drizzle's two integer numerical types. BIGINT is
18-a 64bit integer while INTEGER is a 32bit integer. Declaring a numerical types as UNSIGNED the value to be 64bit.
19+a 64 bit integer while INTEGER is a 32 bit integer. Declaring a numerical types
20+as UNSIGNED causes the value to be 64 bit.
21
22 DOUBLE is the systems native double type.
23
24@@ -44,7 +46,9 @@
25
26 TIME
27
28-TIMESTAMP 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.
29+TIMESTAMP can be supplied an optional parameter of (6) during creation. This
30+causes microseconds to be recorded as well. The TIME type represents duration
31+of an event in seconds.
32
33 ----
34 ENUM
35@@ -62,8 +66,16 @@
36 increasing order as rows are inserted into the table. The actual type is a
37 BIGINT.
38
39+----
40+IPV6
41+----
42+
43+IPV6 is a special column type that allows you to insert and query both IPv4 and
44+IPv6 addresses in their human readable presentation forms (e.g. 127.0.0.1 and
45+::1 respectively) but stores them as binary 128 bit values. For example usage,
46+see:
47+
48 .. toctree::
49- :maxdepth: 2
50+ :maxdepth: 1
51
52 ipv6_data_type
53-
54
55=== modified file 'docs/ipv6_data_type.rst'
56--- docs/ipv6_data_type.rst 2011-08-21 23:08:13 +0000
57+++ docs/ipv6_data_type.rst 2012-03-19 09:06:19 +0000
58@@ -1,13 +1,17 @@
59 IPV6 Data Type
60 ==============
61
62-The data type IPV6 stores Internet Protocol version(IPv) 4 & 6 addresses.
63-
64-This 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.
65-
66-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:
67-
68- 1080:0:0:0:8:800:200C:417A a unicast address
69+The data type IPV6 stores Internet Protocol version(IPv) 4 & 6 addresses. [1]_
70+
71+About IPv6
72+----------
73+
74+IPv6 address are written in preferred form as x:x:x:x:x:x:x:x, where the 'x's
75+are the hexadecimal values of the eight 16 bit pieces of the address separated
76+by colons. Leading zeros in a group are allowed to be dropped, upper and lower
77+case are equivalent. For example:
78+
79+ 1080:0:0:0:8:800:200C:417A a unicast address
80 FF01:0:0:0:0:0:0:101 a multicast address
81 0:0:0:0:0:0:0:1 the loopback address
82 0:0:0:0:0:0:0:0 the unspecified addresses
83@@ -19,10 +23,64 @@
84 ::1 the loopback address
85 :: the unspecified addresses
86
87-The IPV6 data type support to store IPv4 address in both formats.
88+The IPV6 data type supports storing also IPv4 address in both formats.
89+
90 For example:
91
92 ::192.168.1.10 or 192.168.1.10
93
94-IPV6 are documented as part of Standard Track :rfc:'2373'.
95+
96+Example usage
97+-------------
98+
99+Creating a database schema and changing to using the schema as default.
100+
101+.. code-block:: mysql
102+
103+ CREATE SCHEMA ipaddress;
104+ use ipaddress;
105+
106+
107+Creating a table with a IPV6 column:
108+
109+.. code-block:: mysql
110+
111+ CREATE TABLE ipaddress_table (addr IPV6);
112+
113+Adding data to the table:
114+
115+.. code-block:: mysql
116+
117+ INSERT INTO ipaddress_table (addr)
118+ VALUES ("fe8::b3ff:fe1a:8329");
119+
120+The above command adds one row to the database. IPv4 addresses can be inserted
121+to the same column as well. The IPV6 data type handles the distinction between
122+IPv4 & IPv6 addresses internally:
123+
124+.. code-block:: mysql
125+
126+ INSERT INTO ipaddress_table (address)
127+ VALUES ("192.168.100.10");
128+
129+Querying the table:
130+
131+.. code-block:: mysql
132+
133+ SELECT * FROM ipaddress_table;
134+
135+ address
136+ 0fe8:0000:0000:0000:0000:beff:fe1a:8329
137+ 000:000:000:000:000:000:192.168.100.010
138+
139+Authors
140+-------
141+
142+:Code: Muhammad Umair, Mark Atwood
143+:Documentation: Muhammad Umair, Henrik Ingo
144+
145+
146+.. rubric:: Footnotes
147+
148+.. [1] IPv6 is documented as part of the IETF Standard Track `RFC 2373 <http://www.ietf.org/rfc/rfc2373.txt>`_.
149