Operations on Network Addresses
Hello, I'm a relatively new user and have run into a problem which may just be a misunderstanding. I'm using the Oct2014 version, installed on Fedora 20 from the MonetDB rpm repository. When I try to query a database using inet "containment" operators like << or <<= it seems that the operators are not recognized: sql> select src,dst from raw.ids where src << inet'xxx.xxx.xxx.xxx/27'; SELECT: no such binary operator 'left_shift(inet,inet)' sql> select src,dst from raw.ids where src <<= inet'xxx.xxx.xxx.xxx/27'; syntax error, unexpected '=' in: "select src,dst from raw.ids where src <<=" Other ordinary binary inet operators seem OK: sql> select src,dst from raw.ids where src = inet'xxx.xxx.xxx.xxx'; (prints out table) sql> select src,dst from raw.ids where src < dst; (prints out table) However the documented functions do not seem to be recognized: sql> select masklen(inet'192.168.0.0/24') SELECT: no such unary operator 'masklen(inet)' sql> select netmask(inet'192.168.0.0/24') SELECT: no such unary operator 'netmask(inet)' So it seems that support for network address types is only partially available in this release. Is that normal? Do I need to rebuild from source in order to get them? Thanks! Tim
Hi Tim,
I'm afraid the operations and functions that you want to use have not yet been implemented in MonetDB.
Sorry!
Please consider filing a feature request via http://bugs.monetdb.org/
Thanks!
Best,
Stefan
On November 13, 2014 2:32:27 AM CET, Tim Burress
Hello,
I'm a relatively new user and have run into a problem which may just be a misunderstanding. I'm using the Oct2014 version, installed on Fedora 20 from the MonetDB rpm repository. When I try to query a database using inet "containment" operators like << or <<= it seems that the operators are not recognized:
sql> select src,dst from raw.ids where src << inet'xxx.xxx.xxx.xxx/27'; SELECT: no such binary operator 'left_shift(inet,inet)'
sql> select src,dst from raw.ids where src <<= inet'xxx.xxx.xxx.xxx/27'; syntax error, unexpected '=' in: "select src,dst from raw.ids where src <<="
Other ordinary binary inet operators seem OK:
sql> select src,dst from raw.ids where src = inet'xxx.xxx.xxx.xxx'; (prints out table) sql> select src,dst from raw.ids where src < dst; (prints out table)
However the documented functions do not seem to be recognized:
sql> select masklen(inet'192.168.0.0/24') SELECT: no such unary operator 'masklen(inet)' sql> select netmask(inet'192.168.0.0/24') SELECT: no such unary operator 'netmask(inet)'
So it seems that support for network address types is only partially available in this release. Is that normal? Do I need to rebuild from source in order to get them?
Thanks!
Tim
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
Hello! Thanks for your note. I'm a little confused because the functions do seem to be in the source code (monetdb5/modules/atoms/inet.c). Is it just that the functions aren't being included in the build? One reason I ask is that I'd like to experiment with adding IPv6 support, so it would be useful to know how functions like this get linked in (or in this case, not linked in). Thanks! Tim On 11/13/2014 04:13 PM, Stefan Manegold wrote:
Hi Tim,
I'm afraid the operations and functions that you want to use have not yet been implemented in MonetDB. Sorry!
Please consider filing a feature request via http://bugs.monetdb.org/
Thanks!
Best, Stefan
On November 13, 2014 2:32:27 AM CET, Tim Burress
wrote: Hello,
I'm a relatively new user and have run into a problem which may just be a misunderstanding. I'm using the Oct2014 version, installed on Fedora 20 from the MonetDB rpm repository. When I try to query a database using inet "containment" operators like << or <<= it seems that the operators are not recognized:
sql> select src,dst from raw.ids where src << inet'xxx.xxx.xxx.xxx/27'; SELECT: no such binary operator 'left_shift(inet,inet)'
sql> select src,dst from raw.ids where src <<= inet'xxx.xxx.xxx.xxx/27'; syntax error, unexpected '=' in: "select src,dst from raw.ids where src <<="
Other ordinary binary inet operators seem OK:
sql> select src,dst from raw.ids where src = inet'xxx.xxx.xxx.xxx'; (prints out table) sql> select src,dst from raw.ids where src < dst; (prints out table)
However the documented functions do not seem to be recognized:
sql> select masklen(inet'192.168.0.0/24') SELECT: no such unary operator 'masklen(inet)' sql> select netmask(inet'192.168.0.0/24') SELECT: no such unary operator 'netmask(inet)'
So it seems that support for network address types is only partially available in this release. Is that normal? Do I need to rebuild from source in order to get them?
Thanks!
Tim
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
Hi, thank for your feedback, and sorry for my too premature answer. Indeed, functions masklen() & netmask() are there an work fine for me (yum-installed MonetDB Oct2014 on Fedora 20). I'm puzzled why it doesn't work with you given a seemingly identical setup. Did you try with a new virgin database, or did you upgrade your database from an earlier MonetDB version? inet "containment" operators (<< & <<=) appear to be not supported by the parser (which interprets the first a left-shift, and does not recognize the latter as valid operator). inequality (< & <=) appear to work fine also for me, while equality (=) gives an error. See details below. Best, Stefan ======== Welcome to mclient, the MonetDB/SQL interactive terminal (Oct2014) Database: MonetDB v11.19.3 (Oct2014), 'demo' Type \q to quit, \? for a list of available commands auto commit mode: on sql>select masklen(inet'192.168.0.0/24'); +----------------------+ | masklen_single_value | +======================+ | 24 | +----------------------+ 1 tuple (0.924ms) sql>select netmask(inet'192.168.0.0/24'); +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | netmask_single_value | +======================================================================================================================================================================================================================================================================================================================+ | 255.255.255.0 | +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 tuple (0.831ms) sql>select inet'192.168.0.0/24' << inet'xxx.xxx.xxx.xxx/27'; SELECT: no such binary operator 'left_shift(inet,inet)' sql>select inet'192.168.0.0/24' <<= inet'xxx.xxx.xxx.xxx/27'; syntax error, unexpected '=' in: "select inet'192.168.0.0/24' <<=" sql>select inet'192.168.0.0/24' < inet'xxx.xxx.xxx.xxx/27'; +----------------+ | <_single_value | +================+ | null | +----------------+ 1 tuple (1.9s) sql>select inet'192.168.0.0/24' <= inet'xxx.xxx.xxx.xxx/27'; +-----------------+ | <=_single_value | +=================+ | null | +-----------------+ 1 tuple (0.670ms) sql>select inet'192.168.0.0/24' = inet'xxx.xxx.xxx.xxx/27'; TypeException:user.s6_1[4]:'calc.==' undefined in: _7:any := calc.==(_5:inet, _6:inet) program contains errors sql>select inet'192.168.0.0/24' = inet'192.168.0.0/24'; TypeException:user.s7_1[4]:'calc.==' undefined in: _7:any := calc.==(_5:inet, _6:inet) program contains errors sql>select inet'192.168.0.0/24' <= inet'192.168.0.0/24'; +-----------------+ | <=_single_value | +=================+ | true | +-----------------+ 1 tuple (1.198ms) sql>select inet'192.168.0.0/24' < inet'192.168.0.0/24'; +----------------+ | <_single_value | +================+ | false | +----------------+ 1 tuple (1.104ms) sql>select inet'192.168.0.0/24' < inet'192.168.0.1/24'; +----------------+ | <_single_value | +================+ | true | +----------------+ 1 tuple (0.560ms) sql>select inet'192.168.0.1/24' <= inet'192.168.0.0/24'; +-----------------+ | <=_single_value | +=================+ | false | +-----------------+ 1 tuple (0.441ms) sql> ======== ----- Original Message -----
Hello!
Thanks for your note. I'm a little confused because the functions do seem to be in the source code (monetdb5/modules/atoms/inet.c). Is it just that the functions aren't being included in the build?
One reason I ask is that I'd like to experiment with adding IPv6 support, so it would be useful to know how functions like this get linked in (or in this case, not linked in).
Thanks!
Tim
On 11/13/2014 04:13 PM, Stefan Manegold wrote:
Hi Tim,
I'm afraid the operations and functions that you want to use have not yet been implemented in MonetDB. Sorry!
Please consider filing a feature request via http://bugs.monetdb.org/
Thanks!
Best, Stefan
On November 13, 2014 2:32:27 AM CET, Tim Burress
wrote: Hello,
I'm a relatively new user and have run into a problem which may just be a misunderstanding. I'm using the Oct2014 version, installed on Fedora 20 from the MonetDB rpm repository. When I try to query a database using inet "containment" operators like << or <<= it seems that the operators are not recognized:
sql> select src,dst from raw.ids where src << inet'xxx.xxx.xxx.xxx/27'; SELECT: no such binary operator 'left_shift(inet,inet)'
sql> select src,dst from raw.ids where src <<= inet'xxx.xxx.xxx.xxx/27'; syntax error, unexpected '=' in: "select src,dst from raw.ids where src <<="
Other ordinary binary inet operators seem OK:
sql> select src,dst from raw.ids where src = inet'xxx.xxx.xxx.xxx'; (prints out table) sql> select src,dst from raw.ids where src < dst; (prints out table)
However the documented functions do not seem to be recognized:
sql> select masklen(inet'192.168.0.0/24') SELECT: no such unary operator 'masklen(inet)' sql> select netmask(inet'192.168.0.0/24') SELECT: no such unary operator 'netmask(inet)'
So it seems that support for network address types is only partially available in this release. Is that normal? Do I need to rebuild from source in order to get them?
Thanks!
Tim
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
Hello! Hmmm... I did some more experimentation and find that functions like masklen() and host() either work or do not work depending on the username given to mclient. Both users are accessing the same database. The difference is that the user who can use the functions is the authorized owner of the schema: sql> select masklen(inet'192.168.0.0/24'); +----------------------+ | masklen_single_value | +======================+ | 24 | +----------------------+ while the other user merely has SELECT,INSERT,DELETE on some of the tables: sql> select masklen(inet'192.168.0.0/24'); SELECT: no such unary operator'masklen(inet)' Do I need to grant some privileges to the other users so that they can access these functions? Or if there's some information I could send to help figure this out, just let me know. Thanks very much! Tim On 11/14/2014 09:38 AM, Stefan Manegold wrote:
Hi,
thank for your feedback, and sorry for my too premature answer.
Indeed, functions masklen() & netmask() are there an work fine for me (yum-installed MonetDB Oct2014 on Fedora 20).
I'm puzzled why it doesn't work with you given a seemingly identical setup. Did you try with a new virgin database, or did you upgrade your database from an earlier MonetDB version?
inet "containment" operators (<< & <<=) appear to be not supported by the parser (which interprets the first a left-shift, and does not recognize the latter as valid operator).
inequality (< & <=) appear to work fine also for me, while equality (=) gives an error.
See details below.
Best, Stefan
======== Welcome to mclient, the MonetDB/SQL interactive terminal (Oct2014) Database: MonetDB v11.19.3 (Oct2014), 'demo' Type \q to quit, \? for a list of available commands auto commit mode: on sql>select masklen(inet'192.168.0.0/24'); +----------------------+ | masklen_single_value | +======================+ | 24 | +----------------------+ 1 tuple (0.924ms) sql>select netmask(inet'192.168.0.0/24'); +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | netmask_single_value | +======================================================================================================================================================================================================================================================================================================================+ | 255.255.255.0 | +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 tuple (0.831ms) sql>select inet'192.168.0.0/24' << inet'xxx.xxx.xxx.xxx/27'; SELECT: no such binary operator 'left_shift(inet,inet)' sql>select inet'192.168.0.0/24' <<= inet'xxx.xxx.xxx.xxx/27'; syntax error, unexpected '=' in: "select inet'192.168.0.0/24' <<=" sql>select inet'192.168.0.0/24' < inet'xxx.xxx.xxx.xxx/27'; +----------------+ | <_single_value | +================+ | null | +----------------+ 1 tuple (1.9s) sql>select inet'192.168.0.0/24' <= inet'xxx.xxx.xxx.xxx/27'; +-----------------+ | <=_single_value | +=================+ | null | +-----------------+ 1 tuple (0.670ms) sql>select inet'192.168.0.0/24' = inet'xxx.xxx.xxx.xxx/27'; TypeException:user.s6_1[4]:'calc.==' undefined in: _7:any := calc.==(_5:inet, _6:inet) program contains errors sql>select inet'192.168.0.0/24' = inet'192.168.0.0/24'; TypeException:user.s7_1[4]:'calc.==' undefined in: _7:any := calc.==(_5:inet, _6:inet) program contains errors sql>select inet'192.168.0.0/24' <= inet'192.168.0.0/24'; +-----------------+ | <=_single_value | +=================+ | true | +-----------------+ 1 tuple (1.198ms) sql>select inet'192.168.0.0/24' < inet'192.168.0.0/24'; +----------------+ | <_single_value | +================+ | false | +----------------+ 1 tuple (1.104ms) sql>select inet'192.168.0.0/24' < inet'192.168.0.1/24'; +----------------+ | <_single_value | +================+ | true | +----------------+ 1 tuple (0.560ms) sql>select inet'192.168.0.1/24' <= inet'192.168.0.0/24'; +-----------------+ | <=_single_value | +=================+ | false | +-----------------+ 1 tuple (0.441ms) sql> ========
----- Original Message -----
Hello!
Thanks for your note. I'm a little confused because the functions do seem to be in the source code (monetdb5/modules/atoms/inet.c). Is it just that the functions aren't being included in the build?
One reason I ask is that I'd like to experiment with adding IPv6 support, so it would be useful to know how functions like this get linked in (or in this case, not linked in).
Thanks!
Tim
On 11/13/2014 04:13 PM, Stefan Manegold wrote:
Hi Tim,
I'm afraid the operations and functions that you want to use have not yet been implemented in MonetDB. Sorry!
Please consider filing a feature request via http://bugs.monetdb.org/
Thanks!
Best, Stefan
On November 13, 2014 2:32:27 AM CET, Tim Burress
wrote: Hello,
I'm a relatively new user and have run into a problem which may just be a misunderstanding. I'm using the Oct2014 version, installed on Fedora 20 from the MonetDB rpm repository. When I try to query a database using inet "containment" operators like << or <<= it seems that the operators are not recognized:
sql> select src,dst from raw.ids where src << inet'xxx.xxx.xxx.xxx/27'; SELECT: no such binary operator 'left_shift(inet,inet)'
sql> select src,dst from raw.ids where src <<= inet'xxx.xxx.xxx.xxx/27'; syntax error, unexpected '=' in: "select src,dst from raw.ids where src <<="
Other ordinary binary inet operators seem OK:
sql> select src,dst from raw.ids where src = inet'xxx.xxx.xxx.xxx'; (prints out table) sql> select src,dst from raw.ids where src < dst; (prints out table)
However the documented functions do not seem to be recognized:
sql> select masklen(inet'192.168.0.0/24') SELECT: no such unary operator 'masklen(inet)' sql> select netmask(inet'192.168.0.0/24') SELECT: no such unary operator 'netmask(inet)'
So it seems that support for network address types is only partially available in this release. Is that normal? Do I need to rebuild from source in order to get them?
Thanks!
Tim
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 What if you try using sys.masklen instead? On 14/11/14 02:42, Tim Burress wrote:
Hello!
Hmmm... I did some more experimentation and find that functions like masklen() and host() either work or do not work depending on the username given to mclient. Both users are accessing the same database. The difference is that the user who can use the functions is the authorized owner of the schema:
sql> select masklen(inet'192.168.0.0/24'); +----------------------+ | masklen_single_value | +======================+ | 24 | +----------------------+
while the other user merely has SELECT,INSERT,DELETE on some of the tables:
sql> select masklen(inet'192.168.0.0/24'); SELECT: no such unary operator'masklen(inet)'
Do I need to grant some privileges to the other users so that they can access these functions? Or if there's some information I could send to help figure this out, just let me know.
Thanks very much!
Tim
On 11/14/2014 09:38 AM, Stefan Manegold wrote:
Hi,
thank for your feedback, and sorry for my too premature answer.
Indeed, functions masklen() & netmask() are there an work fine for me (yum-installed MonetDB Oct2014 on Fedora 20).
I'm puzzled why it doesn't work with you given a seemingly identical setup. Did you try with a new virgin database, or did you upgrade your database from an earlier MonetDB version?
inet "containment" operators (<< & <<=) appear to be not supported by the parser (which interprets the first a left-shift, and does not recognize the latter as valid operator).
inequality (< & <=) appear to work fine also for me, while equality (=) gives an error.
See details below.
Best, Stefan
======== Welcome to mclient, the MonetDB/SQL interactive terminal (Oct2014) Database: MonetDB v11.19.3 (Oct2014), 'demo' Type \q to quit, \? for a list of available commands auto commit mode: on sql>select masklen(inet'192.168.0.0/24'); +----------------------+ | masklen_single_value | +======================+ | 24 | +----------------------+ 1 tuple (0.924ms) sql>select netmask(inet'192.168.0.0/24'); +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| netmask_single_value
|
+======================================================================================================================================================================================================================================================================================================================+
| 255.255.255.0
|
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 tuple (0.831ms)
sql>select inet'192.168.0.0/24' << inet'xxx.xxx.xxx.xxx/27'; SELECT: no such binary operator 'left_shift(inet,inet)' sql>select inet'192.168.0.0/24' <<= inet'xxx.xxx.xxx.xxx/27'; syntax error, unexpected '=' in: "select inet'192.168.0.0/24' <<=" sql>select inet'192.168.0.0/24' < inet'xxx.xxx.xxx.xxx/27'; +----------------+ | <_single_value | +================+ | null | +----------------+ 1 tuple (1.9s) sql>select inet'192.168.0.0/24' <= inet'xxx.xxx.xxx.xxx/27'; +-----------------+ | <=_single_value | +=================+ | null | +-----------------+ 1 tuple (0.670ms) sql>select inet'192.168.0.0/24' = inet'xxx.xxx.xxx.xxx/27'; TypeException:user.s6_1[4]:'calc.==' undefined in: _7:any := calc.==(_5:inet, _6:inet) program contains errors sql>select inet'192.168.0.0/24' = inet'192.168.0.0/24'; TypeException:user.s7_1[4]:'calc.==' undefined in: _7:any := calc.==(_5:inet, _6:inet) program contains errors sql>select inet'192.168.0.0/24' <= inet'192.168.0.0/24'; +-----------------+ | <=_single_value | +=================+ | true | +-----------------+ 1 tuple (1.198ms) sql>select inet'192.168.0.0/24' < inet'192.168.0.0/24'; +----------------+ | <_single_value | +================+ | false | +----------------+ 1 tuple (1.104ms) sql>select inet'192.168.0.0/24' < inet'192.168.0.1/24'; +----------------+ | <_single_value | +================+ | true | +----------------+ 1 tuple (0.560ms) sql>select inet'192.168.0.1/24' <= inet'192.168.0.0/24'; +-----------------+ | <=_single_value | +=================+ | false | +-----------------+ 1 tuple (0.441ms) sql> ========
----- Original Message -----
Hello!
Thanks for your note. I'm a little confused because the functions do seem to be in the source code (monetdb5/modules/atoms/inet.c). Is it just that the functions aren't being included in the build?
One reason I ask is that I'd like to experiment with adding IPv6 support, so it would be useful to know how functions like this get linked in (or in this case, not linked in).
Thanks!
Tim
On 11/13/2014 04:13 PM, Stefan Manegold wrote:
Hi Tim,
I'm afraid the operations and functions that you want to use have not yet been implemented in MonetDB. Sorry!
Please consider filing a feature request via http://bugs.monetdb.org/
Thanks!
Best, Stefan
On November 13, 2014 2:32:27 AM CET, Tim Burress
wrote: Hello,
I'm a relatively new user and have run into a problem which may just be a misunderstanding. I'm using the Oct2014 version, installed on Fedora 20 from the MonetDB rpm repository. When I try to query a database using inet "containment" operators like << or <<= it seems that the operators are not recognized:
sql> select src,dst from raw.ids where src << inet'xxx.xxx.xxx.xxx/27'; SELECT: no such binary operator 'left_shift(inet,inet)'
sql> select src,dst from raw.ids where src <<= inet'xxx.xxx.xxx.xxx/27'; syntax error, unexpected '=' in: "select src,dst from raw.ids where src <<="
Other ordinary binary inet operators seem OK:
sql> select src,dst from raw.ids where src = inet'xxx.xxx.xxx.xxx'; (prints out table) sql> select src,dst from raw.ids where src < dst; (prints out table)
However the documented functions do not seem to be recognized:
sql> select masklen(inet'192.168.0.0/24') SELECT: no such unary operator 'masklen(inet)' sql> select netmask(inet'192.168.0.0/24') SELECT: no such unary operator 'netmask(inet)'
So it seems that support for network address types is only partially available in this release. Is that normal? Do I need to rebuild from source in order to get them?
Thanks!
Tim
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
- -- Sjoerd Mullender -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQCVAwUBVGW7gT7g04AjvIQpAQJAwAP/UWfSTaiRPboxNOIChi9co0IdoSh9LlgJ JGmupW+i/fYC+Z4W4OWfuJd1uPZkGW7+9nQLtMadM4TEkzz55FBZg0csPFkx3AhZ K1EiKecs/lVLd7jnjRxTs00MUhs/Ge+GobEtGbIvT0f3/BrReASvFDJ78fYO+Voc 2ICNK0fpYn4= =2rCQ -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 A fix for the equality test will be in the next release. On 14/11/14 09:21, Sjoerd Mullender wrote:
What if you try using sys.masklen instead?
On 14/11/14 02:42, Tim Burress wrote:
Hello!
Hmmm... I did some more experimentation and find that functions like masklen() and host() either work or do not work depending on the username given to mclient. Both users are accessing the same database. The difference is that the user who can use the functions is the authorized owner of the schema:
sql> select masklen(inet'192.168.0.0/24'); +----------------------+ | masklen_single_value | +======================+ | 24 | +----------------------+
while the other user merely has SELECT,INSERT,DELETE on some of the tables:
sql> select masklen(inet'192.168.0.0/24'); SELECT: no such unary operator'masklen(inet)'
Do I need to grant some privileges to the other users so that they can access these functions? Or if there's some information I could send to help figure this out, just let me know.
Thanks very much!
Tim
On 11/14/2014 09:38 AM, Stefan Manegold wrote:
Hi,
thank for your feedback, and sorry for my too premature answer.
Indeed, functions masklen() & netmask() are there an work fine for me (yum-installed MonetDB Oct2014 on Fedora 20).
I'm puzzled why it doesn't work with you given a seemingly identical setup. Did you try with a new virgin database, or did you upgrade your database from an earlier MonetDB version?
inet "containment" operators (<< & <<=) appear to be not supported by the parser (which interprets the first a left-shift, and does not recognize the latter as valid operator).
inequality (< & <=) appear to work fine also for me, while equality (=) gives an error.
See details below.
Best, Stefan
======== Welcome to mclient, the MonetDB/SQL interactive terminal (Oct2014) Database: MonetDB v11.19.3 (Oct2014), 'demo' Type \q to quit, \? for a list of available commands auto commit mode: on sql>select masklen(inet'192.168.0.0/24'); +----------------------+ | masklen_single_value | +======================+ | 24 | +----------------------+ 1 tuple (0.924ms) sql>select netmask(inet'192.168.0.0/24'); +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| netmask_single_value
|
+======================================================================================================================================================================================================================================================================================================================+
| 255.255.255.0
|
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 tuple (0.831ms)
sql>select inet'192.168.0.0/24' << inet'xxx.xxx.xxx.xxx/27'; SELECT: no such binary operator 'left_shift(inet,inet)' sql>select inet'192.168.0.0/24' <<= inet'xxx.xxx.xxx.xxx/27'; syntax error, unexpected '=' in: "select inet'192.168.0.0/24' <<=" sql>select inet'192.168.0.0/24' < inet'xxx.xxx.xxx.xxx/27'; +----------------+ | <_single_value | +================+ | null | +----------------+ 1 tuple (1.9s) sql>select inet'192.168.0.0/24' <= inet'xxx.xxx.xxx.xxx/27'; +-----------------+ | <=_single_value | +=================+ | null | +-----------------+ 1 tuple (0.670ms) sql>select inet'192.168.0.0/24' = inet'xxx.xxx.xxx.xxx/27'; TypeException:user.s6_1[4]:'calc.==' undefined in: _7:any := calc.==(_5:inet, _6:inet) program contains errors sql>select inet'192.168.0.0/24' = inet'192.168.0.0/24'; TypeException:user.s7_1[4]:'calc.==' undefined in: _7:any := calc.==(_5:inet, _6:inet) program contains errors sql>select inet'192.168.0.0/24' <= inet'192.168.0.0/24'; +-----------------+ | <=_single_value | +=================+ | true | +-----------------+ 1 tuple (1.198ms) sql>select inet'192.168.0.0/24' < inet'192.168.0.0/24'; +----------------+ | <_single_value | +================+ | false | +----------------+ 1 tuple (1.104ms) sql>select inet'192.168.0.0/24' < inet'192.168.0.1/24'; +----------------+ | <_single_value | +================+ | true | +----------------+ 1 tuple (0.560ms) sql>select inet'192.168.0.1/24' <= inet'192.168.0.0/24'; +-----------------+ | <=_single_value | +=================+ | false | +-----------------+ 1 tuple (0.441ms) sql> ========
----- Original Message -----
Hello!
Thanks for your note. I'm a little confused because the functions do seem to be in the source code (monetdb5/modules/atoms/inet.c). Is it just that the functions aren't being included in the build?
One reason I ask is that I'd like to experiment with adding IPv6 support, so it would be useful to know how functions like this get linked in (or in this case, not linked in).
Thanks!
Tim
On 11/13/2014 04:13 PM, Stefan Manegold wrote:
Hi Tim,
I'm afraid the operations and functions that you want to use have not yet been implemented in MonetDB. Sorry!
Please consider filing a feature request via http://bugs.monetdb.org/
Thanks!
Best, Stefan
On November 13, 2014 2:32:27 AM CET, Tim Burress
wrote: Hello,
I'm a relatively new user and have run into a problem which may just be a misunderstanding. I'm using the Oct2014 version, installed on Fedora 20 from the MonetDB rpm repository. When I try to query a database using inet "containment" operators like << or <<= it seems that the operators are not recognized:
sql> select src,dst from raw.ids where src << inet'xxx.xxx.xxx.xxx/27'; SELECT: no such binary operator 'left_shift(inet,inet)'
sql> select src,dst from raw.ids where src <<= inet'xxx.xxx.xxx.xxx/27'; syntax error, unexpected '=' in: "select src,dst from raw.ids where src <<="
Other ordinary binary inet operators seem OK:
sql> select src,dst from raw.ids where src = inet'xxx.xxx.xxx.xxx'; (prints out table) sql> select src,dst from raw.ids where src < dst; (prints out table)
However the documented functions do not seem to be recognized:
sql> select masklen(inet'192.168.0.0/24') SELECT: no such unary operator 'masklen(inet)' sql> select netmask(inet'192.168.0.0/24') SELECT: no such unary operator 'netmask(inet)'
So it seems that support for network address types is only partially available in this release. Is that normal? Do I need to rebuild from source in order to get them?
Thanks!
Tim
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
- -- Sjoerd Mullender -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQCVAwUBVGXD8j7g04AjvIQpAQKy4AQAts/fHMH79j55bHUty1hICsb2SlhqLu/F vON9bAuLdnGP96wVI6hY3RD+pMCS3hs36DjJdpZ19o/A65QoeVjL6vsvDGr/nm9z feIUWx3d05l4XftbFtH3//Omx3hl0Ek4sYea2QNUZlvdYfkE3zO6HJ9Y6KYNp7Dc 3h0KDp+5UT0= =cPIn -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/14/2014 05:21 PM, Sjoerd Mullender wrote:
What if you try using sys.masklen instead?
Yes, that works! Adding the 'sys.' prefix seems to make the inet functions, and many others (like median(), gethost(), etc), available. Do I have something wrong in the way the users are set up? The one set of functions that still seem to be unreachable are the inet containment operators like << >> <<= and >>=. Thanks! Tim
On 14/11/14 02:42, Tim Burress wrote:
Hello!
Hmmm... I did some more experimentation and find that functions like masklen() and host() either work or do not work depending on the username given to mclient. Both users are accessing the same database. The difference is that the user who can use the functions is the authorized owner of the schema:
sql> select masklen(inet'192.168.0.0/24'); +----------------------+ | masklen_single_value | +======================+ | 24 | +----------------------+
while the other user merely has SELECT,INSERT,DELETE on some of the tables:
sql> select masklen(inet'192.168.0.0/24'); SELECT: no such unary operator'masklen(inet)'
Do I need to grant some privileges to the other users so that they can access these functions? Or if there's some information I could send to help figure this out, just let me know.
Thanks very much!
Tim
On 11/14/2014 09:38 AM, Stefan Manegold wrote:
Hi,
thank for your feedback, and sorry for my too premature answer.
Indeed, functions masklen() & netmask() are there an work fine for me (yum-installed MonetDB Oct2014 on Fedora 20).
I'm puzzled why it doesn't work with you given a seemingly identical setup. Did you try with a new virgin database, or did you upgrade your database from an earlier MonetDB version?
inet "containment" operators (<< & <<=) appear to be not supported by the parser (which interprets the first a left-shift, and does not recognize the latter as valid operator).
inequality (< & <=) appear to work fine also for me, while equality (=) gives an error.
See details below.
Best, Stefan
======== Welcome to mclient, the MonetDB/SQL interactive terminal (Oct2014) Database: MonetDB v11.19.3 (Oct2014), 'demo' Type \q to quit, \? for a list of available commands auto commit mode: on sql>select masklen(inet'192.168.0.0/24'); +----------------------+ | masklen_single_value | +======================+ | 24 | +----------------------+ 1 tuple (0.924ms) sql>select netmask(inet'192.168.0.0/24'); +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| netmask_single_value
|
+======================================================================================================================================================================================================================================================================================================================+
| 255.255.255.0
|
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 tuple (0.831ms)
sql>select inet'192.168.0.0/24' << inet'xxx.xxx.xxx.xxx/27'; SELECT: no such binary operator 'left_shift(inet,inet)' sql>select inet'192.168.0.0/24' <<= inet'xxx.xxx.xxx.xxx/27'; syntax error, unexpected '=' in: "select inet'192.168.0.0/24' <<=" sql>select inet'192.168.0.0/24' < inet'xxx.xxx.xxx.xxx/27'; +----------------+ | <_single_value | +================+ | null | +----------------+ 1 tuple (1.9s) sql>select inet'192.168.0.0/24' <= inet'xxx.xxx.xxx.xxx/27'; +-----------------+ | <=_single_value | +=================+ | null | +-----------------+ 1 tuple (0.670ms) sql>select inet'192.168.0.0/24' = inet'xxx.xxx.xxx.xxx/27'; TypeException:user.s6_1[4]:'calc.==' undefined in: _7:any := calc.==(_5:inet, _6:inet) program contains errors sql>select inet'192.168.0.0/24' = inet'192.168.0.0/24'; TypeException:user.s7_1[4]:'calc.==' undefined in: _7:any := calc.==(_5:inet, _6:inet) program contains errors sql>select inet'192.168.0.0/24' <= inet'192.168.0.0/24'; +-----------------+ | <=_single_value | +=================+ | true | +-----------------+ 1 tuple (1.198ms) sql>select inet'192.168.0.0/24' < inet'192.168.0.0/24'; +----------------+ | <_single_value | +================+ | false | +----------------+ 1 tuple (1.104ms) sql>select inet'192.168.0.0/24' < inet'192.168.0.1/24'; +----------------+ | <_single_value | +================+ | true | +----------------+ 1 tuple (0.560ms) sql>select inet'192.168.0.1/24' <= inet'192.168.0.0/24'; +-----------------+ | <=_single_value | +=================+ | false | +-----------------+ 1 tuple (0.441ms) sql> ========
----- Original Message -----
Hello!
Thanks for your note. I'm a little confused because the functions do seem to be in the source code (monetdb5/modules/atoms/inet.c). Is it just that the functions aren't being included in the build?
One reason I ask is that I'd like to experiment with adding IPv6 support, so it would be useful to know how functions like this get linked in (or in this case, not linked in).
Thanks!
Tim
On 11/13/2014 04:13 PM, Stefan Manegold wrote:
Hi Tim,
I'm afraid the operations and functions that you want to use have not yet been implemented in MonetDB. Sorry!
Please consider filing a feature request via http://bugs.monetdb.org/
Thanks!
Best, Stefan
On November 13, 2014 2:32:27 AM CET, Tim Burress
wrote: Hello,
I'm a relatively new user and have run into a problem which may just be a misunderstanding. I'm using the Oct2014 version, installed on Fedora 20 from the MonetDB rpm repository. When I try to query a database using inet "containment" operators like << or <<= it seems that the operators are not recognized:
sql> select src,dst from raw.ids where src << inet'xxx.xxx.xxx.xxx/27'; SELECT: no such binary operator 'left_shift(inet,inet)'
sql> select src,dst from raw.ids where src <<= inet'xxx.xxx.xxx.xxx/27'; syntax error, unexpected '=' in: "select src,dst from raw.ids where src <<="
Other ordinary binary inet operators seem OK:
sql> select src,dst from raw.ids where src = inet'xxx.xxx.xxx.xxx'; (prints out table) sql> select src,dst from raw.ids where src < dst; (prints out table)
However the documented functions do not seem to be recognized:
sql> select masklen(inet'192.168.0.0/24') SELECT: no such unary operator 'masklen(inet)' sql> select netmask(inet'192.168.0.0/24') SELECT: no such unary operator 'netmask(inet)'
So it seems that support for network address types is only partially available in this release. Is that normal? Do I need to rebuild from source in order to get them?
Thanks!
Tim
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUZctpAAoJEPLlduTZaDA19pgP/RhijyVZ0ugp48cpkU29+Sbg 8xgojGqj7IozGPtRZMPVPTp7XW6yHV8nW4IbmS23nlQdErDfylAn8BTyRqmR+f6c 9MmKtvnZgOClackLXFb1YcQ4BaSObev0oTqC92aeRV8pNjkLYYezUd/FGj7+0j2J VnfkFaBcgsB6e4qGT4NQvG8LO1O1P7G6sFab/k+2ZGVO4xuNezOPMQ6dOJqnuUo5 lWvqqAlpv1jCYPJFQtLoKeiGrPwcgTG/xy/pM/Ml1LZUIDN7eFMcWyazTPcJ0C0G Gf9szYJduL5H3GGPO57bkf6BhfPStX0mArUFmQ5dG3LoXMR0JeLjKVSOJh3oMZB0 jDdo5T+yi6DvKXLk5FDMmMWy75sr2aB+70xKA3syUcLQvJBQZYhAexB5YIKbbQIu o86/HQ62vgFQQTeb/d79npSKu/RBptb67wydfIBpwfuMYLZX4321z45W2/QvDmqe IjJ9PhtkPf6jUDGhKjDlSu71DR7VyIJo3htEbqf3w6efOhTgaVMDnHfz7sRtE3Bo 4NI0MBLNAlVqB09f8z6K2Anmv5kMNz85aJ89KfxWuyzmMwiOTPs9zIP/ygRu5+Ct udeUFWrOLJkzeTijLIesv1vhjG9PqS9GPfINumPtm3ekZ6uuSnpMJjNlESkCd6FY GiIeE9+DIA6LZdWN8ltd =/UMc -----END PGP SIGNATURE-----
participants (3)
-
Sjoerd Mullender
-
Stefan Manegold
-
Tim Burress