diff --git a/checkin_notes b/checkin_notes index 3ed1181342..c6e9454e10 100755 --- a/checkin_notes +++ b/checkin_notes @@ -8666,3 +8666,18 @@ David 28 June 2005 main.C lib/ prefs.C + +Bruce 28 June 2005 + - locality scheduler: make searches over file names distinguish + lower case and upper case + - locality scheduler: when searching for new work using advertised + files, retry ten times before starting a deterministic search. + We should probably modify this to try ALL advertised files in + a random order before moving onto a deterministic search. + + sched/ + sched_locality.C + + + + diff --git a/sched/sched_locality.C b/sched/sched_locality.C index 2792f0fdd1..70a785e177 100644 --- a/sched/sched_locality.C +++ b/sched/sched_locality.C @@ -447,11 +447,11 @@ static int send_results_for_file( char pattern[256], escaped_pattern[256]; sprintf(pattern, "%s__", filename); escape_mysql_like_pattern(pattern, escaped_pattern); - sprintf(buf, "where userid=%d and name like '%s%%'", + sprintf(buf, "where userid=%d and name like binary '%s%%'", reply.user.id, escaped_pattern ); #else - sprintf(buf, "where userid=%d and name>'%s__' and name<'%s__~'", + sprintf(buf, "where userid=%d and name>binary '%s__' and name%d and workunitid<>%d and server_state=%d order by id limit 1 ", + "where name like binary '%s%%' and id>%d and workunitid<>%d and server_state=%d order by id limit 1 ", escaped_pattern, prev_result.id, prev_result.workunitid, RESULT_SERVER_STATE_UNSENT ); #else sprintf(query, - "where name>'%s__' and name<'%s__~' and id>%d and workunitid<>%d and server_state=%d order by id limit 1 ", + "where name>binary '%s__' and name%d and workunitid<>%d and server_state=%d order by id limit 1 ", filename, filename, prev_result.id, prev_result.workunitid, RESULT_SERVER_STATE_UNSENT ); #endif } else { #ifdef USE_REGEXP sprintf(query, - "where name like '%s%%' and id>%d and server_state=%d order by id limit 1 ", + "where name like binary '%s%%' and id>%d and server_state=%d order by id limit 1 ", escaped_pattern, prev_result.id, RESULT_SERVER_STATE_UNSENT ); #else sprintf(query, - "where name>'%s__' and name<'%s__~' and id>%d and server_state=%d order by id limit 1 ", + "where name>binary '%s__' and name%d and server_state=%d order by id limit 1 ", filename, filename, prev_result.id, RESULT_SERVER_STATE_UNSENT ); #endif @@ -533,12 +533,12 @@ static int send_results_for_file( // do an EXPENSIVE db query #ifdef USE_REGEXP sprintf(query, - "where server_state=%d and name like '%s%%' limit 1", + "where server_state=%d and name like binary '%s%%' limit 1", RESULT_SERVER_STATE_UNSENT, escaped_pattern ); #else sprintf(query, - "where server_state=%d and name>'%s__' and name<'%s__~' limit 1", + "where server_state=%d and name>binary '%s__' and name