Operations are possible even when the order of the attributes is
not the same. Because ordering is just an implementation detail and
not an actual part of relational algebra.
A _rearrange() function exists to convert relations to have a similar
format and be able to operate on them.
The function would perform a projection in any case, which would cause
the creation of a new temporary relation, even when the relations where
already using the same order of attributes.
This commit fixes the issue by making it return an identity if the
operation is not necessary.
When doing a selection, a new context (in the form of a dictionary)
is created.
Instead of re-using the same dictionary re-assigning the values, now
use a comprehension to avoid redundant reads.
Python3 handles encoding differently, and files are loaded
according to the locale set on the system.
This means that when building on a locale-less chroot,
the tests will always fail because it will try to load utf-8
and encode it as ASCII.
This forces the encoding. The tests are encoded in utf-8 anyway
so any other encoding set by the locale would cause a failure.
In this way, checks are performed automatically on every tuple
and code is simplified.
This should make it safer to raise exceptions on files that are
not relations.
By default when loading a file, a relation with the same name is
created.
Now, if the filename is not a valid relation name, the user will be
prompted to manually insert a relation name.
De-duplicated code for doing this when a new relation is created.
to include the 2010 redistributable.
<rant>Windows is several GiB large, but they felt like having to
save space when they had to include a 5MiB library that is used
by everything.</rant>
Rather than having a header class that contains a list of header,
change it to directly be an immutable tuple.
This simplifies the code because header can now be compared and
indexed like any other tuple.
Code had to be changed all over the place to cope with this new
datatype.