1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-08-31 15:11:08 +00:00

Fix sql syntax.

This commit is contained in:
cuihaikuo
2018-01-05 13:01:47 +08:00
parent d53863d30c
commit bb89603e5b
2 changed files with 7 additions and 3 deletions

View File

@@ -1112,8 +1112,12 @@ head_commits_multi_cb (evhtp_request_t *req, void *arg)
g_string_append_printf (id_list_str, ",'%s'", json_string_value(id));
}
sql = g_strdup_printf ("SELECT repo_id, commit_id FROM Branch WHERE name='master' AND repo_id IN (%s) LOCK IN SHARE MODE",
id_list_str->str);
if (seaf_db_type (seaf->db) == SEAF_DB_TYPE_MYSQL)
sql = g_strdup_printf ("SELECT repo_id, commit_id FROM Branch WHERE name='master' AND repo_id IN (%s) LOCK IN SHARE MODE",
id_list_str->str);
else
sql = g_strdup_printf ("SELECT repo_id, commit_id FROM Branch WHERE name='master' AND repo_id IN (%s)",
id_list_str->str);
commit_id_map = json_object();
if (seaf_db_statement_foreach_row (seaf->db, sql,
collect_head_commit_ids, commit_id_map, 0) < 0) {