def do_query(crsr): tpl = innodb.clust_read_tuple_create(crsr) assert tpl innodb.cursor_first(crsr) while True: try: innodb.cursor_read_row(crsr, tpl) except innodb.InnoDBError, exc: error_code = exc.getErrorCode() assert(error_code in (libinnodb.DB_END_OF_INDEX, libinnodb.DB_RECORD_NOT_FOUND)) break test0aux.print_tuple(sys.stdout, tpl) tpl = innodb.tuple_clear(tpl) assert tpl try: innodb.cursor_next(crsr) except innodb.InnoDBError, exc: error_code = exc.getErrorCode() assert(error_code in (libinnodb.DB_END_OF_INDEX, libinnodb.DB_RECORD_NOT_FOUND)) break
def print_lt_5(tpl): result = tpl[0] < 5 if result: test0aux.print_tuple(sys.stdout, tpl._tuple) return result
def print_all(tpl): test0aux.print_tuple(sys.stdout, tpl._tuple) return True