Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Reactor error - core dumped!


devel / comp.lang.mumps / $Query error when globals are mapped at the subscript level

SubjectAuthor
o $Query error when globals are mapped at the subscript levelAlan O'Neill

1
$Query error when globals are mapped at the subscript level

<0dcdc3c0-f948-42cc-8d85-862458c1a6c1n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=475&group=comp.lang.mumps#475

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:ac8:684:0:b0:3a5:b02:a3b7 with SMTP id f4-20020ac80684000000b003a50b02a3b7mr13508532qth.277.1668453548460;
Mon, 14 Nov 2022 11:19:08 -0800 (PST)
X-Received: by 2002:a05:6214:1846:b0:4bb:9dd2:d7a0 with SMTP id
d6-20020a056214184600b004bb9dd2d7a0mr14042628qvy.25.1668453548199; Mon, 14
Nov 2022 11:19:08 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Mon, 14 Nov 2022 11:19:07 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=162.129.250.10; posting-account=qprvMQoAAABJTEC9Gq-vF8RqQ9XYXh1Y
NNTP-Posting-Host: 162.129.250.10
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0dcdc3c0-f948-42cc-8d85-862458c1a6c1n@googlegroups.com>
Subject: $Query error when globals are mapped at the subscript level
From: aoneill5jhh@gmail.com (Alan O'Neill)
Injection-Date: Mon, 14 Nov 2022 19:19:08 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4188
 by: Alan O'Neill - Mon, 14 Nov 2022 19:19 UTC

I believe there is a problem with the $q() function when globals are mapped in the global directory at the subscript level. Here's why.

I have two databases, which I'll call database A (DB-A) and database B (DB-B). They each contain a set of VistA FileMan files stored in a global named ^WEB, and the structure of these files is the same in both databases. We needed DB-B to look to DB-A for all nodes in ^WEB except for ^WEB(3309,*) and ^WEB(3315,*). For these two, DB-B needed to have its own local copy, which resulted in the following [partial] global directory layout for DB-B.

WEB WEB(3309) REG = DBA
SEG = DBA
FILE = /yottadb/dba/mumps.dat
WEB(3309) WEB(3309)++ REG = DEFAULT
SEG = DEFAULT
FILE = /yottadb/dbb/mumps.dat
WEB(3309)++ WEB(3315) REG = DBA
SEG = DBA
FILE = /yottadb/dba/mumps.dat
WEB(3315) WEB(3315)++ REG = DEFAULT
SEG = DEFAULT
FILE = /yottadb/dbb/mumps.dat
WEB(3315)++ WEBERROR REG = DBA
SEG = DBA
FILE = /yottadb/dba/mumps.dat

Here is a partial listing of ^WEB(3315,*) from DB-A:

DB-A>zwrite ^WEB(3315,*)
^WEB(3315,0)="Web System Profile^3315^19^18"
...snip...
^WEB(3315,"IP","pdd17.mycompany.edu",15)=""
^WEB(3315,"IP","wam.mycompany.edu",19)=""

Here is a partial listing of ^WEB(3315,*) in DB-B:

DB-B>zwrite ^WEB(3315,*)
^WEB(3315,0)="Web System Profile^3315^1^1"
...snip...
^WEB(3315,"IP","wam.mycompany.edu",1)=""

Using $q() on this final node in DB-B should return null (or a node in ^WEB that has a first subscript that is greater than 3315). Instead, it is returning the next node in ^WEB(3315,*) from DB-A.

DB-B>w $q(^WEB(3315,"IP","wam.mycompany.edu",1))
^WEB(3315,"IP","wam.mycompany.edu",19)

But that node does not exist in DB-B.

DB-B>w ^WEB(3315,"IP","wam.mycompany.edu",19)
%GTM-E-GVUNDEF, Global variable undefined: ^WEB(3315,"IP","wam.mycompany.edu",19)

Put another way, I would never expect the following line of MUMPS code to fail under any circumstance, yet as you'll see, it does.

DB-B>s g=$na(^WEB(3315)) f s g=$q(@g) q:g="" s x=@g
%GTM-E-GVUNDEF, Global variable undefined: ^WEB(3315,"IP","wam.mycompany.edu",19)

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor