From df430074dbd3cc585f6270c5d285884872be040c Mon Sep 17 00:00:00 2001 From: gombasg Date: Wed, 5 Apr 2006 10:57:02 +0000 Subject: [PATCH] Escape '_' in queries git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@416 a7169a2c-3604-0410-bc95-c702d8d87f7a --- dcapi/boinc/events.C | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dcapi/boinc/events.C b/dcapi/boinc/events.C index a0db48720e..80ff096d50 100644 --- a/dcapi/boinc/events.C +++ b/dcapi/boinc/events.C @@ -24,7 +24,7 @@ int DC_processEvents(int timeout) } /* XXX Check LIMIT value */ - query = g_strdup_printf("WHERE name LIKE '%s_%%' " + query = g_strdup_printf("WHERE name LIKE '%s\\_%%' " "AND assimilate_state = %d LIMIT 100", project_uuid_str, ASSIMILATE_READY); while (!wu.enumerate(query)) @@ -74,15 +74,15 @@ static DC_Event *look_for_results(const char *wuFilter, const char *wuName, char *query; if (wuFilter) - query = g_strdup_printf("WHERE name LIKE '%s_%%_%s' " + query = g_strdup_printf("WHERE name LIKE '%s\\_%%\\_%s' " "AND assimilate_state = %d LIMIT 1", project_uuid_str, wuFilter, ASSIMILATE_READY); else if (wuName) - query = g_strdup_printf("WHERE name LIKE '%s_%s%%' " + query = g_strdup_printf("WHERE name LIKE '%s\\_%s%%' " "AND assimilate_state = %d LIMIT 1", project_uuid_str, wuName, ASSIMILATE_READY); else - query = g_strdup_printf("WHERE name LIKE '%s_%%' " + query = g_strdup_printf("WHERE name LIKE '%s\\_%%' " "AND assimilate_state = %d LIMIT 1", project_uuid_str, ASSIMILATE_READY);