EXEC SQL END DECLARE SECTION;
#ifsql INGRES
- EXEC SQL CONNECT sms;
+ EXEC SQL CONNECT moira;
+ EXEC SQL SET LOCKMODE SESSION WHERE LEVEL=TABLE, READLOCK=SHARED;
#endsql
#ifsql INFORMIX
- EXEC SQL DATABASE sms;
+ EXEC SQL DATABASE moira;
#endsql
if (argc == 2) {
outf = NULL;
}
+ /* The following is declarative, not executed,
+ * and so is dependent on where it is in the file,
+ * not in the order of execution of statements.
+ */
EXEC SQL WHENEVER SQLERROR GOTO sqlerr;
machines = create_hash(1000);
EXEC SQL DECLARE x CURSOR FOR
SELECT DISTINCT f.mach_id, count(f.filsys_id)
FROM filesys f
- WHERE f.type="NFS"
+ WHERE f.type='NFS'
GROUP BY f.mach_id;
EXEC SQL OPEN x;
while (1) {
EXEC SQL FETCH x INTO :id, :n;
if (sqlca.sqlcode != 0) break;
- fprintf(out, "%s %d\n", hash_lookup(machines, id), n);
+ fprintf(out, "%-32s %d\n", hash_lookup(machines, id), n);
}
EXEC SQL CLOSE x;
sqlerr:
com_err(whoami, MR_INGRES_ERR, " code %d\n", sqlca.sqlcode);
+#ifsql INGRES
+ if (sqlca.sqlcode == 17700 || sqlca.sqlcode == -37000)
+ exit(MR_DEADLOCK);
+#endsql
critical_alert("DCM", "Central America build encountered INGRES ERROR %d",
sqlca.sqlcode);
exit(MR_INGRES_ERR);