cheatfate / asyncpg

Asynchronous PostgreSQL driver for Nim language
MIT License
59 stars 6 forks source link

.rows() segfaults #1

Closed JohnEmhoff closed 7 years ago

JohnEmhoff commented 7 years ago

.getRows(-1) works fine, but .rows() segfaults; am I using this correctly?

withConnection(dbPool, conn):
  var res = await conn.exec("select col, id from stuff limit 10")
  for row in res[0].rows():
     echo row
Traceback (most recent call last)
web.nim(18)              web
asyncdispatch.nim(1000)  runForever
asyncdispatch.nim(991)   poll
apg_core.nim(446)        cb
asyncfutures.nim(109)    complete
asyncmacro.nim(34)       cb
apg_core.nim(509)        matchIter
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

line 509 is calling setLen(r[col], 0) for a little more context.

cheatfate commented 7 years ago

Thanks for first issue. Now it fixed.

JohnEmhoff commented 7 years ago

Great, thanks!