Skip to content

Instantly share code, notes, and snippets.

@eden
Created March 21, 2016 15:59
Show Gist options
  • Save eden/812155e79ba78cbe73c3 to your computer and use it in GitHub Desktop.
Save eden/812155e79ba78cbe73c3 to your computer and use it in GitHub Desktop.
rethinkdb crash repro
import rethinkdb as r
conn = r.connect()
tables = r.db('test').table_list().run(conn)
if 'random' not in tables:
r.db('test').table_create('random').run(conn)
r.db('test').table('random').insert(dict(a=1)).run(conn)
r.db('test').table('random').insert(dict(b=2)).run(conn)
r.db('test').table('random').insert(dict(c=3)).run(conn)
print 'test.random created'
for _ in range(0, 4):
row = r.db('test').table('random').order_by(lambda t: r.random()).limit(1).run(conn)
print row
conn.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment