From f5736ace651fd7c277a7729919b45504b830d728 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 21 Oct 2011 15:24:03 -0500 Subject: aurblup: remove ';' from queries The semicolons are not necessary when performing queries via the MySQL API, so remove them. Signed-off-by: Dan McGee Signed-off-by: Lukas Fleischer --- scripts/aurblup/aurblup.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/aurblup/aurblup.c b/scripts/aurblup/aurblup.c index 6a67d68..e01f053 100644 --- a/scripts/aurblup/aurblup.c +++ b/scripts/aurblup/aurblup.c @@ -74,7 +74,7 @@ blacklist_get_pkglist() MYSQL_ROW row; alpm_list_t *pkglist = NULL; - if (mysql_query(c, "SELECT Name FROM PackageBlacklist;")) + if (mysql_query(c, "SELECT Name FROM PackageBlacklist")) mysql_die("failed to read blacklist from MySQL database: %s\n"); if (!(res = mysql_store_result(c))) @@ -96,7 +96,7 @@ blacklist_add(const char *name) mysql_real_escape_string(c, esc, name, strlen(name)); snprintf(query, 1024, "INSERT INTO PackageBlacklist (Name) " - "VALUES ('%s');", esc); + "VALUES ('%s')", esc); free(esc); if (mysql_query(c, query)) @@ -110,7 +110,7 @@ blacklist_remove(const char *name) char query[1024]; mysql_real_escape_string(c, esc, name, strlen(name)); - snprintf(query, 1024, "DELETE FROM PackageBlacklist WHERE Name = '%s';", esc); + snprintf(query, 1024, "DELETE FROM PackageBlacklist WHERE Name = '%s'", esc); free(esc); if (mysql_query(c, query)) @@ -125,7 +125,7 @@ blacklist_sync(alpm_list_t *pkgs_cur, alpm_list_t *pkgs_new) pkgs_add = alpm_list_diff(pkgs_new, pkgs_cur, (alpm_list_fn_cmp)strcmp); pkgs_rem = alpm_list_diff(pkgs_cur, pkgs_new, (alpm_list_fn_cmp)strcmp); - if (mysql_query(c, "START TRANSACTION;")) + if (mysql_query(c, "START TRANSACTION")) mysql_die("failed to start MySQL transaction: %s\n"); for (p = pkgs_add; p; p = alpm_list_next(p)) @@ -134,7 +134,7 @@ blacklist_sync(alpm_list_t *pkgs_cur, alpm_list_t *pkgs_new) for (p = pkgs_rem; p; p = alpm_list_next(p)) blacklist_remove(alpm_list_getdata(p)); - if (mysql_query(c, "COMMIT;")) + if (mysql_query(c, "COMMIT")) mysql_die("failed to commit MySQL transaction: %s\n"); alpm_list_free(pkgs_add); -- cgit v1.2.3-70-g09d2