|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Wed Jan 16, 2008 3:23 pm
[2.18 Pro] Data record variable with one key/value pair is ignored |
Unfortunately, I'm unable to reproduce this with a simple set of steps, but here's what's happening to me:
I noticed that my healing queue wasn't taking care of my last affliction. If I use my "affs" alias, which relies on %dbkeys, to show my current afflictions, I get none listed. If I use #SHOWDB, however, there is one there. Likewise, my healing queue alias, which relies on #LOOPDB to iterate over all my afflictions, does not find this last affliction key. If I add a second affliction, it will cure one of them, but the last one is left alone again. It's not a visibility issue because #SHOWDB works and #LOOPDB doesn't, not even on the command line.
Has anyone else experienced this exact problem? |
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Wed Jan 16, 2008 3:39 pm |
I haven't but it sounds to me to be Lua related. Why?
In Lua as I have already stated elsewhere if a table does not contain two keys it is not a table.
That being the case functions that rely on Lua to deal with hash tables will fail if they only contain a single value.
You could fix this yourself by creating a dummy value that you add to each layer. Duh, you know that or you wouldn't have made this post...
I'm pretty certain that Zugg implemented Database variables using Lua in the background and they could use a little tweaking.
To better understand the concept have a look at my HashSet package in the Library. Ask yourself why I had to do things the way I did. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Wed Jan 16, 2008 3:54 pm |
I don't always use %dbkeys to cause this to happen, though, so I'm not sure if that function is actually causing the "corruption" of the variable. I only use %dbkeys as a way to view the data record variable contents, and my #LOOPDB breaks all by itself.
It may be related to the Lua tables implementation, causing the memory contents to now be incompatible with the standard CMUD commands and functions.
I only wish there was a simple way to reproduce the issue. |
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Wed Jan 16, 2008 4:05 pm |
Perhaps there are more ways to corrupt the db variable, that's certainly possible. What I saw in my bug was that even just viewing the contents of the db variable with %dbkeys caused it to become corrupt. You had mentioned that you use %dbkeys so I suspected it was the same type of issue.
|
|
|
|
|
|