Update of /cvsroot/monetdb/sql/src/backends/monet4
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29119/src/backends/monet4
Modified Files:
Tag: SQL_2-16
sql_server.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: sql_server.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet4/sql_server.mx,v
retrieving revision 1.157.2.3
retrieving revision 1.157.2.4
diff -u -d -r1.157.2.3 -r1.157.2.4
--- sql_server.mx 14 Mar 2007 09:59:21 -0000 1.157.2.3
+++ sql_server.mx 16 Mar 2007 14:54:35 -0000 1.157.2.4
@@ -74,13 +74,13 @@
.COMMAND setVariable( mvc m, str varname, any::1 val ) = setVariable;
"Set the value of a session variable in the mvc structure"
- .COMMAND mvc_next_value( mvc m, str sequence ) : lng = mvc_next_value;
+ .COMMAND mvc_next_value( mvc m, str sname, str seqname ) : lng =
mvc_next_value;
"return the next value of the sequence"
- .COMMAND mvc_get_value( mvc m, str sequence ) : lng = mvc_get_value;
+ .COMMAND mvc_get_value( mvc m, str sname, str sequence ) : lng =
mvc_get_value;
"return the current value of the sequence"
- .COMMAND mvc_restart_seq( mvc m, str sequence, lng start ) : lng =
mvc_restart_seq;
+ .COMMAND mvc_restart_seq( mvc m, str sname, str sequence, lng start ) :
lng = mvc_restart_seq;
"restart the sequence with value start"
@-
The updates against the relational tables are collected in separate
@@ -414,10 +414,10 @@
/* TODO pass also the schema name */
int
-mvc_next_value(lng *res, mvc *C, str seqname)
+mvc_next_value(lng *res, mvc *C, str sname, str seqname)
{
mvc *c = *(mvc**)C;
- sql_schema *s = c->session->schema;
+ sql_schema *s = mvc_bind_schema(c, sname);
if (s) {
sql_sequence *seq = find_sql_sequence(s, seqname);
@@ -428,10 +428,10 @@
return GDK_FAIL;
}
int
-mvc_get_value(lng *res, mvc *C, str seqname)
+mvc_get_value(lng *res, mvc *C, str sname, str seqname)
{
mvc *c = *(mvc**)C;
- sql_schema *s = c->session->schema;
+ sql_schema *s = mvc_bind_schema(c, sname);
if (s) {
sql_sequence *seq = find_sql_sequence(s, seqname);
@@ -443,10 +443,10 @@
}
int
-mvc_restart_seq(lng *res, mvc *C, str seqname, lng *start)
+mvc_restart_seq(lng *res, mvc *C, str sname, str seqname, lng *start)
{
mvc *c = *(mvc**)C;
- sql_schema *s = c->session->schema;
+ sql_schema *s = mvc_bind_schema(c, sname);
if (s) {
sql_sequence *seq = find_sql_sequence(s, seqname);
@@ -1381,14 +1381,14 @@
# forward reference, will be filled in the sql session
var myc := mvc(ptr(nil));
-proc next_value( str v ) : lng {
- return mvc_next_value(myc, v);
+proc next_value( str sname, str v ) : lng {
+ return mvc_next_value(myc, sname, v);
}
-proc get_value( str v ) : lng {
- return mvc_get_value(myc, v);
+proc get_value( str sname, str v ) : lng {
+ return mvc_get_value(myc, sname, v);
}
-proc restart( str seq, lng v ) : lng {
- return mvc_restart_seq(myc, seq, v);
+proc restart( str sname, str seq, lng v ) : lng {
+ return mvc_restart_seq(myc, sname, seq, v);
}
proc SQLgroup(BAT[oid,any] a) : grp {
-------------------------------------------------------------------------
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