[1781] in Moira

home help back first fref pref prev next nref lref last post

patch for machine container mapping

daemon@ATHENA.MIT.EDU (Qing Dong)
Mon Apr 30 16:20:42 2001

Message-Id: <200104302020.QAA06075@melbourne-city-street.mit.edu>
Date: Mon, 30 Apr 2001 16:15:41 -0400
To: moiradev@mit.edu
From: Qing Dong <dongq@MIT.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"

The following patch may fix the two problems I am
having when testing the new code:
1. when using update_container to rename a container
that has subcontainers, it returns DBMS error code  1480: trailing
NULL missing from STR bind value
2. add_machine_to_container shouldn't allow one machine to be
assigned to more than one container. 

Thanks. 

Index: qsupport.pc
===================================================================
RCS file:
\\dongq-afs\all\athena.mit.edu\astaff\project\moiradev\repository/moira/serv
er/qsupport.pc,v
retrieving revision 2.33
diff -c -r2.33 qsupport.pc
*** qsupport.pc	2001/04/26 21:26:10	2.33
--- qsupport.pc	2001/04/30 20:02:31
***************
*** 1923,1929 ****
        EXEC SQL FETCH csr_ucon INTO :childname, :childid;
        if (sqlca.sqlcode)
  	      break;
!       
        /* concatenate the new parent name with the existing sub-container
name
         * we get the sub-containers new name */
        tmpchar = childname + strlen(name);
--- 1923,1930 ----
        EXEC SQL FETCH csr_ucon INTO :childname, :childid;
        if (sqlca.sqlcode)
  	      break;
! 
! 	  strcpy(childname, strtrim(childname));      
        /* concatenate the new parent name with the existing sub-container
name
         * we get the sub-containers new name */
        tmpchar = childname + strlen(name);

Index: queries2.c
===================================================================
RCS file:
\\dongq-afs\all\athena.mit.edu\astaff\project\moiradev\repository/moira/serv
er/queries2.c,v
retrieving revision 2.83
diff -c -r2.83 queries2.c
*** queries2.c	2001/04/26 21:26:11	2.83
--- queries2.c	2001/04/30 15:56:14
***************
*** 3222,3227 ****
--- 3222,3240 ----
    amcn_valobj,
    2,
    "mach_id",
+   "mach_id = %d",
+   1,
+   0,
+   access_container,
+   0,
+   set_mach_modtime_by_id,
+ };
+ 
+ static struct validate dmcn_validate = /* for amtn and dmfn */
+ {
+   amcn_valobj,
+   2,
+   "mach_id",
    "mach_id = %d and cnt_id = %d",
    2,
    0,
***************
*** 6685,6691 ****
      "mach_id = %d AND cnt_id = %d",
      2,
      NULL,
!     &amcn_validate,
    },
  
    {
--- 6698,6704 ----
      "mach_id = %d AND cnt_id = %d",
      2,
      NULL,
!     &dmcn_validate,
    },




home help back first fref pref prev next nref lref last post