Changeset: 168ce2b82ad3 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=168ce2b82ad3 Added Files: monetdb5/mal/Tests/malids.malC monetdb5/mal/Tests/malids.stable.err monetdb5/mal/Tests/malids.stable.out Modified Files: monetdb5/mal/Tests/All monetdb5/mal/mal_parser.c Branch: default Log Message:
Enlarge parsing of type identifiers Only look for the special cases 'any', 'any_' diffs (134 lines): diff --git a/monetdb5/mal/Tests/All b/monetdb5/mal/Tests/All --- a/monetdb5/mal/Tests/All +++ b/monetdb5/mal/Tests/All @@ -199,3 +199,4 @@ flowchk dynamicload pithole +malids diff --git a/monetdb5/mal/Tests/malids.malC b/monetdb5/mal/Tests/malids.malC new file mode 100644 --- /dev/null +++ b/monetdb5/mal/Tests/malids.malC @@ -0,0 +1,14 @@ +module cip_chop; + +atom cipchop1 : oid; + +atom cip_chop1 : oid; + +command foo1(:bat[:oid]) :bat[:oid] +address MATHpi; + +command foo2(:bat[:oid]) :bat[:cipchop1] +address MATHpi; + +command foo3(:bat[:oid]) :bat[:cip_chop1] +address MATHpi; diff --git a/monetdb5/mal/Tests/malids.stable.err b/monetdb5/mal/Tests/malids.stable.err new file mode 100644 --- /dev/null +++ b/monetdb5/mal/Tests/malids.stable.err @@ -0,0 +1,34 @@ +stderr of test 'malids` in directory 'monetdb5/mal` itself: + + +# 10:19:27 > +# 10:19:27 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=34785" "--set" "mapi_usock=/var/tmp/mtest-3702/.s.monetdb.34785" "--set" "monet_prompt=" "--forcemito" "--dbpath=/export/scratch1/mk/default//Linux/var/MonetDB/mTests_monetdb5_mal" +# 10:19:27 > + +# builtin opt gdk_dbpath = /export/scratch1/mk/default//Linux/var/monetdb5/dbfarm/demo +# builtin opt gdk_debug = 0 +# builtin opt gdk_vmtrim = no +# builtin opt monet_prompt = > +# builtin opt monet_daemon = no +# builtin opt mapi_port = 50000 +# builtin opt mapi_open = false +# builtin opt mapi_autosense = false +# builtin opt sql_optimizer = default_pipe +# builtin opt sql_debug = 0 +# cmdline opt gdk_nr_threads = 0 +# cmdline opt mapi_open = true +# cmdline opt mapi_port = 34785 +# cmdline opt mapi_usock = /var/tmp/mtest-3702/.s.monetdb.34785 +# cmdline opt monet_prompt = +# cmdline opt gdk_dbpath = /export/scratch1/mk/default//Linux/var/MonetDB/mTests_monetdb5_mal +# cmdline opt gdk_debug = 536870922 + +# 10:19:27 > +# 10:19:27 > "mclient" "-lmal" "-ftest" "-Eutf-8" "--host=/var/tmp/mtest-3702" "--port=34785" +# 10:19:27 > + + +# 10:19:27 > +# 10:19:27 > "Done." +# 10:19:27 > + diff --git a/monetdb5/mal/Tests/malids.stable.out b/monetdb5/mal/Tests/malids.stable.out new file mode 100644 --- /dev/null +++ b/monetdb5/mal/Tests/malids.stable.out @@ -0,0 +1,31 @@ +stdout of test 'malids` in directory 'monetdb5/mal` itself: + + +# 10:19:27 > +# 10:19:27 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=34785" "--set" "mapi_usock=/var/tmp/mtest-3702/.s.monetdb.34785" "--set" "monet_prompt=" "--forcemito" "--dbpath=/export/scratch1/mk/default//Linux/var/MonetDB/mTests_monetdb5_mal" +# 10:19:27 > + +# MonetDB 5 server v11.26.0 +# This is an unreleased version +# Serving database 'mTests_monetdb5_mal', using 8 threads +# Compiled for x86_64-unknown-linux-gnu/64bit with 128bit integers +# Found 15.589 GiB available main-memory. +# Copyright (c) 1993-July 2008 CWI. +# Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved +# Visit http://www.monetdb.org/ for further information +# Listening for connection requests on mapi:monetdb://vienna.da.cwi.nl:34785/ +# Listening for UNIX domain connection requests on mapi:monetdb:///var/tmp/mtest-3702/.s.monetdb.34785 +# MonetDB/GIS module loaded +# MonetDB/SQL module loaded + +Ready. + +# 10:19:27 > +# 10:19:27 > "mclient" "-lmal" "-ftest" "-Eutf-8" "--host=/var/tmp/mtest-3702" "--port=34785" +# 10:19:27 > + + +# 10:19:27 > +# 10:19:27 > "Done." +# 10:19:27 > + diff --git a/monetdb5/mal/mal_parser.c b/monetdb5/mal/mal_parser.c --- a/monetdb5/mal/mal_parser.c +++ b/monetdb5/mal/mal_parser.c @@ -145,6 +145,7 @@ static int typeidLength(Client cntxt) { int l; + char id[IDLENGTH], *t= id; str s; skipSpace(cntxt); s = CURRENT(cntxt); @@ -152,13 +153,16 @@ typeidLength(Client cntxt) if (!idCharacter[(int) (*s)]) return 0; l = 1; - s++; - idCharacter[TMPMARKER] = 0; + *t++ = *s++; while (l < IDLENGTH && (idCharacter[(int) (*s)] || isdigit(*s)) ) { - s++; + *t++ = *s++; l++; } - idCharacter[TMPMARKER] = 1; + /* recognize the special type variables {any, any_<nr>} */ + if( strncmp(id, "any",3) == 0) + return 3; + if( strncmp(id, "any_",4) == 0) + return 4; return l; } _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list