Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008645opensim[REGION] OpenSim Corepublic2020-01-18 08:472020-01-19 04:56
Reportertglion 
Assigned Totglion 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version0.9.1.0 
Target VersionFixed in Versionmaster (dev code) 
Summary0008645: Many duplicates in the table "landaccesslist"
DescriptionI found a bug with AccessList on using SQlite3. On each Start or Stop of a region will generate unnecessary duplicates in the table "landaccesslist".
Second problem is: you can never remove the entries via the viewer anymore (tested with the singularty-viewer).
You have to purge the data directly in the "landaccesslist" table with a sqlite-database-tool.
Steps To Reproduce1) Set one or more Avatars in "About Land" -> "Acess" dialogue as Allowed and/or Banned.

Simply restart the region serveral times. 2 x should be enough for this test.

2) check the table "landaccesslist" with a sqlite3-tool:
select * from landaccesslist;

You see now some duplicates now.
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (1 Region per Sim)
Physics EngineubODE
Script EngineXEngine
EnvironmentMono / Linux64
Mono Version6.x
ViewerSingularity 64 bit
Attached Filespatch file icon 0001-Fix-avoid-generating-of-many-duplicates-in-table-lan.patch [^] (1,325 bytes) 2020-01-18 08:59 [Show Content]

- Relationships

-  Notes
(0036093)
tglion (reporter)
2020-01-18 08:59

I found a simple fix to avoid this duplicates.
Sure, there are still more potential to improve more things around this, but this patch should be working for the first step to fix the above issue.

See attached patch...
(0036095)
UbitUmarov (administrator)
2020-01-18 10:06

thanks
just changed sqlite on that, not exactly using you patch.
It should work.. plz let us know
(0036097)
tglion (reporter)
2020-01-18 12:09

I have tested your modified commit:
No sorry, this does not work.
I can explain why:
You have left the wrong command:
landaccesslist.Rows.Remove(rowsToDelete[iter]);
is wrong in 2 cases:
1) The method Remove for the List of DataRow does delete the element from the list and do not mark the DataRow itself as deleted.
2) Removing elements from a list inside an iteratrion-loop is evil and a cause of many bugs.
Example:
You have "Peter", "Mary" and "Joe" in a list. So in an iter=0 you get "Peter". Do you remove it form the list and iter next to iter=1 you will get "Joe" as next and not "Mary" as expected, because "Mary" is now on iter=0.
I hope I explained it right :-)
That was the bug I seen on this. Removing the element from the list is not necessary in this case and produce the main problem here.
Only rowsToDelete[iter].Delete(); is the right case to do here :-)

I have used "foreach" instead of "for" iter, because I think that's nicer. But that is a personal preference of an developer. Both does the same :-)

for (int iter = 0; iter < rowsToDelete.Count; iter++)
    rowsToDelete[iter].Delete();

does work.

for (int iter = 0; iter < rowsToDelete.Count; iter++)
    landaccesslist.Rows.Remove(rowsToDelete[iter]);

does not work.

for (DataRow row in rowsToDelete)
    row.Delete();

does work.
(0036098)
UbitUmarov (administrator)
2020-01-18 12:14

did you run it and tested?
thx
(0036099)
tglion (reporter)
2020-01-18 12:43
edited on: 2020-01-18 12:54

yes.

Mhhh ok, litte correction to my last notice: the explaining example above is not 100% correct to this issue. But similar.
Short: The Problem here was to change the delete-mark in reference on delete (marks only for delete and deletes not immediate. This is only done on commit) the row first and try to remove it from the list. That is not a good idea ;-)

Only removing the row from the list has no effect on the db. (Does not remove the row from the db)

(0036100)
UbitUmarov (administrator)
2020-01-18 13:10
edited on: 2020-01-18 13:35

ok changed to just "flag" delete
( the foreach is a lot heavier )

(0036104)
tglion (reporter)
2020-01-19 04:54

Yes, its working now.
thanks :-)

- Issue History
Date Modified Username Field Change
2020-01-18 08:47 tglion New Issue
2020-01-18 08:59 tglion File Added: 0001-Fix-avoid-generating-of-many-duplicates-in-table-lan.patch
2020-01-18 08:59 tglion Note Added: 0036093
2020-01-18 09:00 tglion Status new => patch included
2020-01-18 10:06 UbitUmarov Note Added: 0036095
2020-01-18 12:09 tglion Note Added: 0036097
2020-01-18 12:14 UbitUmarov Note Added: 0036098
2020-01-18 12:43 tglion Note Added: 0036099
2020-01-18 12:54 tglion Note Edited: 0036099 View Revisions
2020-01-18 13:10 UbitUmarov Note Added: 0036100
2020-01-18 13:35 UbitUmarov Note Edited: 0036100 View Revisions
2020-01-19 04:54 tglion Note Added: 0036104
2020-01-19 04:56 tglion Status patch included => resolved
2020-01-19 04:56 tglion Fixed in Version => master (dev code)
2020-01-19 04:56 tglion Resolution open => fixed
2020-01-19 04:56 tglion Assigned To => tglion


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker