From 69104d7dee584261e4fcfa2ae3833b45a009dfea Mon Sep 17 00:00:00 2001 From: VilhoRaatikka Date: Tue, 26 Aug 2014 11:08:05 +0300 Subject: [PATCH] skygw_utils.cc:replace_literal: Fixed regular expression which, for example, accepted "200" with needle "2" query_classifier.cc: fixed invalid argument list in logging command. input.sql: added a few previously failed cases for canonical query test --- query_classifier/query_classifier.cc | 1 - query_classifier/test/canonical_tests/input.sql | 4 ++++ utils/skygw_utils.cc | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/query_classifier/query_classifier.cc b/query_classifier/query_classifier.cc index 8cef07a10..7a4bcba40 100644 --- a/query_classifier/query_classifier.cc +++ b/query_classifier/query_classifier.cc @@ -672,7 +672,6 @@ static skygw_query_type_t resolve_query_type( "%lu [resolve_query_type] " "functype FUNC_SP, stored proc " "or unknown function.", - "%s:%s", pthread_self()))); break; case Item_func::UDF_FUNC: diff --git a/query_classifier/test/canonical_tests/input.sql b/query_classifier/test/canonical_tests/input.sql index 192db761c..59e9a2496 100755 --- a/query_classifier/test/canonical_tests/input.sql +++ b/query_classifier/test/canonical_tests/input.sql @@ -1,3 +1,7 @@ +select md5("200000foo") =10, sleep(2), rand(100); +select * from my1 where md5("110") =10; +select md5("100foo") =10; +select * from my1 where md5("100") =10; select sleep(2); select * from tst where lname='Doe'; select 1,2,3,4,5,6 from tst; diff --git a/utils/skygw_utils.cc b/utils/skygw_utils.cc index 7bfc42949..8297ca5ba 100644 --- a/utils/skygw_utils.cc +++ b/utils/skygw_utils.cc @@ -1883,7 +1883,7 @@ char* replace_literal( const char* replacement) { const char* prefix = "[ ='\",\\(]"; /*< ' ','=','(',''',''"',',' are allowed before needle */ - const char* suffix = "[$^[:alnum:]]?"; /*< alpha-num chars aren't allowed after the needle */ + const char* suffix = "[^[:alnum:]]"; /*< alpha-num chars aren't allowed after the needle */ char* search_re; char* newstr; regex_t re;