-
-
Save iffy/c31198e66fe51f8dcaf6c4289fab8f43 to your computer and use it in GitHub Desktop.
What in that loop could cause the first string of `res.rows[5]` to be overwritten with nulls?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# type | |
# AllResult* = object | |
# rows*: seq[seq[string]] | |
# cols*: seq[string] | |
# types*: seq[string] | |
# res is a `ref AllResult` | |
for row in res.rows: | |
var jrow = newJArray() | |
for col in row: | |
if col.startsWith("\0\0"): | |
echo "STARTS WITH NULL" | |
echo "res.rows[5]: ", res.rows[5].repr | |
jrow.add(newJString(col)) | |
jrows.add(jrow) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STARTS WITH NULL | |
res.rows[5]: 0x107b07db8[0x107b41800"5", 0x107b41828"0", 0x107b41850"0", 0x107b41878"INTEGER", 0x107b418a0"deposit", ""] | |
STARTS WITH NULL | |
res.rows[5]: 0x107b07db8[0x107b41800"\0\0\0\0", 0x107b41828"0", 0x107b41850"0", 0x107b41878"INTEGER", 0x107b418a0"deposit", ""] | |
STARTS WITH NULL | |
res.rows[5]: 0x107b07db8[0x107b41800"\0\0\0\0", 0x107b41828"0", 0x107b41850"0", 0x107b41878"INTEGER", 0x107b418a0"deposit", ""] | |
STARTS WITH NULL | |
res.rows[5]: 0x107b07db8[0x107b41800"\0\0\0\0", 0x107b41828"0", 0x107b41850"0", 0x107b41878"INTEGER", 0x107b418a0"deposit", ""] | |
STARTS WITH NULL | |
res.rows[5]: 0x107b07db8[0x107b41800"\0\0\0\0", 0x107b41828"0", 0x107b41850"0", 0x107b41878"INTEGER", 0x107b418a0"deposit", ""] | |
STARTS WITH NULL | |
res.rows[5]: 0x107b07db8[0x107b41800"\0\0\0\0", 0x107b41828"0", 0x107b41850"0", 0x107b41878"INTEGER", 0x107b418a0"deposit", ""] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment