Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory
sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28939/src/backends/monet5
Modified Files:
Tag: Nov2009
sql_result.mx sql_scenario.mx
Log Message:
fix leak in sql_result.mx
Index: sql_result.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_result.mx,v
retrieving revision 1.127.2.6
retrieving revision 1.127.2.7
diff -u -d -r1.127.2.6 -r1.127.2.7
--- sql_result.mx 10 Nov 2009 19:02:35 -0000 1.127.2.6
+++ sql_result.mx 30 Nov 2009 20:32:58 -0000 1.127.2.7
@@ -281,7 +281,6 @@
sql_subtype *t = &col->type;
unsigned int i, neg = 0;
- char *p = s;
@1 *r;
@1 res = 0;
if (*s == '-'){
@@ -292,10 +291,8 @@
s++;
}
for (i = 0; i < (t->digits-t->scale) && *s != '.' && *s; i++, s++) {
- if (!*s || *s < '0' || *s > '9') {
- createException(SQL,"sql", "decimal wrong format (%s)
digit expected", p);
+ if (!*s || *s < '0' || *s > '9')
return NULL;
- }
res *= 10;
res += (*s-'0');
}
@@ -305,14 +302,11 @@
}
}
if (*s) {
- if (*s != '.') {
- createException(SQL,"sql", "decimal wrong format (%s)
'.' expected", p);
+ if (*s != '.')
return NULL;
- }
s++;
for( i = 0; *s && i < t->scale; i++, s++) {
if (*s < '0' || *s > '9') {
- createException(SQL,"sql", "decimal wrong
format (%s)", p);
return NULL;
}
res *= 10;
@@ -322,10 +316,8 @@
res *= 10;
}
}
- if (*s) {
- createException(SQL,"sql", "decimal wrong format (%s) too many
characters", p);
+ if (*s)
return NULL;
- }
r = c->data;
if (!r)
r = (@1*)GDKmalloc(sizeof(@1));
@@ -344,7 +336,6 @@
(void)e;
(void)quote;
if (s == e) {
- createException(SQL, "sql", "Decimal cannot be parsed from
%s\n", ATOMname(type));
return NULL;
} else if (type == TYPE_bte) {
@:dec_frstr(bte)@
@@ -354,8 +345,6 @@
@:dec_frstr(int)@
} else if (type == TYPE_lng) {
@:dec_frstr(lng)@
- } else {
- createException(SQL, "sql", "Decimal cannot be parsed from
%s\n", ATOMname(type));
}
return NULL;
}
Index: sql_scenario.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_scenario.mx,v
retrieving revision 1.356.2.15
retrieving revision 1.356.2.16
diff -u -d -r1.356.2.15 -r1.356.2.16
--- sql_scenario.mx 22 Nov 2009 20:30:17 -0000 1.356.2.15
+++ sql_scenario.mx 30 Nov 2009 20:32:58 -0000 1.356.2.16
@@ -521,6 +521,7 @@
static str
SQLstatementIntern(Client c, str *expr, str nme, int execute, bit output)
{
+ int pstatus = 0;
int err = 0;
mvc *o, *m;
int ac, sizevars, topvars;
@@ -545,6 +546,7 @@
m = sql->mvc;
ac = m->session->auto_commit;
SQLtrans(m);
+ pstatus = m->session->status;
if (!m->sa)
m->sa = sa_create();
@@ -606,13 +608,9 @@
stmt *s = sql_symbol2stmt(m, m->sym);
MSinitClientPrg(c,"user",nme);
- if (!s && (err = mvc_status(m))) {
- stream_printf(c->fdout, "%s\n", m->errstr);
- if( m->errstr)
- msg = createException(PARSE, "SQLparser", "%s",
m->errstr);
- else
- msg = createException(PARSE, "SQLparser",
"Semantic errors");
- *m->errstr = 0;
+ if (s==0 || (err = mvc_status(m))) {
+ msg = createException(PARSE, "SQLparser", "%s",
m->errstr);
+ handle_error(m, c->fdout, pstatus);
sqlcleanup(m, err);
/* restore the state */
freeSymbol(c->curprg);
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins