PDA

View Full Version : Player database ID Jump


cuervo72
08-24-2012, 03:26 PM
I just noticed this in FOFL even though it happened last year.

<table class="data ajax" id="table_results"><tbody> <tr class="odd"> <td class="data inline_edit not_null odd nowrap" align="right">11189</td> <td class="data inline_edit not_null odd nowrap" align="right">32764</td> <td class="data inline_edit not_null odd nowrap" align="right">18</td> <td class="data inline_edit not_null odd">Kestner</td> <td class="data inline_edit not_null odd">Ryan</td> <td class="data inline_edit not_null odd nowrap">
</td> </tr> <tr class="even"> <td class="data inline_edit not_null even nowrap" align="right">11583</td> <td class="data inline_edit not_null even nowrap" align="right">32765</td> <td class="data inline_edit not_null even nowrap" align="right">18</td> <td class="data inline_edit not_null even">Ledet</td> <td class="data inline_edit not_null even">Clifton</td> <td class="data inline_edit not_null even nowrap">
</td> </tr> <tr class="odd"> <td class="data inline_edit not_null odd nowrap" align="right">11190</td> <td class="data inline_edit not_null odd nowrap" align="right">32766</td> <td class="data inline_edit not_null odd nowrap" align="right">18</td> <td class="data inline_edit not_null odd">Ferguson</td> <td class="data inline_edit not_null odd">Norman</td> <td class="data inline_edit not_null odd nowrap">
</td> </tr> <tr class="even"> <td class="data inline_edit not_null even nowrap" align="right">11585</td> <td class="data inline_edit not_null even nowrap" align="right">32767</td> <td class="data inline_edit not_null even nowrap" align="right">18</td> <td class="data inline_edit not_null even">Hardy</td> <td class="data inline_edit not_null even">Joseph</td> <td class="data inline_edit not_null even nowrap">
</td> </tr> <tr class="odd"> <td class="data inline_edit not_null odd nowrap" align="right">11586</td> <td class="data inline_edit not_null odd nowrap" align="right">65536</td> <td class="data inline_edit not_null odd nowrap" align="right">14</td> <td class="data inline_edit not_null odd">Fisher</td> <td class="data inline_edit not_null odd">Dexter</td> <td class="data inline_edit not_null odd nowrap">
</td> </tr> <tr class="even"> <td class="data inline_edit not_null even nowrap" align="right">11587</td> <td class="data inline_edit not_null even nowrap" align="right">65537</td> <td class="data inline_edit not_null even nowrap" align="right">18</td> <td class="data inline_edit not_null even">Bluske</td> <td class="data inline_edit not_null even">Marvin</td> <td class="data inline_edit not_null even nowrap">
</td> </tr></tbody></table>

Why the jump in generated ids? I mean, I get that 32767 is the upperbound for a signed SMALLINT. But first, these I imagine shouldn't be signed to begin with (I don't imagine an ID would ever be negative), and I'd also think that the ids wouldn't be SMALLINT (and as they continue above 65535, they can't be). So...what exactly is going on here? I mean, I'm not sure it really matters, other than the fact that the player ids will hit six digits a wee bit faster than I anticipated they would. At least, I hope that's the only effect.

Ben E Lou
08-24-2012, 03:27 PM
Verified this against the PFL database (the largest online one I know of). Checking a SP league now...

gstelmack
08-24-2012, 06:57 PM
This may be related to the transaction amount discrepancy we found earlier. I am not convinced FOF writes a true INT32, it's like it writes two signed INT16s and does the shifting or calculations internally somehow, and since they are unsigned numbers you ignore the upper bit of the lower two bytes. Perhaps a harkening back to the 16-bit days, some artifact in there. I could change everything to read it that way (and I already fixed the profit/loss income fields I believe), but with some like playerID it really doesn't matter, it's still a unique ID.