1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-03 16:34:33 +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)); 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", if (seaf_db_type (seaf->db) == SEAF_DB_TYPE_MYSQL)
id_list_str->str); 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(); commit_id_map = json_object();
if (seaf_db_statement_foreach_row (seaf->db, sql, if (seaf_db_statement_foreach_row (seaf->db, sql,
collect_head_commit_ids, commit_id_map, 0) < 0) { collect_head_commit_ids, commit_id_map, 0) < 0) {

View File

@@ -3064,7 +3064,7 @@ seaf_repo_manager_get_repos_by_group (SeafRepoManager *mgr,
"v.origin_repo, v.path ," "v.origin_repo, v.path ,"
"(SELECT name FROM RepoInfo WHERE repo_id=v.origin_repo) " "(SELECT name FROM RepoInfo WHERE repo_id=v.origin_repo) "
"FROM RepoGroup LEFT JOIN VirtualRepo v ON " "FROM RepoGroup LEFT JOIN VirtualRepo v ON "
"RepoGroup.repo_id = VirtualRepo.repo_id " "RepoGroup.repo_id = v.repo_id "
"LEFT JOIN RepoSize s ON RepoGroup.repo_id = s.repo_id, " "LEFT JOIN RepoSize s ON RepoGroup.repo_id = s.repo_id, "
"Branch WHERE group_id = ? AND " "Branch WHERE group_id = ? AND "
"RepoGroup.repo_id = Branch.repo_id AND " "RepoGroup.repo_id = Branch.repo_id AND "