<p><a href="https://gerrit.osmocom.org/11898">View Change</a></p><p>4 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/11898/5/src/Makefile.am">File src/Makefile.am:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11898/5/src/Makefile.am@119">Patch Set #5, Line 119:</a> <code style="font-family:monospace,monospace">     echo "/* DO NOT EDIT THIS FILE. It is generated from files in osmo-hlr.git/sql/ */" > "$@"</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">(wow, I really cooked up some voodoo here didn't I ... now wondering whether a python script "sql2c. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Yes, later putayta.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/11898/5/src/db.c">File src/db.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11898/5/src/db.c@378">Patch Set #5, Line 378:</a> <code style="font-family:monospace,monospace">   rc = sqlite3_exec(dbc->db, "PRAGMA journal_mode=WAL; PRAGMA synchonous = NORMAL;", 0, 0, &err_msg);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">(interesting typo in old code: "synchronous" […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This should not break anything.<br>It seems this statement is trying to switch the synchronous pragma from 'FULL' to 'NORMAL'.<br>In a hlr.db freshly created by running osmo-hlr, the pragma is set to 'FULL' by default.<br>Because 'FULL' is more paranoid than 'NORMAL', we didn't lose anything here except for negligible performance differences.<br>See https://sqlite.org/pragma.html#pragma_synchronous</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11898/5/src/db.c@383">Patch Set #5, Line 383:</a> <code style="font-family:monospace,monospace">     if (!db_is_bootstrapped(dbc)) {</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">imagine some future scheme adds a new table. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">The idea is that this function will only ever check for tables which were already known in schema version 0.<br>In which case the problems you point out won't occur.<br>Maybe I should add a comment about that.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Checking for tables which are added in later schema versions should be done as an additional later step.<br>There's a bit of a blurry line between checking for being bootstrapped and full-on schema verification; so we'll have to find some acceptable trade-off.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11898/5/src/db.c@403">Patch Set #5, Line 403:</a> <code style="font-family:monospace,monospace">           LOGP(DDB, LOGL_ERROR, "Unable to read user version number from database '%s'\n", dbc->fname);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Is the user_version always present in an sqlite db? otherwise, if I read this right, when osmo-hlr n […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">No, it will only return -1 if queries return errors.</p><p style="white-space: pre-wrap; word-wrap: break-word;">It seems to me like user_version will always be zero unless we explicitly set it.<br>On an empty sqlite DB, pragma user_version returns zero.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/11898">change 11898</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/11898"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-hlr </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I8aeaa9a404b622657cbc7138106f38aa6ad8d01b </div>
<div style="display:none"> Gerrit-Change-Number: 11898 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: Stefan Sperling <ssperling@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Stefan Sperling <ssperling@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 30 Nov 2018 11:40:53 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>