query("insert... returning") fails to commit

performing db.query("INSERT into sample_table (value) VALUES ('a')" )works as anticipated: data is stored and committed.

performing db.query("INSERT into sample_table (valid) VALUES ('a') RETURNING idx") fails to commit the insert. Data is added to database, idx is indeed returned, but the insert is not committed, so data is not available.

Problem is due to class DB, query() change with introduction self.create_result_set()

Compare web.py 038 db.py line 661:

if db_cursor.description:
    ...
    out.list = ...
else:
    out = db_cursor.rowcount
if not self.ctx.transactions:
    self.ctx.commit()
return out

0.51:

if db_cursor.description:
   return self.create_result_set(db_cursor)  # <---- HERE
else:
   out = db_cursor.rowcount
if not self.ctx.transactions:
    self.ctx.commit()
return out

INSERT...RETURNING sets db_cursor.description, which causes 0.51 to perform return self.create_result_set(db_cursor) which means self.ctx.commit() is never called.

It appears (with limited testing) a possible solution may be as simple as replacing:

return self.create_result_set(db_cursor)

with:

out = self.create_result_set(db_cursor)

and allowing it to flow through to return out.