LinuxDoku / migratordotnet

Automatically exported from code.google.com/p/migratordotnet
0 stars 0 forks source link

Wrong array bounds check in MigrateAnywhere causes problem running against a new empty database #54

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
A bounds check in MigrateAnywhere reads the wrong array's count before
trying to get the last element.  Patch attached.

Original issue reported on code.google.com by evon...@gmail.com on 9 Aug 2008 at 2:28

Attachments:

GoogleCodeExporter commented 8 years ago
And here's a failing test to expose this issue. Please fix, this is extremely
blocking because it happens when applying the very first migration.

[TestFixture]
public class MigratorTest
{
// [...]

    [Test]
    public void MigrateUpwardFrom0()
    {
        _migrator.MigrateTo(3);

        Assert.AreEqual(3, _upCalled.Count);
        Assert.AreEqual(0, _downCalled.Count);

        Assert.AreEqual(1, _upCalled[0]);
        Assert.AreEqual(2, _upCalled[1]);
        Assert.AreEqual(3, _upCalled[2]);
    }

// [...]
}

Original comment by simone.b...@gmail.com on 27 Aug 2008 at 4:07

GoogleCodeExporter commented 8 years ago
The release version 0.7 is still available and doesn't suffer from this problem.

Original comment by geoffl...@gmail.com on 27 Aug 2008 at 4:46

GoogleCodeExporter commented 8 years ago
It takes a sec to fix :)

Original comment by simone.b...@gmail.com on 27 Aug 2008 at 4:56

GoogleCodeExporter commented 8 years ago
Is it going to be fixed in the trunk anytime soon?

Original comment by simone.b...@gmail.com on 5 Sep 2008 at 7:42

GoogleCodeExporter commented 8 years ago
SVN 116
Fixed bounds checking error.
Thanks evonzee for the patch and simone.busoli for the unit test.

Original comment by geoffl...@gmail.com on 5 Sep 2008 at 9:20