<p><a href="https://gerrit.osmocom.org/12121">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/12121/5//COMMIT_MSG">Commit Message:</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/12121/5//COMMIT_MSG@11">Patch Set #5, Line 11:</a> <code style="font-family:monospace,monospace">in the 'subscriber' table, in granularity of seconds.</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">(imho what the value means should be in a code comment and not so much in a commit log)</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">The value is indeed UTC.</p><p style="white-space: pre-wrap; word-wrap: break-word;">The conversion from local time to UTC is done by SQlite.<br>I wrote a patch to convert to UTC in our C code, but with that patch the conversion happens twice, so I had to discard this patch.<br>Instead I have added a comment which documents what SQlite will do with the timestamp.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12121/5//COMMIT_MSG@19">Patch Set #5, Line 19:</a> <code style="font-family:monospace,monospace">  901990000000001|2018-12-04 14:17:12</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I wonder why we don't store it as num of seconds since 1970. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Our code only deals with seconds since epoch.</p><p style="white-space: pre-wrap; word-wrap: break-word;">SQlite is transforming from seconds since epoch to a string.<br>The reverse transformation can probably be done by SQlite as well; if not, we could easily do it in C.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I think storing the time as a string is great for users because an epoch timestamp is meaningless to humans.<br>It also makes future VTY timestamp display trivial (just print a string).</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/12121/5/sql/hlr.sql">File sql/hlr.sql:</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/12121/5/sql/hlr.sql@42">Patch Set #5, Line 42:</a> <code style="font-family:monospace,monospace">     last_lu_seen TIMESTAMP default NULL</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">found https://www.sqlite.org/lang_datefunc. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I also noticed that documentation seems to be lacking here.<br>My tests are producing good results though.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/12121/5/src/db_hlr.c">File src/db_hlr.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/12121/5/src/db_hlr.c@637">Patch Set #5, Line 637:</a> <code style="font-family:monospace,monospace">                 "Cannot update LU timestamp for subscriber ID=%"PRId64": SQL error: (%d) %s\n",</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Be careful in general with interleavin strings and PRId64 type of strings, I recall seeing compilers […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This problem also affects many other existing strings in this file.<br>So I would defer this to a separate patch.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/12121">change 12121</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/12121"/><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: Ibeb49d45aec18451a260a6654b8c51b8fc3bec50 </div>
<div style="display:none"> Gerrit-Change-Number: 12121 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: Stefan Sperling <stsp@stsp.name> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Stefan Sperling <stsp@stsp.name> </div>
<div style="display:none"> Gerrit-CC: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 07 Dec 2018 11:04:36 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>