| 356 | } |
| 357 | |
| 358 | int extract_sqlcache_hint(const char *sql, char *hint, int hintlen) |
| 359 | { |
| 360 | const char *start = NULL; |
| 361 | const char *end = NULL; |
| 362 | int length; |
| 363 | int ret; |
| 364 | |
| 365 | ret = has_sqlcache_hint(sql, &start, &end); |
| 366 | |
| 367 | if (ret) { |
| 368 | length = end - start; |
| 369 | if (length >= hintlen) { |
| 370 | logmsg(LOGMSG_WARN, "Query has very long hint! \"%s\"\n", sql); |
| 371 | length = hintlen - 1; |
| 372 | } |
| 373 | strncpy(hint, start, length); |
| 374 | hint[length] = '\0'; |
| 375 | } |
| 376 | return ret; |
| 377 | } |
| 378 | |
| 379 | static int find_sql_hint_table(char *sql_hint, char **sql_str, void **dta, |
| 380 | int *dta_sz) |
no test coverage detected