Update of /cvsroot/monetdb/MonetDB5/src/mal
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv30355
Modified Files:
mal_parser.mx mal_utils.mx mal_import.mx
Log Message:
A real old bug appeared. Literal character constants were not properly
dealt with.
Still there is an issue, due to the way MonetDB kernel formats them.
It means that c:='\n' is printed as '\012'. This also holds for M4.
Index: mal_parser.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_parser.mx,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -d -r1.201 -r1.202
--- mal_parser.mx 17 Aug 2007 13:56:23 -0000 1.201
+++ mal_parser.mx 19 Aug 2007 16:33:57 -0000 1.202
@@ -744,11 +744,15 @@
v++; i++;
switch(*v){
case 'n':
+ v++; i++;
cst->val.cval[0]= '\n';
break;
case 'r':
+ v++; i++;
cst->val.cval[0]= '\r';
+ break;
case 't':
+ v++; i++;
cst->val.cval[0]= '\t';
break;
case '\\':
@@ -756,6 +760,7 @@
cst->val.cval[0]= *v;
break;
default:
+ cst->val.cval[0]= (char) strtol(v,NULL,0);
if (isdigit(*v)) {
i++; v++;
}
@@ -765,15 +770,12 @@
if (isdigit(*v)) {
i++; v++;
}
- cst->val.cval[0]= (char) strtol(v,NULL,0);
}
} else {
cst->val.cval[0]= *v;
- v++;
+ i++; v++;
}
- if (*v != '\'')
- return i+1;
- return i+2;
+ return i+1;
}
@+ The Parser
The client is responsible to collect the
Index: mal_utils.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_utils.mx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- mal_utils.mx 5 Jan 2007 10:09:43 -0000 1.14
+++ mal_utils.mx 19 Aug 2007 16:34:01 -0000 1.15
@@ -44,11 +44,6 @@
{
char *p = msg, *s;
- /* first skip over leading white space */
- while (*p && isspace((int) *p))
- p++;
- /* get quoted string and remove leading bracket first */
- p++;
s = p;
while (*p) {
if (*p == '\\') {
Index: mal_import.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_import.mx,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- mal_import.mx 25 Jul 2007 11:30:33 -0000 1.69
+++ mal_import.mx 19 Aug 2007 16:34:02 -0000 1.70
@@ -274,6 +274,7 @@
s = n;
len++;
}
+ if( *s== '"') s++;
mal_unquote(qry = GDKstrdup(s));
buffer_init(b, qry, len);
MCpushClientInput(c, bstream_create(buffer_rastream(b,
"compileString"), b->len), 0, "");
@@ -332,6 +333,7 @@
s = n;
len++;
}
+ if( *s=='"') s++;
mal_unquote(qry = GDKstrdup(s));
buffer_init(b, qry, len);
MCpushClientInput(c, bstream_create(buffer_rastream(b, "callString"),
b->len), listing, "");
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins