Commit dae3940
fix(downgrade): store is_hash_attribute in __dbis__ for harperdb@4.x compat
harperdb@4.7.x reads is_hash_attribute from the __dbis__ primary-key entry to
compute LMDB DBI open flags: DBIDefinition(!is_hash_attribute, is_hash_attribute).
harper@5 only stored isPrimaryKey, so harperdb@4 opened hdb_deployment with
dup_sort=true/useVersions=false instead of the dup_sort=false/useVersions=true
it was created with, causing LMDB to throw MDB_INCOMPATIBLE. This left
databases.system.hdb_info unpopulated and checkIfInstallIsSupported fatal.
Fix: set is_hash_attribute=true alongside isPrimaryKey in databases.ts so new
tables (including those created by the 5.1.0 directive) carry the backward-compat
field. The 5.1.0 directive also now patches the __dbis__ entry on existing installs
that ran the directive before this fix. Re-enable the downgrade test.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent c4cc54e commit dae3940
3 files changed
Lines changed: 32 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 108 | + | |
121 | 109 | | |
122 | 110 | | |
123 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
970 | 970 | | |
971 | 971 | | |
972 | 972 | | |
| 973 | + | |
973 | 974 | | |
974 | 975 | | |
975 | 976 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
| |||
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
51 | 81 | | |
52 | 82 | | |
53 | 83 | | |
| |||
0 commit comments