Update of /cvsroot/monetdb/sql/src/backends/monet4
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv32459/src/backends/monet4
Modified Files:
Tag: GDK-2
sql_result.mx sql_server.mx
Log Message:
prepared sql for the split bats
m4/sql runs as well as before the split
m5/sql needs a bit more work (about 35 failing tests)
Index: sql_result.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet4/sql_result.mx,v
retrieving revision 1.62
retrieving revision 1.62.2.1
diff -u -d -r1.62 -r1.62.2.1
--- sql_result.mx 9 Jul 2007 09:58:13 -0000 1.62
+++ sql_result.mx 12 Aug 2007 17:42:26 -0000 1.62.2.1
@@ -250,9 +250,10 @@
BUN p, q;
size_t max = 0;
size_t l = 0;
+ BATiter bi = bat_iterator(b);
BATloop(b, p, q) {
- char *s = BUNtail(b, p);
+ char *s = BUNtail(bi, p);
l = strlen(s);
if (l > max)
@@ -269,9 +270,10 @@
lng max = 0;
lng min = 0;
size_t ret = 0;
+ BATiter bi = bat_iterator(b);
BATloop(b, p, q) {
- @1 l = *((@1 *)BUNtail(b, p));
+ @1 l = *((@1 *)BUNtail(bi, p));
if (l == @1_nil) l = 4;
if (l > max) max = l;
if (l < min) min = l;
@@ -720,6 +722,7 @@
break;
fmt[i].c = BATdescriptor(c->b);
+ fmt[i].ci = bat_iterator(fmt[i].c);
fmt[i].name = NULL;
fmt[i].sep = ((i - 1) < (t->nr_cols - 1)) ? _strdup(sep) :
_strdup(rsep);
fmt[i].seplen = _strlen(fmt[i].sep);
Index: sql_server.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet4/sql_server.mx,v
retrieving revision 1.171
retrieving revision 1.171.2.1
diff -u -d -r1.171 -r1.171.2.1
--- sql_server.mx 15 Jul 2007 20:47:31 -0000 1.171
+++ sql_server.mx 12 Aug 2007 17:42:26 -0000 1.171.2.1
@@ -454,12 +454,12 @@
mvc_bat_next_value(BAT **res, mvc *C, BAT *snames, str seqname)
{
mvc *c = *(mvc**)C;
- int xx;
BAT *r;
BUN p,q;
sql_schema *s = NULL;
sql_sequence *seq = NULL;
seqbulk *sb = NULL;
+ BATiter snamesi = bat_iterator(snames);
r = BATnew(snames->htype, TYPE_lng, BATcount(snames));
if (!r) {
@@ -473,8 +473,8 @@
return GDK_SUCCEED;
}
- BATloopFast(snames,p,q,xx){
- str sname = BUNtail(snames,BUNfirst(snames));
+ BATloop(snames,p,q){
+ str sname = BUNtail(snamesi,BUNfirst(snames));
lng l;
if (!s || strcmp(s->base.name, sname) != 0) {
@@ -496,7 +496,7 @@
GDKerror("sql.next_value error");
return GDK_FAIL;
}
- BUNins(r, BUNhead(snames,p), &l, FALSE);
+ BUNins(r, BUNhead(snamesi,p), &l, FALSE);
}
if (sb)
seqbulk_destroy(sb);
@@ -1369,7 +1369,8 @@
if (c == 0) {
p = ATOMnilptr(b->ttype);
} else if (c == 1) {
- p = BUNtail(b,BUNfirst(b));
+ BATiter bi = bat_iterator(b);
+ p = BUNtail(bi,BUNfirst(b));
} else {
p = NULL;
GDKerror("zero_or_one: cardinality violation (%d>1)", c);
@@ -1402,12 +1403,10 @@
return GDK_SUCCEED;
} else if (b->tsorted&1) {
BUN p,q;
- int sz;
- oid c = *(oid*)BUNtloc(b, BUNfirst(b));
- sz = BUNsize(b);
- for(p=BUNfirst(b)+sz, q=BUNlast(b);p<q;p+=sz) {
- oid v = *(oid*)BUNtloc(b,p);
+ oid c = *(oid*)Tloc(b, BUNfirst(b));
+ for(p=BUNfirst(b), q=BUNlast(b); p<q; p++) {
+ oid v = *(oid*)Tloc(b,p);
if (v<=c) {
*ret = TRUE;
break;
-------------------------------------------------------------------------
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-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins