<p style="white-space: pre-wrap; word-wrap: break-word;">-1</p><p><a href="https://gerrit.osmocom.org/12525">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/12525/4/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/12525/4/src/db_hlr.c@426">Patch Set #4, Line 426:</a> <code style="font-family:monospace,monospace">          LOGP(DAUC, LOGL_ERROR, "Update IMEI for subscriber ID='%s': SQL modified %d rows (expected 1)\n", imsi,</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">ID=<imsi></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Argh hm, there's one thing I so far completely missed in this: would SQLite return 0 if the IMEI is already in the DB for this IMSI?<br>Apologies, I might have sent us off on a tangent here.</p><p style="white-space: pre-wrap; word-wrap: break-word;">It appears to me that we can't distinguish between "no such IMSI" and "the IMEI was already exactly the given one".<br>Can you briefly investigate whether we can get some SQL that has two different return codes for the two situations? If we can't, then we may after all still require a separate subscr_get_by_imsi followed by an IMEI update only if it differs, and my earlier preview generated some unnecessary work for you... :/</p><p style="white-space: pre-wrap; word-wrap: break-word;">Or maybe the code path managing this already has the subscriber struct present somehow, maybe as part of the luop? Then we can check for differing IMEI there without another db hit ... and then we could also have used the ID as selector instead of the IMSI.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Please add the scenario "setting the same IMEI again" to the unit test.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Sorry again for missing that corner case before.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/12525">change 12525</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/12525"/><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: If232c80bea35d5c6864b889ae92d477eeaa3f45d </div>
<div style="display:none"> Gerrit-Change-Number: 12525 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@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: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 15 Jan 2019 15:57:47 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>