Re: bitwise logic

2007-09-10 Thread Jeremy Cole
nce as an integer? "Gerald L. Clark" wrote: Wagner, Chris (GEAE, CBTS) wrote: Hi. I've got IP addresses stored in the database as packed binaries. i.e. binary(4). I put them in there that way so that I could do bitwise logic on them to do subnet searches. e.g. ...WHERE `ip` &

Re: bitwise logic

2007-08-28 Thread Baron Schwartz
re that way so that I could do bitwise logic on them to do subnet searches. e.g. ...WHERE `ip` & 'mask' = 'network'. Only it turns out that as far as I can tell MySQL can't do bit logic on strings, only integers. I came up with an onerous SQL call that eats the 4 bytes and

Re: bitwise logic

2007-08-28 Thread Wagner, Chris (GEAE, CBTS)
I've got IP addresses stored in the database as packed binaries. > > i.e. binary(4). I put them in there that way so that I could do bitwise > > logic on them to do subnet searches. e.g. ...WHERE `ip` & 'mask' = > > 'network'. Only it turns out th

bitwise logic

2007-08-24 Thread Wagner, Chris (GEAE, CBTS)
Hi. I've got IP addresses stored in the database as packed binaries. i.e. binary(4). I put them in there that way so that I could do bitwise logic on them to do subnet searches. e.g. ...WHERE `ip` & 'mask' = 'network'. Only it turns out that as far as I can tel