diff --git a/query_classifier/qc_sqlite/qc_sqlite.c b/query_classifier/qc_sqlite/qc_sqlite.c index 9c7b086ce..6253b2a33 100644 --- a/query_classifier/qc_sqlite/qc_sqlite.c +++ b/query_classifier/qc_sqlite/qc_sqlite.c @@ -919,6 +919,7 @@ static void update_database_names(QC_SQLITE_INFO* info, const char* zDatabase) static void update_names(QC_SQLITE_INFO* info, const char* zDatabase, const char* zTable) { char* zCopy = mxs_strdup(zTable); + // TODO: Is this call really needed. Check also sqlite3Dequote. exposed_sqlite3Dequote(zCopy); enlarge_string_array(1, info->table_names_len, &info->table_names, &info->table_names_capacity); diff --git a/query_classifier/qc_sqlite/sqlite-src-3110100/src/util.c b/query_classifier/qc_sqlite/sqlite-src-3110100/src/util.c index 94b10b481..2030e0e0c 100644 --- a/query_classifier/qc_sqlite/sqlite-src-3110100/src/util.c +++ b/query_classifier/qc_sqlite/sqlite-src-3110100/src/util.c @@ -220,7 +220,13 @@ int sqlite3Dequote(char *z){ for(i=1, j=0;; i++){ assert( z[i] ); #ifdef MAXSCALE - if ( z[i]=='\\' ){ + if ( z[i]==0 ){ + // TODO: This is needed only because exposed_sqlite3Dequote() is called + // TODO: in qc_sqlite.c:update_names(). That call probably is not needed + // TODO: and should be removed, in which case this check could also be + // TODO: removed. + break; + }else if ( z[i]=='\\' ){ z[j++] = '\\'; if ( z[i+1]==quote || z[i+1]=='\\' ){ z[j++] = quote;