@@ -91,7 +91,9 @@ func Test_Insert(t *testing.T) {
9191 date Date,
9292 datetime DateTime,
9393 ipv4 IPv4,
94- ipv6 IPv6
94+ ipv6 IPv6,
95+ ipv4str FixedString(16),
96+ ipv6str FixedString(16)
9597 ) Engine=Memory
9698 `
9799 dml = `
@@ -111,7 +113,9 @@ func Test_Insert(t *testing.T) {
111113 date,
112114 datetime,
113115 ipv4,
114- ipv6
116+ ipv6,
117+ ipv4str,
118+ ipv6str
115119 ) VALUES (
116120 ?,
117121 ?,
@@ -128,6 +132,8 @@ func Test_Insert(t *testing.T) {
128132 ?,
129133 ?,
130134 ?,
135+ ?,
136+ ?,
131137 ?
132138 )
133139 `
@@ -148,7 +154,9 @@ func Test_Insert(t *testing.T) {
148154 date,
149155 datetime,
150156 ipv4,
151- ipv6
157+ ipv6,
158+ ipv4str,
159+ ipv6str
152160 FROM clickhouse_test_insert
153161 `
154162 )
@@ -162,12 +170,14 @@ func Test_Insert(t *testing.T) {
162170 - 1 * i , - 2 * i , - 4 * i , - 8 * i , // int
163171 uint8 (1 * i ), uint16 (2 * i ), uint32 (4 * i ), uint64 (8 * i ), // uint
164172 1.32 * float32 (i ), 1.64 * float64 (i ), //float
165- fmt .Sprintf ("string %d" , i ), // string
166- "RU" , //fixedstring,
167- time .Now (), //date
168- time .Now (), //datetime
169- "1.2.3.4" , // ipv4
173+ fmt .Sprintf ("string %d" , i ), // string
174+ "RU" , //fixedstring,
175+ time .Now (), //date
176+ time .Now (), //datetime
177+ "1.2.3.4" , // ipv4
170178 "2001:0db8:85a3:0000:0000:8a2e:0370:7334" , //ipv6
179+ column .IP (net .ParseIP ("127.0.0.1" ).To4 ()),
180+ column .IP (net .ParseIP ("2001:0db8:85a3:0000:0000:8a2e:0370:7334" )),
171181 )
172182 if ! assert .NoError (t , err ) {
173183 return
@@ -194,6 +204,8 @@ func Test_Insert(t *testing.T) {
194204 DateTime time.Time
195205 Ipv6 column.IP
196206 Ipv4 column.IP
207+ Ipv4str column.IP
208+ Ipv6str column.IP
197209 }
198210 if rows , err := connect .Query (query ); assert .NoError (t , err ) {
199211 var count int
@@ -216,6 +228,8 @@ func Test_Insert(t *testing.T) {
216228 & item .DateTime ,
217229 & item .Ipv4 ,
218230 & item .Ipv6 ,
231+ & item .Ipv4str ,
232+ & item .Ipv6str ,
219233 )
220234 if ! assert .NoError (t , err ) {
221235 return
0 commit comments