|
Lines 2885-2891
static uint32_t _archive_table(purge_type_t type, mysql_conn_t *mysql_conn,
Link Here
|
| 2885 |
case PURGE_TXN: |
2885 |
case PURGE_TXN: |
| 2886 |
query = xstrdup_printf("select %s from \"%s\" where " |
2886 |
query = xstrdup_printf("select %s from \"%s\" where " |
| 2887 |
"timestamp <= %ld && cluster='%s' " |
2887 |
"timestamp <= %ld && cluster='%s' " |
| 2888 |
"order by timestamp asc for update", |
2888 |
"order by timestamp asc", |
| 2889 |
cols, sql_table, |
2889 |
cols, sql_table, |
| 2890 |
period_end, cluster_name); |
2890 |
period_end, cluster_name); |
| 2891 |
break; |
2891 |
break; |
|
Lines 2893-2913
static uint32_t _archive_table(purge_type_t type, mysql_conn_t *mysql_conn,
Link Here
|
| 2893 |
case PURGE_CLUSTER_USAGE: |
2893 |
case PURGE_CLUSTER_USAGE: |
| 2894 |
query = xstrdup_printf("select %s from \"%s_%s\" where " |
2894 |
query = xstrdup_printf("select %s from \"%s_%s\" where " |
| 2895 |
"time_start <= %ld " |
2895 |
"time_start <= %ld " |
| 2896 |
"order by time_start asc for update", |
2896 |
"order by time_start asc", |
| 2897 |
cols, cluster_name, sql_table, |
2897 |
cols, cluster_name, sql_table, |
| 2898 |
period_end); |
2898 |
period_end); |
| 2899 |
break; |
2899 |
break; |
| 2900 |
case PURGE_JOB: |
2900 |
case PURGE_JOB: |
| 2901 |
query = xstrdup_printf("select %s from \"%s_%s\" where " |
2901 |
query = xstrdup_printf("select %s from \"%s_%s\" where " |
| 2902 |
"time_submit < %ld && time_end != 0 " |
2902 |
"time_submit < %ld && time_end != 0 " |
| 2903 |
"order by time_submit asc for update", |
2903 |
"order by time_submit asc", |
| 2904 |
cols, cluster_name, job_table, |
2904 |
cols, cluster_name, job_table, |
| 2905 |
period_end); |
2905 |
period_end); |
| 2906 |
break; |
2906 |
break; |
| 2907 |
default: |
2907 |
default: |
| 2908 |
query = xstrdup_printf("select %s from \"%s_%s\" where " |
2908 |
query = xstrdup_printf("select %s from \"%s_%s\" where " |
| 2909 |
"time_start <= %ld && time_end != 0 " |
2909 |
"time_start <= %ld && time_end != 0 " |
| 2910 |
"order by time_start asc for update", |
2910 |
"order by time_start asc", |
| 2911 |
cols, cluster_name, sql_table, |
2911 |
cols, cluster_name, sql_table, |
| 2912 |
period_end); |
2912 |
period_end); |
| 2913 |
break; |
2913 |
break; |