Dear John,
I saw your emails for pointing out the bug. If you are working to fix it.
I figured out the problem.
I hope problem will be solved if you replace the following code of the function
char * ipv4_inet_ntop(char *destination)
{
memset(destination,NULL,sizeof(destination));
snprintf( destination ,IPV6_BUFFER_LENGTH,
"%03x:%03x:%03x:%03x:%03x:%03x:%03d.%03d.%03d.%03d" ,
str.ip6[0],str.ip6[1],str.ip6[2],str.ip6[3],str.ip6[4],str.ip6[5],
(((unsigned int )str.ip6[6]>>8) & 0xFF),
((unsigned int )str.ip6[6] & 0xFF),
(((unsigned int )str.ip6[7]>>8) & 0xFF),
((unsigned int )str.ip6[7] & 0xFF));
return destination;
}// end of ipv4_inet_ntop function
The new function code,
char * ipv4_inet_ntop(char *destination)
{
memset(destination,NULL,sizeof(destination));
snprintf( destination ,IPV6_BUFFER_LENGTH, "%d.%d.%d.%d" ,
(((unsigned int )str.ip6[6]>>8) & 0xFF),
((unsigned int )str.ip6[6] & 0xFF),
(((unsigned int )str.ip6[7]>>8) & 0xFF),
((unsigned int )str.ip6[7] & 0xFF));
return destination;
}// end of ipv4_inet_ntop function
I haven't run it, but I think it will be fixed. The problem is only this
function. Rest of the code base is work well. If you need more help. Feel free
to ask me.
Regards,
Umair Muhammad
Electrical Engineering Master Student,
Specialization in Wireless Systems,
School of Electrical Engineering,
Royal Institute of Technology (KTH),
SE 100-44 Stockholm, SWEDEN.
Email: [email protected]
Cell: +46 764 097 574
________________________________________
From: [email protected]
[[email protected]] on behalf of John
Z. [[email protected]]
Sent: Thursday, March 15, 2012 9:46 PM
To: [email protected]
Subject: Re: [Drizzle-discuss] IPv4 selection from IPv6 column
> You mean by diving into the code yourself? That would certainly be
> most welcome. The IPV6 data type was done by a Google Summer of Code
> student. So while he is still engaged with the project, it is of
> course on-off depending on his studies and other priorities.
Yup, that's what I meant :-) Best way to get stuff fixed is to fix it
yourself, right?
> The type is defined and implemented in
>
> drizzled/type/ipv6.h
> drizzled/field/ipv6.cc
>
> If you "grep -Ri ipv6" you will find more places that are involved.
> I'm happy to guide you around more if needed. (But I'm not personally
> familiar with this code, so I can't point you to the exact line where
> the bug is.)
That would be most welcome! I'm branching off bazaar right now, I'll
dwell into the code as soon as its done. I'll post here with questions,
if I have nay.
Cheers.
>
> henrik
>
> On Thu, Mar 15, 2012 at 10:27 PM, John Z.<[email protected]> wrote:
>> Sure thing, on it now. Thanks.
>>
>> Btw, since I don't know how long will the wait last until bug gets to be
>> fixed - can I help fixing it, somehow? My employer most probably won't mind
>> since we need this functionality.
>>
>>
>> John
>>
>>> Yep
>>>
>>> drizzle> describe ipaddress_table;
>>> +-------+------+------+---------+-----------------+-----------+
>>> | Field | Type | Null | Default | Default_is_NULL | On_Update |
>>> +-------+------+------+---------+-----------------+-----------+
>>> | addr | IPV6 | YES | | YES | |
>>> +-------+------+------+---------+-----------------+-----------+
>>> 1 row in set (0.001061 sec)
>>>
>>> drizzle> insert into ipaddress_table values ('10.28.4.10');
>>> Query OK, 1 row affected (0.009366 sec)
>>>
>>> drizzle> select * from ipaddress_table;
>>> +-----------------------------------------+
>>> | addr |
>>> +-----------------------------------------+
>>> | 000:000:000:000:000:000:010.028.004.010 |
>>> +-----------------------------------------+
>>> 1 row in set (0.000795 sec)
>>>
>>> drizzle> select * from ipaddress_table where addr='10.28.4.10';
>>> Empty set (0.000814 sec)
>>>
>>>
>>> Please file a bug. Any value that will be accepted for insert, should
>>> certainly be accepted for where clause too.
>>>
>>> henrik
>>>
>>>
>>> On Thu, Mar 15, 2012 at 9:35 PM, John Z.<[email protected]>
>>> wrote:
>>>> Hello,
>>>> I have a table with IPv6 column. Documentation says IPv6 supports IPv4
>>>> values too, so I'm using same column to store both values if needed.
>>>> IPv6 insertion/selection works just fine, however I can't figure out
>>>> proper string format when trying to select by an IPv4 value - it always
>>>> returns an empty result set.
>>>>
>>>> Describe table and some examples follow:
>>>>
>>>>
>>>> drizzle> describe cassandra_cluster;
>>>> +-------+---------+------+---------+-----------------+-----------+
>>>> | Field | Type | Null | Default | Default_is_NULL | On_Update |
>>>> +-------+---------+------+---------+-----------------+-----------+
>>>> | node | IPV6 | NO | | NO | |
>>>> | port | INTEGER | NO | | NO | |
>>>> +-------+---------+------+---------+-----------------+-----------+
>>>>
>>>> drizzle> insert into cassandra_cluster values('::10.28.4.10', 9160);
>>>> Query OK, 1 row affected (0.100422 sec)
>>>>
>>>> drizzle> select * from cassandra_cluster;
>>>> +-----------------------------------------+------+
>>>> | node | port |
>>>> +-----------------------------------------+------+
>>>> | 000:000:000:000:000:000:010.028.004.010 | 9160 |
>>>> +-----------------------------------------+------+
>>>> 1 row in set (0.00042 sec)
>>>>
>>>> drizzle> select * from cassandra_cluster where node='::10.28.4.10';
>>>> Empty set (0.000433 sec)
>>>>
>>>>
>>>>
>>>> Here, I tried various formats for '::10.28.4.10', but all of them
>>>> failing,
>>>> together with copy-paste of output from select *.
>>>> I tried on IRC, but we concluded that it could be a bug, and I was
>>>> suggested
>>>> to try here first, before reporting it.
>>>>
>>>> Please, help :-)
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~drizzle-discuss
>>>> Post to : [email protected]
>>>> Unsubscribe : https://launchpad.net/~drizzle-discuss
>>>> More help : https://help.launchpad.net/ListHelp
>>>
>>>
>>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~drizzle-discuss
>> Post to : [email protected]
>> Unsubscribe : https://launchpad.net/~drizzle-discuss
>> More help : https://help.launchpad.net/ListHelp
>
>
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp