You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
libsql> create table t(v) random rowid;
libsql>insert into t values (zeroblob(4096)), (zeroblob(4096)), (zeroblob(4096));
libsql>select rowid from t;
250405975976554441544561536558169132324534292316624990338
libsql>
libsql> create table y(v) random rowid;
libsql>insert into y select*from t;
libsql>select rowid from y;
123
libsql>
It should not assign consecutive ids, rather random ones.
The text was updated successfully, but these errors were encountered:
Tests added for:
1. VACUUM does not respect RANDOM ROWID - #929
2. Bulk insert into a fresh table does not respect RANDOM ROWID - #1046
In both cases, the table should end up random rowids, but they seem to have sequential ones.
…t ops (#1048)
* Add regression tests for random rowid bugs
Tests added for:
1. VACUUM does not respect RANDOM ROWID - #929
2. Bulk insert into a fresh table does not respect RANDOM ROWID - #1046
In both cases, the table should end up random rowids, but they seem to have sequential ones.
* bugfix: pass `regNextRowid` to `OP_NewRowid` call in `xferOptimization`
The register `regNextRowid` contains the `LIBSQL_RANDOM_ROWID_MARKER` value
which tells the VDBE to use a random value for row ids. The method `xferOptimization`
is used in `VACUUM` and bulk insert routines where data from one table is
inserted in another. Since the data is inserted in a loop, it checks for
max rowid once and then keeps inserting it serially. Hence we pass the marker
in each call, so that random id is generated.
This is similar to the bug #929
It should not assign consecutive ids, rather random ones.
The text was updated successfully, but these errors were encountered: