With big cells it is easy to see multiple overflow cells happen while
balancing. Previously we disallowed insertion with > 1 overflow cells,
let's fix this by allowing it as we should be safe now.
This pr also adds some more comments to the balancing algorithm.
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>
Closes#1270
closes#1239

warns the user if a .db file is opened that contains a schema entry of a
vtab created with a module that is no longer loaded.
If the module is loaded for that connection, the user can properly query
the table.
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>
Closes#1244
~~Moving cells from right to left involves moving cell that are from any
page in the right, from left to right, this means we update the size of
page of adjacent one only but not the last one. This is kinda weird but
it works. I might change it if it feels to weird.~~
Update: my previous analysis was obviously incorrect. Underflowing is
undesired behaviour and accounting for divider cell avoided it.
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>
Closes#1269
## Issue
Numeric values outside the range of what f64 can represent are formatted
to strings as "Inf" or "-Inf" in sqlite, but they are "inf" and "-inf"
in limbo.
```
sqlite> SELECT 1.7976931348623157E+309;
Inf
```
```
limbo> SELECT 1.7976931348623157E+309;
┌─────────────────────────┐
│ 1.7976931348623157E+309 │
├─────────────────────────┤
│ inf │
└─────────────────────────┘
```
closes#1248Closes#1272
Let's make sure every insert does still contain all keys. Previously we
did this at the end but it made it hard to debug issues that
`validate_btree` might not encounter.
This PR should close two related issues:
## 1. Remainder operand with lhs as text
Before:
```
limbo> SELECT 10 % '3';
┌──────────┐
│ 10 % '3' │
├──────────┤
│ 3 │
└──────────┘
```
sqlite:
```
sqlite> SELECT 10 % '3';
1
```
After:
```
limbo> SELECT 10 % '3';
┌──────────┐
│ 10 % '3' │
├──────────┤
│ 1 │
└──────────┘
```
## Overflow when min int64 % -1
Before:
```
limbo> SELECT -9223372036854775808 % -1;
thread 'main' panicked at core/vdbe/insn.rs:974:37:
attempt to calculate the remainder with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
sqlite:
```
sqlite> SELECT -9223372036854775808 % -1;
0
```
After:
```
limbo> SELECT -9223372036854775808 % -1;
┌─────────────────────────────┐
│ - 9223372036854775808 % - 1 │
├─────────────────────────────┤
│ 0 │
└─────────────────────────────┘
```
Tests for these cases are also added, and the `%` operator tests in
`math.test` were renamed to `remainder-` instead of `mod-` to
differentiate from tests for the `mod()` function.
Closes#1172Closes#1267
Fixes#603
This patch adds a `Clock` trait whose member function `now` returns an
`Instant`. Now in sim, we can nicely make the clock deterministic.
The earlier method `get_current_time` returned `chrono::Local::now()`.
The `Instant` returned by `now` carries the same information.
Closes#1263