32 #include "fts0types.ic"
41 fts_config_fetch_value(
53 void* data = dfield_get_data(dfield);
57 if (len != UNIV_SQL_NULL) {
60 memcpy(value->
f_str, data, max_len);
61 value->
f_len = max_len;
87 ulint name_len = strlen(name);
102 fts_table->
suffix =
"CONFIG";
107 "DECLARE FUNCTION my_func;\n"
108 "DECLARE CURSOR c IS SELECT value FROM %s"
109 " WHERE key = :name;\n"
114 " FETCH c INTO my_func();\n"
115 " IF c % NOTFOUND THEN\n"
121 trx->
op_info =
"getting FTS config value";
212 ulint name_len = strlen(name);
220 fts_table->
suffix =
"CONFIG";
224 "BEGIN UPDATE \"%s\" SET value = :value WHERE key = :name;");
226 trx->
op_info =
"setting FTS config value";
234 n_rows_updated = trx->
undo_no - undo_no;
237 if (n_rows_updated == 0) {
241 info,
"name", (byte*) name, name_len);
249 "INSERT INTO \"%s\" VALUES(:name, :value);");
251 trx->
op_info =
"inserting FTS config value";
314 if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
317 fprintf(stderr,
" InnoDB: Error: (%s) reading `%s'\n",
320 *int_value = strtoul((
char*) value.
f_str, NULL, 10);
356 if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
359 fprintf(stderr,
" InnoDB: Error: (%s) writing `%s'\n",
391 if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
394 fprintf(stderr,
" InnoDB: Error: (%s) reading `%s'\n",
397 *int_value = strtoul((
char*) value.
f_str, NULL, 10);
429 value.
f_len = snprintf(
434 if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
437 fprintf(stderr,
" InnoDB: Error: (%s) writing `%s'\n",
464 ulint name_len = strlen(name);
477 info,
"my_func", fts_config_fetch_value, &value);
479 fts_table->
suffix =
"CONFIG";
483 "DECLARE FUNCTION my_func;\n"
484 "DECLARE CURSOR c IS SELECT value FROM %s"
485 " WHERE key = :name FOR UPDATE;\n"
490 " FETCH c INTO my_func();\n"
491 " IF c % NOTFOUND THEN\n"
497 trx->
op_info =
"read FTS config value";
503 if (UNIV_UNLIKELY(error == DB_SUCCESS)) {
506 int_value = strtoul((
char*) value.
f_str, NULL, 10);
513 value.
f_len = snprintf(
519 if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
523 fprintf(stderr,
" InnoDB: Error: (%s) "
524 "while incrementing %s.\n",
ut_strerr(error), name);