LiteDB icon indicating copy to clipboard operation
LiteDB copied to clipboard

Connection string parsing can result in a endless loop (Unity3d)

Open mcintyrg opened this issue 9 years ago • 4 comments

I may be formatting my string incorrectly however at the very least this isn't clear in the docs I found here

https://github.com/mbdavid/LiteDB/wiki/Connection-String

I tested on V3-beta3

My connection string is as follows:

filename=TestDB1.db; password=bloggs;

The endless loop happens because the scan calls fail to find the value "TestDB1.db" (even the second check fails, so HasTerminated is never being set and hence endless loop!) For some reason the Regex is returning no matches for the value part

mcintyrg avatar Jan 16 '17 14:01 mcintyrg

Hi @mcintyrg, I made unit test using you same example and works fine:

            var c = new ConnectionString("filename=TestDB1.db; password=bloggs;");

            Assert.AreEqual("TestDB1.db", c.Filename);
            Assert.AreEqual("bloggs", c.Password);

mbdavid avatar Jan 19 '17 11:01 mbdavid

Hi @mbdavid : The above test code also produces the endless loop, which I guess means it is perhaps another missing feature in Unity's mono implementation of .NET 3.5. I can work round this myself to provide a different means to set encryption.

Perhaps something to consider in the new branch ?

mcintyrg avatar Jan 20 '17 15:01 mcintyrg

I have managed to work round this issue and I plan to integrate this into the unity branch we are using. This can then be reviewed when you have time if you wish @mbdavid. Essentially I have just avoided using RegEx - I don't know why this doesn't work as it does when running against .NET rather than unity's mono implementation

mcintyrg avatar Apr 21 '17 10:04 mcintyrg

Hi! With the objective of organizing our issues, we are closing old unsolved issues. Please check the latest version of LiteDB and open a new issue if your problem/question/suggestion still applies. Thanks!

lbnascimento avatar Feb 05 '20 14:02 lbnascimento