MCPcopy Create free account
hub / github.com/MariaDB/server / add_key_with_algorithm

Function add_key_with_algorithm

sql/sql_partition.cc:2465–2497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2463*/
2464
2465static int add_key_with_algorithm(String *str, const partition_info *part_info)
2466{
2467 int err= 0;
2468 err+= str->append(STRING_WITH_LEN("KEY "));
2469
2470 if (part_info->key_algorithm != partition_info::KEY_ALGORITHM_NONE &&
2471 part_info->key_algorithm != partition_info::KEY_ALGORITHM_55)
2472 {
2473 err+= str->append(STRING_WITH_LEN("ALGORITHM = "));
2474 switch (part_info->key_algorithm)
2475 {
2476 case partition_info::KEY_ALGORITHM_51:
2477 err+= str->append(STRING_WITH_LEN("MYSQL51"));
2478 break;
2479 case partition_info::KEY_ALGORITHM_BASE31:
2480 err+= str->append(STRING_WITH_LEN("BASE31"));
2481 break;
2482 case partition_info::KEY_ALGORITHM_CRC32C:
2483 err+= str->append(STRING_WITH_LEN("CRC32C"));
2484 break;
2485 case partition_info::KEY_ALGORITHM_XXH32:
2486 err+= str->append(STRING_WITH_LEN("XXH32"));
2487 break;
2488 case partition_info::KEY_ALGORITHM_XXH3:
2489 err+= str->append(STRING_WITH_LEN("XXH3"));
2490 break;
2491 default:
2492 DBUG_ASSERT(0 && "wrong part_info->key_algorithm");
2493 }
2494 err+= str->append(' ');
2495 }
2496 return err;
2497}
2498
2499char *generate_partition_syntax_for_frm(THD *thd, partition_info *part_info,
2500 uint *buf_length,

Callers 2

gen_part_typeMethod · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected