Update of /cvsroot/monetdb/sql/src/storage/bat
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29119/src/storage/bat
Modified Files:
Tag: SQL_2-16
bat_store.mx sql_catalog.mx
Log Message:
fixes for the following bugs
1) set role while user isn't granted that role succeeded incorrectly
2) role grants were incorrectly stored (cut/paste problem)
3) automatic sequence numbers (AUTO_INCREMENT and SERIAL) were
allways created in the 'sys' schema.
4) the schema part of sequence numbers statements was never used
5) the NEXT VALUE, get_value, restart should use the schema part of
the sequence number
Index: bat_store.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/bat/bat_store.mx,v
retrieving revision 1.120.2.1
retrieving revision 1.120.2.2
diff -u -d -r1.120.2.1 -r1.120.2.2
--- bat_store.mx 23 Jan 2007 13:27:40 -0000 1.120.2.1
+++ bat_store.mx 16 Mar 2007 14:54:37 -0000 1.120.2.2
@@ -3189,18 +3189,21 @@
if (rollforward_updates) {
for (n = fs->set->h; ok == LOG_OK && n && n !=
fs->nelm; n = n->next) {
sql_base *fb = n->data;
- node *tbn = cs_find_name(ts, fb->name);
- if (tbn && fb->wtime && fb->flag == TR_OLD) {
- sql_base *tb = tbn->data;
+ if (fb->wtime && fb->flag == TR_OLD) {
+ node *tbn = cs_find_id(ts, fb->id);
- /* update timestamps */
- if (fb->rtime && tr->stime > tb->rtime)
- tb->rtime = tr->stime;
- if (fb->wtime && tr->stime > tb->wtime)
- tb->wtime = tr->stime;
+ if (tbn) {
+ sql_base *tb = tbn->data;
- ok = rollforward_updates(tr, fb, tb);
+ /* update timestamps */
+ if (fb->rtime && tr->stime >
tb->rtime)
+ tb->rtime = tr->stime;
+ if (fb->wtime && tr->stime >
tb->wtime)
+ tb->wtime = tr->stime;
+
+ ok = rollforward_updates(tr,
fb, tb);
+ }
}
fb->rtime = fb->wtime = 0;
}
@@ -3982,8 +3985,12 @@
if (cs_size(&s->tables))
for (n = s->tables.set->h; n; n = n->next) {
sql_table *t = n->data;
- sql_table *ot = find_sql_table(os, t->base.name);
+ sql_table *ot;
+
+ if (!t->base.wtime && !t->base.rtime)
+ continue;
+ ot = find_sql_table(os, t->base.name);
if (ot && isTable(ot) && isTable(t)) {
if (t->base.wtime && (t->base.wtime <
ot->base.rtime || (t->base.wtime < ot->base.wtime && t->base.rtime)))
return 0;
Index: sql_catalog.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/bat/sql_catalog.mx,v
retrieving revision 1.16
retrieving revision 1.16.2.1
diff -u -d -r1.16 -r1.16.2.1
--- sql_catalog.mx 3 Jan 2007 12:39:50 -0000 1.16
+++ sql_catalog.mx 16 Mar 2007 14:54:37 -0000 1.16.2.1
@@ -44,6 +44,24 @@
}
node *
+cs_find_id(changeset * cs, int id)
+{
+ node *n;
+ list *l = cs->set;
+
+ if (l)
+ for (n = l->h; n; n = n->next) {
+ sql_base *b = n->data;
+
+ /* check if names match */
+ if (b->id == id) {
+ return n;
+ }
+ }
+ return NULL;
+}
+
+node *
list_find_id(list *l, int id)
{
node *n;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins