Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

$Query error when globals are mapped at the subscript level

134 views
Skip to first unread message

Alan O'Neill

unread,
Nov 14, 2022, 2:19:09 PM11/14/22
to
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)

Alan O'Neill

unread,
Nov 23, 2022, 3:14:39 PM11/23/22
to
Just wondering if anyone has any thoughts.
Happy Thanksgiving! :-)

Sam Habiel

unread,
Nov 24, 2022, 7:53:26 AM11/24/22
to
On Wednesday, November 23, 2022 at 3:14:39 PM UTC-5, aonei...@gmail.com wrote:
> Just wondering if anyone has any thoughts.
> Happy Thanksgiving! :-)

Hello there.

I take it you are using GT.M or YottaDB? It looks like a bug to me, but I think you have a possible workaround: remove the nodes from A, and leave them in B.

When you have a moment, can you create a small self-standing example to illustrate the issue and post it to https://gitlab.com/YottaDB/DB/YDB/-/issues?

--Sam Habiel at YottaDB

K.S. Bhaskar

unread,
Nov 28, 2022, 12:50:25 PM11/28/22
to
You are using some advanced functionality in YottaDB, and likely using it in production. Contact your YottaDB support channel, if you have purchased support. If you have not purchased support, contact me (bhaskar at yottadb dot com) to purchase support, or if you want to explore free support, then post a standalone test case as Sam suggested.

Regards
– Bhaskar

K.S. Bhaskar

unread,
Nov 30, 2022, 11:03:38 AM11/30/22
to
Thank you for contacting me off-list, and thank you for reporting this bug. We have created https://gitlab.com/YottaDB/DB/YDB/-/issues/960 ($QUERY(gvn) returns incorrect results when global names are mapped at the subscript level) to track it.

Regards
– Bhaskar
0 new messages