add magic vairable __tsort_direction

if __tsort_direction is set, the table alway order in one
direction(ascending desc)